diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineList.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineList.vue index 38c212bb..f0ff6068 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineList.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineList.vue @@ -10,8 +10,8 @@ - - + + @@ -21,6 +21,7 @@ + @@ -140,7 +141,7 @@ { title:'工序编号', align:"center", - dataIndex: 'processCode' + dataIndex: 'processCode_dictText' }, { title:'工序', @@ -148,14 +149,14 @@ dataIndex: 'processId_dictText' }, { - title:'设备编号', + title:'设备类型编号', align:"center", dataIndex: 'code' }, { - title:'设备名称', + title:'设备类型名称', align:"center", - dataIndex: 'machineId_dictText' + dataIndex: 'codeName' }, { title: '操作', @@ -193,9 +194,9 @@ edit (record) { this.id = record; this.queryParam.processId=this.id; - this.loadData(); + // this.loadData(); this.visible = true; - + this.loadData(); }, initDictConfig(){ }, diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue index 8afacee1..ad1c3c14 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue @@ -8,7 +8,7 @@ :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @cancel="handleCancel" cancelText="关闭"> - + @@ -29,7 +29,10 @@ disableSubmit: false, model:{ machineId:'', - processId:'' + processId:'', + code:'', + processCode:"", + codeName:"" }, url:{ add: "/pro/zyProcessMachine/add", @@ -46,6 +49,7 @@ add1 (id) { this.visible=true this.model.processId=id; + this.model.processCode=id; }, edit (record) { this.visible=true @@ -61,6 +65,13 @@ this.model.machineId=res; console.log(res) }, + changecode(res){ + this.model.code=res; + console.log(res) + }, + changecodename(res){ + this.model.codeName=res; + }, handleOk () { postAction(this.url.add,this.model).then((res)=>{ if(res.success){ diff --git a/ant-design-vue-jeecg/src/views/process/modules/list/ZyMachine.vue b/ant-design-vue-jeecg/src/views/process/modules/list/ZyMachine.vue index 0dedd3d0..dcf241f0 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/list/ZyMachine.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/list/ZyMachine.vue @@ -127,11 +127,11 @@ dataIndex: 'code' }, { - title:'设备名称', + title:'名称', align:"center", dataIndex: 'name' }, - + // { // title: '操作', // dataIndex: 'action', @@ -166,7 +166,16 @@ for (var a = 0; a < this.selectedRowKeys.length; a++) { ids += this.selectedRowKeys[a] + ","; } - this.$emit('onChangeRowKey',ids) + let codes = ""; + let codenames = ""; + for (var a = 0; a < this.selectionRows.length; a++) { + codes += this.selectionRows[a].code + ","; + codenames += this.selectionRows[a].name + ","; + } + + this.$emit('onChangeRowKey',ids); + this.$emit('onChangeCode',codes); + this.$emit('onChangeCodeName',codenames); }, add (code) { }, diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessMachineController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessMachineController.java index 2afaaf83..3755bd32 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessMachineController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessMachineController.java @@ -81,18 +81,13 @@ public class ZyProcessMachineController extends JeecgController queryPageList1(ZyProcessMachine zyProcessMachine, + public Result queryPageList1(ZyProcessMachine zyProcessMachine,@RequestParam(name="processId",required=true) String processId, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { - //QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProcessMachine, req.getParameterMap()); - String s=zyProcessMachine.getProcessId(),t=null; - - if(zyProcessMachine.getMachineId()!=null){ - t="%"+zyProcessMachine.getMachineId()+"%"; - } + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProcessMachine, req.getParameterMap()); Page page = new Page(pageNo, pageSize); - IPage pageList = zyProcessMachineService.page1(page, s,t); + IPage pageList = zyProcessMachineService.page(page, queryWrapper); return Result.OK(pageList); } /** @@ -106,8 +101,12 @@ public class ZyProcessMachineController extends JeecgController add(@RequestBody ZyProcessMachine zyProcessMachine) { String[] split = zyProcessMachine.getMachineId().split(","); - for (String k : split) { - zyProcessMachine.setMachineId(k); + String[] splitc = zyProcessMachine.getCode().split(","); + String[] splitcn = zyProcessMachine.getCodeName().split(","); + for (int i = 0 ; i < splitc.length; i++) { + zyProcessMachine.setMachineId(split[i]); + zyProcessMachine.setCode(splitc[i]); + zyProcessMachine.setCodeName(splitcn[i]); QueryWrapper s=new QueryWrapper(); s.eq("process_id",zyProcessMachine.getProcessId()); s.eq("machine_id",zyProcessMachine.getMachineId()); diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java index ca24dec1..0d10d1f6 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java @@ -49,6 +49,9 @@ public class ZyProcessMachine implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "创建时间") private Date createTime; + @Dict(dictTable = "zy_process", dicText = "process_code", dicCode = "id") + @ApiModelProperty(value = "工序编号") private String processCode; private String code; + private String codeName; } 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 55125280..6eba724e 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 @@ -29,6 +29,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel; +import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype; +import org.jeecg.modules.zydevice.devicetype.service.IZyDevicetypeService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -58,6 +60,8 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class ZyDeviceController extends JeecgController { @Autowired private IZyDeviceService zyDeviceService; + @Autowired + private IZyDevicetypeService zyDevicetypeService; /** * 分页列表查询 @@ -131,13 +135,14 @@ public class ZyDeviceController extends JeecgController queryPageList1(ZyDevice zyDevice, + public Result queryPageList1(ZyDevicetype zyDevicetype, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) throws WriterException, IOException { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyDevice, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = zyDeviceService.page(page, queryWrapper); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyDevicetype, req.getParameterMap()); + queryWrapper.orderByDesc("code"); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyDevicetypeService.page(page, queryWrapper); return Result.OK(pageList); }