计划工序管理-列表、读取工序 1.17

zhc4dev
zhc077 2 years ago
parent 16e889e753
commit cd796d2a5b
  1. 93
      ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue
  2. 29
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java
  3. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java
  4. 66
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/enums/ProductPlanStatusEnum.java
  5. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java
  6. 95
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java
  7. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationMachineService.java
  8. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/IStationToolService.java
  9. 29
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationMachineServiceImpl.java
  10. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationToolServiceImpl.java

@ -3,14 +3,14 @@
<template> <template>
<div> <div>
<el-descriptions border :column='4'> <el-descriptions border :column='4'>
<el-descriptions-item label="工单编号 ">{{planInfo.productName}}</el-descriptions-item> <el-descriptions-item label="工单编号 ">{{ planInfo.productCode }}</el-descriptions-item>
<el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item> <el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item>
<!-- <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>--> <!-- <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>-->
<el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item> <el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item>
<!-- <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>--> <!-- <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>-->
<el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item> <el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item>
<el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item> <el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item>
<el-descriptions-item label="产品类型">10</el-descriptions-item> <el-descriptions-item label="产品类型">{{ planInfo.productType }}</el-descriptions-item>
<el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item> <el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item>
<el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item> <el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item>
<el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item> <el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item>
@ -46,6 +46,7 @@
@save="handleTableSave" @save="handleTableSave"
> >
<template v-slot:toolbarSuffix> <template v-slot:toolbarSuffix>
<a-button type="primary" icon="plus-circle" @click="syncProductProcess()">读取工序</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
</template> </template>
@ -76,20 +77,18 @@ export default {
description: '生产计划工序管理页面', description: '生产计划工序管理页面',
loading: false, loading: false,
dataSource: [], dataSource: [],
// columns,
columns: [ columns: [
{key: 'workOrderId', title: '工单编号', width: '200px'}, {
// {key: 'productName', title: '', width: '120px'}, title: '工序名称',
{key: 'departName', title: '车间名称', width: '120px'}, key: 'processName',
{key: 'processName', title: '工序名称', width: '120px'}, width: '180px',
},
{ {
title: '工位ID', title: '工位ID',
key: 'stationId', key: 'stationId',
type: JVXETypes.hidden, type: JVXETypes.hidden,
// width: '200px', },
// options: [], {
// placeholder: '${title}',
}, {
title: '工位名称', title: '工位名称',
key: 'stationName', key: 'stationName',
type: JVXETypes.select, type: JVXETypes.select,
@ -98,9 +97,9 @@ export default {
placeholder: '请选择${title}', placeholder: '请选择${title}',
}, },
{ {
title: 'stationIds', title: '设备名称',
key: 'stationIds', key: 'machineIds',
type: JVXETypes.hidden, type: JVXETypes.hidden
}, },
{ {
title: '设备列表', title: '设备列表',
@ -117,7 +116,7 @@ export default {
}, },
{ {
title: '工具列表', title: '工具列表',
key: 'toolsIdNames', key: 'toolsNames',
type: JVXETypes.selectMultiple, type: JVXETypes.selectMultiple,
width: '200px', width: '200px',
options: [], options: [],
@ -155,6 +154,7 @@ export default {
url: { url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist", list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist",
getPlanInfo: "/org.jeecg.modules.productplan/zyPlanProcess/getPlanInfo", getPlanInfo: "/org.jeecg.modules.productplan/zyPlanProcess/getPlanInfo",
syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess",
stationToolslist: "/stationTool/list2", stationToolslist: "/stationTool/list2",
stationMachinelist: "/stationMachine/list2", stationMachinelist: "/stationMachine/list2",
addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch", addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch",
@ -164,8 +164,8 @@ export default {
dictOptions: {}, dictOptions: {},
planInfo: {}, planInfo: {},
superFieldList: [], superFieldList: [],
stationId: [], // stationId: [],
stationList: [], stationIdList: [],
toolsList: [], toolsList: [],
machineList: [], machineList: [],
clickTrue: true, clickTrue: true,
@ -217,10 +217,24 @@ export default {
}, },
fanHui() { fanHui() {
this.$router.push({ this.$router.push({
path: '/productplan/ZyPlanProcessList', path: '/productplan/ZyProductPlanList',
}); });
}, },
//
syncProductProcess() {
getAction(this.url.syncProductProcess, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// //
loadParameter() { loadParameter() {
// debugger; // debugger;
@ -239,7 +253,7 @@ export default {
return return
} }
// 1 // 1
// this.loadParameter(); this.loadParameter();
var params = this.getQueryParams();// var params = this.getQueryParams();//
this.loading = true; this.loading = true;
console.log("----------------the params:", params); console.log("----------------the params:", params);
@ -247,7 +261,7 @@ export default {
if (res.success) { if (res.success) {
this.dataSource = res.result.records || res.result; this.dataSource = res.result.records || res.result;
// this.stationId = this.dataSource[0].stationId; // this.stationId = this.dataSource[0].stationId;
this.stationList = this.dataSource[0].stationList; this.stationIdList = this.dataSource[0].stationIdList;
} else { } else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')"; // this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')";
this.$message.warning(res.message) this.$message.warning(res.message)
@ -273,42 +287,43 @@ export default {
// //
handleSelectRowChange(event) { handleSelectRowChange(event) {
console.log("handleSelectRowChange") // console.log("handleSelectRowChange")
console.log("handleSelectRowChange-event:", event) console.log("handleSelectRowChange-event:", event)
const {type, row, column, value, target, $table} = event const {type, row, column, value, target, $table} = event
console.log(JSON.stringify(this.stationIdList)); console.log("stationIdList", JSON.stringify(this.stationIdList));
// target.$refs.vxe.columns[6].dictCode = this.stationIdCode; target.$refs.vxe.columns[4].options = this.stationIdList;
target.$refs.vxe.columns[6].options = this.stationList;
}, },
/** 当选项被改变时,联动其他组件 */ /** 当选项被改变时,联动其他组件 */
handleValueChange(event) { handleValueChange(event) {
const {type, row, column, value, target} = event const {type, row, column, value, target} = event
console.log("event", event) console.log("选择列-" + column.key + ":的事件-----", event)
console.log("row", row) console.log("选择列-" + column.key + ":所在行数据-----", row)
// if (type === JVXETypes.select) { // console.log("row", row)
// //
if (column.key === 'stationId') { if (column.key === 'stationName') {
let selectedStationId = event.value;
// options // options
console.log('this stationid(row.id):', row.stationId) // console.log('id---------:', selectedStationId)
row.stationId = selectedStationId;
// //
target.setValues([{ target.setValues([{
rowKey: row.id, rowKey: row.id,
values: {machineIds: '', toolsIds: ''} values: {machineIds: '', toolsIds: '', machineNames: '', toolsNames: ''}
}]) }])
target.$refs.vxe.columns[7].options = [] target.$refs.vxe.columns[6].options = []
target.$refs.vxe.columns[8].options = [] target.$refs.vxe.columns[8].options = []
getAction(this.url.stationMachinelist, {"stationId": row.stationId}).then((res) => { getAction(this.url.stationMachinelist, {"stationId": selectedStationId}).then((res) => {
if (res.success) { if (res.success) {
this.machineList = res.result.records || res.result; this.machineList = res.result.records || res.result;
console.log("machineList", JSON.stringify(this.machineList)) console.log("machineList", JSON.stringify(this.machineList))
target.$refs.vxe.columns[7].options = this.machineList; target.$refs.vxe.columns[6].options = this.machineList;
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}); });
getAction(this.url.stationToolslist, {"stationId": row.stationId}).then((res) => { getAction(this.url.stationToolslist, {"stationId": selectedStationId}).then((res) => {
if (res.success) { if (res.success) {
this.toolsList = res.result.records || res.result; this.toolsList = res.result.records || res.result;
console.log("toolsList", JSON.stringify(this.toolsList)) console.log("toolsList", JSON.stringify(this.toolsList))
@ -318,6 +333,14 @@ export default {
} }
}); });
} }
//
if (column.key === 'machineNames') {
row.machineIds = event.value;
}
if (column.key === 'toolsNames') {
row.toolsIds = event.value;
}
} }
}, },
}; };

@ -20,7 +20,10 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; import org.jeecg.modules.productplan.entity.vo.ProcessDataVo;
import org.jeecg.modules.productplan.service.IZyPlanProcessService; import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.team.entity.Station; import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.entity.StationMachine;
import org.jeecg.modules.team.service.IStationMachineService;
import org.jeecg.modules.team.service.IStationService; import org.jeecg.modules.team.service.IStationService;
import org.jeecg.modules.team.service.IStationToolService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
@ -50,6 +53,10 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
@Autowired @Autowired
private IStationService iStationService; private IStationService iStationService;
@Autowired
private IStationMachineService iStationMachineService;
@Autowired
private IStationToolService iStationToolService;
/** /**
* 分页列表查询 * 分页列表查询
@ -131,6 +138,14 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK(map); return Result.OK(map);
} }
@ApiOperation(value = "读取工序", notes = "读取工序")
@GetMapping(value = "/syncProductProcess")
public Result<?> syncProductProcess(ZyPlanProcess zyPlanProcess,
HttpServletRequest req) {
zyPlanProcessService.syncProductBaseProcess(zyPlanProcess);
return Result.OK();
}
@ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组") @ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组")
@GetMapping(value = "/getTeamDatalist") @GetMapping(value = "/getTeamDatalist")
public Result<?> getTeamDatalist(ZyPlanProcess zyPlanProcess, public Result<?> getTeamDatalist(ZyPlanProcess zyPlanProcess,
@ -176,11 +191,21 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
@PostMapping(value = "/addProcessBatch") @PostMapping(value = "/addProcessBatch")
public Result<?> addProcessBatch(@RequestBody List<ZyPlanProcess> zyPlanProcessList) { public Result<?> addProcessBatch(@RequestBody List<ZyPlanProcess> zyPlanProcessList) {
if (!ObjectUtils.isEmpty(zyPlanProcessList)) { if (!ObjectUtils.isEmpty(zyPlanProcessList)) {
// zyPlanProcessService.remove(new LambdaQueryWrapper<ZyPlanProcess>()
// .eq(ZyPlanProcess::getPlanId, zyPlanProcessList.get(0).getPlanId()));
zyPlanProcessList.forEach(e -> { zyPlanProcessList.forEach(e -> {
if (StringUtils.isNotBlank(e.getStationId())) {
Station station = iStationService.getById(e.getStationId()); Station station = iStationService.getById(e.getStationId());
e.setStationName(StringUtils.isNotBlank(station.getStationName()) ? station.getStationName() : ""); e.setStationName(StringUtils.isNotBlank(station.getStationName()) ? station.getStationName() : "");
if (StringUtils.isNotBlank(e.getMachineIds())) {
e.setMachineNames(iStationMachineService.convertByMachineId(e.getStationId()));
}
if (StringUtils.isNotBlank(e.getToolsIds())) {
e.setToolsNames(iStationToolService.convertByToolId(e.getStationId()));
}
} else {
e.setMachineIds("");
e.setToolsIds("");
}
}); });
zyPlanProcessService.saveOrUpdateBatch(zyPlanProcessList); zyPlanProcessService.saveOrUpdateBatch(zyPlanProcessList);
} }

@ -78,6 +78,7 @@ public class ZyPlanProcess implements Serializable {
@ApiModelProperty(value = "工序id列表") @ApiModelProperty(value = "工序id列表")
@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id") @Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
private String processId; private String processId;
private String processName;
/** /**
* 工位id * 工位id
*/ */
@ -85,7 +86,6 @@ public class ZyPlanProcess implements Serializable {
@ApiModelProperty(value = "工位id") @ApiModelProperty(value = "工位id")
@Dict(dictTable = "station", dicText = "station_name", dicCode = "id") @Dict(dictTable = "station", dicText = "station_name", dicCode = "id")
private String stationId; private String stationId;
@ApiModelProperty(value = "工序名称") @ApiModelProperty(value = "工序名称")
private String stationName; private String stationName;
@ -98,6 +98,7 @@ public class ZyPlanProcess implements Serializable {
@ApiModelProperty(value = "设备id列表") @ApiModelProperty(value = "设备id列表")
@Dict(dictTable = "zy_device", dicText = "name", dicCode = "id") @Dict(dictTable = "zy_device", dicText = "name", dicCode = "id")
private String machineIds; private String machineIds;
private String machineNames;
/** /**
* 工具id列表 * 工具id列表
*/ */
@ -105,6 +106,7 @@ public class ZyPlanProcess implements Serializable {
@ApiModelProperty(value = "工具id列表") @ApiModelProperty(value = "工具id列表")
@Dict(dictTable = "zy_tool", dicText = "name", dicCode = "id") @Dict(dictTable = "zy_tool", dicText = "name", dicCode = "id")
private String toolsIds; private String toolsIds;
private String toolsNames;
/** /**
* 成员id列表 * 成员id列表
*/ */
@ -117,11 +119,11 @@ public class ZyPlanProcess implements Serializable {
* 前导工序 * 前导工序
*/ */
@Excel(name = "前导工序", width = 15) @Excel(name = "前导工序", width = 15)
private String proProcess;
@ApiModelProperty(value = "前导工序") @ApiModelProperty(value = "前导工序")
private String proProcessName;
// @Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id") // @Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
private String proProcess;
private String proProcessName;
/** /**
* 后导工序 * 后导工序
*/ */

@ -0,0 +1,66 @@
package org.jeecg.modules.productplan.enums;
/**
* 生产计划状态枚举
*/
public enum ProductPlanStatusEnum {
UNAUDITED("0", "未审核"),
REVIEWED("1", "已审核"),
PRODUCTION("2", "生产中"),
COMPLETED("3", "已完成"),
REVOKED("8", "已撤销"),
EXCEPTION("9", "异常");
private String code;
private String val;
private ProductPlanStatusEnum(String code, String val) {
this.code = code;
this.val = val;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getVal() {
return val;
}
public void setVal(String val) {
this.val = val;
}
public static String getValueByCode(String code) {
ProductPlanStatusEnum[] values = ProductPlanStatusEnum.values();
for (ProductPlanStatusEnum type : values) {
if (type.code.equals(code)) {
return type.val;
}
}
return null;
}
public static String getCodeByValue(String value) {
ProductPlanStatusEnum[] values = ProductPlanStatusEnum.values();
for (ProductPlanStatusEnum type : values) {
if (type.val.equals(value)) {
return type.code;
}
}
return null;
}
@Override
public String toString() {
return "ProductPlanStatusEnum{" +
"code='" + code + '\'' +
", val='" + val + '\'' +
'}';
}
}

@ -17,6 +17,8 @@ import java.util.Map;
public interface IZyPlanProcessService extends IService<ZyPlanProcess> { public interface IZyPlanProcessService extends IService<ZyPlanProcess> {
List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess); List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess);
List<ZyPlanProcess> syncProductBaseProcess(ZyPlanProcess zyPlanProcess);
Map<String,Object> getPlanInfo(ZyPlanProcess zyPlanProcess); Map<String,Object> getPlanInfo(ZyPlanProcess zyPlanProcess);
List<ProcessDataVo> getTeamDatalist(ZyPlanProcess zyPlanProcess); List<ProcessDataVo> getTeamDatalist(ZyPlanProcess zyPlanProcess);

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.base.entity.ZyProcess;
import org.jeecg.modules.demo.base.service.IZyProcessService; import org.jeecg.modules.demo.base.service.IZyProcessService;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
@ -16,6 +17,7 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; import org.jeecg.modules.productplan.entity.vo.ProcessDataVo;
import org.jeecg.modules.productplan.enums.ProductPlanStatusEnum;
import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper; import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper;
import org.jeecg.modules.productplan.service.IZyPlanProcessService; import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.productplan.service.IZyProductPlanService;
@ -99,7 +101,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
//生产计划id //生产计划id
String planId = zyPlanProcess.getPlanId(); String planId = zyPlanProcess.getPlanId();
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId);
if (ObjectUtils.isEmpty(zyPlanProcess)) { if (ObjectUtils.isEmpty(zyProductPlan)) {
throw new JeecgBootException("生产计划不存在!"); throw new JeecgBootException("生产计划不存在!");
} }
@ -110,27 +112,8 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
if (ObjectUtils.isEmpty(zyProduct)) { if (ObjectUtils.isEmpty(zyProduct)) {
throw new JeecgBootException("产品不存在!"); throw new JeecgBootException("产品不存在!");
} }
List<ProcessDataVo> result = new LinkedList<>();
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId)); List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId));
//生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表
if (ObjectUtils.isEmpty(planProcessList)) {
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, zyProduct.getId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
List<ZyPlanProcess> saveList = new LinkedList<>();
productProcessesList.forEach(o -> {
ZyPlanProcess en = new ZyPlanProcess();
en.setProcessId(o.getProcessId());
en.setPlanId(planId);
saveList.add(en);
});
this.saveBatch(saveList);
//重新查询已录入工序数据
planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId));
}
}
if (!ObjectUtils.isEmpty(planProcessList)) { if (!ObjectUtils.isEmpty(planProcessList)) {
SysDepart depart = iSysDepartService.getById(departId);
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId)); List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId));
List<StationVo> stationVoList = new LinkedList<>(); List<StationVo> stationVoList = new LinkedList<>();
if (!ObjectUtils.isEmpty(stationList)) { if (!ObjectUtils.isEmpty(stationList)) {
@ -143,25 +126,51 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
stationVoList.add(stationVo); stationVoList.add(stationVo);
}); });
} }
if (!ObjectUtils.isEmpty(planProcessList)) {
planProcessList.forEach(e -> { planProcessList.forEach(e -> {
// ProcessDataVo vo = new ProcessDataVo(); e.setStationIdList(stationVoList);
// vo.setId(e.getId());
// vo.setPlanId(planId);
// vo.setProcessId(e.getProcessId());
// e.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName());
// vo.setProductName("产品名称");
// vo.setWorkOrderId(workOrderId);
// vo.setDepartId(departId);
// vo.setDepartName(depart.getDepartName());
// vo.setStationList(stationVoList);
// vo.setStationId(stationVoList);
// e.setStationIdList(stationVoList);
// result.add(vo);
}); });
} }
}
return planProcessList; return planProcessList;
} }
@Override
public List<ZyPlanProcess> syncProductBaseProcess(ZyPlanProcess zyPlanProcess) {
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
//生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表
if (ObjectUtils.isEmpty(planProcessList)) {
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(zyPlanProcess.getPlanId());
if (ObjectUtils.isEmpty(zyProductPlan)) {
throw new JeecgBootException(zyProductPlan.getId() + "生产计划不存在");
}
ZyProduct zyProduct = iZyProductService.getOne(new LambdaQueryWrapper<ZyProduct>()
.eq(ZyProduct::getWorkOrderId, zyProductPlan.getProductCode())
.eq(ZyProduct::getProductCode, zyProductPlan.getProductNo()));
if (ObjectUtils.isEmpty(zyProduct)) {
throw new JeecgBootException(zyProductPlan.getProductNo() + "产品不存在");
}
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>()
.eq(ZyProductProcess::getProductId, zyProduct.getId()));
if (!ObjectUtils.isEmpty(productProcessesList)) {
List<ZyPlanProcess> saveList = new LinkedList<>();
productProcessesList.forEach(o -> {
ZyPlanProcess en = new ZyPlanProcess();
en.setProcessId(o.getProcessId());
ZyProcess zyProcess = iZyProcessService.getById(o.getProcessId());
en.setProcessName(zyProcess.getProcessName());
en.setPlanId(zyPlanProcess.getPlanId());
saveList.add(en);
});
this.saveBatch(saveList);
}
}
return null;
}
@Override @Override
public Map<String, Object> getPlanInfo(ZyPlanProcess planProcess) { public Map<String, Object> getPlanInfo(ZyPlanProcess planProcess) {
//生产计划id //生产计划id
@ -178,8 +187,6 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
if (ObjectUtils.isEmpty(zyProduct)) { if (ObjectUtils.isEmpty(zyProduct)) {
throw new JeecgBootException("产品不存在!"); throw new JeecgBootException("产品不存在!");
} }
// 工单信息 // 工单信息
WorkOrder workOrder = iWorkOrderService.getOne(new LambdaQueryWrapper<WorkOrder>().eq(WorkOrder::getProductCode, zyProductPlan.getProductCode())); WorkOrder workOrder = iWorkOrderService.getOne(new LambdaQueryWrapper<WorkOrder>().eq(WorkOrder::getProductCode, zyProductPlan.getProductCode()));
if (ObjectUtils.isEmpty(workOrder)) if (ObjectUtils.isEmpty(workOrder))
@ -193,27 +200,35 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
ZyOrders zyOrders = iZyOrdersService.getOne(new LambdaQueryWrapper<ZyOrders>().eq(ZyOrders::getId, ordersId)); ZyOrders zyOrders = iZyOrdersService.getOne(new LambdaQueryWrapper<ZyOrders>().eq(ZyOrders::getId, ordersId));
if (ObjectUtils.isEmpty(zyOrders)) throw new JeecgBootException(ordersId + "订单信息不存在"); if (ObjectUtils.isEmpty(zyOrders)) throw new JeecgBootException(ordersId + "订单信息不存在");
// ZyClothsStyle zyClothsStyle = iZyClothsStyleService.getById(orderGoods.getStyleId());
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put("productCode", zyProduct.getProductCode());
result.put("productName", zyProduct.getProductName()); result.put("productName", zyProduct.getProductName());
result.put("productOrg", zyProductPlan.getProductOrg()); result.put("productOrg", zyProductPlan.getProductOrg());
result.put("productName", zyProductPlan.getProductName()); result.put("productName", zyProductPlan.getProductName());
result.put("productNo", zyProductPlan.getProductNo()); result.put("productNo", zyProductPlan.getProductNo());
SysDepart depart = iSysDepartService.getById(departId); SysDepart depart = iSysDepartService.getById(departId);
Groupx groupx = iGroupxService.getById(zyProductPlan.getTeamId()); Groupx groupx = iGroupxService.getById(zyProductPlan.getTeamId());
result.put("Workshop", depart.getDepartName()); result.put("workshop", depart.getDepartName());
result.put("team", groupx.getGroupName()); result.put("team", groupx.getGroupName());
result.put("teamLade", groupx.getEnterprisesManager()); result.put("teamLade", iSysUserService.getById(groupx.getEnterprisesManager()).getRealname());
result.put("productType", groupx.getEnterprisesManager()); result.put("productType", groupx.getEnterprisesManager());
result.put("workTime", zyProductPlan.getWorkTime()); result.put("workTime", zyProductPlan.getWorkTime());
result.put("duration", zyProductPlan.getDuration()); result.put("duration", zyProductPlan.getDuration());
result.put("speedUp", zyProductPlan.getSpeedUp()); if ("0".equals(zyProductPlan.getSpeedUp())) {
result.put("speedUp", "否");
} else {
result.put("speedUp", "是");
}
result.put("orderTime", zyOrders.getOrderTime()); result.put("orderTime", zyOrders.getOrderTime());
SysDepart depart1 = iSysDepartService.getById(zyOrders.getSalesEnterpriseId()); SysDepart depart1 = iSysDepartService.getById(zyOrders.getSalesEnterpriseId());
//销售门店 //销售门店
result.put("salesEnterprise", depart1.getDepartName()); result.put("salesEnterprise", depart1.getDepartName());
result.put("auditBy", zyProductPlan.getAuditBy()); SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, zyProductPlan.getAuditBy()));
result.put("auditBy", sysUser.getRealname());
result.put("status", ProductPlanStatusEnum.getValueByCode(zyProductPlan.getStatus().toString()));
result.put("auditTimr", zyProductPlan.getAuditTimr()); result.put("auditTimr", zyProductPlan.getAuditTimr());
ZyClothsStyle zyClothsStyle = iZyClothsStyleService.getById(orderGoods.getStyleId());
result.put("productType", zyClothsStyle.getStyleNames());
return result; return result;
} }

