|
|
|
@ -28,9 +28,20 @@ import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
|
import org.jeecg.common.system.util.JwtUtil; |
|
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
|
import org.jeecg.common.util.*; |
|
|
|
|
import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService; |
|
|
|
|
import org.jeecg.modules.demo.collecttype.entity.CollectType; |
|
|
|
|
import org.jeecg.modules.demo.collecttype.service.ICollectTypeService; |
|
|
|
|
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; |
|
|
|
|
import org.jeecg.modules.demo.fabric.service.IZyFabricService; |
|
|
|
|
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
|
|
|
|
import org.jeecg.modules.demo.goodsaccessories.service.IGoodsAccessoriesService; |
|
|
|
|
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
|
|
|
|
import org.jeecg.modules.demo.goodsfabric.service.IGoodsFabricService; |
|
|
|
|
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
|
|
|
|
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; |
|
|
|
|
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
|
|
|
|
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
|
|
|
|
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
|
|
|
|
import org.jeecg.modules.orderbymakeclothplan.service.ZyOrderService; |
|
|
|
|
import org.jeecg.modules.system.entity.*; |
|
|
|
|
import org.jeecg.modules.system.model.DepartIdModel; |
|
|
|
@ -44,6 +55,9 @@ import org.jeecg.modules.team.entity.Groupx; |
|
|
|
|
import org.jeecg.modules.team.entity.Station; |
|
|
|
|
import org.jeecg.modules.team.service.IGroupxService; |
|
|
|
|
import org.jeecg.modules.team.service.IStationService; |
|
|
|
|
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; |
|
|
|
|
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; |
|
|
|
|
import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; |
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams; |
|
|
|
@ -112,6 +126,8 @@ public class SysUserController { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IGroupxService iGroupxService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyOrdersService zyOrdersService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${jeecg.path.upload}") |
|
|
|
@ -120,6 +136,21 @@ public class SysUserController { |
|
|
|
|
@Resource |
|
|
|
|
private BaseCommonService baseCommonService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IOrderGoodsService orderGoodsService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsStyleService zyClothsStyleService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyStyleModelService zyStyleModelService; |
|
|
|
|
@Autowired |
|
|
|
|
private IGoodsFabricService goodsFabricService; |
|
|
|
|
@Autowired |
|
|
|
|
private IGoodsAccessoriesService goodsAccessoriesService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyAccessoriesService zyAccessoriesService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyFabricService zyFabricService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取用户列表数据 |
|
|
|
|
* |
|
|
|
@ -1523,26 +1554,53 @@ public class SysUserController { |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@RequestMapping(value = "/findgoods", method = RequestMethod.GET) |
|
|
|
|
public Result<?> findgoods() { |
|
|
|
|
public Result<?> findgoods(HttpServletRequest req) { |
|
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
String userid = loginUser.getId(); |
|
|
|
|
List<Grzx1> gr1 = new ArrayList<>(); |
|
|
|
|
ZyOrders zyOrders = new ZyOrders(); |
|
|
|
|
QueryWrapper<ZyOrders> queryWrapperzos = QueryGenerator.initQueryWrapper(zyOrders, req.getParameterMap()); |
|
|
|
|
queryWrapperzos.eq("user_id",userid); |
|
|
|
|
queryWrapperzos.eq("ischild",0); |
|
|
|
|
List<ZyOrders> zyOrdersList = zyOrdersService.list(queryWrapperzos); |
|
|
|
|
List<Grzx2> gr2 = new ArrayList<>(); |
|
|
|
|
gr1 =sysUserService.getallgr1(userid); |
|
|
|
|
for (int i=0;i<gr1.size();i++){ |
|
|
|
|
for(int i = 0 ; i < zyOrdersList.size(); i++){ |
|
|
|
|
Grzx2 g2 = new Grzx2(); |
|
|
|
|
g2.setId(gr1.get(i).getId()); |
|
|
|
|
g2.setOrderNum(gr1.get(i).getOrdersNum()); |
|
|
|
|
g2.setPay(gr1.get(i).getDeliveryStatus()); |
|
|
|
|
g2.setId(zyOrdersList.get(i).getId()); |
|
|
|
|
g2.setOrderNum(zyOrdersList.get(i).getOrdersNum()); |
|
|
|
|
g2.setPay(zyOrdersList.get(i).getDeliveryStatus()+""); |
|
|
|
|
g2.setReceipt("false"); |
|
|
|
|
g2.setUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+gr1.get(i).getDefaultPicture()); |
|
|
|
|
g2.setName(gr1.get(i).getGoodsName()); |
|
|
|
|
g2.setType(gr1.get(i).getStyleNames()); |
|
|
|
|
g2.setSize(gr1.get(i).getModelNumber()); |
|
|
|
|
g2.setNum(gr1.get(i).getGoodsNum()); |
|
|
|
|
g2.setPrice(gr1.get(i).getUnitPrice()); |
|
|
|
|
g2.setMaterial(gr1.get(i).getName()+","+gr1.get(i).getTypeName()); |
|
|
|
|
g2.setTotal(gr1.get(i).getPayTotalPrice()); |
|
|
|
|
OrderGoods orderGoods = new OrderGoods(); |
|
|
|
|
QueryWrapper<OrderGoods> queryWrapperogs = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
|
|
|
|
queryWrapperogs.eq("orders_id",zyOrdersList.get(i).getId()); |
|
|
|
|
List<OrderGoods> orderGoodsList = orderGoodsService.list(queryWrapperogs); |
|
|
|
|
g2.setUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+orderGoodsList.get(0).getDefaultPicture()); |
|
|
|
|
g2.setName(orderGoodsList.get(0).getGoodsName()); |
|
|
|
|
g2.setType(zyClothsStyleService.getById(orderGoodsList.get(0).getStyleId()).getStyleNames()); |
|
|
|
|
ZyStyleModel zyStyleModel = new ZyStyleModel(); |
|
|
|
|
QueryWrapper<ZyStyleModel> queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModel, req.getParameterMap()); |
|
|
|
|
queryWrapperzsm.eq("style_id",orderGoodsList.get(0).getStyleId()); |
|
|
|
|
g2.setSize(zyStyleModelService.list(queryWrapperzsm).get(0).getModelNumber()); |
|
|
|
|
g2.setNum(orderGoodsList.get(0).getGoodsNum()+""); |
|
|
|
|
g2.setPrice(orderGoodsList.get(0).getUnitPrice()+""); |
|
|
|
|
//主辅料
|
|
|
|
|
GoodsFabric goodsFabric = new GoodsFabric(); |
|
|
|
|
QueryWrapper<GoodsFabric> queryWrappergf = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap()); |
|
|
|
|
queryWrappergf.eq("goods_id",orderGoodsList.get(0).getGoodsId()); |
|
|
|
|
List<GoodsFabric> listgf = goodsFabricService.list(queryWrappergf); |
|
|
|
|
String zlstr = ""; |
|
|
|
|
for(int j = 0 ; j < listgf.size() ; j++){ |
|
|
|
|
zlstr = zlstr + zyFabricService.getById(listgf.get(j).getFabricId()).getName()+","; |
|
|
|
|
} |
|
|
|
|
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
|
|
|
|
QueryWrapper<GoodsAccessories> queryWrapperga = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap()); |
|
|
|
|
queryWrapperga.eq("goods_id",orderGoodsList.get(0).getGoodsId()); |
|
|
|
|
List<GoodsAccessories> listga = goodsAccessoriesService.list(queryWrapperga); |
|
|
|
|
String flstr = ""; |
|
|
|
|
for(int k = 0 ; k < listga.size() ; k++){ |
|
|
|
|
flstr = flstr + zyAccessoriesService.getById(listga.get(k).getAccessoriesId()).getContents()+","; |
|
|
|
|
} |
|
|
|
|
g2.setMaterial(zlstr+flstr.substring(0,flstr.length()-1)); |
|
|
|
|
g2.setTotal(orderGoodsList.get(0).getPayTotalPrice()+""); |
|
|
|
|
gr2.add(g2); |
|
|
|
|
} |
|
|
|
|
return Result.ok(gr2); |
|
|
|
@ -1554,11 +1612,75 @@ public class SysUserController { |
|
|
|
|
获取个人中心的订单详情 |
|
|
|
|
*/ |
|
|
|
|
@RequestMapping(value = "/getdingdaninfo", method = RequestMethod.GET) |
|
|
|
|
public Result<?> findgoods(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
public Result<?> findgoods(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
|
|
|
|
//这个是获取订单的数据中的商品数据
|
|
|
|
|
Grzx1 g1 = new Grzx1(); |
|
|
|
|
g1 = sysUserService.getallg2(id); |
|
|
|
|
|
|
|
|
|
ZyOrders zyOrders = zyOrdersService.getById(id); |
|
|
|
|
g1.setId(zyOrders.getId()); |
|
|
|
|
g1.setOrdersNum(zyOrders.getOrdersNum()); |
|
|
|
|
OrderGoods orderGoods = new OrderGoods(); |
|
|
|
|
QueryWrapper<OrderGoods> queryWrapperogs = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
|
|
|
|
queryWrapperogs.eq("orders_id",zyOrders.getId()); |
|
|
|
|
List<OrderGoods> orderGoodsList = orderGoodsService.list(queryWrapperogs); |
|
|
|
|
g1.setGoodsName(orderGoodsList.get(0).getGoodsName()); |
|
|
|
|
g1.setStyleNames(zyClothsStyleService.getById(orderGoodsList.get(0).getStyleId()).getStyleNames()); |
|
|
|
|
ZyStyleModel zyStyleModel = new ZyStyleModel(); |
|
|
|
|
QueryWrapper<ZyStyleModel> queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModel, req.getParameterMap()); |
|
|
|
|
queryWrapperzsm.eq("style_id",orderGoodsList.get(0).getStyleId()); |
|
|
|
|
g1.setModelNumber(zyStyleModelService.list(queryWrapperzsm).get(0).getModelNumber()); |
|
|
|
|
g1.setGoodsNum(orderGoodsList.get(0).getGoodsNum()+""); |
|
|
|
|
GoodsFabric goodsFabric = new GoodsFabric(); |
|
|
|
|
QueryWrapper<GoodsFabric> queryWrappergf = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap()); |
|
|
|
|
queryWrappergf.eq("goods_id",orderGoodsList.get(0).getGoodsId()); |
|
|
|
|
List<GoodsFabric> listgf = goodsFabricService.list(queryWrappergf); |
|
|
|
|
String zlstr = ""; |
|
|
|
|
for(int j = 0 ; j < listgf.size() ; j++){ |
|
|
|
|
zlstr = zlstr + zyFabricService.getById(listgf.get(j).getFabricId()).getName()+","; |
|
|
|
|
} |
|
|
|
|
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
|
|
|
|
QueryWrapper<GoodsAccessories> queryWrapperga = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap()); |
|
|
|
|
queryWrapperga.eq("goods_id",orderGoodsList.get(0).getGoodsId()); |
|
|
|
|
List<GoodsAccessories> listga = goodsAccessoriesService.list(queryWrapperga); |
|
|
|
|
String flstr = ""; |
|
|
|
|
for(int k = 0 ; k < listga.size() ; k++){ |
|
|
|
|
flstr = flstr + zyAccessoriesService.getById(listga.get(k).getAccessoriesId()).getContents()+","; |
|
|
|
|
} |
|
|
|
|
g1.setName(zlstr+flstr.substring(0,flstr.length()-1)); |
|
|
|
|
g1.setDefaultPicture("http://localhost:10085/jeecg-boot/sys/common/static/"+orderGoodsList.get(0).getDefaultPicture()); |
|
|
|
|
g1.setPayTotalPrice(orderGoodsList.get(0).getPayTotalPrice()+""); |
|
|
|
|
g1.setUnitPrice(orderGoodsList.get(0).getUnitPrice()+""); |
|
|
|
|
g1.setCreateTime(zyOrders.getOrderTime()); |
|
|
|
|
g1.setCreateBy(sysUserService.getById(zyOrders.getUserId()).getRealname()); |
|
|
|
|
g1.setCityId(zyOrders.getCityId()); |
|
|
|
|
g1.setAddress(zyOrders.getAddress()); |
|
|
|
|
g1.setZipCode(zyOrders.getZipCode()); |
|
|
|
|
if (zyOrders.getDeliveryStatus()==0){ |
|
|
|
|
g1.setDeliveryStatus("未支付"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==1){ |
|
|
|
|
g1.setDeliveryStatus("已支付"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==2){ |
|
|
|
|
g1.setDeliveryStatus("待生产中"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==3){ |
|
|
|
|
g1.setDeliveryStatus("生产中"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==4){ |
|
|
|
|
g1.setDeliveryStatus("已发货"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==5){ |
|
|
|
|
g1.setDeliveryStatus("已到货"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==6){ |
|
|
|
|
g1.setDeliveryStatus("已签收"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==8){ |
|
|
|
|
g1.setDeliveryStatus("申请撤销"); |
|
|
|
|
} |
|
|
|
|
if (zyOrders.getDeliveryStatus()==9){ |
|
|
|
|
g1.setDeliveryStatus("已撤销"); |
|
|
|
|
} |
|
|
|
|
return Result.ok(g1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|