From 571f4061f74c52ad905c83c9ba0496c22684b7ea Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 12 May 2023 18:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/modules/ZyOperationtoolList.vue | 14 +++++------ .../process/modules/ZyOperationtoolModal.vue | 12 ++++++++- .../process/modules/ZyProcessMachineModal.vue | 1 - .../views/process/modules/list/ZyToolList.vue | 12 +++++++-- .../controller/ZyOperationtoolController.java | 21 ++++++++-------- .../operationtool/entity/ZyOperationtool.java | 6 +++-- .../zytool/controller/ZyToolController.java | 25 +++++++++++-------- 7 files changed, 58 insertions(+), 33 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolList.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolList.vue index 0c44cdcf..c3cebf0f 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolList.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolList.vue @@ -5,8 +5,8 @@ - - + + @@ -136,7 +136,7 @@ { title:'工序编号', align:"center", - dataIndex: 'processCode' + dataIndex: 'processCode_dictText' }, { title:'工序', @@ -144,14 +144,14 @@ dataIndex: 'operationid_dictText' }, { - title:'工具编号', + title:'工具类型编号', align:"center", dataIndex: 'code' }, { - title:'工具', + title:'工具类型名称', align:"center", - dataIndex: 'toolid_dictText' + dataIndex: 'codeName' }, { title: '操作', @@ -186,8 +186,8 @@ edit (record) { this.id = record; this.queryParam.operationid=this.id; - this.loadData(); this.visible = true; + this.loadData(); }, initDictConfig(){ }, diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolModal.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolModal.vue index 18f78fd5..0ba6ae91 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolModal.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolModal.vue @@ -9,7 +9,7 @@ @cancel="handleCancel" cancelText="关闭"> - + @@ -32,6 +32,9 @@ model:{ operationid:'', toolid:'', + processCode:'', + code:'', + codeName:'' }, url:{ add:"/operationtool/zyOperationtool/add" @@ -50,6 +53,7 @@ this.$nextTick(()=>{ // this.$refs.realForm.add1(id); this.model.operationid=id; + this.model.processCode=id; }) }, edit (record) { @@ -71,6 +75,12 @@ chuancan(res){ this.model.toolid=res; }, + changecode(res){ + this.model.code=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/ZyProcessMachineModal.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue index ad1c3c14..6ec6ebf7 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue @@ -67,7 +67,6 @@ }, changecode(res){ this.model.code=res; - console.log(res) }, changecodename(res){ this.model.codeName=res; diff --git a/ant-design-vue-jeecg/src/views/process/modules/list/ZyToolList.vue b/ant-design-vue-jeecg/src/views/process/modules/list/ZyToolList.vue index 6fb21cb1..0ed3b3e4 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/list/ZyToolList.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/list/ZyToolList.vue @@ -101,7 +101,7 @@ ], url: { - list: "/zytool/zyTool/list", + list: "/zytool/zyTool/list1", delete: "/tool/zyTool/delete", deleteBatch: "/tool/zyTool/deleteBatch", exportXlsUrl: "/tool/zyTool/exportXls", @@ -128,7 +128,15 @@ 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-system/src/main/java/org/jeecg/modules/operationtool/controller/ZyOperationtoolController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/operationtool/controller/ZyOperationtoolController.java index ab62d81b..9a18c7f9 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/operationtool/controller/ZyOperationtoolController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/operationtool/controller/ZyOperationtoolController.java @@ -9,6 +9,8 @@ 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.demo.pro.entity.ZyProcessMachine; import org.jeecg.modules.operationtool.entity.ZyOperationtool; import org.jeecg.modules.operationtool.service.IZyOperationtoolService; import org.springframework.beans.factory.annotation.Autowired; @@ -64,18 +66,13 @@ public class ZyOperationtoolController extends JeecgController queryPageList1(ZyOperationtool zyOperationtool, + public Result queryPageList1(ZyOperationtool zyOperationtool,@RequestParam(name="operationid",required=true) String operationid, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { - //QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyOperationtool, req.getParameterMap()); - String s=zyOperationtool.getOperationid(),t=null; - - if(zyOperationtool.getToolid()!=null){ - t="%"+zyOperationtool.getToolid()+"%"; - } + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyOperationtool, req.getParameterMap()); Page page = new Page(pageNo, pageSize); - IPage pageList = zyOperationtoolService.page1(page, s,t); + IPage pageList = zyOperationtoolService.page(page, queryWrapper); return Result.OK(pageList); } /** @@ -89,8 +86,12 @@ public class ZyOperationtoolController extends JeecgController add(@RequestBody ZyOperationtool zyOperationtool) { String[] split = zyOperationtool.getToolid().split(","); - for (String k : split) { - zyOperationtool.setToolid(k); + String[] splitc = zyOperationtool.getCode().split(","); + String[] splitcn = zyOperationtool.getCodeName().split(","); + for (int i = 0 ; i < splitc.length; i++) { + zyOperationtool.setToolid(split[i]); + zyOperationtool.setCode(splitc[i]); + zyOperationtool.setCodeName(splitcn[i]); QueryWrapper s=new QueryWrapper(); s.eq("operationid",zyOperationtool.getOperationid()); s.eq("toolid",zyOperationtool.getToolid()); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/operationtool/entity/ZyOperationtool.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/operationtool/entity/ZyOperationtool.java index adebaf2e..a1a5546f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/operationtool/entity/ZyOperationtool.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/operationtool/entity/ZyOperationtool.java @@ -74,9 +74,11 @@ public class ZyOperationtool implements Serializable { @Dict(dictTable = "zy_tool", dicText = "name", dicCode = "id") @ApiModelProperty(value = "工具") private String toolid; - @TableField (exist = false) + + @Dict(dictTable = "zy_process", dicText = "process_code", dicCode = "id") + @ApiModelProperty(value = "工序编号") private String processCode; - @TableField(exist = false) private String code; + private String codeName; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/controller/ZyToolController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/controller/ZyToolController.java index d682f937..b5843b90 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/controller/ZyToolController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zytool/zytool/controller/ZyToolController.java @@ -30,6 +30,8 @@ import org.jeecg.modules.device.entity.ZyDevice; import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel; import org.jeecg.modules.zytool.toolmodel.entity.ZyToolModel; +import org.jeecg.modules.zytool.tooltype.entity.ZyToolType; +import org.jeecg.modules.zytool.tooltype.service.IZyToolTypeService; import org.jeecg.modules.zytool.zytool.entity.ZyTool; import org.jeecg.modules.zytool.zytool.service.IZyToolService; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -61,7 +63,9 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class ZyToolController extends JeecgController { @Autowired private IZyToolService zyToolService; - + @Autowired + private IZyToolTypeService zyToolTypeService; + /** * 分页列表查询 * @@ -133,16 +137,17 @@ public class ZyToolController extends JeecgController { @AutoLog(value = "设备信息-分页列表查询") @ApiOperation(value="设备信息-分页列表查询", notes="设备信息-分页列表查询") @GetMapping(value = "/list1") - public Result queryPageList1(ZyTool zyTool, + public Result queryPageList1(ZyToolType zyToolType, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) throws WriterException, IOException { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyTool, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = zyToolService.page(page, queryWrapper); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyToolType, req.getParameterMap()); + queryWrapper.orderByDesc("code"); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyToolTypeService.page(page, queryWrapper); return Result.OK(pageList); } - + /** * 添加 * @@ -180,7 +185,7 @@ public class ZyToolController extends JeecgController { return Result.error("添加失败,设备名称重复!!!"); } } - + /** * 编辑 * @@ -201,7 +206,7 @@ public class ZyToolController extends JeecgController { return Result.error("编辑失败,设备名称重复!!!"); } } - + /** * 通过id删除 * @@ -219,7 +224,7 @@ public class ZyToolController extends JeecgController { zyToolService.removeById(id); return Result.OK("删除成功!"); } - + /** * 批量删除 * @@ -233,7 +238,7 @@ public class ZyToolController extends JeecgController { this.zyToolService.removeByIds(Arrays.asList(ids.split(","))); return Result.OK("批量删除成功!"); } - + /** * 通过id查询 *