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/mixins/JeecgListMixin.js b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js index 79a3249f..6dee898a 100644 --- a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js +++ b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js @@ -322,7 +322,7 @@ export const JeecgListMixin = { zyStyleFabricHandleAdd: function (id) { this.$refs.modalForm.add(id); this.$refs.modalForm.title = "新增"; - console.log("js层id的传递"+id); + //console.log("js层id的传递"+id); this.$refs.modalForm.disableSubmit = false; }, styleModuleHandleAdd: function (id,typeId,styleNames) { diff --git a/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue b/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue index 30dc49a3..2cfedd50 100644 --- a/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue +++ b/ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue @@ -95,6 +95,10 @@ + 确定出库 + + 撤销出库 + 编辑 @@ -115,7 +119,7 @@ - + @@ -126,13 +130,16 @@ 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' + import { getAction } from '../../api/manage' export default { name: 'DeliveryList', mixins:[JeecgListMixin, mixinDevice], components: { - DeliveryModal + DeliveryModal, + DeliveryModal1 }, data () { return { @@ -197,6 +204,11 @@ align:"center", dataIndex: 'adminId_dictText' }, + { + title:'出库状态', + align:"center", + dataIndex: 'status_dictText' + }, { title: '操作', dataIndex: 'action', @@ -207,6 +219,7 @@ } ], url: { + cxck: "/delivery/delivery/cxck", list: "/delivery/delivery/list", delete: "/delivery/delivery/delete", deleteBatch: "/delivery/delivery/deleteBatch", @@ -227,6 +240,20 @@ }, }, 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 = "确定出库"; + this.$refs.modalFormqdck.disableSubmit = false; + }, initDictConfig(){ }, getSuperFieldList(){ 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 new file mode 100644 index 00000000..f2011fdc --- /dev/null +++ b/ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue @@ -0,0 +1,139 @@ + + + \ 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/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/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/ZyHangList.vue b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue new file mode 100644 index 00000000..228f5493 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue @@ -0,0 +1,285 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/ZyHangPointList.vue b/ant-design-vue-jeecg/src/views/hanger/ZyHangPointList.vue new file mode 100644 index 00000000..ce4cb2f1 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/ZyHangPointList.vue @@ -0,0 +1,183 @@ + + + + \ No newline at end of file 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}, 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..f8e1ad1d --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue @@ -0,0 +1,225 @@ + + + \ 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/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointForm.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointForm.vue new file mode 100644 index 00000000..f31173ae --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointForm.vue @@ -0,0 +1,118 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal.vue new file mode 100644 index 00000000..884b144e --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal__Style#Drawer.vue new file mode 100644 index 00000000..30a01652 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/maker/ZyMakerList.vue b/ant-design-vue-jeecg/src/views/maker/ZyMakerList.vue index 5902a2f8..69932155 100644 --- a/ant-design-vue-jeecg/src/views/maker/ZyMakerList.vue +++ b/ant-design-vue-jeecg/src/views/maker/ZyMakerList.vue @@ -11,25 +11,34 @@
- 新增 + + 制单 导出 - + 导入 - + - 删除 + + + 删除 + - 批量操作 + 批量操作 + +
@@ -52,7 +61,8 @@ - 编辑 + - - - 更多 - - - 详情 - - - 二维码 - - - - 删除 - - - - + 详情 + + + 删除 + + + + + + + + + + + + + + + + + + -
@@ -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/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue index 14e63ec8..2429657f 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue @@ -313,7 +313,6 @@ export default { getPaiWeiTu(record) { // alert(JSON.stringify(record)); - alert("请稍等,正在开发中。。。") getAction(this.url.paiweitu, record).then((res) => { if (res.success) { console.log("the paiweitu----------" + JSON.stringify(res.result)) 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-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 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; } 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); 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/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..c86750ca --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java @@ -0,0 +1,214 @@ +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 com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.QRCodeWriter; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +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.exception.JeecgBootException; +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.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.*; + +/** + * @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); + if (!ObjectUtils.isEmpty(pageList)) { + Map hints = new HashMap(); + //设置UTF-8, 防止中文乱码 + hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); + //设置二维码四周白色区域的大小 + hints.put(EncodeHintType.MARGIN, 1); + //设置二维码的容错性 + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); + //width:图片完整的宽;height:图片完整的高 + //因为要在二维码下方附上文字,所以把图片设置为长方形(高大于宽) + int width = 150; + int height = 150; + //画二维码,记得调用multiFormatWriter.encode()时最后要带上hints参数,不然上面设置无效 + QRCodeWriter qrCodeWriter = new QRCodeWriter(); +// List img = new ArrayList<>(); + String content = ""; + //批量生成二维码 + try { + for (int i = 0; i < pageList.getRecords().size(); i++) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + content = pageList.getRecords().get(i).getCode(); + BitMatrix bitMatrix = qrCodeWriter.encode(content, BarcodeFormat.QR_CODE, width, height, hints); + MatrixToImageWriter.writeToStream(bitMatrix, "PNG", outputStream); + Base64.Encoder encoder = Base64.getEncoder(); + String text = encoder.encodeToString(outputStream.toByteArray()); + pageList.getRecords().get(i).setQrcode("data:image/png;base64," + text); + } + } catch (Exception e) { + log.error("获取吊挂信息-异常-{},{}", e, e.getMessage()); + Result.error("获取数据失败"); + } + } + 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) { + zyHang.setQrcode(""); + 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/controller/ZyHangPointController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangPointController.java new file mode 100644 index 00000000..44a2db0c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangPointController.java @@ -0,0 +1,156 @@ +package org.jeecg.modules.hanger.controller; + + +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.ZyHangPoint; +import org.jeecg.modules.hanger.service.IZyHangPointService; +import org.springframework.beans.factory.annotation.Autowired; +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; + +/** + * @Description: 吊挂工位表 + * @Author: jeecg-boot + * @Date: 2023-02-03 + * @Version: V1.0 + */ +@Api(tags = "吊挂工位表") +@RestController +@RequestMapping("/org.jeecg.modules.hanger/zyHangPoint") +@Slf4j +public class ZyHangPointController extends JeecgController { + @Autowired + private IZyHangPointService zyHangPointService; + + /** + * 分页列表查询 + * + * @param zyHangPoint + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "吊挂工位表-分页列表查询") + @ApiOperation(value = "吊挂工位表-分页列表查询", notes = "吊挂工位表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyHangPoint zyHangPoint, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyHangPoint, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyHangPointService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zyHangPoint + * @return + */ + @AutoLog(value = "吊挂工位表-添加") + @ApiOperation(value = "吊挂工位表-添加", notes = "吊挂工位表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyHangPoint zyHangPoint) { + zyHangPointService.save(zyHangPoint); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyHangPoint + * @return + */ + @AutoLog(value = "吊挂工位表-编辑") + @ApiOperation(value = "吊挂工位表-编辑", notes = "吊挂工位表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyHangPoint zyHangPoint) { + zyHangPointService.updateById(zyHangPoint); + 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) { + zyHangPointService.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.zyHangPointService.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) { + ZyHangPoint zyHangPoint = zyHangPointService.getById(id); + if (zyHangPoint == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyHangPoint); + } + + /** + * 导出excel + * + * @param request + * @param zyHangPoint + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ZyHangPoint zyHangPoint) { + return super.exportXls(request, zyHangPoint, ZyHangPoint.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, ZyHangPoint.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..ce45211c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java @@ -0,0 +1,156 @@ +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, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "购买时间") + private Date buydate; + /** + * 经办人 + */ + @Excel(name = "经办人", width = 15) + @ApiModelProperty(value = "经办人") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + private String agent; + /** + * 状态 + */ + @Excel(name = "状态", width = 15) + @ApiModelProperty(value = "状态") + @Dict(dicCode = "devicestatus1") + 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 = "管理人") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + private String administrator; + /** + * 上次维护时间 + */ + @Excel(name = "上次维护时间", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "上次维护时间") + private Date 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/entity/ZyHangPoint.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHangPoint.java new file mode 100644 index 00000000..eb0d0f24 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHangPoint.java @@ -0,0 +1,81 @@ +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.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-03 + * @Version: V1.0 + */ +@Data +@TableName("zy_hang_point") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "zy_hang_point对象", description = "吊挂工位表") +public class ZyHangPoint 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 = "吊挂编号") + private String code; + /** + * 工站编号 + */ + @Excel(name = "工站编号", width = 15) + @ApiModelProperty(value = "工站编号") + private String point; + /** + * 工位id + */ + @Excel(name = "工位id", width = 15) + @ApiModelProperty(value = "工位id") + private String stationId; +} 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/mapper/ZyHangPointMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangPointMapper.java new file mode 100644 index 00000000..045a7fc2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangPointMapper.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.hanger.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.hanger.entity.ZyHangPoint; + +/** + * @Description: 吊挂工位表 + * @Author: jeecg-boot + * @Date: 2023-02-03 + * @Version: V1.0 + */ +public interface ZyHangPointMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java new file mode 100644 index 00000000..054f8193 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.hanger.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.hanger.entity.ZyHangPoint; + +/** + * @Description: 吊挂工位表 + * @Author: jeecg-boot + * @Date: 2023-02-03 + * @Version: V1.0 + */ +public interface IZyHangPointService extends IService { + +} 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/ZyHangPointServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangPointServiceImpl.java new file mode 100644 index 00000000..e6e580a3 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangPointServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.hanger.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.hanger.entity.ZyHangPoint; +import org.jeecg.modules.hanger.mapper.ZyHangPointMapper; +import org.jeecg.modules.hanger.service.IZyHangPointService; +import org.springframework.stereotype.Service; + +/** + * @Description: 吊挂工位表 + * @Author: jeecg-boot + * @Date: 2023-02-03 + * @Version: V1.0 + */ +@Service +public class ZyHangPointServiceImpl extends ServiceImpl implements IZyHangPointService { + +} 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 { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/controller/ZyMakerController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/controller/ZyMakerController.java index 40f59984..d65a8253 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/controller/ZyMakerController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/controller/ZyMakerController.java @@ -9,6 +9,7 @@ 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; @@ -36,133 +37,148 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; - /** +/** * @Description: 制单管理 * @Author: jeecg-boot - * @Date: 2021-11-27 + * @Date: 2021-11-27 * @Version: V1.0 */ -@Api(tags="制单管理") +@Api(tags = "制单管理") @RestController @RequestMapping("/maker/zyMaker") @Slf4j public class ZyMakerController 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); + } } 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("删除成功!"); }