优化电测试-增加生产记录

tags/yfai-pcn-ext-v2.3
臧学普 7 months ago
parent d709c834d5
commit ec226284ea

@ -9,6 +9,7 @@ import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.model.MesReturnModel;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -40,6 +41,11 @@ public class DcsForEquipmentServiceImpl implements IDcsForEquipmentService {
@Autowired
private MesProductionRecordRepository recordRao;
@Autowired
private MesPartSapRepository partSapRao;
@Override
public String doGetConsoleItemCode(String barcode, String custCode, String custPlantCode, String workCenterCode, String workCellCode) {
@ -93,6 +99,7 @@ public class DcsForEquipmentServiceImpl implements IDcsForEquipmentService {
custPartNo = customerPartList.get(0).getCustPartNo();
}
}
log.info("castle-返回的客户零件号为:{}",custPartNo);
return custPartNo;
}
return "";
@ -130,11 +137,25 @@ public class DcsForEquipmentServiceImpl implements IDcsForEquipmentService {
}
if (StringUtils.isNotBlank(erpPartNo)){
//更新条码表的状态
//插入生产记录表
DdlPackBean erpPartPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(erpPartNo,"erpPartNo",erpPartPackBean);
List<MesPartSap> partSapList = partSapRao.findByHqlTopWhere(erpPartPackBean, 1);
String partName = "";
if (!partSapList.isEmpty()){
partName = partSapList.get(0).getPartName();
}
//插入生产记录表 reportType 无需汇报 status 无需汇报
MesProductionRecord mesProductionRecord = new MesProductionRecord();
mesProductionRecord.setPartNo(erpPartNo);
mesProductionRecord.setPartName(partName);
mesProductionRecord.setProductSn(barcode);
mesProductionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue());
mesProductionRecord.setReportType(MesExtEnumUtil.MES_REPORT_TYPE.NO_REPORT.getValue());
mesProductionRecord.setOrganizeCode(organizeCode);
mesProductionRecord.setRemark("电测试:"+result);
ConvertBean.saveOrUpdate(mesProductionRecord,"电测试");
recordRao.insert(mesProductionRecord);
//插入装配件生产记录表
}
return "1";
}

Loading…
Cancel
Save