|
|
|
@ -15,8 +15,14 @@ import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
import org.jeecg.modules.demo.base.entity.ZyClothsType; |
|
|
|
|
import org.jeecg.modules.demo.base.service.IZyClothsModularService; |
|
|
|
|
import org.jeecg.modules.demo.base.service.IZyClothsTypeService; |
|
|
|
|
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.goodsmodule.entity.GoodsModule; |
|
|
|
|
import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; |
|
|
|
|
import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories; |
|
|
|
|
import org.jeecg.modules.demo.zyaccessories.service.IZyStyleAccessoriesService; |
|
|
|
|
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
|
|
|
|
import org.jeecg.modules.demo.zygoods.service.IZyGoodsService; |
|
|
|
|
|
|
|
|
@ -25,7 +31,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
|
|
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; |
|
|
|
|
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; |
|
|
|
|
import org.jeecg.modules.zystylefabric.entity.ZyStyleFabric; |
|
|
|
|
import org.jeecg.modules.zystylefabric.service.IZyStyleFabricService; |
|
|
|
|
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; |
|
|
|
|
import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; |
|
|
|
|
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule; |
|
|
|
@ -71,6 +80,14 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService> |
|
|
|
|
private IZyStyleModelService zyStyleModelService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyClothsTypeService zyClothsTypeService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyStyleFabricService zyStyleFabricService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyStyleAccessoriesService zyStyleAccessoriesService; |
|
|
|
|
@Autowired |
|
|
|
|
private IGoodsAccessoriesService goodsAccessoriesService; |
|
|
|
|
@Autowired |
|
|
|
|
private IGoodsFabricService goodsFabricService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
@ -119,6 +136,26 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService> |
|
|
|
|
//goodsModule.setPlace();
|
|
|
|
|
goodsModuleService.save(goodsModule); |
|
|
|
|
} |
|
|
|
|
ZyStyleFabric zyStyleFabric = new ZyStyleFabric(); |
|
|
|
|
QueryWrapper<ZyStyleFabric> queryWrapperzsf = QueryGenerator.initQueryWrapper(zyStyleFabric, req.getParameterMap()); |
|
|
|
|
queryWrapperzsf.eq("style_id",zyGoods.getStyleId()); |
|
|
|
|
List<ZyStyleFabric> listzsf = zyStyleFabricService.list(queryWrapperzsf); |
|
|
|
|
for (int j = 0 ; j < listzsf.size() ; j++){ |
|
|
|
|
GoodsFabric goodsFabric = new GoodsFabric(); |
|
|
|
|
goodsFabric.setGoodsId(zyGoods.getId()); |
|
|
|
|
goodsFabric.setFabricId(listzsf.get(j).getFabricId()); |
|
|
|
|
goodsFabricService.save(goodsFabric); |
|
|
|
|
} |
|
|
|
|
ZyStyleAccessories zyStyleAccessories = new ZyStyleAccessories(); |
|
|
|
|
QueryWrapper<ZyStyleAccessories> queryWrapperzsa = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap()); |
|
|
|
|
queryWrapperzsa.eq("style_id",zyGoods.getStyleId()); |
|
|
|
|
List<ZyStyleAccessories> listzsa = zyStyleAccessoriesService.list(queryWrapperzsa); |
|
|
|
|
for (int k = 0 ; k < listzsa.size() ; k++){ |
|
|
|
|
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
|
|
|
|
goodsAccessories.setGoodsId(zyGoods.getId()); |
|
|
|
|
goodsAccessories.setAccessoriesId(listzsa.get(k).getAccessoriesId()); |
|
|
|
|
goodsAccessoriesService.save(goodsAccessories); |
|
|
|
|
} |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -151,8 +188,121 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService> |
|
|
|
|
//goodsModule1.setPlace();
|
|
|
|
|
goodsModuleService.save(goodsModule1); |
|
|
|
|
} |
|
|
|
|
GoodsFabric goodsFabric = new GoodsFabric(); |
|
|
|
|
QueryWrapper<GoodsFabric> queryWrappergf = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap()); |
|
|
|
|
queryWrappergf.eq("goods_id",zyGoods.getId()); |
|
|
|
|
goodsFabricService.remove(queryWrappergf); |
|
|
|
|
ZyStyleFabric zyStyleFabric = new ZyStyleFabric(); |
|
|
|
|
QueryWrapper<ZyStyleFabric> queryWrapperzsf = QueryGenerator.initQueryWrapper(zyStyleFabric, req.getParameterMap()); |
|
|
|
|
queryWrapperzsf.eq("style_id",zyGoods.getStyleId()); |
|
|
|
|
List<ZyStyleFabric> listzsf = zyStyleFabricService.list(queryWrapperzsf); |
|
|
|
|
for (int j = 0 ; j < listzsf.size() ; j++){ |
|
|
|
|
GoodsFabric goodsFabric1 = new GoodsFabric(); |
|
|
|
|
goodsFabric1.setGoodsId(zyGoods.getId()); |
|
|
|
|
goodsFabric1.setFabricId(listzsf.get(j).getFabricId()); |
|
|
|
|
goodsFabricService.save(goodsFabric1); |
|
|
|
|
} |
|
|
|
|
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
|
|
|
|
QueryWrapper<GoodsAccessories> queryWrapperga = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap()); |
|
|
|
|
queryWrapperga.eq("goods_id",zyGoods.getId()); |
|
|
|
|
goodsAccessoriesService.remove(queryWrapperga); |
|
|
|
|
ZyStyleAccessories zyStyleAccessories = new ZyStyleAccessories(); |
|
|
|
|
QueryWrapper<ZyStyleAccessories> queryWrapperzsa = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap()); |
|
|
|
|
queryWrapperzsa.eq("style_id",zyGoods.getStyleId()); |
|
|
|
|
List<ZyStyleAccessories> listzsa = zyStyleAccessoriesService.list(queryWrapperzsa); |
|
|
|
|
for (int k = 0 ; k < listzsa.size() ; k++){ |
|
|
|
|
GoodsAccessories goodsAccessories1 = new GoodsAccessories(); |
|
|
|
|
goodsAccessories1.setGoodsId(zyGoods.getId()); |
|
|
|
|
goodsAccessories1.setAccessoriesId(listzsa.get(k).getAccessoriesId()); |
|
|
|
|
goodsAccessoriesService.save(goodsAccessories1); |
|
|
|
|
} |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 更新商品辅料 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "更新商品辅料") |
|
|
|
|
@ApiOperation(value="更新商品辅料", notes="更新商品辅料") |
|
|
|
|
@GetMapping(value = "/upfl") |
|
|
|
|
public Result<?> upfl(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
|
|
|
|
ZyGoods zyGoods = zyGoodsService.getById(id); |
|
|
|
|
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
|
|
|
|
QueryWrapper<GoodsAccessories> queryWrapperga = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap()); |
|
|
|
|
queryWrapperga.eq("goods_id",id); |
|
|
|
|
goodsAccessoriesService.remove(queryWrapperga); |
|
|
|
|
ZyStyleAccessories zyStyleAccessories = new ZyStyleAccessories(); |
|
|
|
|
QueryWrapper<ZyStyleAccessories> queryWrapperzsa = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap()); |
|
|
|
|
queryWrapperzsa.eq("style_id",zyGoods.getStyleId()); |
|
|
|
|
List<ZyStyleAccessories> listzsa = zyStyleAccessoriesService.list(queryWrapperzsa); |
|
|
|
|
for (int k = 0 ; k < listzsa.size() ; k++){ |
|
|
|
|
GoodsAccessories goodsAccessories1 = new GoodsAccessories(); |
|
|
|
|
goodsAccessories1.setGoodsId(id); |
|
|
|
|
goodsAccessories1.setAccessoriesId(listzsa.get(k).getAccessoriesId()); |
|
|
|
|
goodsAccessoriesService.save(goodsAccessories1); |
|
|
|
|
} |
|
|
|
|
return Result.OK("更新成功!"); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 更新商品模块 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "更新商品模块") |
|
|
|
|
@ApiOperation(value="更新商品模块", notes="更新商品模块") |
|
|
|
|
@GetMapping(value = "/upmk") |
|
|
|
|
public Result<?> upmk(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
|
|
|
|
ZyGoods zyGoods = zyGoodsService.getById(id); |
|
|
|
|
GoodsModule goodsModule = new GoodsModule(); |
|
|
|
|
QueryWrapper<GoodsModule> queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); |
|
|
|
|
queryWrappergm.eq("goods_id",id); |
|
|
|
|
goodsModuleService.remove(queryWrappergm); |
|
|
|
|
ZyStyleModule zyStyleModule = new ZyStyleModule(); |
|
|
|
|
QueryWrapper<ZyStyleModule> queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap()); |
|
|
|
|
queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); |
|
|
|
|
List<ZyStyleModule> listzsm = zyStyleModuleService.list(queryWrapperzsm); |
|
|
|
|
for (int i = 0 ; i < listzsm.size() ; i++){ |
|
|
|
|
GoodsModule goodsModule1 = new GoodsModule(); |
|
|
|
|
goodsModule1.setGoodsId(id); |
|
|
|
|
goodsModule1.setStyleId(zyGoods.getStyleId()); |
|
|
|
|
goodsModule1.setStyleModuleId(listzsm.get(i).getId()); |
|
|
|
|
goodsModule1.setModuleId(listzsm.get(i).getModularId()); |
|
|
|
|
//部位暂时没有字段,zy_cloths_modular的place
|
|
|
|
|
//goodsModule1.setPlace();
|
|
|
|
|
goodsModuleService.save(goodsModule1); |
|
|
|
|
} |
|
|
|
|
return Result.OK("更新成功!"); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 更新商品面料 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "更新商品面料") |
|
|
|
|
@ApiOperation(value="更新商品面料", notes="更新商品面料") |
|
|
|
|
@GetMapping(value = "/upml") |
|
|
|
|
public Result<?> upml(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
|
|
|
|
ZyGoods zyGoods = zyGoodsService.getById(id); |
|
|
|
|
GoodsFabric goodsFabric = new GoodsFabric(); |
|
|
|
|
QueryWrapper<GoodsFabric> queryWrappergf = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap()); |
|
|
|
|
queryWrappergf.eq("goods_id",zyGoods.getId()); |
|
|
|
|
goodsFabricService.remove(queryWrappergf); |
|
|
|
|
ZyStyleFabric zyStyleFabric = new ZyStyleFabric(); |
|
|
|
|
QueryWrapper<ZyStyleFabric> queryWrapperzsf = QueryGenerator.initQueryWrapper(zyStyleFabric, req.getParameterMap()); |
|
|
|
|
queryWrapperzsf.eq("style_id",zyGoods.getStyleId()); |
|
|
|
|
List<ZyStyleFabric> listzsf = zyStyleFabricService.list(queryWrapperzsf); |
|
|
|
|
for (int j = 0 ; j < listzsf.size() ; j++){ |
|
|
|
|
GoodsFabric goodsFabric1 = new GoodsFabric(); |
|
|
|
|
goodsFabric1.setGoodsId(zyGoods.getId()); |
|
|
|
|
goodsFabric1.setFabricId(listzsf.get(j).getFabricId()); |
|
|
|
|
goodsFabricService.save(goodsFabric1); |
|
|
|
|
} |
|
|
|
|
return Result.OK("更新成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id删除 |
|
|
|
@ -239,6 +389,20 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService> |
|
|
|
|
return Result.OK(spbh); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 动态服装款式 |
|
|
|
|
* |
|
|
|
|
* @param |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "商品表-通过id查询") |
|
|
|
|
@ApiOperation(value="商品表-通过id查询", notes="商品表-通过id查询") |
|
|
|
|
@GetMapping(value = "/getzystyle") |
|
|
|
|
public Result<?> getzystyle(@RequestParam(name="ksid",required=true) String ksid) { |
|
|
|
|
ZyClothsStyle zyClothsStyle = zyClothsStyleService.getById(ksid); |
|
|
|
|
return Result.OK(zyClothsStyle); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 导出excel |
|
|
|
|
* |
|
|
|
|