diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue index 5f1a6293..f17cd089 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue @@ -10,36 +10,42 @@ + + + + + + + + + + + + + + + + + + + + + +
- 新增 - 导出 - - - - - - - - - - - 删除 - - - 批量操作 - - - + + + 导出 + 返回
-
- 已选择 {{ selectedRowKeys.length }}项 - 清空 -
+ + + + + + + + + {{ item.stationName }} + + + - - - - - - - - - - - - 删除 - - - 制定计划详情 + + + + {{ item.name }} + + + + + + {{ item.name }} + + +
- +
+ 提交 +
+ + @@ -85,6 +100,8 @@ import '@/assets/less/TableExpand.less' import {mixinDevice} from '@/utils/mixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin' import ZyPlanProcessModal from './modules/ZyPlanProcessModal2' +import {getAction} from "@api/manage"; +import {filterObj} from "@/utils/util"; export default { name: 'ZyPlanProcessList', @@ -94,7 +111,7 @@ export default { }, data() { return { - description: '计划工序制定数据列表', + description: '生产计划工序管理页面', // 表头 columns: [ { @@ -107,35 +124,57 @@ export default { return parseInt(index) + 1; } }, + // { + // title: '计划id', + // align: "center", + // dataIndex: 'planId' + // }, { - title: '生产计划id', + title: '工单编号', align: "center", - dataIndex: 'planId' + dataIndex: 'workOrderId' }, { - title: '车间名称', + title: '产品id', align: "center", - dataIndex: 'teamName' + dataIndex: 'productId' }, { - title: '工单编号', + title: '产品', align: "center", - dataIndex: 'productCode' + dataIndex: 'productName' }, { - title: '产品名称', + title: '车间', align: "center", - dataIndex: 'productCode2' + dataIndex: 'departName' }, { - title:'工序名称', - align:"center", - dataIndex: 'processId_dictText' + title: '工序', + align: "center", + dataIndex: 'processName' }, { - title:'序号', - align:"center", - dataIndex: 'number' + title: '工位列表', + align: "center", + dataIndex: 'stationList', + width: 150, + scopedSlots: {customRender: 'stationList'} + }, + { + title: '工位工具列表', + align: "center", + dataIndex: 'toolsList', + width: 150, + scopedSlots: {customRender: 'toolsList'} + // scopedSlots: {customRender: this.toolsList} + }, + { + title: '工具设备列表', + align: "center", + dataIndex: 'machineList', + width: 150, + scopedSlots: {customRender: 'machineList'} }, { title: '操作', @@ -147,16 +186,21 @@ export default { } ], url: { - list: "/org.jeecg.modules.productplan/zyPlanProcess/list", - productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list", + list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist", + stationToolslist: "/stationTool/list", + stationMachinelist: "/stationMachine/list", + // productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list", delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete", - deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch", - exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls", - importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcess/importExcel", - + // deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch", + // exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls", + // importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcess/importExcel", }, + loadRouteType: false, + planId: "", dictOptions: {}, superFieldList: [], + toolsList: [], + machineList: [], } }, created() { @@ -168,8 +212,88 @@ export default { }, }, methods: { - initDictConfig() { + fanHui() { + this.$router.push({ + path: '/productplan/ZyPlanProcessList', + }); + }, + getToolAndMachine(stationId) { + // alert("stationId=" + stationId); + getAction(this.url.stationToolslist, {"stationId": stationId}).then((res) => { + if (res.success) { + this.toolsList = res.result.records || res.result; + console.log("toolsList", JSON.stringify(this.toolsList)) + } else { + this.$message.warning(res.message) + } + }); + + getAction(this.url.stationMachinelist, {"stationId": stationId}).then((res) => { + if (res.success) { + this.machineList = res.result.records || res.result; + console.log("machineList", JSON.stringify(this.toolsList)) + } else { + this.$message.warning(res.message) + } + }); + }, + //加载传递参数 + loadParameter() { + if (this.loadRouteType === false) { + this.planId = this.$route.query.planId; + // this.biaoTi = this.$route.query.styleNames+"款式面料管理"; + console.log("*******传递的planId:" + this.planId) + this.loadRouteType = true; + } + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("请设置url.list属性!") + return + } + //加载数据 若传入参数1则加载第一页的内容 + if (arg === 1) { + this.ipagination.current = 1; + } + this.loadParameter(); + var params = this.getQueryParams();//查询条件 + this.loading = true; + console.log("----------------the params:", params); + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records || res.result; + if (res.result.total) { + this.ipagination.total = res.result.total; + } else { + this.ipagination.total = 0; + } + } else { + this.$message.warning(res.message) + } + }).finally(() => { + // this.dataSource.forEach(item => { + // item['stationName'] = this.stationName; + // item['stationNum'] = this.stationNum; + // }) + this.loading = false + }) + }, + getQueryParams() { + //获取查询条件 + let sqp = {} + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); + param.field = this.getQueryField(); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + param.planId = this.planId; + return filterObj(param); }, + // initDictConfig() { + // }, getSuperFieldList() { let fieldList = []; fieldList.push({type: 'string', value: 'planId', text: '生产计划id', dictCode: ''}) @@ -180,16 +304,17 @@ export default { fieldList.push({type: 'string', value: 'userIds', text: '成员id列表', dictCode: ''}) this.superFieldList = fieldList }, - jumpPage1(record) { - this.$router.push({ - path: '/productplan/ZyProductPlanList', - - // query: { // 路由携带参数 - // 'stationId': record.id, - // 'stationName': record.stationName, - // }, - }); - }, + // jumpPage1(record) { + // this.$router.push({ + // // path: '/productplan/ZyProductPlanList', + // path: '/productplan/ZyPlanProcessDataList', + // + // // query: { // 路由携带参数 + // // 'stationId': record.id, + // // 'stationName': record.stationName, + // // }, + // }); + // }, // pf(record) { // this.$router.push({ // path: '/productplan/ZyPlanProcessAddList', @@ -197,17 +322,17 @@ export default { // } // }); - // getAction("productPlanlist", {id: record.id}).then((res) => { - // if (res.success) { - // this.$router.push({ - // path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList', - // query: { // 路由携带参数 - // } - // }); - // } else { - // this.$message.error(res.message) - // } - // }); + // getAction("productPlanlist", {id: record.id}).then((res) => { + // if (res.success) { + // this.$router.push({ + // path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList', + // query: { // 路由携带参数 + // } + // }); + // } else { + // this.$message.error(res.message) + // } + // }); // }, } } diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue index f63c30b1..02a75a6b 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue @@ -55,16 +55,51 @@ class="j-table-force-nowrap" @change="handleTableChange"> - - - - - + + + + {{ text }} + + + + + + {{ text }} + + + + + + + {{ text }} + + + + + + + {{ text }} + + + + + + + {{ text }} + + + - - - - 删除 @@ -108,33 +143,39 @@ export default { } }, { - title: '生产计划id', + title: '生产计划', align: "center", dataIndex: 'planId' - }, { - title: '工位id', + }, + { + title: '工序', align: "center", - dataIndex: 'stationId' + dataIndex: 'processId_dictText', + scopedSlots: {customRender: 'stationId_dictText'} }, { - title: '设备id列表', + title: '工位', align: "center", - dataIndex: 'machineIds' + dataIndex: 'stationId_dictText', + scopedSlots: {customRender: 'stationId_dictText'} }, { - title: '工具id列表', + title: '设备', align: "center", - dataIndex: 'toolsIds' + dataIndex: 'machineIds_dictText', + scopedSlots: {customRender: 'machineIds_dictText'} }, { - title: '工序id列表', + title: '工具', align: "center", - dataIndex: 'processIds' + dataIndex: 'toolsIds_dictText', + scopedSlots: {customRender: 'toolsIds_dictText'} }, { - title: '成员id列表', + title: '成员', align: "center", - dataIndex: 'userIds' + dataIndex: 'userIds', + scopedSlots: {customRender: 'userIds'} }, { title: '操作', @@ -146,7 +187,8 @@ export default { } ], url: { - list: "/org.jeecg.modules.productplan/zyPlanProcess/list", + // list: "/org.jeecg.modules.productplan/zyPlanProcess/list", + list: "/org.jeecg.modules.productplan/zyPlanProcess/list2", productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list", delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete", deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch", @@ -181,12 +223,11 @@ export default { }, jumpPage1(record) { this.$router.push({ - path: '/productplan/ZyProductPlanList', - - // query: { // 路由携带参数 - // 'stationId': record.id, - // 'stationName': record.stationName, - // }, + path: '/productplan/ZyPlanProcessDataList', + query: { // 路由携带参数 + 'planId': record.planId, + // 'stationName': record.stationName, + }, }); }, // pf(record) { @@ -196,17 +237,17 @@ export default { // } // }); - // getAction("productPlanlist", {id: record.id}).then((res) => { - // if (res.success) { - // this.$router.push({ - // path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList', - // query: { // 路由携带参数 - // } - // }); - // } else { - // this.$message.error(res.message) - // } - // }); + // getAction("productPlanlist", {id: record.id}).then((res) => { + // if (res.success) { + // this.$router.push({ + // path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList', + // query: { // 路由携带参数 + // } + // }); + // } else { + // this.$message.error(res.message) + // } + // }); // }, } } diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue index 2233a512..9540c7e7 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue @@ -184,7 +184,7 @@ export default { { title: '生产时长', align: "center", - dataIndex: 'offTime' + dataIndex: 'duration' }, { title: '状态', @@ -252,7 +252,7 @@ export default { fieldList.push({type: 'string', value: 'teamId', text: '班组', dictCode: ''}) fieldList.push({type: 'string', value: 'teamLeader', text: '组长', dictCode: ''}) fieldList.push({type: 'date', value: 'workTime', text: '生产开始时间'}) - fieldList.push({type: 'int', value: 'offTime', text: '生产时长', dictCode: ''}) + fieldList.push({type: 'int', value: 'duration', text: '生产时长', dictCode: ''}) fieldList.push({type: 'int', value: 'status', text: '状态', dictCode: ''}) fieldList.push({type: 'int', value: 'speedUp', text: '是否加急', dictCode: ''}) fieldList.push({type: 'string', value: 'auditBy', text: '审核人', dictCode: ''}) 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 58ab2ebf..d7c93fad 100644 --- a/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue +++ b/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue @@ -57,8 +57,8 @@ - - + + @@ -134,7 +134,7 @@ export default { // status: [ // {required: true,message: "状态不能为空"}, // ], - offTime: [ + duration: [ {required: true, message: "生产时长不能不空"}, {pattern: /^[0-9]{0,100}$/, message: '生产时间不能为空且长度为正整数'} ], 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 1340be1d..b26835f3 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 @@ -3,6 +3,7 @@ package org.jeecg.modules.productplan.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.PageList; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -15,6 +16,7 @@ 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.util.ObjectUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -47,7 +49,7 @@ public class ZyPlanProcessController extends JeecgController queryPageList(ZyPlanProcess zyPlanProcess, @@ -60,17 +62,53 @@ public class ZyPlanProcessController extends JeecgController queryPageList2(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.page(page, queryWrapper); + if (!ObjectUtils.isEmpty(pageList)) { + String processIdList = ""; + String stationIdList = ""; + String machineIdList = ""; + String toolsIdList = ""; + String userIdList = ""; + List records = pageList.getRecords(); + for (ZyPlanProcess e : records) { + processIdList += e.getProcessId(); + stationIdList += e.getStationId(); + machineIdList += e.getMachineIds(); + toolsIdList += e.getToolsIds(); + userIdList += e.getUserIds(); + } + for (ZyPlanProcess e : records) { + e.setProcessId(processIdList); + e.setStationId(stationIdList); + e.setMachineIds(machineIdList); + e.setToolsIds(toolsIdList); + e.setUserIds(userIdList); + } + } + return Result.OK(pageList); + } + @ApiOperation(value = "生产计划工序-查询产品工序&计划", notes = "生产计划工序-查询产品工序&计划") @GetMapping(value = "/getProcessDatalist") public Result getProcessDatalist(ZyPlanProcess zyPlanProcess, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + @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); + List processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess); + PageList processDataVos = new PageList<>(processDatalist, processDatalist.size()); + + return Result.OK(processDatalist); } /** diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java index 36cd67d0..ae3b5c27 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java @@ -10,6 +10,7 @@ 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; @@ -66,34 +67,39 @@ public class ZyPlanProcess implements Serializable { @Excel(name = "生产计划id", width = 15) @ApiModelProperty(value = "生产计划id") private String planId; + /** + * 工序id列表 + */ + @Excel(name = "工序id", width = 15) + @ApiModelProperty(value = "工序id列表") + @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") + private String processId; /** * 工位id */ @Excel(name = "工位id", width = 15) @ApiModelProperty(value = "工位id") + @Dict(dictTable = "station",dicText = "station_name",dicCode = "id") private String stationId; /** * 设备id列表 */ @Excel(name = "设备id列表", width = 15) @ApiModelProperty(value = "设备id列表") + @Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id") private String machineIds; /** * 工具id列表 */ @Excel(name = "工具id列表", width = 15) @ApiModelProperty(value = "工具id列表") + @Dict(dictTable = "zy_tool", dicText = "name", dicCode = "id") private String toolsIds; - /** - * 工序id列表 - */ - @Excel(name = "工序id列表", width = 15) - @ApiModelProperty(value = "工序id列表") - private String processIds; /** * 成员id列表 */ @Excel(name = "成员id列表", width = 15) @ApiModelProperty(value = "成员id列表") +// @Dict(dictTable = "sys_user", dicText = "name", dicCode = "id") private String userIds; } 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 bf4e54e3..9f8a5495 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 @@ -103,7 +103,7 @@ public class ZyProductPlan implements Serializable { */ @Excel(name = "生产时长", width = 15) @ApiModelProperty(value = "生产时长") - private Integer offTime; + private Integer duration; /** * 值:未审核0、已审核1、生产中2、已完成3、已撤销8、异常9,默认0 */ 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 index d0dfb54b..596a69f1 100644 --- 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 @@ -1,27 +1,38 @@ package org.jeecg.modules.productplan.entity.vo; import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; import org.jeecg.common.aspect.annotation.Dict; import org.jeecg.modules.team.entity.Station; +import java.io.Serializable; import java.util.List; @Data -public class ProcessDataVo { +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ProcessDataVo implements Serializable { + + private static final long serialVersionUID = 1009888L; //工单id private String workOrderId; //产品id private String productId; + private String productName; //车间 +// @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id") private String departId; + private String departName; //工位 private List stationList; -// @Dict("") //产品工序id +// @Dict(dictTable ="zy_process",dicText = "process_name",dicCode = "id") private String productProcessId; + private String processName; } 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 5af4f5c4..ee9ddff8 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 @@ -4,6 +4,8 @@ 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.common.exception.JeecgBootException; +import org.jeecg.modules.demo.base.service.IZyProcessService; import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService; import org.jeecg.modules.productplan.entity.ZyPlanProcess; @@ -12,12 +14,16 @@ 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.system.entity.SysDepart; +import org.jeecg.modules.system.service.ISysDepartService; 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 org.springframework.util.ObjectUtils; import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import java.util.Optional; @@ -38,27 +44,43 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl getProcessDatalist(ZyPlanProcess zyPlanProcess) { //生产计划id String planId = zyPlanProcess.getPlanId(); ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); + if (ObjectUtils.isEmpty(zyPlanProcess)) { + throw new JeecgBootException("生产计划不存在!"); + } //工单id String productCode = zyProductPlan.getProductCode(); String departId = zyProductPlan.getWorkshopId(); // TODO zy_product产品表,根据工单id获取产品id, - + List result = new LinkedList<>(); //根据产品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; +// List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "产品id")); + List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "1")); + if (!ObjectUtils.isEmpty(productProcessesList)) { + SysDepart depart = iSysDepartService.getById(departId); + List stationList = iStationService.list(new LambdaQueryWrapper().eq(Station::getDepartId, departId)); + productProcessesList.forEach(e -> { + ProcessDataVo vo = new ProcessDataVo(); + vo.setProductProcessId(e.getProcessId()); + vo.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName()); + vo.setProductId(e.getProductId()); +// vo.setProductName("产品名称") + vo.setWorkOrderId(productCode); + vo.setDepartId(departId); + vo.setDepartName(depart.getDepartName()); + vo.setStationList(stationList); + result.add(vo); + }); + } + return result; } }