From 7b25cd66b89040833e36ff8c79902335fa6cae52 Mon Sep 17 00:00:00 2001 From: lenovo <123> Date: Fri, 2 Dec 2022 13:49:02 +0800 Subject: [PATCH] =?UTF-8?q?2022-12-2=E5=9F=BA=E6=9C=AC=E5=B7=A5=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mixins/JeecgListMixin.js | 9 ++++ .../src/views/process/ZyProcessList.vue | 32 +++++++------ .../views/process/modules/ZyProcessForm.vue | 45 ++++++++++++++++--- .../base/controller/ZyProcessController.java | 22 ++++++++- .../modules/demo/base/entity/ZyProcess.java | 6 +-- .../demo/base/mapper/ZyProcessMapper.java | 4 ++ .../demo/base/service/IZyProcessService.java | 2 + .../service/impl/ZyProcessServiceImpl.java | 9 ++++ 8 files changed, 105 insertions(+), 24 deletions(-) diff --git a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js index 68759ee3..2b3b041c 100644 --- a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js +++ b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js @@ -233,6 +233,15 @@ export const JeecgListMixin = { }, fuzhi: function (record) { record.id=""; + var s=record.processCode.substring(10,record.processCode.length) + + record.processCode=(parseInt(s,10)+1).toString() + while(record.processCode.length<6){ + record.processCode="0"+record.processCode + } + record.processCode=record.styleId+record.processCode + // console.log(record.process_code) + this.$refs.modalForm.edit(record); this.$refs.modalForm.title = "复制"; this.$refs.modalForm.disableSubmit = false; diff --git a/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue b/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue index c8833255..89c2d4e7 100644 --- a/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue +++ b/ant-design-vue-jeecg/src/views/process/ZyProcessList.vue @@ -5,9 +5,9 @@ - - + + @@ -187,16 +187,26 @@ export default { align: "center", dataIndex: 'processName' }, + { + title: '企业', + align: "center", + dataIndex: 'enterpriseId_dictText' + }, + { + title: '服装类型', + align: "center", + dataIndex: 'styleId_dictText' + }, // { // title:'工艺描述', // align:"center", // dataIndex: 'processDescribe' // }, - { - title: '品质要求', - align: "center", - dataIndex: 'qualityRequire' - }, + // { + // title: '品质要求', + // align: "center", + // dataIndex: 'qualityRequire' + // }, { title: '工序时间', align: "center", @@ -267,11 +277,7 @@ export default { align: "center", dataIndex: 'totalMachine' }, - // { - // title: '企业名称', - // align: "center", - // dataIndex: 'enterpriseId_dictText' - // }, + { title: '创建时间', diff --git a/ant-design-vue-jeecg/src/views/process/modules/ZyProcessForm.vue b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessForm.vue index 33e9aa54..2af440c6 100644 --- a/ant-design-vue-jeecg/src/views/process/modules/ZyProcessForm.vue +++ b/ant-design-vue-jeecg/src/views/process/modules/ZyProcessForm.vue @@ -3,9 +3,28 @@ + + + + + + + + + + - + @@ -118,11 +137,7 @@ - - - - - + @@ -210,6 +225,7 @@ data () { return { model:{ + processCode:'', processType:0, }, labelCol: { @@ -237,7 +253,8 @@ url: { add: "/base/zyProcess/add", edit: "/base/zyProcess/edit", - queryById: "/base/zyProcess/queryById" + queryById: "/base/zyProcess/queryById", + sort:"/base/zyProcess/sort" } } }, @@ -291,6 +308,20 @@ }) console.log(this.model) }, + popupCallback(value,row){ + var n=6; + this.model = Object.assign(this.model, row); + getAction(this.url.sort,{id:this.model.styleId}).then((res)=>{ + // console.log(res.result) + var num=parseInt(res.result,10)+1 + num=num.toString() + while(num.length \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java index 2e1840b6..30be0019 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java @@ -89,6 +89,12 @@ public class ZyProcessController extends JeecgController add(@RequestBody ZyProcess zyProcess) { + zyProcess.setCreateTime(null); + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("process_name",zyProcess.getProcessName()); + int a=zyProcessService.count(queryWrapper); + if(a!=0) + return Result.error("添加失败,该工序名称已存在!!!"); zyProcessService.save(zyProcess); return Result.OK("添加成功!"); } @@ -103,6 +109,11 @@ public class ZyProcessController extends JeecgController edit(@RequestBody ZyProcess zyProcess) { + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("process_name",zyProcess.getProcessName()); + int a=zyProcessService.count(queryWrapper); + if(a!=0) + return Result.error("编辑失败,该工序名称已存在!!!"); zyProcessService.updateById(zyProcess); return Result.OK("编辑成功!"); } @@ -187,6 +198,15 @@ public class ZyProcessController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, ZyProcess.class); } - + @AutoLog(value = "zy_process-顺序查询") + @ApiOperation(value="zy_process-顺序查询", notes="zy_process-顺序查询") + @GetMapping(value = "/sort") + public Result sort(@RequestParam(name="id",required=true) String id) { + String sort=zyProcessService.sort(id); + if(sort==null){ + return Result.ok(0); + } + return Result.OK(sort.substring(10,sort.length())); + } } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java index f9e5caab..4595a4d8 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/entity/ZyProcess.java @@ -177,9 +177,9 @@ public class ZyProcess implements Serializable { /** * 款式名称 */ - @Excel(name = "款式名称", width = 15) - @ApiModelProperty(value = "款式名称") - @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") + @Excel(name = "类型名称", width = 15) + @ApiModelProperty(value = "类型名称") + @Dict(dictTable = "zy_cloths_type", dicText = "zy_cloths_type", dicCode = "nums") private java.lang.String styleId; /** * 工段代码 diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java index f55dd903..8b7bf361 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java @@ -3,6 +3,7 @@ package org.jeecg.modules.demo.base.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.jeecg.modules.demo.base.entity.ZyClothsModular; import org.jeecg.modules.demo.base.entity.ZyProcess; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -24,4 +25,7 @@ public interface ZyProcessMapper extends BaseMapper { public List selectByComponentId(@Param("component_id") String component_id); String getProcessNameById(String processId); + + @Select("select process_code from zy_process where style_id=#{id} order by process_code DESC limit 0,1") + String sort(String id); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyProcessService.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyProcessService.java index 4708ba4d..210c80e3 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyProcessService.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyProcessService.java @@ -19,4 +19,6 @@ public interface IZyProcessService extends IService { ZyProcess selectZyprocess(String id); public List selectByComponentId(String component_id); + + String sort(String id); } diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyProcessServiceImpl.java index 2f2b63aa..e22a94b2 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyProcessServiceImpl.java @@ -34,6 +34,15 @@ public class ZyProcessServiceImpl extends ServiceImpl list=baseMapper.selectByIds(id);