@ -4,6 +4,8 @@ package org.jeecg.modules.team.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.team.entity.StationMachine; import org.jeecg.modules.team.entity.StationMachine;
import java.util.List;
/** /**
* @Description: 工序设备管理 * @Description: 工序设备管理
* @Author: jeecg-boot * @Author: jeecg-boot
@ -12,4 +14,6 @@ import org.jeecg.modules.team.entity.StationMachine;
*/ */
public interface IStationMachineService extends IService<StationMachine> { public interface IStationMachineService extends IService<StationMachine> {
String convertByMachineId(String stationId);
} }

@ -12,4 +12,5 @@ import org.jeecg.modules.team.entity.StationTool;
*/ */
public interface IStationToolService extends IService<StationTool> { public interface IStationToolService extends IService<StationTool> {
String convertByToolId(String stationId);
} }

@ -1,10 +1,19 @@
package org.jeecg.modules.team.service.impl; package org.jeecg.modules.team.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.modules.device.entity.ZyDevice;
import org.jeecg.modules.device.service.IZyDeviceService;
import org.jeecg.modules.team.entity.StationMachine; import org.jeecg.modules.team.entity.StationMachine;
import org.jeecg.modules.team.mapper.StationMachineMapper; import org.jeecg.modules.team.mapper.StationMachineMapper;
import org.jeecg.modules.team.service.IStationMachineService; import org.jeecg.modules.team.service.IStationMachineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
/** /**
* @Description: 工序设备管理 * @Description: 工序设备管理
@ -15,4 +24,24 @@ import org.springframework.stereotype.Service;
@Service @Service
public class StationMachineServiceImpl extends ServiceImpl<StationMachineMapper, StationMachine> implements IStationMachineService { public class StationMachineServiceImpl extends ServiceImpl<StationMachineMapper, StationMachine> implements IStationMachineService {
@Autowired
private IZyDeviceService iZyDeviceService;
@Override
public String convertByMachineId(String stationId) {
List<StationMachine> machineList = this.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, stationId));
StringBuffer machineNames = new StringBuffer();
String machineNamesStr = "";
if (!ObjectUtils.isEmpty(machineList)) {
machineList.forEach(e -> {
ZyDevice zyDevice = iZyDeviceService.getById(e.getMachineId());
if (!ObjectUtils.isEmpty(zyDevice)) {
machineNames.append(zyDevice.getName()).append(",");
}
});
}
machineNamesStr = machineNames.toString();
machineNamesStr = machineNames.substring(0, machineNamesStr.length() - 1);
return machineNamesStr;
}
} }

@ -1,10 +1,17 @@
package org.jeecg.modules.team.service.impl; package org.jeecg.modules.team.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.team.entity.StationTool; import org.jeecg.modules.team.entity.StationTool;
import org.jeecg.modules.team.mapper.StationToolMapper; import org.jeecg.modules.team.mapper.StationToolMapper;
import org.jeecg.modules.team.service.IStationToolService; import org.jeecg.modules.team.service.IStationToolService;
import org.jeecg.modules.zytool.zytool.entity.ZyTool;
import org.jeecg.modules.zytool.zytool.service.IZyToolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.List;
/** /**
* @Description: 工序工具管理 * @Description: 工序工具管理
@ -15,4 +22,24 @@ import org.springframework.stereotype.Service;
@Service @Service
public class StationToolServiceImpl extends ServiceImpl<StationToolMapper, StationTool> implements IStationToolService { public class StationToolServiceImpl extends ServiceImpl<StationToolMapper, StationTool> implements IStationToolService {
@Autowired
private IZyToolService iZyToolService;
@Override
public String convertByToolId(String stationId) {
List<StationTool> toolList = this.list(new LambdaQueryWrapper<StationTool>().eq(StationTool::getStationId, stationId));
StringBuffer toolNames = new StringBuffer();
String toolNamesStr = "";
if (!ObjectUtils.isEmpty(toolList)) {
toolList.forEach(e -> {
ZyTool zyTool = iZyToolService.getById(e.getToolsId());
if (!ObjectUtils.isEmpty(zyTool)) {
toolNames.append(zyTool.getName()).append(",");
}
});
}
toolNamesStr = toolNames.toString();
toolNamesStr = toolNamesStr.substring(0, toolNamesStr.length() - 1);
return toolNamesStr;
}
} }

Loading…
Cancel
Save