线体管理修改

master
shaoyong 8 months ago
parent 10a57885f0
commit 2cad02ff7b

@ -83,6 +83,8 @@ public class MesLine extends BaseEntity {
private List<String> processList;
private List<BigDecimal> qualityList;
public void setId(String id) {
this.id = id;
}
@ -179,6 +181,14 @@ public class MesLine extends BaseEntity {
this.processList = processList;
}
public List<BigDecimal> getQualityList() {
return qualityList;
}
public void setQualityList(List<BigDecimal> qualityList) {
this.qualityList = qualityList;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -1,5 +1,6 @@
package com.op.mes.service.impl;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
@ -48,10 +49,12 @@ public class MesLineServiceImpl implements IMesLineService {
//查询时回显线体工艺数据
List<MesLineProcess> mesList = mesLineProcessService.selectMesLineProcessByBelongTo(id);
List<String> processList = mesList.stream().map(MesLineProcess::getProcessName).collect(Collectors.toList());
List<BigDecimal> qualityList = mesList.stream().map(MesLineProcess::getQuality).collect(Collectors.toList());
MesLine mesLine = mesLineMapper.selectMesLineById(id);
//设置线体数据
if (!CollectionUtils.isEmpty(processList)) {
mesLine.setProcessList(processList);
mesLine.setQualityList(qualityList);
}
return mesLine;
}
@ -101,6 +104,7 @@ public class MesLineServiceImpl implements IMesLineService {
mesLine.setUpdateTime(DateUtils.getNowDate());
mesLine.setUpdateBy(SecurityUtils.getUsername());
List<String> processList = mesLine.getProcessList();
List<BigDecimal> qualityList = mesLine.getQualityList();
int flag = 0;
if (!CollectionUtils.isEmpty(processList)) {
//删除旧的工艺项
@ -114,10 +118,11 @@ public class MesLineServiceImpl implements IMesLineService {
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
for (String processName : processList ) {
for (int i = 0; i < processList.size(); i++) {
MesLineProcess mesLineProcess = new MesLineProcess();
mesLineProcess.setBelongTo(belongTo);
mesLineProcess.setProcessName(processName);
mesLineProcess.setProcessName(processList.get(i));
mesLineProcess.setQuality(qualityList.get(i));
mesLineProcess.setLineCode(lineCode);
mesLineProcess.setLineName(lineName);
mesLineProcess.setFactoryCode(factoryCode);

Loading…
Cancel
Save