From 1ff2d6bbf08f78cd32a5f8e4601fa80e25420de2 Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 8 Dec 2022 16:49:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E3=80=81=E9=9D=A2=E8=BE=85=E6=96=99=E3=80=81?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goodsaccessories/GoodsAccessoriesList.vue | 198 ++++++++++ .../modules/GoodsAccessoriesForm.vue | 109 ++++++ .../modules/GoodsAccessoriesModal.vue | 60 +++ .../GoodsAccessoriesModal__Style#Drawer.vue | 84 +++++ .../src/views/goodsfabric/GoodsFabricList.vue | 198 ++++++++++ .../goodsfabric/modules/GoodsFabricForm.vue | 109 ++++++ .../goodsfabric/modules/GoodsFabricModal.vue | 60 +++ .../GoodsFabricModal__Style#Drawer.vue | 84 +++++ .../src/views/goodsmodule/GoodsModuleList.vue | 217 +++++++++++ .../goodsmodule/modules/GoodsModuleForm.vue | 114 ++++++ .../goodsmodule/modules/GoodsModuleModal.vue | 60 +++ .../GoodsModuleModal__Style#Drawer.vue | 84 +++++ .../src/views/zygoods/ZyGoodsList.vue | 351 ++++++++++++++++++ .../src/views/zygoods/modules/ZyGoodsForm.vue | 219 +++++++++++ .../views/zygoods/modules/ZyGoodsModal.vue | 60 +++ .../modules/ZyGoodsModal__Style#Drawer.vue | 84 +++++ ...ZyGoodsMapper.java => ZyGoodsMapper1.java} | 4 +- .../demo/mall/mapper/xml/ZyGoodsMapper.xml | 10 +- ...viceImpl.java => ZyGoodsServiceI1mpl.java} | 12 +- .../service/impl/ZyOrdersServiceImpl.java | 22 +- .../GoodsAccessoriesController.java | 171 +++++++++ .../entity/GoodsAccessories.java | 67 ++++ .../mapper/GoodsAccessoriesMapper.java | 17 + .../mapper/xml/GoodsAccessoriesMapper.xml | 5 + .../service/IGoodsAccessoriesService.java | 14 + .../impl/GoodsAccessoriesServiceImpl.java | 19 + .../controller/GoodsFabricController.java | 171 +++++++++ .../demo/goodsfabric/entity/GoodsFabric.java | 67 ++++ .../goodsfabric/mapper/GoodsFabricMapper.java | 17 + .../mapper/xml/GoodsFabricMapper.xml | 5 + .../service/IGoodsFabricService.java | 14 + .../service/impl/GoodsFabricServiceImpl.java | 19 + .../controller/GoodsModuleController.java | 172 +++++++++ .../demo/goodsmodule/entity/GoodsModule.java | 80 ++++ .../goodsmodule/mapper/GoodsModuleMapper.java | 17 + .../mapper/xml/GoodsModuleMapper.xml | 5 + .../service/IGoodsModuleService.java | 14 + .../service/impl/GoodsModuleServiceImpl.java | 19 + .../zygoods/controller/ZyGoodsController.java | 230 ++++++++++++ .../modules/demo/zygoods/entity/ZyGoods.java | 140 +++++++ .../demo/zygoods/mapper/ZyGoodsMapper.java | 20 + .../demo/zygoods/mapper/xml/ZyGoodsMapper.xml | 16 + .../demo/zygoods/service/IZyGoodsService.java | 17 + .../service/impl/ZyGoodsServiceImpl.java | 29 ++ 44 files changed, 3460 insertions(+), 24 deletions(-) create mode 100644 ant-design-vue-jeecg/src/views/goodsaccessories/GoodsAccessoriesList.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesForm.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal__Style#Drawer.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsfabric/GoodsFabricList.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricForm.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal__Style#Drawer.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsmodule/GoodsModuleList.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleForm.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal.vue create mode 100644 ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal__Style#Drawer.vue create mode 100644 ant-design-vue-jeecg/src/views/zygoods/ZyGoodsList.vue create mode 100644 ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue create mode 100644 ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal.vue create mode 100644 ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal__Style#Drawer.vue rename jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/{ZyGoodsMapper.java => ZyGoodsMapper1.java} (87%) rename jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/{ZyGoodsServiceImpl.java => ZyGoodsServiceI1mpl.java} (68%) create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/controller/GoodsAccessoriesController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/entity/GoodsAccessories.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/GoodsAccessoriesMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/xml/GoodsAccessoriesMapper.xml create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/IGoodsAccessoriesService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/impl/GoodsAccessoriesServiceImpl.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/controller/GoodsFabricController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/entity/GoodsFabric.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/GoodsFabricMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/xml/GoodsFabricMapper.xml create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/IGoodsFabricService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/impl/GoodsFabricServiceImpl.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/controller/GoodsModuleController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/entity/GoodsModule.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/GoodsModuleMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/xml/GoodsModuleMapper.xml create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/IGoodsModuleService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/impl/GoodsModuleServiceImpl.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/ZyGoodsMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/xml/ZyGoodsMapper.xml create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/IZyGoodsService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/impl/ZyGoodsServiceImpl.java diff --git a/ant-design-vue-jeecg/src/views/goodsaccessories/GoodsAccessoriesList.vue b/ant-design-vue-jeecg/src/views/goodsaccessories/GoodsAccessoriesList.vue new file mode 100644 index 00000000..39eb472f --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsaccessories/GoodsAccessoriesList.vue @@ -0,0 +1,198 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesForm.vue b/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesForm.vue new file mode 100644 index 00000000..72eb6e61 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesForm.vue @@ -0,0 +1,109 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal.vue b/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal.vue new file mode 100644 index 00000000..ca69ea98 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal__Style#Drawer.vue new file mode 100644 index 00000000..ba96327e --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsaccessories/modules/GoodsAccessoriesModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsfabric/GoodsFabricList.vue b/ant-design-vue-jeecg/src/views/goodsfabric/GoodsFabricList.vue new file mode 100644 index 00000000..bd10ae3c --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsfabric/GoodsFabricList.vue @@ -0,0 +1,198 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricForm.vue b/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricForm.vue new file mode 100644 index 00000000..f984db58 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricForm.vue @@ -0,0 +1,109 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal.vue b/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal.vue new file mode 100644 index 00000000..e839f0b3 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal__Style#Drawer.vue new file mode 100644 index 00000000..da81ef46 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsfabric/modules/GoodsFabricModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsmodule/GoodsModuleList.vue b/ant-design-vue-jeecg/src/views/goodsmodule/GoodsModuleList.vue new file mode 100644 index 00000000..1b0261e3 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsmodule/GoodsModuleList.vue @@ -0,0 +1,217 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleForm.vue b/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleForm.vue new file mode 100644 index 00000000..d41103ec --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleForm.vue @@ -0,0 +1,114 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal.vue b/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal.vue new file mode 100644 index 00000000..98113e73 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal__Style#Drawer.vue new file mode 100644 index 00000000..f0f29053 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/goodsmodule/modules/GoodsModuleModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zygoods/ZyGoodsList.vue b/ant-design-vue-jeecg/src/views/zygoods/ZyGoodsList.vue new file mode 100644 index 00000000..0667f1fe --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zygoods/ZyGoodsList.vue @@ -0,0 +1,351 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue new file mode 100644 index 00000000..84232a6e --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue @@ -0,0 +1,219 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal.vue b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal.vue new file mode 100644 index 00000000..142cfc46 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal__Style#Drawer.vue new file mode 100644 index 00000000..4e6a95a0 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/ZyGoodsMapper.java b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/ZyGoodsMapper1.java similarity index 87% rename from jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/ZyGoodsMapper.java rename to jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/ZyGoodsMapper1.java index 5920b448..812031ab 100644 --- a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/ZyGoodsMapper.java +++ b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/ZyGoodsMapper1.java @@ -11,9 +11,9 @@ import org.apache.ibatis.annotations.Param; * @Date: 2021-11-11 * @Version: V1.0 */ -public interface ZyGoodsMapper extends BaseMapper { +public interface ZyGoodsMapper1 extends BaseMapper { public boolean deleteByMainId(@Param("mainId") String mainId); - + public List selectByMainId(@Param("mainId") String mainId); } diff --git a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/xml/ZyGoodsMapper.xml b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/xml/ZyGoodsMapper.xml index 6dd3a581..b72f1a3f 100644 --- a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/xml/ZyGoodsMapper.xml +++ b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/mapper/xml/ZyGoodsMapper.xml @@ -1,15 +1,15 @@ - + - DELETE - FROM zy_goods + DELETE + FROM zy_goods WHERE orders_id = #{mainId} - + diff --git a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyGoodsServiceImpl.java b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyGoodsServiceI1mpl.java similarity index 68% rename from jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyGoodsServiceImpl.java rename to jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyGoodsServiceI1mpl.java index ebc16b27..54215ace 100644 --- a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyGoodsServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyGoodsServiceI1mpl.java @@ -1,7 +1,7 @@ package org.jeecg.modules.demo.mall.service.impl; import org.jeecg.modules.demo.mall.entity.ZyGoods; -import org.jeecg.modules.demo.mall.mapper.ZyGoodsMapper; +import org.jeecg.modules.demo.mall.mapper.ZyGoodsMapper1; import org.jeecg.modules.demo.mall.service.IZyGoodsService; import org.springframework.stereotype.Service; import java.util.List; @@ -15,13 +15,13 @@ import org.springframework.beans.factory.annotation.Autowired; * @Version: V1.0 */ @Service -public class ZyGoodsServiceImpl extends ServiceImpl implements IZyGoodsService { - +public class ZyGoodsServiceI1mpl extends ServiceImpl implements IZyGoodsService { + @Autowired - private ZyGoodsMapper zyGoodsMapper; - + private ZyGoodsMapper1 zyGoodsMapper1; + @Override public List selectByMainId(String mainId) { - return zyGoodsMapper.selectByMainId(mainId); + return zyGoodsMapper1.selectByMainId(mainId); } } diff --git a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyOrdersServiceImpl.java b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyOrdersServiceImpl.java index 7b39ffbb..68f08e03 100644 --- a/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyOrdersServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-mall/src/main/java/org/jeecg/modules/demo/mall/service/impl/ZyOrdersServiceImpl.java @@ -2,7 +2,7 @@ package org.jeecg.modules.demo.mall.service.impl; import org.jeecg.modules.demo.mall.entity.ZyOrders; import org.jeecg.modules.demo.mall.entity.ZyGoods; -import org.jeecg.modules.demo.mall.mapper.ZyGoodsMapper; +import org.jeecg.modules.demo.mall.mapper.ZyGoodsMapper1; import org.jeecg.modules.demo.mall.mapper.ZyOrdersMapper; import org.jeecg.modules.demo.mall.service.IZyOrdersService; import org.springframework.stereotype.Service; @@ -25,8 +25,8 @@ public class ZyOrdersServiceImpl extends ServiceImpl i @Autowired private ZyOrdersMapper zyOrdersMapper; @Autowired - private ZyGoodsMapper zyGoodsMapper; - + private ZyGoodsMapper1 zyGoodsMapper1; + @Override @Transactional public void saveMain(ZyOrders zyOrders, List zyGoodsList) { @@ -35,7 +35,7 @@ public class ZyOrdersServiceImpl extends ServiceImpl i for(ZyGoods entity:zyGoodsList) { //外键设置 entity.setOrdersId(zyOrders.getId()); - zyGoodsMapper.insert(entity); + zyGoodsMapper1.insert(entity); } } } @@ -44,16 +44,16 @@ public class ZyOrdersServiceImpl extends ServiceImpl i @Transactional public void updateMain(ZyOrders zyOrders,List zyGoodsList) { zyOrdersMapper.updateById(zyOrders); - + //1.先删除子表数据 - zyGoodsMapper.deleteByMainId(zyOrders.getId()); - + zyGoodsMapper1.deleteByMainId(zyOrders.getId()); + //2.子表数据重新插入 if(zyGoodsList!=null && zyGoodsList.size()>0) { for(ZyGoods entity:zyGoodsList) { //外键设置 entity.setOrdersId(zyOrders.getId()); - zyGoodsMapper.insert(entity); + zyGoodsMapper1.insert(entity); } } } @@ -61,7 +61,7 @@ public class ZyOrdersServiceImpl extends ServiceImpl i @Override @Transactional public void delMain(String id) { - zyGoodsMapper.deleteByMainId(id); + zyGoodsMapper1.deleteByMainId(id); zyOrdersMapper.deleteById(id); } @@ -69,9 +69,9 @@ public class ZyOrdersServiceImpl extends ServiceImpl i @Transactional public void delBatchMain(Collection idList) { for(Serializable id:idList) { - zyGoodsMapper.deleteByMainId(id.toString()); + zyGoodsMapper1.deleteByMainId(id.toString()); zyOrdersMapper.deleteById(id); } } - + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/controller/GoodsAccessoriesController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/controller/GoodsAccessoriesController.java new file mode 100644 index 00000000..65916333 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/controller/GoodsAccessoriesController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.demo.goodsaccessories.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; +import org.jeecg.modules.demo.goodsaccessories.service.IGoodsAccessoriesService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 商品辅料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +@Api(tags="商品辅料表") +@RestController +@RequestMapping("/goodsaccessories/goodsAccessories") +@Slf4j +public class GoodsAccessoriesController extends JeecgController { + @Autowired + private IGoodsAccessoriesService goodsAccessoriesService; + + /** + * 分页列表查询 + * + * @param goodsAccessories + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "商品辅料表-分页列表查询") + @ApiOperation(value="商品辅料表-分页列表查询", notes="商品辅料表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(GoodsAccessories goodsAccessories, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(goodsAccessories, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = goodsAccessoriesService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param goodsAccessories + * @return + */ + @AutoLog(value = "商品辅料表-添加") + @ApiOperation(value="商品辅料表-添加", notes="商品辅料表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody GoodsAccessories goodsAccessories) { + goodsAccessoriesService.save(goodsAccessories); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param goodsAccessories + * @return + */ + @AutoLog(value = "商品辅料表-编辑") + @ApiOperation(value="商品辅料表-编辑", notes="商品辅料表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody GoodsAccessories goodsAccessories) { + goodsAccessoriesService.updateById(goodsAccessories); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "商品辅料表-通过id删除") + @ApiOperation(value="商品辅料表-通过id删除", notes="商品辅料表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + goodsAccessoriesService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "商品辅料表-批量删除") + @ApiOperation(value="商品辅料表-批量删除", notes="商品辅料表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.goodsAccessoriesService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "商品辅料表-通过id查询") + @ApiOperation(value="商品辅料表-通过id查询", notes="商品辅料表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + GoodsAccessories goodsAccessories = goodsAccessoriesService.getById(id); + if(goodsAccessories==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(goodsAccessories); + } + + /** + * 导出excel + * + * @param request + * @param goodsAccessories + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, GoodsAccessories goodsAccessories) { + return super.exportXls(request, goodsAccessories, GoodsAccessories.class, "商品辅料表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, GoodsAccessories.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/entity/GoodsAccessories.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/entity/GoodsAccessories.java new file mode 100644 index 00000000..c1638e88 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/entity/GoodsAccessories.java @@ -0,0 +1,67 @@ +package org.jeecg.modules.demo.goodsaccessories.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 商品辅料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +@Data +@TableName("goods_accessories") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="goods_accessories对象", description="商品辅料表") +public class GoodsAccessories implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**商品id*/ + @Excel(name = "商品id", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") + @Dict(dictTable = "zy_goods", dicText = "goods_num", dicCode = "id") + @ApiModelProperty(value = "商品id") + private java.lang.String goodsId; + /**辅料id*/ + @Excel(name = "辅料id", width = 15, dictTable = "zy_accessories", dicText = "contents", dicCode = "id") + @Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id") + @ApiModelProperty(value = "辅料id") + private java.lang.String accessoriesId; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/GoodsAccessoriesMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/GoodsAccessoriesMapper.java new file mode 100644 index 00000000..89707800 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/GoodsAccessoriesMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.goodsaccessories.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 商品辅料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +public interface GoodsAccessoriesMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/xml/GoodsAccessoriesMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/xml/GoodsAccessoriesMapper.xml new file mode 100644 index 00000000..3a7b12e0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/mapper/xml/GoodsAccessoriesMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/IGoodsAccessoriesService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/IGoodsAccessoriesService.java new file mode 100644 index 00000000..3836eeec --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/IGoodsAccessoriesService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.goodsaccessories.service; + +import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 商品辅料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +public interface IGoodsAccessoriesService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/impl/GoodsAccessoriesServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/impl/GoodsAccessoriesServiceImpl.java new file mode 100644 index 00000000..995102f8 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsaccessories/service/impl/GoodsAccessoriesServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.goodsaccessories.service.impl; + +import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; +import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; +import org.jeecg.modules.demo.goodsaccessories.service.IGoodsAccessoriesService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 商品辅料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +@Service +public class GoodsAccessoriesServiceImpl extends ServiceImpl implements IGoodsAccessoriesService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/controller/GoodsFabricController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/controller/GoodsFabricController.java new file mode 100644 index 00000000..39546e79 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/controller/GoodsFabricController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.demo.goodsfabric.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; +import org.jeecg.modules.demo.goodsfabric.service.IGoodsFabricService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 商品面料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +@Api(tags="商品面料表") +@RestController +@RequestMapping("/goodsfabric/goodsFabric") +@Slf4j +public class GoodsFabricController extends JeecgController { + @Autowired + private IGoodsFabricService goodsFabricService; + + /** + * 分页列表查询 + * + * @param goodsFabric + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "商品面料表-分页列表查询") + @ApiOperation(value="商品面料表-分页列表查询", notes="商品面料表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(GoodsFabric goodsFabric, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(goodsFabric, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = goodsFabricService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param goodsFabric + * @return + */ + @AutoLog(value = "商品面料表-添加") + @ApiOperation(value="商品面料表-添加", notes="商品面料表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody GoodsFabric goodsFabric) { + goodsFabricService.save(goodsFabric); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param goodsFabric + * @return + */ + @AutoLog(value = "商品面料表-编辑") + @ApiOperation(value="商品面料表-编辑", notes="商品面料表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody GoodsFabric goodsFabric) { + goodsFabricService.updateById(goodsFabric); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "商品面料表-通过id删除") + @ApiOperation(value="商品面料表-通过id删除", notes="商品面料表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + goodsFabricService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "商品面料表-批量删除") + @ApiOperation(value="商品面料表-批量删除", notes="商品面料表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.goodsFabricService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "商品面料表-通过id查询") + @ApiOperation(value="商品面料表-通过id查询", notes="商品面料表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + GoodsFabric goodsFabric = goodsFabricService.getById(id); + if(goodsFabric==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(goodsFabric); + } + + /** + * 导出excel + * + * @param request + * @param goodsFabric + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, GoodsFabric goodsFabric) { + return super.exportXls(request, goodsFabric, GoodsFabric.class, "商品面料表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, GoodsFabric.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/entity/GoodsFabric.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/entity/GoodsFabric.java new file mode 100644 index 00000000..d2be8cb8 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/entity/GoodsFabric.java @@ -0,0 +1,67 @@ +package org.jeecg.modules.demo.goodsfabric.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 商品面料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +@Data +@TableName("goods_fabric") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="goods_fabric对象", description="商品面料表") +public class GoodsFabric implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**商品id*/ + @Excel(name = "商品id", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") + @Dict(dictTable = "zy_goods", dicText = "goods_num", dicCode = "id") + @ApiModelProperty(value = "商品id") + private java.lang.String goodsId; + /**面料id*/ + @Excel(name = "面料id", width = 15, dictTable = "zy_fabric", dicText = "name", dicCode = "id") + @Dict(dictTable = "zy_fabric", dicText = "name", dicCode = "id") + @ApiModelProperty(value = "面料id") + private java.lang.String fabricId; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/GoodsFabricMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/GoodsFabricMapper.java new file mode 100644 index 00000000..3eeecd75 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/GoodsFabricMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.goodsfabric.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 商品面料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +public interface GoodsFabricMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/xml/GoodsFabricMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/xml/GoodsFabricMapper.xml new file mode 100644 index 00000000..f2983dec --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/mapper/xml/GoodsFabricMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/IGoodsFabricService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/IGoodsFabricService.java new file mode 100644 index 00000000..662246eb --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/IGoodsFabricService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.goodsfabric.service; + +import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 商品面料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +public interface IGoodsFabricService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/impl/GoodsFabricServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/impl/GoodsFabricServiceImpl.java new file mode 100644 index 00000000..9778d5d6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsfabric/service/impl/GoodsFabricServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.goodsfabric.service.impl; + +import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; +import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; +import org.jeecg.modules.demo.goodsfabric.service.IGoodsFabricService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 商品面料表 + * @Author: jeecg-boot + * @Date: 2022-12-06 + * @Version: V1.0 + */ +@Service +public class GoodsFabricServiceImpl extends ServiceImpl implements IGoodsFabricService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/controller/GoodsModuleController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/controller/GoodsModuleController.java new file mode 100644 index 00000000..726c68c2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/controller/GoodsModuleController.java @@ -0,0 +1,172 @@ +package org.jeecg.modules.demo.goodsmodule.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; +import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 商品模块表 + * @Author: jeecg-boot + * @Date: 2022-12-08 + * @Version: V1.0 + */ +@Api(tags="商品模块表") +@RestController +@RequestMapping("/goodsmodule/goodsModule") +@Slf4j +public class GoodsModuleController extends JeecgController { + @Autowired + private IGoodsModuleService goodsModuleService; + + /** + * 分页列表查询 + * + * @param goodsModule + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "商品模块表-分页列表查询") + @ApiOperation(value="商品模块表-分页列表查询", notes="商品模块表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(GoodsModule goodsModule, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req,String goodsid) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); + queryWrapper.eq("goods_id",goodsid); + Page page = new Page(pageNo, pageSize); + IPage pageList = goodsModuleService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param goodsModule + * @return + */ + @AutoLog(value = "商品模块表-添加") + @ApiOperation(value="商品模块表-添加", notes="商品模块表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody GoodsModule goodsModule) { + goodsModuleService.save(goodsModule); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param goodsModule + * @return + */ + @AutoLog(value = "商品模块表-编辑") + @ApiOperation(value="商品模块表-编辑", notes="商品模块表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody GoodsModule goodsModule) { + goodsModuleService.updateById(goodsModule); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "商品模块表-通过id删除") + @ApiOperation(value="商品模块表-通过id删除", notes="商品模块表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + goodsModuleService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "商品模块表-批量删除") + @ApiOperation(value="商品模块表-批量删除", notes="商品模块表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.goodsModuleService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "商品模块表-通过id查询") + @ApiOperation(value="商品模块表-通过id查询", notes="商品模块表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + GoodsModule goodsModule = goodsModuleService.getById(id); + if(goodsModule==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(goodsModule); + } + + /** + * 导出excel + * + * @param request + * @param goodsModule + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, GoodsModule goodsModule) { + return super.exportXls(request, goodsModule, GoodsModule.class, "商品模块表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, GoodsModule.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/entity/GoodsModule.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/entity/GoodsModule.java new file mode 100644 index 00000000..12b36198 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/entity/GoodsModule.java @@ -0,0 +1,80 @@ +package org.jeecg.modules.demo.goodsmodule.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 商品模块表 + * @Author: jeecg-boot + * @Date: 2022-12-08 + * @Version: V1.0 + */ +@Data +@TableName("goods_module") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="goods_module对象", description="商品模块表") +public class GoodsModule implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**商品id*/ + @Excel(name = "商品id", width = 15, dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") + @Dict(dictTable = "zy_goods", dicText = "goods_name", dicCode = "id") + @ApiModelProperty(value = "商品id") + private java.lang.String goodsId; + /**款式id*/ + @Excel(name = "款式id", width = 15, dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") + @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") + @ApiModelProperty(value = "款式id") + private java.lang.String styleId; + /**款式模块id*/ + @Excel(name = "款式模块id", width = 15) + @ApiModelProperty(value = "款式模块id") + private java.lang.String styleModuleId; + /**模块id*/ + @Excel(name = "模块id", width = 15, dictTable = "zy_cloths_modular ", dicText = "modular_name", dicCode = "id") + @Dict(dictTable = "zy_cloths_modular ", dicText = "modular_name", dicCode = "id") + @ApiModelProperty(value = "模块id") + private java.lang.String moduleId; + /**部位*/ + @Excel(name = "部位", width = 15) + @ApiModelProperty(value = "部位") + private java.lang.String place; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/GoodsModuleMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/GoodsModuleMapper.java new file mode 100644 index 00000000..53aa79c2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/GoodsModuleMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.goodsmodule.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 商品模块表 + * @Author: jeecg-boot + * @Date: 2022-12-08 + * @Version: V1.0 + */ +public interface GoodsModuleMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/xml/GoodsModuleMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/xml/GoodsModuleMapper.xml new file mode 100644 index 00000000..88690991 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/mapper/xml/GoodsModuleMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/IGoodsModuleService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/IGoodsModuleService.java new file mode 100644 index 00000000..3e05a7eb --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/IGoodsModuleService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.goodsmodule.service; + +import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 商品模块表 + * @Author: jeecg-boot + * @Date: 2022-12-08 + * @Version: V1.0 + */ +public interface IGoodsModuleService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/impl/GoodsModuleServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/impl/GoodsModuleServiceImpl.java new file mode 100644 index 00000000..ad6eeb5c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/goodsmodule/service/impl/GoodsModuleServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.goodsmodule.service.impl; + +import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; +import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; +import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 商品模块表 + * @Author: jeecg-boot + * @Date: 2022-12-08 + * @Version: V1.0 + */ +@Service +public class GoodsModuleServiceImpl extends ServiceImpl implements IGoodsModuleService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java new file mode 100644 index 00000000..53493ae2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java @@ -0,0 +1,230 @@ +package org.jeecg.modules.demo.zygoods.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.base.service.IZyClothsModularService; +import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; +import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; +import org.jeecg.modules.demo.zygoods.entity.ZyGoods; +import org.jeecg.modules.demo.zygoods.service.IZyGoodsService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +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.service.IZyClothsStyleService; +import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; +import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; +import org.jeecg.modules.zystylemodule.entity.ZyStyleModule; +import org.jeecg.modules.zystylemodule.service.IZyStyleModuleService; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 商品表 + * @Author: jeecg-boot + * @Date: 2022-12-07 + * @Version: V1.0 + */ +@Api(tags="商品表") +@RestController +@RequestMapping("/zygoods/zyGoods") +@Slf4j +public class ZyGoodsController extends JeecgController { + @Autowired + private IZyGoodsService zyGoodsService; + @Autowired + private IGoodsModuleService goodsModuleService; + @Autowired + private IZyStyleModuleService zyStyleModuleService; + @Autowired + private IZyClothsModularService zyClothsModularService; + @Autowired + private IZyClothsStyleService zyClothsStyleService; + + /** + * 分页列表查询 + * + * @param zyGoods + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "商品表-分页列表查询") + @ApiOperation(value="商品表-分页列表查询", notes="商品表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyGoods zyGoods, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyGoodsService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zyGoods + * @return + */ + @AutoLog(value = "商品表-添加") + @ApiOperation(value="商品表-添加", notes="商品表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyGoods zyGoods,HttpServletRequest req) { + zyGoodsService.save(zyGoods); + ZyStyleModule zyStyleModule = new ZyStyleModule(); + QueryWrapper queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap()); + queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); + List listzsm = zyStyleModuleService.list(queryWrapperzsm); + for (int i = 0 ; i < listzsm.size() ; i++){ + GoodsModule goodsModule = new GoodsModule(); + goodsModule.setGoodsId(zyGoods.getId()); + goodsModule.setStyleId(zyGoods.getStyleId()); + goodsModule.setStyleModuleId(listzsm.get(i).getId()); + goodsModule.setModuleId(listzsm.get(i).getModularId()); + //部位暂时没有字段,zy_cloths_modular的place + //goodsModule.setPlace(); + goodsModuleService.save(goodsModule); + } + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyGoods + * @return + */ + @AutoLog(value = "商品表-编辑") + @ApiOperation(value="商品表-编辑", notes="商品表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyGoods zyGoods,HttpServletRequest req) { + zyGoodsService.updateById(zyGoods); + GoodsModule goodsModule = new GoodsModule(); + QueryWrapper queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); + queryWrappergm.eq("goods_id",zyGoods.getId()); + goodsModuleService.remove(queryWrappergm); + ZyStyleModule zyStyleModule = new ZyStyleModule(); + QueryWrapper queryWrapperzsm = QueryGenerator.initQueryWrapper(zyStyleModule, req.getParameterMap()); + queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); + List listzsm = zyStyleModuleService.list(queryWrapperzsm); + for (int i = 0 ; i < listzsm.size() ; i++){ + GoodsModule goodsModule1 = new GoodsModule(); + goodsModule1.setGoodsId(zyGoods.getId()); + 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("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "商品表-通过id删除") + @ApiOperation(value="商品表-通过id删除", notes="商品表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { + zyGoodsService.removeById(id); + GoodsModule goodsModule = new GoodsModule(); + QueryWrapper queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); + queryWrappergm.eq("goods_id",id); + goodsModuleService.remove(queryWrappergm); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "商品表-批量删除") + @ApiOperation(value="商品表-批量删除", notes="商品表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids,HttpServletRequest req) { + this.zyGoodsService.removeByIds(Arrays.asList(ids.split(","))); + String [] str = ids.split(","); + for(int i = 0 ; i < str.length ; i++){ + GoodsModule goodsModule = new GoodsModule(); + QueryWrapper queryWrappergm = QueryGenerator.initQueryWrapper(goodsModule, req.getParameterMap()); + queryWrappergm.eq("goods_id",str[i]); + goodsModuleService.remove(queryWrappergm); + } + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "商品表-通过id查询") + @ApiOperation(value="商品表-通过id查询", notes="商品表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + ZyGoods zyGoods = zyGoodsService.getById(id); + if(zyGoods==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyGoods); + } + + /** + * 导出excel + * + * @param request + * @param zyGoods + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ZyGoods zyGoods) { + return super.exportXls(request, zyGoods, ZyGoods.class, "商品表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ZyGoods.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java new file mode 100644 index 00000000..dbc1b3da --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java @@ -0,0 +1,140 @@ +package org.jeecg.modules.demo.zygoods.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 商品表 + * @Author: jeecg-boot + * @Date: 2022-12-07 + * @Version: V1.0 + */ +@Data +@TableName("zy_goods") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="zy_goods对象", description="商品表") +public class ZyGoods implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**商品编号*/ + @Excel(name = "商品编号", width = 15) + @ApiModelProperty(value = "商品编号") + private java.lang.String goodsCode; + /**商品名称*/ + @Excel(name = "商品名称", width = 15) + @ApiModelProperty(value = "商品名称") + private java.lang.String goodsName; + /**商品描述*/ + @Excel(name = "商品描述", width = 15) + @ApiModelProperty(value = "商品描述") + private java.lang.String goodsIntr; + /**是否定制*/ + @Excel(name = "是否定制", width = 15, dicCode = "yn") + @Dict(dicCode = "yn") + @ApiModelProperty(value = "是否定制") + private java.lang.Integer customized; + /**商品图片*/ + @Excel(name = "商品图片", width = 15) + @ApiModelProperty(value = "商品图片") + private java.lang.String goodsPicture; + /**默认图片*/ + @Excel(name = "默认图片", width = 15) + @ApiModelProperty(value = "默认图片") + private java.lang.String defaultPicture; + /**商品视频*/ + @Excel(name = "商品视频", width = 15) + @ApiModelProperty(value = "商品视频") + private java.lang.String goodsVideo; + /**类型id*/ + @Excel(name = "类型id", width = 15, dictTable = "zy_cloths_type ", dicText = "type_name", dicCode = "id") + @Dict(dictTable = "zy_cloths_type ", dicText = "type_name", dicCode = "id") + @ApiModelProperty(value = "类型id") + private java.lang.String clothsTypeId; + /**型号id*/ + @Excel(name = "型号id", width = 15, dictTable = "zy_style_model", dicText = "model_number", dicCode = "id") + @Dict(dictTable = "zy_style_model", dicText = "model_number", dicCode = "id") + @ApiModelProperty(value = "型号id") + private java.lang.String modelId; + /**款式id*/ + @Excel(name = "款式id", width = 15, dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") + @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") + @ApiModelProperty(value = "款式id") + private java.lang.String styleId; + /**单位*/ + @Excel(name = "单位", width = 15) + @ApiModelProperty(value = "单位") + private java.lang.String unit; + /**包装个数*/ + @Excel(name = "包装个数", width = 15) + @ApiModelProperty(value = "包装个数") + private java.lang.Integer number; + /**单价*/ + @Excel(name = "单价", width = 15) + @ApiModelProperty(value = "单价") + private java.lang.Double unitPrice; + /**折扣*/ + @Excel(name = "折扣", width = 15) + @ApiModelProperty(value = "折扣") + private java.lang.Double discount; + /**促销价*/ + @Excel(name = "促销价", width = 15) + @ApiModelProperty(value = "促销价") + private java.lang.Double promotionPrice; + /**是否推荐*/ + @Excel(name = "是否推荐", width = 15, dicCode = "yn") + @Dict(dicCode = "yn") + @ApiModelProperty(value = "是否推荐") + private java.lang.Integer recommend; + /**产地*/ + @Excel(name = "产地", width = 15) + @ApiModelProperty(value = "产地") + private java.lang.String placeOrigin; + /**状态*/ + @Excel(name = "状态", width = 15, dicCode = "good_status") + @Dict(dicCode = "good_status") + @ApiModelProperty(value = "状态") + private java.lang.Integer status; + /**企业id*/ + @Excel(name = "企业id", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "企业id") + private java.lang.String enterprisesId; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/ZyGoodsMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/ZyGoodsMapper.java new file mode 100644 index 00000000..d9f88a72 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/ZyGoodsMapper.java @@ -0,0 +1,20 @@ +package org.jeecg.modules.demo.zygoods.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.zygoods.entity.ZyGoods; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 商品表 + * @Author: jeecg-boot + * @Date: 2022-12-07 + * @Version: V1.0 + */ +public interface ZyGoodsMapper extends BaseMapper { + public boolean deleteByMainId(@Param("mainId") String mainId); + + public List selectByMainId(@Param("mainId") String mainId); + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/xml/ZyGoodsMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/xml/ZyGoodsMapper.xml new file mode 100644 index 00000000..d056c23b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/mapper/xml/ZyGoodsMapper.xml @@ -0,0 +1,16 @@ + + + + + DELETE + FROM zy_goods + WHERE + id = #{mainId} + + + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/IZyGoodsService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/IZyGoodsService.java new file mode 100644 index 00000000..c25dfaa0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/IZyGoodsService.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.zygoods.service; + +import org.jeecg.modules.demo.zygoods.entity.ZyGoods; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * @Description: 商品表 + * @Author: jeecg-boot + * @Date: 2022-12-07 + * @Version: V1.0 + */ +public interface IZyGoodsService extends IService { + public List selectByMainId(String mainId); + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/impl/ZyGoodsServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/impl/ZyGoodsServiceImpl.java new file mode 100644 index 00000000..90463972 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/impl/ZyGoodsServiceImpl.java @@ -0,0 +1,29 @@ +package org.jeecg.modules.demo.zygoods.service.impl; + +import org.jeecg.modules.demo.zygoods.entity.ZyGoods; +import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; +import org.jeecg.modules.demo.zygoods.service.IZyGoodsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import java.util.List; + +/** + * @Description: 商品表 + * @Author: jeecg-boot + * @Date: 2022-12-07 + * @Version: V1.0 + */ +@Service +public class ZyGoodsServiceImpl extends ServiceImpl implements IZyGoodsService { + @Autowired + private ZyGoodsMapper zyGoodsMapper; + + @Override + public List selectByMainId(String mainId) { + return zyGoodsMapper.selectByMainId(mainId); + } + + }