From 955a16290b647b36189e6ab10b9e02ce60349ff1 Mon Sep 17 00:00:00 2001 From: shenyuan Date: Fri, 16 Dec 2022 16:49:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=9D=A2=E6=96=99=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/erp/fabric/modules/ZyFabricForm.vue | 238 +++++++++++++----- 1 file changed, 182 insertions(+), 56 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue b/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue index 83a5e190..6dd9161c 100644 --- a/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue +++ b/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue @@ -2,8 +2,8 @@ - - + + - + - + - + - + - + - - - - - - - - - - - - - - - - + + - - - + + + - - - + + + - + - + + + + + + + - - + + - - - - - - + - - - + + + + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -172,6 +290,14 @@ xs: { span: 24 }, sm: { span: 16 }, }, + labelCol1: { + xs: { span: 24 }, + sm: { span: 3 }, + }, + wrapperCol1: { + xs: { span: 24 }, + sm: { span: 21 }, + }, confirmLoading: false, validatorRules: { typeId: [ From 14a8105eaff70aadbc02e7d34fe88ed187c1e70e Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 16 Dec 2022 16:59:57 +0800 Subject: [PATCH 2/3] 2022-12-16 --- .../src/views/zygoods/modules/ZyGoodsForm.vue | 87 +++++++++++++------ .../zygoods/controller/ZyGoodsController.java | 35 ++++++++ .../zystylemodel/entity/ZyStyleModel.java | 2 +- 3 files changed, 97 insertions(+), 27 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue index 84232a6e..ba512797 100644 --- a/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue +++ b/ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue @@ -3,9 +3,29 @@ + + + + + + + + + + + + + + + + + + + + - + @@ -38,21 +58,6 @@ - - - - - - - - - - - - - - - @@ -64,17 +69,17 @@ - + - + - + @@ -93,11 +98,7 @@ - - - - - + @@ -123,6 +124,9 @@ }, data () { return { + lx:'zy_cloths_type ,type_name,id', + ks:'zy_cloths_style,style_names,id', + xh:'zy_style_model,model_number,id', model:{ customized:0, recommend:0, @@ -138,15 +142,24 @@ }, confirmLoading: false, validatorRules: { + enterprisesId:[{ + required: true, message: '请选择企业!' + }], + modelId:[{ + required: true, message: '请选择型号!' + }], goodsCode: [ { required: true, message: '请输入商品编号!'}, ], styleId: [ { required: true, message: '请选择款式!'}, ], + clothsTypeId:[{ + required: true, message: '请选择类型!' + }], number: [ { required: false}, - { pattern: /^-?\d+$/, message: '请输入整数!'}, + { pattern: /^[+]{0,1}(\d+)$/, message: '包装个数必须大于等于0!'}, ], unitPrice: [ { required: false}, @@ -164,7 +177,8 @@ url: { add: "/zygoods/zyGoods/add", edit: "/zygoods/zyGoods/edit", - queryById: "/zygoods/zyGoods/queryById" + queryById: "/zygoods/zyGoods/queryById", + zy:"/zygoods/zyGoods/getspbh" } } }, @@ -178,6 +192,27 @@ this.modelDefault = JSON.parse(JSON.stringify(this.model)); }, methods: { + getlx(){ + this.lx ="zy_cloths_type ,type_name,id,enterprise_id='" + this.model.enterprisesId + "'"; + }, + getks(){ + this.ks ="zy_cloths_style,style_names,id,type_id='" + this.model.clothsTypeId + "'"; + }, + getxh(){ + this.xh ="zy_style_model,model_number,id,style_id='" + this.model.styleId + "'"; + }, + getspbh(){ + getAction(this.url.zy, {lxid:this.model.clothsTypeId,xhid:this.model.modelId}).then((res) => { + if (res.success) { + // console.log(res.result.nums) + // this.$forceUpdate(); + //写一个接口返回一个拼装好的商品编号 + this.$set(this.model,'goodsCode',res.result); + } else { + + } + }); + }, add () { this.edit(this.modelDefault); }, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java index 53493ae2..6cc69625 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java @@ -12,7 +12,9 @@ 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; +import org.jeecg.modules.demo.base.entity.ZyClothsType; import org.jeecg.modules.demo.base.service.IZyClothsModularService; +import org.jeecg.modules.demo.base.service.IZyClothsTypeService; import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService; import org.jeecg.modules.demo.zygoods.entity.ZyGoods; @@ -65,6 +67,10 @@ public class ZyGoodsController extends JeecgController private IZyClothsModularService zyClothsModularService; @Autowired private IZyClothsStyleService zyClothsStyleService; + @Autowired + private IZyStyleModelService zyStyleModelService; + @Autowired + private IZyClothsTypeService zyClothsTypeService; /** * 分页列表查询 @@ -204,6 +210,35 @@ public class ZyGoodsController extends JeecgController return Result.OK(zyGoods); } + /** + * 动态获取商品编码 + * + * @param + * @return + */ + @AutoLog(value = "商品表-通过id查询") + @ApiOperation(value="商品表-通过id查询", notes="商品表-通过id查询") + @GetMapping(value = "/getspbh") + public Result getspbh(@RequestParam(name="lxid",required=true) String lxid,@RequestParam(name="xhid",required=true) String xhid,HttpServletRequest req) { + String spbh = ""; + ZyClothsType zyClothsType = zyClothsTypeService.getById(lxid); + //服装类型编号 + String lxbh = zyClothsType.getNums(); + //型号编码 + ZyStyleModel zyStyleModel = zyStyleModelService.getById(xhid); + String xhbm =zyStyleModel.getModelNumber(); + //顺序号 + String sxh = ""; + ZyGoods zyGoods = new ZyGoods(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap()); + queryWrapper.eq("cloths_type_id",lxid); + queryWrapper.eq("model_id",xhid); + List list = zyGoodsService.list(queryWrapper); + sxh = list.size()+1+""; + spbh = lxbh + xhbm + sxh; + return Result.OK(spbh); + } + /** * 导出excel * diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java index 6b4f6b36..23ccf1f3 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java @@ -47,7 +47,7 @@ public class ZyStyleModel implements Serializable { /**型号编码*/ @Excel(name = "型号编码", width = 15) @ApiModelProperty(value = "型号编码") - private java.lang.Integer modelNumber; + private java.lang.String modelNumber; /**码数*/ @Excel(name = "码数", width = 15) @ApiModelProperty(value = "码数") From f9c17d8dde9e4ec38bed615ab26a2d2af4c2e985 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Fri, 16 Dec 2022 17:15:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92-?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=2012.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productplan/ZyPlanProcessDataList.vue | 217 ++++++++++++++++++ .../views/productplan/ZyProductPlanList.vue | 30 ++- .../productplan/modules/ZyProductPlanForm.vue | 73 +++--- .../src/views/team/modules/GroupxModal.vue | 4 +- .../controller/ZyPlanProcessController.java | 16 ++ .../controller/ZyProductPlanController.java | 2 + .../productplan/entity/ZyProductPlan.java | 19 +- .../productplan/entity/vo/ProcessDataVo.java | 27 +++ .../service/IZyPlanProcessService.java | 4 + .../impl/ZyPlanProcessServiceImpl.java | 45 ++++ 10 files changed, 388 insertions(+), 49 deletions(-) create mode 100644 ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue new file mode 100644 index 00000000..5f1a6293 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue @@ -0,0 +1,217 @@ + + + + \ 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 eb8f9e78..2233a512 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue @@ -168,12 +168,19 @@ export default { }, { title: '生产开始时间', + width:150, align: "center", dataIndex: 'workTime', - customRender: function (text) { - return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) - } + // customRender: function (text) { + // return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) + // } }, + /*{ + title: '创建时间', width:150, + dataIndex: 'createTime', + align:"center", + // sorter:true + },*/ { title: '生产时长', align: "center", @@ -196,14 +203,15 @@ export default { align: "center", dataIndex: 'auditBy' }, - // { - // title: '审核时间', - // align: "center", - // dataIndex: 'auditTimr', - // customRender: function (text) { - // return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) - // } - // }, + { + title: '审核时间', + width:150, + align: "center", + dataIndex: 'auditTimr', + // customRender: function (text) { + // return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) + // } + }, { title: '操作', dataIndex: 'action', diff --git a/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue b/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue index 0702eb76..58ab2ebf 100644 --- a/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue +++ b/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue @@ -7,9 +7,9 @@ - + @@ -18,20 +18,27 @@ - + + - + + + + @@ -39,13 +46,14 @@ + placeholder="请选择组长" :dict-code="groupxVal2" + :disabled="model.teamId==null"/> - + + @@ -54,25 +62,27 @@ - + - - + + - - - + + + - - + + @@ -99,8 +109,8 @@ export default { }, data() { return { - groupxVal: "", - groupxVal2: "", + groupxVal: "groupx,group_name,id", + groupxVal2: "groupx,enterprises_manager,id", model: {}, labelCol: { xs: {span: 24}, @@ -112,13 +122,21 @@ export default { }, confirmLoading: false, validatorRules: { - workOrderId: [ - {required: true,}, + productCode: [ + {required: true, message: "工单不能为空"}, ], workshopId: [ - {required: true,}, - ], teamId: [ - {required: true,}, + {required: true, message: "工单不能为空"}, + ], + teamId: [ + {required: true, message: "班组不能为空"}, + ], + // status: [ + // {required: true,message: "状态不能为空"}, + // ], + offTime: [ + {required: true, message: "生产时长不能不空"}, + {pattern: /^[0-9]{0,100}$/, message: '生产时间不能为空且长度为正整数'} ], }, url: { @@ -138,11 +156,14 @@ export default { this.modelDefault = JSON.parse(JSON.stringify(this.model)); }, methods: { - groupxValChange() { + getGroupxValChange() { // alert("车间选中" + this.model.workshopId); // this.basicInfoCode = "py_basic_info,chart_head,id, major_id='" + this.queryParam.majorId + "'"; this.groupxVal = "groupx,group_name,id,depart_id='" + this.model.workshopId + "'"; - this.groupxVal2 = "groupx,enterprises_manager,enterprises_manager,depart_id='" + this.model.workshopId + "'"; + // this.groupxVal2 = "groupx,enterprises_manager,enterprises_manager,depart_id='" + this.model.workshopId + "'"; + }, + getEnterprisesManagerValChange() { + this.groupxVal2 = "groupx,enterprises_manager,enterprises_manager,id='" + this.model.teamId + "'"; }, add() { this.edit(this.modelDefault); diff --git a/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue b/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue index 7d377c1a..276fb66d 100644 --- a/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue +++ b/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue @@ -31,9 +31,9 @@ - + - + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java index bf56eee8..1340be1d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java @@ -12,6 +12,7 @@ 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.productplan.entity.ZyPlanProcess; +import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; import org.jeecg.modules.productplan.service.IZyPlanProcessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -20,6 +21,8 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.List; +import java.util.Map; /** * @Description: 生产计划工序 @@ -57,6 +60,19 @@ public class ZyPlanProcessController extends JeecgController getProcessDatalist(ZyPlanProcess zyPlanProcess, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); +// IPage pageList = zyPlanProcessService.getProcessDatalist(page, queryWrapper); + List pageList = zyPlanProcessService.getProcessDatalist(zyPlanProcess); + return Result.OK(pageList); + } + /** * 添加 * diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java index 3efb487a..afe88aa7 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java @@ -68,6 +68,7 @@ public class ZyProductPlanController extends JeecgController add(@RequestBody ZyProductPlan zyProductPlan) { zyProductPlanService.save(zyProductPlan); + //TODO 更新work_order表work_order_status为“1” (不能为其新增生产计划) return Result.OK("添加成功!"); } @@ -96,6 +97,7 @@ public class ZyProductPlanController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { zyProductPlanService.removeById(id); + //TODO 更新work_order表work_order_status为“0” (可以为其新增生产计划) return Result.OK("删除成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java index 8382c1fb..bf4e54e3 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java @@ -1,8 +1,6 @@ package org.jeecg.modules.productplan.entity; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -84,7 +82,7 @@ public class ZyProductPlan implements Serializable { */ @Excel(name = "班组", width = 15) @ApiModelProperty(value = "班组") - @Dict(dictTable = "station", dicText = "station_name", dicCode = "id") + @Dict(dictTable = "groupx", dicText = "group_name", dicCode = "id") private String teamId; /** * 组长 @@ -95,9 +93,9 @@ public class ZyProductPlan implements Serializable { /** * 生产开始时间 */ - @Excel(name = "生产开始时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产开始时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "生产开始时间") private Date workTime; /** @@ -129,9 +127,10 @@ public class ZyProductPlan implements Serializable { /** * 审核时间 */ - @Excel(name = "审核时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "审核时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "审核时间") +// @TableField(fill = FieldFill.INSERT) private Date auditTimr; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java new file mode 100644 index 00000000..d0dfb54b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java @@ -0,0 +1,27 @@ +package org.jeecg.modules.productplan.entity.vo; + +import lombok.Data; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecg.modules.team.entity.Station; + +import java.util.List; + +@Data +public class ProcessDataVo { + + //工单id + private String workOrderId; + + //产品id + private String productId; + + //车间 + private String departId; + + //工位 + private List stationList; + +// @Dict("") + //产品工序id + private String productProcessId; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java index 64b75e44..804cca26 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java @@ -3,6 +3,9 @@ package org.jeecg.modules.productplan.service; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.productplan.entity.ZyPlanProcess; +import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; + +import java.util.List; /** * @Description: 生产计划工序 @@ -12,4 +15,5 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcess; */ public interface IZyPlanProcessService extends IService { + List getProcessDatalist(ZyPlanProcess zyPlanProcess); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java index fdeeff68..5af4f5c4 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java @@ -1,12 +1,26 @@ package org.jeecg.modules.productplan.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.swagger.annotations.Authorization; +import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; +import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService; import org.jeecg.modules.productplan.entity.ZyPlanProcess; +import org.jeecg.modules.productplan.entity.ZyProductPlan; +import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper; import org.jeecg.modules.productplan.service.IZyPlanProcessService; +import org.jeecg.modules.productplan.service.IZyProductPlanService; +import org.jeecg.modules.team.entity.Station; +import org.jeecg.modules.team.service.IStationService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + /** * @Description: 生产计划工序 * @Author: jeecg-boot @@ -16,4 +30,35 @@ import org.springframework.stereotype.Service; @Service public class ZyPlanProcessServiceImpl extends ServiceImpl implements IZyPlanProcessService { + @Autowired + private IZyProductPlanService iZyProductPlanService; + @Autowired + private IZyProductProcessService iZyProductProcessService; + + @Autowired + private IStationService iStationService; + + + public List getProcessDatalist(ZyPlanProcess zyPlanProcess) { + //生产计划id + String planId = zyPlanProcess.getPlanId(); + ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); + //工单id + String productCode = zyProductPlan.getProductCode(); + String departId = zyProductPlan.getWorkshopId(); + // TODO zy_product产品表,根据工单id获取产品id, + + //根据产品id获取产品工序列表 + List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "产品id")); + Optional.ofNullable(productProcessesList).orElse(new ArrayList<>()).forEach(e -> { + ProcessDataVo vo = new ProcessDataVo(); + vo.setProductProcessId(e.getProcessId()); + vo.setProductId(e.getProductId()); + vo.setWorkOrderId(productCode); + vo.setDepartId(departId); + vo.setStationList(iStationService.list(new LambdaQueryWrapper().eq(Station::getDepartId, departId))); + }); + + return null; + } }