From 4ff41ec6366ebef335053f85a4568a1a44027d1b Mon Sep 17 00:00:00 2001
From: zhc077 <565291854>
Date: Sat, 17 Dec 2022 15:40:36 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=B7=A5=E5=BA=8F=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=2012.17?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../productplan/ZyPlanProcessDataList.vue | 126 ++++++++++++------
.../productplan/entity/vo/ProcessDataVo.java | 15 ++-
.../impl/ZyPlanProcessServiceImpl.java | 40 ++++--
3 files changed, 125 insertions(+), 56 deletions(-)
diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
index 6d1601cb..f17cd089 100644
--- a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
+++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
@@ -32,6 +32,12 @@
+
@@ -55,32 +61,35 @@
class="j-table-force-nowrap"
@change="handleTableChange">
-
-
- {{item.stationName}}
+
+
+ {{ item.stationName }}
-
-
-
-
-
-
-
-
-
-
- handleDelete(record.id)">
- 删除
-
-
-
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
@@ -115,11 +124,11 @@ export default {
return parseInt(index) + 1;
}
},
- {
- title: '计划id',
- align: "center",
- dataIndex: 'planId'
- },
+ // {
+ // title: '计划id',
+ // align: "center",
+ // dataIndex: 'planId'
+ // },
{
title: '工单编号',
align: "center",
@@ -129,36 +138,43 @@ export default {
title: '产品id',
align: "center",
dataIndex: 'productId'
- }, {
- title: '车间',
+ },
+ {
+ title: '产品',
align: "center",
- dataIndex: 'departId'
+ dataIndex: 'productName'
},
{
- title: '工序id',
+ title: '车间',
align: "center",
- dataIndex: 'productProcessId'
+ dataIndex: 'departName'
},
{
- title: '工位list',
+ title: '工序',
align: "center",
- dataIndex: 'stationList',
- scopedSlots: {customRender: 'stationList'}
+ dataIndex: 'processName'
},
{
- title: '工具id列表',
+ title: '工位列表',
align: "center",
- dataIndex: 'toolsIds'
+ dataIndex: 'stationList',
+ width: 150,
+ scopedSlots: {customRender: 'stationList'}
},
{
- title: '工序id列表',
+ title: '工位工具列表',
align: "center",
- dataIndex: 'processIds'
+ dataIndex: 'toolsList',
+ width: 150,
+ scopedSlots: {customRender: 'toolsList'}
+ // scopedSlots: {customRender: this.toolsList}
},
{
- title: '成员id列表',
+ title: '工具设备列表',
align: "center",
- dataIndex: 'userIds'
+ dataIndex: 'machineList',
+ width: 150,
+ scopedSlots: {customRender: 'machineList'}
},
{
title: '操作',
@@ -171,6 +187,8 @@ export default {
],
url: {
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",
@@ -181,14 +199,12 @@ export default {
planId: "",
dictOptions: {},
superFieldList: [],
+ toolsList: [],
+ machineList: [],
}
},
- // mounted() {
- // this.loadData()
- // },
created() {
this.getSuperFieldList();
- // this.loadParameter();
},
computed: {
importExcelUrl: function () {
@@ -196,9 +212,31 @@ export default {
},
},
methods: {
- // valueChange(value) {
- // if (value) this.loadData()
- // },
+ 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) {
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 e1295ef4..629a3792 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,10 +14,13 @@ 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;
@@ -39,11 +44,20 @@ 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();
@@ -52,16 +66,22 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "产品id"));
List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "1"));
- 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)));
- result.add(vo);
- });
-
+ 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;
}
}