From 8454c8f40575b5b43e64002fe72d685abce35a47 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Thu, 2 Feb 2023 15:12:34 +0800 Subject: [PATCH 1/7] =?UTF-8?q?package.json=20antd-online-mini=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20=E6=9B=B4=E6=96=B0=202.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ant-design-vue-jeecg/package.json | 2 +- .../src/views/hanger/HangerMakerList.vue | 4 ++-- .../src/views/hanger/modules/HangerMakerForm.vue | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ant-design-vue-jeecg/package.json b/ant-design-vue-jeecg/package.json index a5c4000b..730bfbbc 100644 --- a/ant-design-vue-jeecg/package.json +++ b/ant-design-vue-jeecg/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@antv/data-set": "^0.11.4", - "@jeecg/antd-online-mini": "^3.4.3-beta2", + "@jeecg/antd-online-mini": "2.4.5-RC", "@jiaminghi/data-view": "^2.10.0", "@tinymce/tinymce-vue": "2.1.0", "@toast-ui/editor": "^2.1.2", diff --git a/ant-design-vue-jeecg/src/views/hanger/HangerMakerList.vue b/ant-design-vue-jeecg/src/views/hanger/HangerMakerList.vue index b7a8c935..15c20ba7 100644 --- a/ant-design-vue-jeecg/src/views/hanger/HangerMakerList.vue +++ b/ant-design-vue-jeecg/src/views/hanger/HangerMakerList.vue @@ -157,11 +157,11 @@ export default { align: "center", dataIndex: 'orderCode' }, - { + /*{ title: '制单编号', align: "center", dataIndex: 'makerCode' - }, + },*/ { title: '操作', dataIndex: 'action', diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/HangerMakerForm.vue b/ant-design-vue-jeecg/src/views/hanger/modules/HangerMakerForm.vue index 9d15b68d..2eb1b26b 100644 --- a/ant-design-vue-jeecg/src/views/hanger/modules/HangerMakerForm.vue +++ b/ant-design-vue-jeecg/src/views/hanger/modules/HangerMakerForm.vue @@ -29,7 +29,7 @@ - + @@ -45,7 +45,7 @@ /> - + @@ -87,7 +87,9 @@ export default { }, data() { return { - model: {}, + model: { + ismaker: 0, + }, labelCol: { xs: {span: 24}, sm: {span: 5}, From 091160fe883270ea5a79438f20c2306543f9d1c0 Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Thu, 2 Feb 2023 15:17:07 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/delivery/DeliveryList.vue | 13 +- .../views/delivery/modules/DeliveryForm1.vue | 141 ++++++++++++++++++ .../views/delivery/modules/DeliveryModal1.vue | 60 ++++++++ .../demo/delivery/mapper/DeliveryMapper.java | 11 ++ .../service/impl/DeliveryServiceImpl.java | 38 ++++- 5 files changed, 256 insertions(+), 7 deletions(-) create mode 100644 ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue create mode 100644 ant-design-vue-jeecg/src/views/delivery/modules/DeliveryModal1.vue diff --git a/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue b/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue index 30dc49a3..16bf0339 100644 --- a/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue +++ b/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue @@ -95,6 +95,8 @@ + 确定出库 + 编辑 @@ -115,7 +117,7 @@ - + @@ -126,13 +128,15 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import DeliveryModal from './modules/DeliveryModal' + import DeliveryModal1 from './modules/DeliveryModal1' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' export default { name: 'DeliveryList', mixins:[JeecgListMixin, mixinDevice], components: { - DeliveryModal + DeliveryModal, + DeliveryModal1 }, data () { return { @@ -227,6 +231,11 @@ }, }, methods: { + qdck: function (record) { + this.$refs.modalFormqdck.edit(record); + this.$refs.modalFormqdck.title = "确定出库"; + this.$refs.modalFormqdck.disableSubmit = false; + }, initDictConfig(){ }, getSuperFieldList(){ diff --git a/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue new file mode 100644 index 00000000..86771266 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue @@ -0,0 +1,141 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryModal1.vue b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryModal1.vue new file mode 100644 index 00000000..ea35d415 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryModal1.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/mapper/DeliveryMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/mapper/DeliveryMapper.java index b84bdb31..e5515bb2 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/mapper/DeliveryMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/mapper/DeliveryMapper.java @@ -4,6 +4,7 @@ package org.jeecg.modules.demo.delivery.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.jeecg.modules.demo.delivery.entity.Delivery; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -15,4 +16,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface DeliveryMapper extends BaseMapper { + @Select("select storehouse_id from storage where item_type=#{s} and item_code=#{fabricNumber} and amount > #{doubleValue}") + String findStorehouseId(String s, double doubleValue, String fabricNumber); + + @Select("select user_id from storehouse where id =#{storehouseId}") + String getadminid(String storehouseId); + + + + @Select("select storehouse_id from storage where item_type=#{s} and item_code=#{fabricNumber} and amount > #{doubleValue}") + String findStorehouseId2(String s, double doubleValue, String fabricNumber); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java index 7aa4f2bd..b7cba37b 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; +import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.Optional; @@ -34,6 +35,10 @@ import java.util.Optional; @Service public class DeliveryServiceImpl extends ServiceImpl implements IDeliveryService { + + @Autowired + DeliveryMapper deliveryMapper; + @Autowired private IZyProductPlanService iZyProductPlanService; @@ -62,14 +67,28 @@ public class DeliveryServiceImpl extends ServiceImpl i delivery.setDeliveryReason("0"); delivery.setItemType("0"); delivery.setAmount(e.getAmount().doubleValue()); -// delivery.setDeliveryTime(new Date()); -// delivery.setCarrierId("TODO"); -// delivery.setAdminId("TODO"); -// delivery.setStorehouseId("TODO"); + delivery.setDeliveryTime(new Date()); + ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId()); if (!ObjectUtils.isEmpty(zyFabric)) { delivery.setItemCode(zyFabric.getFabricNumber()); } + + //取货人 +// delivery.setCarrierId("TODO"); + //管理员 +// delivery.setAdminId("TODO"); + //仓库id +// delivery.setStorehouseId("TODO"); + /*=====================开始=============================王家东添加*/ + /* String StorehouseId = deliveryMapper.findStorehouseId("0",e.getAmount().doubleValue(),zyFabric.getFabricNumber()); + if (StorehouseId!=""){ + delivery.setStorehouseId(StorehouseId); + String adminid =deliveryMapper.getadminid(StorehouseId); + delivery.setStorehouseId(adminid); + }*/ + + /*=====================结束=============================王家东添加*/ deliveryList4Fabric.add(delivery); }); this.saveBatch(deliveryList4Fabric); @@ -82,7 +101,7 @@ public class DeliveryServiceImpl extends ServiceImpl i delivery2.setDeliveryReason("0"); delivery2.setItemType("1"); delivery2.setAmount(e.getAmount().doubleValue()); -// delivery2.setDeliveryTime(new Date()); + delivery2.setDeliveryTime(new Date()); // delivery2.setCarrierId("TODO"); // delivery2.setAdminId("TODO"); // delivery2.setStorehouseId("TODO"); @@ -90,6 +109,15 @@ public class DeliveryServiceImpl extends ServiceImpl i if (!ObjectUtils.isEmpty(zyAccessories)) { delivery2.setItemCode(zyAccessories.getNums()); } + + /* String StorehouseId = deliveryMapper.findStorehouseId2("0",e.getAmount().doubleValue(),zyFabric.getFabricNumber()); + if (StorehouseId!=""){ + delivery2.setStorehouseId(StorehouseId); + String adminid =deliveryMapper.getadminid(StorehouseId); + delivery2.setStorehouseId(adminid); + }*/ + + deliveryList4accessories.add(delivery2); }); this.saveBatch(deliveryList4accessories); From a72f32a8a2a826daafebb759feb1d055db59d5cc Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Thu, 2 Feb 2023 17:09:38 +0800 Subject: [PATCH 3/7] shuaxin --- .../src/views/delivery/DeliveryList.vue | 18 +++++++ .../views/delivery/modules/DeliveryForm.vue | 52 ++++++------------- .../views/delivery/modules/DeliveryForm1.vue | 10 ++-- .../controller/DeliveryController.java | 29 +++++++++++ .../demo/delivery/entity/Delivery.java | 6 +++ 5 files changed, 72 insertions(+), 43 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue b/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue index 16bf0339..2cfedd50 100644 --- a/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue +++ b/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue @@ -97,6 +97,8 @@ 确定出库 + 撤销出库 + 编辑 @@ -130,6 +132,7 @@ import DeliveryModal from './modules/DeliveryModal' import DeliveryModal1 from './modules/DeliveryModal1' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + import { getAction } from '../../api/manage' export default { name: 'DeliveryList', @@ -201,6 +204,11 @@ align:"center", dataIndex: 'adminId_dictText' }, + { + title:'出库状态', + align:"center", + dataIndex: 'status_dictText' + }, { title: '操作', dataIndex: 'action', @@ -211,6 +219,7 @@ } ], url: { + cxck: "/delivery/delivery/cxck", list: "/delivery/delivery/list", delete: "/delivery/delivery/delete", deleteBatch: "/delivery/delivery/deleteBatch", @@ -231,6 +240,15 @@ }, }, methods: { + cxck(record){ + getAction(this.url.cxck,{ id: record.id}).then((res)=>{ + if(res.success){ + this.loadData(1); + }else{ + that.$message.warning(res.message); + } + }) + }, qdck: function (record) { this.$refs.modalFormqdck.edit(record); this.$refs.modalFormqdck.title = "确定出库"; diff --git a/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm.vue b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm.vue index 3530446c..45e95852 100644 --- a/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm.vue +++ b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm.vue @@ -3,19 +3,16 @@ - - - - - + - + - + - + - + - - - - - - - - - - - + + @@ -167,9 +151,7 @@ amount: [ { required: true, message: '请输入用量!'}, ], - storehouseId: [ - { required: true, message: '请输入仓库!'}, - ], + itemType: [ { required: true, message: '请输入物品类型!'}, ], @@ -179,12 +161,8 @@ deliveryTime: [ { required: true, message: '请输入出库时间!'}, ], - carrierId: [ - { required: true, message: '请输入取货人!'}, - ], - adminName: [ - { required: true, message: '请输入管理员!'}, - ], + + }, url: { add: "/delivery/delivery/add", diff --git a/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue index 86771266..f2011fdc 100644 --- a/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue +++ b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue @@ -5,17 +5,18 @@ - + - + - - 一旦确定将无法编辑修改 - - @@ -56,6 +53,7 @@ data () { return { model:{ + state :"0", itemType :"1", deliveryReason : "0" }, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/controller/DeliveryController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/controller/DeliveryController.java index 5f22e058..9085d920 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/controller/DeliveryController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/controller/DeliveryController.java @@ -137,6 +137,35 @@ public class DeliveryController extends JeecgController edit1(@RequestBody Delivery delivery) { + delivery.setStatus("1"); + deliveryService.updateById(delivery); + return Result.OK("编辑成功!"); + } + + //重新上线cxsx + @AutoLog(value = "专利列表-重新上线") + @ApiOperation(value="专利列表-重新上线", notes="专利列表-重新上线") + @RequestMapping(value = "/cxck") + public Result cxck(@RequestParam(name="id",required=true) String id) { + Delivery delivery = new Delivery(); + delivery.setId(id); + delivery.setStatus("2"); + deliveryService.updateById(delivery); + return Result.OK("ok!"); + } + + /** * 通过id删除 * diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/entity/Delivery.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/entity/Delivery.java index dd4d1f05..fb1dccbf 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/entity/Delivery.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/entity/Delivery.java @@ -103,4 +103,10 @@ public class Delivery implements Serializable { @Excel(name = "管理员", width = 15) @ApiModelProperty(value = "管理员") private String adminName; + + /**出库状态*/ + @Excel(name = "出库状态", width = 15, dicCode = "ckzt") + @Dict(dicCode = "ckzt") + @ApiModelProperty(value = "出库状态") + private java.lang.String status; } From 9d97205281a3549500ac4523614888dee621ad40 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Thu, 2 Feb 2023 17:58:53 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=90=8A=E6=8C=82=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=202.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/hanger/ZyHangList.vue | 236 ++++++++++++++++++ .../src/views/hanger/modules/ZyHangForm.vue | 219 ++++++++++++++++ .../src/views/hanger/modules/ZyHangModal.vue | 60 +++++ .../modules/ZyHangModal__Style#Drawer.vue | 84 +++++++ .../hanger/controller/ZyHangController.java | 172 +++++++++++++ .../jeecg/modules/hanger/entity/ZyHang.java | 149 +++++++++++ .../modules/hanger/mapper/ZyHangMapper.java | 15 ++ .../hanger/service/IZyHangService.java | 15 ++ .../service/impl/ZyHangServiceImpl.java | 19 ++ 9 files changed, 969 insertions(+) create mode 100644 ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue create mode 100644 ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue create mode 100644 ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue create mode 100644 ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java diff --git a/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue new file mode 100644 index 00000000..49b489ba --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue @@ -0,0 +1,236 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue new file mode 100644 index 00000000..2bd149cb --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue @@ -0,0 +1,219 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue new file mode 100644 index 00000000..ac2423ef --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue new file mode 100644 index 00000000..297b3480 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java new file mode 100644 index 00000000..8fd4607e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java @@ -0,0 +1,172 @@ +package org.jeecg.modules.hanger.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.hanger.entity.ZyHang; +import org.jeecg.modules.hanger.service.IZyHangService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +@Api(tags = "吊挂表") +@RestController +@RequestMapping("/org.jeecg.modules.hanger/zyHang") +@Slf4j +public class ZyHangController extends JeecgController { + @Autowired + private IZyHangService zyHangService; + + /** + * 分页列表查询 + * + * @param zyHang + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "吊挂表-分页列表查询") + @ApiOperation(value = "吊挂表-分页列表查询", notes = "吊挂表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyHang zyHang, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyHang, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyHangService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zyHang + * @return + */ + @AutoLog(value = "吊挂表-添加") + @ApiOperation(value = "吊挂表-添加", notes = "吊挂表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyHang zyHang) { + List list = zyHangService.list(new LambdaQueryWrapper() + .eq(ZyHang::getStatus, "0") + .orderByDesc(ZyHang::getCode)); + String code = ""; + if (ObjectUtils.isEmpty(list)) { + code = "DG1000"; + } else { + String[] dgs = list.get(0).getCode().split("DG"); + int val = new Integer(dgs[1]).intValue() + 1 ; + code = "DG" + val+ ""; + } + zyHang.setCode(code); + zyHang.setStatus("0"); + zyHangService.save(zyHang); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyHang + * @return + */ + @AutoLog(value = "吊挂表-编辑") + @ApiOperation(value = "吊挂表-编辑", notes = "吊挂表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyHang zyHang) { + zyHangService.updateById(zyHang); + 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) { + zyHangService.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.zyHangService.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) { + ZyHang zyHang = zyHangService.getById(id); + if (zyHang == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyHang); + } + + /** + * 导出excel + * + * @param request + * @param zyHang + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ZyHang zyHang) { + return super.exportXls(request, zyHang, ZyHang.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, ZyHang.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java new file mode 100644 index 00000000..8273c52c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java @@ -0,0 +1,149 @@ +package org.jeecg.modules.hanger.entity; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +@Data +@TableName("zy_hang") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "zy_hang对象", description = "吊挂表") +public class ZyHang implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private String createBy; + /** + * 创建日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private Date createTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private String updateBy; + /** + * 更新日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private Date updateTime; + /** + * 车间 + */ + @Excel(name = "车间", width = 15) + @ApiModelProperty(value = "车间") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + private String workshopId; + /** + * 品牌 + */ + @Excel(name = "品牌", width = 15) + @ApiModelProperty(value = "品牌") + private String brand; + /** + * 型号 + */ + @Excel(name = "型号", width = 15) + @ApiModelProperty(value = "型号") + private String model; + /** + * 编号 + */ + @Excel(name = "编号", width = 15) + @ApiModelProperty(value = "编号") + private String code; + /** + * 工站数 + */ + @Excel(name = "工站数", width = 15) + @ApiModelProperty(value = "工站数") + private Integer pointnumber; + /** + * 购买时间 + */ + @Excel(name = "购买时间", width = 15) + @ApiModelProperty(value = "购买时间") + private String buydate; + /** + * 经办人 + */ + @Excel(name = "经办人", width = 15) + @ApiModelProperty(value = "经办人") + private String agent; + /** + * 状态 + */ + @Excel(name = "状态", width = 15) + @ApiModelProperty(value = "状态") + private String status; + /** + * 二维码 + */ + @Excel(name = "二维码", width = 15) + @ApiModelProperty(value = "二维码") + private String qrcode; + /** + * 维护周期 + */ + @Excel(name = "维护周期", width = 15) + @ApiModelProperty(value = "维护周期") + private Integer maintenancecycle; + /** + * 管理 人 + */ + @Excel(name = "管理 人", width = 15) + @ApiModelProperty(value = "管理 人") + private String administrator; + /** + * 上次维护时间 + */ + @Excel(name = "上次维护时间", width = 15) + @ApiModelProperty(value = "上次维护时间") + private String maintenancedate; + /** + * 图片 + */ + @Excel(name = "图片", width = 15) + @ApiModelProperty(value = "图片") + private String img; + /** + * 3d模型 + */ + @Excel(name = "3d模型", width = 15) + @ApiModelProperty(value = "3d模型") + private String img3d; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java new file mode 100644 index 00000000..769d78bd --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.hanger.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.hanger.entity.ZyHang; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +public interface ZyHangMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java new file mode 100644 index 00000000..8b12290b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.hanger.service; + + +import org.jeecg.modules.hanger.entity.ZyHang; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +public interface IZyHangService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java new file mode 100644 index 00000000..ba2daec4 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.hanger.service.impl; + +import org.jeecg.modules.hanger.entity.ZyHang; +import org.jeecg.modules.hanger.mapper.ZyHangMapper; +import org.jeecg.modules.hanger.service.IZyHangService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +@Service +public class ZyHangServiceImpl extends ServiceImpl implements IZyHangService { + +} From 87501ef21f88876c2c2f969921d6b076c9cbd2bb Mon Sep 17 00:00:00 2001 From: lenovo <123> Date: Thu, 2 Feb 2023 22:03:06 +0800 Subject: [PATCH 5/7] =?UTF-8?q?2023-2-2=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/device/ZyDeviceList.vue | 10 +++++ .../src/views/device/modules/ZyDeviceForm.vue | 18 ++++++-- .../devicebrand/modules/ZyDevicebrandForm.vue | 42 +++++++++++++------ .../devicemodel/modules/ZyDevicemodelForm.vue | 42 ++++++++++++------- .../devicetype/modules/ZyDevicetypeForm.vue | 4 ++ .../device/controller/ZyDeviceController.java | 27 +++++++++++- .../modules/device/mapper/ZyDeviceMapper.java | 8 ++++ .../device/service/IZyDeviceService.java | 8 ++++ .../service/impl/ZyDeviceServiceImpl.java | 17 ++++++++ .../controller/ZyDevicebrandController.java | 13 +++++- .../controller/ZyDevicemodelController.java | 10 ++++- .../controller/ZyDevicetypeController.java | 23 ++++++++-- 12 files changed, 185 insertions(+), 37 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue b/ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue index 0c836ae5..c0820745 100644 --- a/ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue +++ b/ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue @@ -4,6 +4,16 @@
+ + + + + + + + + + diff --git a/ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue b/ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue index b593d7a2..786151be 100644 --- a/ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue +++ b/ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue @@ -40,7 +40,7 @@ - + @@ -53,8 +53,6 @@ - - @@ -77,6 +75,12 @@ + + + + + @@ -116,6 +121,9 @@ }, data () { return { + parm1:{ + brand_id:'' + }, model:{ status:1, }, @@ -147,6 +155,10 @@ this.modelDefault = JSON.parse(JSON.stringify(this.model)); }, methods: { + canshu(){ + this.parm1.brand_id=this.model.canshu + console.log(this.parm1) + }, add () { this.edit(this.modelDefault); }, diff --git a/ant-design-vue-jeecg/src/views/zydevice/devicebrand/modules/ZyDevicebrandForm.vue b/ant-design-vue-jeecg/src/views/zydevice/devicebrand/modules/ZyDevicebrandForm.vue index 4e3fbadb..59f7f56c 100644 --- a/ant-design-vue-jeecg/src/views/zydevice/devicebrand/modules/ZyDevicebrandForm.vue +++ b/ant-design-vue-jeecg/src/views/zydevice/devicebrand/modules/ZyDevicebrandForm.vue @@ -3,33 +3,36 @@ - + - + - - - + + + - - - + + + - + + - - + + + + @@ -68,8 +71,20 @@ xs: { span: 24 }, sm: { span: 16 }, }, + labelCol1: { + xs: { span: 24 }, + sm: { span: 3 }, + }, + wrapperCol1: { + xs: { span: 24 }, + sm: { span: 21 }, + }, confirmLoading: false, validatorRules: { + brand:[ + { required: true, message: '请输入品牌名称!'}, + {min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'}, + ], }, url: { add: "/devicebrand/zyDevicebrand/add", @@ -88,6 +103,9 @@ this.modelDefault = JSON.parse(JSON.stringify(this.model)); }, methods: { + shengchan(){ + this.model.manufacturer=this.model.supplier + }, add () { this.edit(this.modelDefault); }, @@ -126,4 +144,4 @@ }, } } - \ No newline at end of file + diff --git a/ant-design-vue-jeecg/src/views/zydevice/devicemodel/modules/ZyDevicemodelForm.vue b/ant-design-vue-jeecg/src/views/zydevice/devicemodel/modules/ZyDevicemodelForm.vue index 290689cd..0342be94 100644 --- a/ant-design-vue-jeecg/src/views/zydevice/devicemodel/modules/ZyDevicemodelForm.vue +++ b/ant-design-vue-jeecg/src/views/zydevice/devicemodel/modules/ZyDevicemodelForm.vue @@ -16,7 +16,7 @@ - + --> - + - + @@ -67,24 +67,24 @@ - + - - - - - - - - + + + + + - - - + + + + + + @@ -122,8 +122,20 @@ xs: { span: 24 }, sm: { span: 16 }, }, + labelCol1: { + xs: { span: 24 }, + sm: { span: 3 }, + }, + wrapperCol1: { + xs: { span: 24 }, + sm: { span: 21 }, + }, confirmLoading: false, validatorRules: { + model:[ + { required: true, message: '请输入型号名称!'}, + {min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'}, + ], }, url: { add: "/devicemodel/zyDevicemodel/add", diff --git a/ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeForm.vue b/ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeForm.vue index 958bdbe3..fc467c33 100644 --- a/ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeForm.vue +++ b/ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeForm.vue @@ -56,6 +56,10 @@ }, confirmLoading: false, validatorRules: { + name:[ + { required: true, message: '请输入设备类型!'}, + {min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'}, + ], }, url: { add: "/devicetype/zyDevicetype/add", diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java index d91662a9..55125280 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java @@ -75,7 +75,28 @@ public class ZyDeviceController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(zyDevice, req.getParameterMap()); +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyDevice, req.getParameterMap()); + QueryWrapper queryWrapper=new QueryWrapper(); + if(zyDevice.getName()!=null){ + queryWrapper.like("name",zyDevice.getName()); + } + if(zyDevice.getCode()!=null){ + queryWrapper.like("code",zyDevice.getCode()); + } + if(zyDevice.getStatus()!=null){ + queryWrapper.eq("status",zyDevice.getStatus()); + } + if(zyDevice.getBrandId()!=null){ + String s="%"+zyDevice.getBrandId()+"%"; + List brand=zyDeviceService.findAllBrand(s); + queryWrapper.in("brand_id",brand); + } + if(zyDevice.getModelId()!=null){ + String s="%"+zyDevice.getModelId()+"%"; + List model=zyDeviceService.findAllModel(s); + queryWrapper.in("model_id",model); + } + Page page = new Page(pageNo, pageSize); IPage pageList = zyDeviceService.page(page, queryWrapper); MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); @@ -192,6 +213,10 @@ public class ZyDeviceController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { + int a=zyDeviceService.find(id); + if(a>=1){ + return Result.error("有工序使用本设备,删除失败!!!"); + } zyDeviceService.removeById(id); return Result.OK("删除成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/mapper/ZyDeviceMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/mapper/ZyDeviceMapper.java index eada1e78..ae6d04cb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/mapper/ZyDeviceMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/mapper/ZyDeviceMapper.java @@ -21,4 +21,12 @@ public interface ZyDeviceMapper extends BaseMapper { @Select("select code from zy_device order by code desc limit 0,1") String getCode(); + + @Select("select id from zy_devicebrand where brand like #{s}") + List findAllBrand(String s); + @Select("select id from zy_devicemodel where model like #{s}") + List findAllModel(String s); + + @Select("select count(1) from zy_process_machine where machineId=#{id}") + int find(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/IZyDeviceService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/IZyDeviceService.java index 26cb92eb..f471aa48 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/IZyDeviceService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/IZyDeviceService.java @@ -4,6 +4,8 @@ import org.jeecg.modules.device.entity.ZyDevice; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel; +import java.util.List; + /** * @Description: 设备信息 * @Author: jeecg-boot @@ -15,4 +17,10 @@ public interface IZyDeviceService extends IService { ZyDevicemodel findByModelId(String modelId); String getCode(); + + List findAllBrand(String s); + + List findAllModel(String s); + + int find(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/impl/ZyDeviceServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/impl/ZyDeviceServiceImpl.java index 95332469..1048379a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/impl/ZyDeviceServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/service/impl/ZyDeviceServiceImpl.java @@ -9,6 +9,8 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; + /** * @Description: 设备信息 * @Author: jeecg-boot @@ -29,4 +31,19 @@ public class ZyDeviceServiceImpl extends ServiceImpl i public String getCode() { return zyDeviceMapper.getCode(); } + + @Override + public List findAllBrand(String s) { + return zyDeviceMapper.findAllBrand(s); + } + + @Override + public List findAllModel(String s) { + return zyDeviceMapper.findAllModel(s); + } + + @Override + public int find(String id) { + return zyDeviceMapper.find(id); + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicebrand/controller/ZyDevicebrandController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicebrand/controller/ZyDevicebrandController.java index e36801f1..8b1b2866 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicebrand/controller/ZyDevicebrandController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicebrand/controller/ZyDevicebrandController.java @@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.zydevice.devicebrand.entity.ZyDevicebrand; import org.jeecg.modules.zydevice.devicebrand.service.IZyDevicebrandService; +import org.jeecg.modules.zydevice.devicemodel.service.IZyDevicemodelService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -51,8 +52,10 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class ZyDevicebrandController extends JeecgController { @Autowired private IZyDevicebrandService zyDevicebrandService; - - /** + @Autowired + private IZyDevicemodelService zyDevicemodelService; + + /** * 分页列表查询 * * @param zyDevicebrand @@ -127,6 +130,12 @@ public class ZyDevicebrandController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("brand_id",id); + int a=zyDevicemodelService.count(queryWrapper); + if(a>=0){ + return Result.error("本型号已被使用,删除失败!!"); + } zyDevicebrandService.removeById(id); return Result.OK("删除成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicemodel/controller/ZyDevicemodelController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicemodel/controller/ZyDevicemodelController.java index a0874536..cb611445 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicemodel/controller/ZyDevicemodelController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicemodel/controller/ZyDevicemodelController.java @@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.device.service.IZyDeviceService; import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel; import org.jeecg.modules.zydevice.devicemodel.service.IZyDevicemodelService; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -59,7 +60,8 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class ZyDevicemodelController extends JeecgController { @Autowired private IZyDevicemodelService zyDevicemodelService; - + @Autowired + private IZyDeviceService zyDeviceService; /** * 分页列表查询 * @@ -162,6 +164,12 @@ public class ZyDevicemodelController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("model_id",id); + int a=zyDeviceService.count(queryWrapper); + if(a>=1){ + return Result.error("设备型号有使用,删除失败!!!"); + } zyDevicemodelService.removeById(id); return Result.OK("删除成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/controller/ZyDevicetypeController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/controller/ZyDevicetypeController.java index 5d39fa65..ea165007 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/controller/ZyDevicetypeController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/controller/ZyDevicetypeController.java @@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.zydevice.devicemodel.service.IZyDevicemodelService; import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype; import org.jeecg.modules.zydevice.devicetype.service.IZyDevicetypeService; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -49,8 +50,10 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class ZyDevicetypeController extends JeecgController { @Autowired private IZyDevicetypeService zyDevicetypeService; - - /** + @Autowired + private IZyDevicemodelService zyDevicemodelService; + + /** * 分页列表查询 * * @param zyDevicetype @@ -83,6 +86,9 @@ public class ZyDevicetypeController extends JeecgController add(@RequestBody ZyDevicetype zyDevicetype) { + if(zyDevicetype.getName().length()>200){ + return Result.error("添加失败,设备类型名称太长!"); + } QueryWrapper queryWrapper=new QueryWrapper(); queryWrapper.eq("name",zyDevicetype.getName()); int a=zyDevicetypeService.count(queryWrapper); @@ -90,7 +96,7 @@ public class ZyDevicetypeController extends JeecgController edit(@RequestBody ZyDevicetype zyDevicetype) { + if(zyDevicetype.getName().length()>200){ + return Result.error("添加失败,设备类型名称太长!"); + } QueryWrapper queryWrapper=new QueryWrapper(); queryWrapper.eq("name",zyDevicetype.getName()); int a=zyDevicetypeService.count(queryWrapper); @@ -125,6 +134,14 @@ public class ZyDevicetypeController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { + ZyDevicetype zyDevicetype = zyDevicetypeService.getById(id); + //判断型号中是否被使用 + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("devicetype_code",zyDevicetype.getCode()); + int a=zyDevicemodelService.count(queryWrapper); + if(a>=1){ + return Result.error("本类型已被使用,请先删除对应型号!!!"); + } zyDevicetypeService.removeById(id); return Result.OK("删除成功!"); } From b8aff2e54ea280041adf10440eb7eb85a144b07b Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Fri, 3 Feb 2023 15:38:27 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=90=8A=E6=8C=82=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E5=90=8A=E6=8C=82=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF=202.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/hanger/ZyHangList.vue | 343 ++++++++++-------- .../src/views/hanger/ZyHangPointList.vue | 183 ++++++++++ .../src/views/hanger/modules/ZyHangForm.vue | 34 +- .../views/hanger/modules/ZyHangPointForm.vue | 118 ++++++ .../views/hanger/modules/ZyHangPointModal.vue | 60 +++ .../ZyHangPointModal__Style#Drawer.vue | 84 +++++ .../views/productplan/ZyProductPlanList.vue | 1 - .../hanger/controller/ZyHangController.java | 50 ++- .../controller/ZyHangPointController.java | 156 ++++++++ .../jeecg/modules/hanger/entity/ZyHang.java | 19 +- .../modules/hanger/entity/ZyHangPoint.java | 81 +++++ .../hanger/mapper/ZyHangPointMapper.java | 15 + .../hanger/service/IZyHangPointService.java | 15 + .../service/impl/ZyHangPointServiceImpl.java | 19 + 14 files changed, 1006 insertions(+), 172 deletions(-) create mode 100644 ant-design-vue-jeecg/src/views/hanger/ZyHangPointList.vue create mode 100644 ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointForm.vue create mode 100644 ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal.vue create mode 100644 ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal__Style#Drawer.vue create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangPointController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHangPoint.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangPointMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangPointServiceImpl.java diff --git a/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue index 49b489ba..228f5493 100644 --- a/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue +++ b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue @@ -4,6 +4,38 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + 重置 + +
@@ -13,23 +45,30 @@
新增 导出 - - + + - + - 删除 + + + 删除 + - 批量操作 + 批量操作 + +
@@ -52,8 +91,16 @@ + + + - 编辑 + - - - 更多 - - - 详情 - - - 二维码 - - - - 删除 - - - - + 详情 + + + 删除 + + + + + + + + + + + + + + + + + + -
@@ -99,106 +113,132 @@ \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/maker/modules/ZyMakerFormDetail.vue b/ant-design-vue-jeecg/src/views/maker/modules/ZyMakerFormDetail.vue index 3a716b67..7e9d1b41 100644 --- a/ant-design-vue-jeecg/src/views/maker/modules/ZyMakerFormDetail.vue +++ b/ant-design-vue-jeecg/src/views/maker/modules/ZyMakerFormDetail.vue @@ -11,17 +11,17 @@ > - - - {{model.code}} - - - {{model.workerCode}} - - - {{model.modelName}} - - + + + {{model.code}} + + + {{model.workerCode}} + + + {{model.modelName}} + + @@ -29,44 +29,43 @@ \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java index b9c45c65..1f798db9 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java @@ -237,6 +237,7 @@ public class ZyClothsTypeController extends JeecgController { - @Autowired - private IZyMakerService zyMakerService; - - /** - * 分页列表查询 - * - * @param zyMaker - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "制单管理-分页列表查询") - @ApiOperation(value="制单管理-分页列表查询", notes="制单管理-分页列表查询") - @GetMapping(value = "/list") - public Result queryPageList(ZyMaker zyMaker, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyMaker, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = zyMakerService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param zyMaker - * @return - */ - @AutoLog(value = "制单管理-添加") - @ApiOperation(value="制单管理-添加", notes="制单管理-添加") - @PostMapping(value = "/add") - public Result add(@RequestBody ZyMaker zyMaker) { - zyMakerService.save(zyMaker); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param zyMaker - * @return - */ - @AutoLog(value = "制单管理-编辑") - @ApiOperation(value="制单管理-编辑", notes="制单管理-编辑") - @PutMapping(value = "/edit") - public Result edit(@RequestBody ZyMaker zyMaker) { - zyMakerService.updateById(zyMaker); - 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) { - zyMakerService.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.zyMakerService.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) { - ZyMaker zyMaker = zyMakerService.getById(id); - if(zyMaker==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(zyMaker); - } + @Autowired + private IZyMakerService zyMakerService; + + /** + * 分页列表查询 + * + * @param zyMaker + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "制单管理-分页列表查询") + @ApiOperation(value = "制单管理-分页列表查询", notes = "制单管理-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyMaker zyMaker, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyMaker, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyMakerService.page(page, queryWrapper); + List zyMakerList = zyMakerService.ZyMakerVo(pageList.getRecords()); + pageList.setRecords(zyMakerList); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zyMaker + * @return + */ + @AutoLog(value = "制单管理-添加") + @ApiOperation(value = "制单管理-添加", notes = "制单管理-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyMaker zyMaker) { + zyMakerService.save(zyMaker); + return Result.OK("添加成功!"); + } + + /** + * 制单 + */ + @AutoLog(value = "制单管理-制单") + @ApiOperation(value = "制单管理-制单", notes = "制单管理-制单") + @PostMapping(value = "/listMakerAdd") + public Result listMakerAdd() { + //点击制单 点击后按产品模块分解成制单写入制单表 + zyMakerService.listMakerAdd(); + //zyMakerService.save(zyMaker); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyMaker + * @return + */ + @AutoLog(value = "制单管理-编辑") + @ApiOperation(value = "制单管理-编辑", notes = "制单管理-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyMaker zyMaker) { + zyMakerService.updateById(zyMaker); + 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) { + zyMakerService.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.zyMakerService.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) { + ZyMaker zyMaker = zyMakerService.getById(id); + if (zyMaker == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyMaker); + } /** - * 导出excel - * - * @param request - * @param zyMaker - */ + * 导出excel + * + * @param request + * @param zyMaker + */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ZyMaker zyMaker) { return super.exportXls(request, zyMaker, ZyMaker.class, "制单管理"); } /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, ZyMaker.class); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/entity/ZyMaker.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/entity/ZyMaker.java index e6156187..dbf594e7 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/entity/ZyMaker.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/entity/ZyMaker.java @@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -66,6 +67,12 @@ public class ZyMaker implements Serializable { @Excel(name = "工单编号", width = 15) @ApiModelProperty(value = "工单编号") private String workerCode; + /**产品编号*/ + @TableField(exist = false) + private String productCode; + /**产品名称*/ + @TableField(exist = false) + private String productName; /**模块id*/ @Excel(name = "模块id", width = 15) @ApiModelProperty(value = "模块id") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/mapper/ZyMakerMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/mapper/ZyMakerMapper.java index 01d0e773..1582e764 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/mapper/ZyMakerMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/mapper/ZyMakerMapper.java @@ -3,8 +3,10 @@ package org.jeecg.modules.maker.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.jeecg.modules.maker.entity.ZyMaker; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.workproduct.entity.ZyProduct; /** * @Description: 制单管理 @@ -14,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface ZyMakerMapper extends BaseMapper { + + @Select("select * from zy_product where work_order_id=#{workerCode}") + ZyProduct getProduct(String workerCode); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/IZyMakerService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/IZyMakerService.java index b4d3a93d..36c4c9fd 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/IZyMakerService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/IZyMakerService.java @@ -3,6 +3,8 @@ package org.jeecg.modules.maker.service; import org.jeecg.modules.maker.entity.ZyMaker; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 制单管理 * @Author: jeecg-boot @@ -11,4 +13,8 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IZyMakerService extends IService { + //点击制单 点击后按产品模块分解成制单写入制单表 + void listMakerAdd(); + + List ZyMakerVo(List records); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/impl/ZyMakerServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/impl/ZyMakerServiceImpl.java index 7fd243b7..38479627 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/impl/ZyMakerServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/impl/ZyMakerServiceImpl.java @@ -1,19 +1,109 @@ package org.jeecg.modules.maker.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.maker.entity.ZyMaker; import org.jeecg.modules.maker.mapper.ZyMakerMapper; import org.jeecg.modules.maker.service.IZyMakerService; +import org.jeecg.modules.workorder.entity.WorkOrder; +import org.jeecg.modules.workorder.service.IWorkOrderService; +import org.jeecg.modules.workproduct.entity.ZyProduct; +import org.jeecg.modules.workproduct.service.IZyProductService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; +import java.util.stream.Collectors; /** * @Description: 制单管理 * @Author: jeecg-boot - * @Date: 2021-11-27 + * @Date: 2021-11-27 * @Version: V1.0 */ @Service public class ZyMakerServiceImpl extends ServiceImpl implements IZyMakerService { + @Autowired + private IWorkOrderService workOrderService; + @Autowired + private IZyProductService productService; + + @Resource + private ZyMakerMapper zyMakerMapper; + + ////点击制单 点击后按产品模块分解成制单写入制单表 + @Override + public void listMakerAdd() { + //先拿到所有产品 产品暂定为服装款式里面的数据 + List workOrderList = workOrderService.list(); + for (WorkOrder workOrder : workOrderList) { + ZyMaker maker = new ZyMaker(); + //制单编号 工单编号(22)+顺序号(2) + maker.setCode(getMakerCode(workOrder.getProductCode())); + //工单编号 + maker.setWorkerCode(workOrder.getProductCode()); + this.save(maker); + } + + } + + @Override + public List ZyMakerVo(List records) { + if (ObjectUtils.isEmpty(records)) { + return null; + } + //根据工单编号找到产品编号 产品名称 + for (ZyMaker maker : records) { + ZyProduct zyProductMapper = zyMakerMapper.getProduct(maker.getWorkerCode()); +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); +// queryWrapper.eq(ZyProduct::getWorkOrderId, maker.getWorkerCode()); +// ZyProduct zyProduct = productService.getOne(queryWrapper); + //产品编号 + if (!ObjectUtils.isEmpty(zyProductMapper)){ + if (StringUtils.hasText(zyProductMapper.getProductCode())) { + maker.setProductCode(zyProductMapper.getProductCode()); + } + if (StringUtils.hasText(zyProductMapper.getProductName())) { + maker.setProductName(zyProductMapper.getProductName()); + } + } + + //产品名称 + + } + return records; + } + + private String getMakerCode(String productCode) { + if (StringUtils.isEmpty(productCode)) { + return "null"; + } + List zyMakerList = this.list(); + List collect = zyMakerList.stream().map(ZyMaker::getCode).collect(Collectors.toList()); + List longList = new ArrayList<>(); + for (String makerCode : collect) { + String newNums = makerCode.trim(); + if (StringUtils.isEmpty(newNums)) continue; + if (newNums.length() <= 2) longList.add(Long.valueOf(newNums)); + else { + //拿到后6位 substring(4) 截掉前4位 + String substring = newNums.substring(newNums.length() - 2); + longList.add(Long.valueOf(substring)); + } + } + long max = Collections.max(longList) + 1; + if (Long.toString(max).length() > 2) { + String toString = Long.toString(max); + return toString.substring(toString.length() - 2); + } + return String.format("%02d", max); + } }