tags/yfai-pcn-ext-v1.0
gsz 11 months ago
commit d0a6298ecc

@ -17,7 +17,7 @@ public interface IMesProductionRecordService {
/**
*
* @param serialNo
* @param productSn
* @param sourceId
* @param dataSource ,,
*
@ -27,7 +27,7 @@ public interface IMesProductionRecordService {
* DATA_SOURCE30(30, "非排序装配件");
*
*/
Map<String, Object> checkSnTimeliness(String organizeCode, String serialNo, Long sourceId, Integer dataSource, Boolean isAssembly);
Map<String, Object> checkSnTimeliness(String organizeCode, String productSn, Long sourceId, Integer dataSource);
@ApiOperation(value = "根据零件条码查询加工记录信息")
List<MesProductionRecord> findProductionRecordList(String organizeCode, String productSn);
@ -35,4 +35,10 @@ public interface IMesProductionRecordService {
@ApiOperation(value = "根据零件条码,物料编码,工序代码,工艺代码查询加工记录信息")
List<MesProductionRecord> findProductionRecordList(String organizeCode, String productSn, String partNo, String processCode, String craftCode);
@ApiOperation(value = "根据零件条码,物料编码,工序代码,工艺代码查询加工记录信息")
List<MesProductionRecord> findProductionRecordList(String organizeCode, String productSn, String partNo, String craftCode);
void updateProductionRecord(String organizeCode, String userName, String sn);
void updateProductionRecord(String organizeCode, String userName, String sn, String errorMsg);
}

@ -1,6 +1,7 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.schedulejob;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesWorkOrderService;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
@ -45,6 +46,8 @@ public class MesReportNoSortJob extends BaseMesScheduleJob {
@Autowired
private MesProductionRecordRepository productionRecordRao;
@Autowired
private IMesProductionRecordService productionRecordService;
public MesReportNoSortJob() {
super(MesReportNoSortJob.class, "非排序报工JOB");
@ -85,7 +88,7 @@ public class MesReportNoSortJob extends BaseMesScheduleJob {
} catch (ImppBusiException e) {
LOGGER.error("条码:{}报工失败", unReportMesProduceSn.get(0).getProductSn(), e.getErrorDetail());
//updateProductionRecord(organizeCode, userName, unReportMesProduceSn.get(0).getProductSn(), e.getErrorDetail());
productionRecordService.updateProductionRecord(organizeCode, userName, unReportMesProduceSn.get(0).getProductSn(), e.getErrorDetail());
}
}
@ -101,7 +104,7 @@ public class MesReportNoSortJob extends BaseMesScheduleJob {
} catch (ImppBusiException e) {
LOGGER.error("条码:{}报工失败", unReportMesProduceSn.get(0).getProductSn(), e.getErrorDetail());
//updateProductionRecord(organizeCode, userName, unReportMesProduceSn.get(0).getProductSn(), e.getErrorDetail());
productionRecordService.updateProductionRecord(organizeCode, userName, unReportMesProduceSn.get(0).getProductSn(), e.getErrorDetail());
}
}

@ -24,7 +24,6 @@ import cn.estsh.i3plus.pojo.mes.bean.rework.MesReworkTaskDetail;
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.ResultBean;
import lombok.extern.slf4j.Slf4j;
@ -329,7 +328,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
//更新条码质量状态
MesProduceSn sn = checkProduceSn(model.getSn(), org);
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
produceSnRepository.save(sn);
//更新检验单
@ -338,7 +337,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
}
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
model.getPartInspection().setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.NORMAL.getValue());
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
partInspectionRepository.save(model.getPartInspection());
//移库 转正常、放行8000移至2000
@ -352,7 +351,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
//生成返工单 根据责任方库区对应关系选择哪个责任方就移动到哪个库区8000移至8002/8003
GenSerialNoModel serialNoModel = new GenSerialNoModel("NC_REWORK");
serialNoModel.setPartNo(part.getPartNo());
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1);
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getPartInspection().getModifyUser(), org, 1);
String rework = "";
if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) {
rework = (rb.getResultList().get(0)).toString();
@ -367,7 +366,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
reworkTask.setPartInspectionId(model.getPartInspection().getId());
reworkTask.setOrganizeCode(org);
reworkTask.setType(model.getPartInspection().getSourceType());
ConvertBean.serviceModelInitialize(reworkTask, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelInitialize(reworkTask, model.getPartInspection().getModifyUser());
reworkTaskRepository.save(reworkTask);
//生成返工单明细
@ -379,7 +378,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
taskDetail.setStatus(MesExtEnumUtil.REWORK_TASK_DETAIL_STATUS.REWORK_TASK_DETAIL_STATUS_10.getValue());
taskDetail.setPartInspectionDetailId(detail.getId());
taskDetail.setOrganizeCode(org);
ConvertBean.serviceModelInitialize(taskDetail, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelInitialize(taskDetail, model.getPartInspection().getModifyUser());
taskDetailList.add(taskDetail);
}
@ -399,7 +398,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
//更新条码质量状态
MesProduceSn sn = checkProduceSn(model.getSn(), org);
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue());
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
produceSnRepository.save(sn);
//更新检验单
@ -411,7 +410,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
model.getPartInspection().setDefectTypeId(person.getId());
model.getPartInspection().setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.SCRAP.getValue());
model.getPartInspection().setRejectQty(model.getPartInspection().getQty());
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
partInspectionRepository.save(model.getPartInspection());
//移库 转报废 根据责任方库区对应关系的主数据选择哪个责任方就移动到哪个库区8000移至8002/8003
@ -424,7 +423,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
//更新条码质量状态
MesProduceSn sn = checkProduceSn(model.getSn(), org);
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
produceSnRepository.save(sn);
//更新检验单
@ -433,7 +432,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
}
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
model.getPartInspection().setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.RELEASE.getValue());
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
partInspectionRepository.save(model.getPartInspection());
@ -464,7 +463,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org,MesExtEnumUtil.MOVE_TYPE moveType) {
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
serialNoModel.setPartNo(model.getPart().getPartNo());
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1);
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getPartInspection().getModifyUser(), org, 1);
String zrsum = "";
if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) {
zrsum = (rb.getResultList().get(0)).toString();
@ -484,7 +483,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
move.setMoveType(moveType.getValue());
move.setPartInspectionId(model.getPartInspection().getId());
move.setProductSn(model.getSn());
ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelInitialize(move, model.getPartInspection().getModifyUser());
return move;
}
}

@ -2,6 +2,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
@ -14,6 +15,7 @@ import cn.estsh.i3plus.pojo.mes.repository.MesTimeEfficientCfgRepository;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.text.ParseException;
@ -58,59 +60,63 @@ public class MesProductionRecordService implements IMesProductionRecordService {
* DATA_SOURCE20(20, "非排序加工规则"),
* DATA_SOURCE30(30, "非排序装配件");
*
* @param serialNo
* @param productSn
* @param sourceId
* @param organizeCode
* @param isAssembly
* @return
*/
@Override
public Map<String, Object> checkSnTimeliness(String organizeCode, String serialNo, Long sourceId, Integer dataSource, Boolean isAssembly) {
public Map<String, Object> checkSnTimeliness(String organizeCode, String productSn, Long sourceId, Integer dataSource) {
Map<String, Object> resultMap = new HashMap<>();
//校验成功
resultMap.put(MesPcnExtConstWords.RESULT, true);
//1.根据prodRuleNoSortId 获取 非排序加工规则的 时效性数据 --- 当前的条码需要完全匹配查询的规则
DdlPackBean timelinessPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(sourceId, MesPcnExtConstWords.SOURCE_ID, timelinessPackBean);
List<MesTimeEfficientCfg> timelinessList = timeEfficientCfgRepository.findByHqlWhere(timelinessPackBean);
//2.如果timelinessList为空 且 非装配件校验 直接返回true
if (timelinessList.isEmpty() && !isAssembly){
return resultMap;
}
//查询主条码的逻辑
if (!isAssembly){
//3.根据条码获取生产加工记录结果
DdlPackBean recordPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(serialNo, MesPcnExtConstWords.PRODUCT_SN, recordPackBean);
List<MesProductionRecord> recordList = productionRecordRepository.findByHqlWhere(recordPackBean);
boolean checkedResult = checkProductSn(recordList, timelinessList);
if (!checkedResult){
resultMap.put(MesPcnExtConstWords.RESULT, false);
return resultMap;
}
}
resultMap.put(MesPcnExtConstWords.RESULT, true);//校验成功
try {
if (isAssembly){
Date now = new Date();
for (MesTimeEfficientCfg timeliness : timelinessList) {
//需要查询装配件记录表 production_assembly productionAssemblyRepository
DdlPackBean assemblyPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(serialNo,"assemblySn",assemblyPackBean);
DdlPreparedPack.getStringEqualPack(timeliness.getCraftCode(),"craftCode",assemblyPackBean);
List<MesProductionAssembly> productionAssemblyList = productionAssemblyRepository.findByHqlWhere(assemblyPackBean);
MesProductionAssembly mesProductionAssembly = productionAssemblyList.get(0);
String productDateTimeStr = mesProductionAssembly.getCreateDatetime();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date productDateTime = sdf.parse(productDateTimeStr);
//时差
int minDiff = (int) ((now.getTime() - productDateTime.getTime())/(60 * 1000));
}
//1.根据prodRuleNoSortId 获取 非排序加工规则的 时效性数据 --- 当前的条码需要完全匹配查询的规则
DdlPackBean timelinessPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(sourceId, MesPcnExtConstWords.SOURCE_ID, timelinessPackBean);
List<MesTimeEfficientCfg> timelinessList = timeEfficientCfgRepository.findByHqlWhere(timelinessPackBean);
//2.如果timelinessList为空 且 非装配件校验 直接返回true
if (CollectionUtils.isEmpty(timelinessList)) return resultMap;
//3.根据条码获取生产加工记录结果
List<MesProductionRecord> productionRecordList = findProductionRecordList(organizeCode, productSn);
if (CollectionUtils.isEmpty(productionRecordList)) return backResultMap(resultMap, String.format("零件条码[%s]时效性验证失败,未查询到加工记录信息!", productSn));
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT);
for (MesTimeEfficientCfg timeliness : timelinessList) {
if (null == timeliness || StringUtils.isEmpty(timeliness.getCraftCode())) continue;
List<MesProductionRecord> filterList;
//时效性规则 零件号不为空或者为空 过滤数据
if (!StringUtils.isEmpty(timeliness.getPartNo())) filterList = productionRecordList.stream().filter(o -> o.getPartNo().equals(timeliness.getPartNo()) && o.getCraftCode().equals(timeliness.getCraftCode())).sorted(Comparator.comparing(MesProductionRecord::getCreateDatetime).reversed()).collect(Collectors.toList());
else filterList = productionRecordList.stream().filter(item -> item.getCraftCode().equals(timeliness.getCraftCode())).sorted(Comparator.comparing(MesProductionRecord::getCreateDatetime).reversed()).collect(Collectors.toList());
if (CollectionUtils.isEmpty(filterList)) return backResultMap(resultMap, String.format("零件条码[%s]时效性零件号[%s]工艺[%s]验证失败,未查询到加工记录信息!", productSn, timeliness.getPartNo(), timeliness.getCraftCode()));
//不为空 则 需要校验时效性
String completeDateTime = filterList.get(0).getCompleteDateTime();
Date productDateTime = sdf.parse(completeDateTime);
//时差
int minDiff = (int) ((now.getTime() - productDateTime.getTime())/(60 * 1000));
if (!checkTimeliness(timeliness, minDiff)) return backResultMap(resultMap, String.format("零件条码[%s]时效性零件号[%s]工艺[%s]验证失败!", productSn, timeliness.getPartNo(), timeliness.getCraftCode()));
}
} catch (ParseException e) {
throw new RuntimeException(e);
return resultMap;
} catch (Exception e) {
return backResultMap(resultMap, String.format("零件条码[%s]时效性零件号[%s]工艺[%s]验证异常:%s!", productSn, e.toString()));
}
}
private Map<String, Object> backResultMap(Map<String, Object> resultMap, String message) {
resultMap.put(MesPcnExtConstWords.RESULT, false);
resultMap.put(MesPcnExtConstWords.MESSAGE, message);
return resultMap;
}
@ -127,41 +133,6 @@ public class MesProductionRecordService implements IMesProductionRecordService {
* @param
* @return
*/
private boolean checkProductSn(List<MesProductionRecord> recordList,List<MesTimeEfficientCfg> timelinessList) {
try {
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (MesTimeEfficientCfg timeliness : timelinessList) {
List<MesProductionRecord> records = new ArrayList<>();
//时效性规则 零件号不为空
if (!StringUtils.isEmpty(timeliness.getPartNo())){
records = recordList.stream().filter(item -> item.getPartNo().equals(timeliness.getPartNo())).sorted(Comparator.comparing(MesProductionRecord::getCompleteDateTime)).collect(Collectors.toList());
}
//时效性规则 工艺不为空时
if (!StringUtils.isEmpty(timeliness.getCraftCode())){
records = recordList.stream().filter(item -> item.getCraftCode().equals(timeliness.getCraftCode())).sorted(Comparator.comparing(MesProductionRecord::getCompleteDateTime)).collect(Collectors.toList());
}
if (records.isEmpty()){
return false;
}
//不为空 则 需要校验时效性
MesProductionRecord record = records.get(0);
String completeDateTime = record.getCompleteDateTime();
Date productDateTime = sdf.parse(completeDateTime);
//时差
int minDiff = (int) ((now.getTime() - productDateTime.getTime())/(60 * 1000));
if (!checkTimeliness(timeliness, minDiff)){
return false;
}
}
} catch (ParseException e) {
throw new RuntimeException(e);
}
return false;
}
private boolean checkTimeliness(MesTimeEfficientCfg timeliness, int minDiff) {
String matchRule = timeliness.getMatchRule();
Double minValue = timeliness.getMinValue();
@ -206,5 +177,29 @@ public class MesProductionRecordService implements IMesProductionRecordService {
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.PRODUCT_SN, MesPcnExtConstWords.PART_NO, MesPcnExtConstWords.PROCESS_CODE, MesPcnExtConstWords.CRAFT_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn, partNo, processCode, craftCode});
}
@Override
public List<MesProductionRecord> findProductionRecordList(String organizeCode, String productSn, String partNo, String craftCode) {
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(productSn) || StringUtils.isEmpty(partNo) || StringUtils.isEmpty(craftCode)) return null;
return productionRecordRepository.findByProperty(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.PRODUCT_SN, MesPcnExtConstWords.PART_NO, MesPcnExtConstWords.CRAFT_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn, partNo, craftCode});
}
@Override
public void updateProductionRecord(String organizeCode, String userName, String sn) {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(sn, "productSn", ddlPackBean);
productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus"},
new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue() },ddlPackBean);
}
@Override
public void updateProductionRecord(String organizeCode, String userName, String sn, String errorMsg) {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(sn, "productSn", ddlPackBean);
productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"},
new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), errorMsg },ddlPackBean);
}
}

@ -426,8 +426,8 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(sn, "custSn", ddlPackBean);
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus"},
new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_50.getValue()},ddlPackBean);
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime"},
new Object[]{userName, TimeTool.getNowTime(true)},ddlPackBean);
}
@Override
public void doProductReportByRecord(MesProductionRecord productionRecord, String organizeCode, String userName) {
@ -436,7 +436,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
//根据物料获取已发布的工单
MesWorkOrder oldMesWorkOrder = getMesWorkOrder(productionRecord, organizeCode);
if (oldMesWorkOrder == null) {
//updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
return;
}
@ -451,7 +451,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
LOGGER.info("此次报工的条码【{}】,工单【{}】", productionRecord.getProductSn(), productionRecord.getWorkOrderNo());
List<MesWorkOrder> oldMesWorkOrders = getMesWorkOrders(productionRecord, organizeCode, null);
if (CollectionUtils.isEmpty(oldMesWorkOrders)) {
//updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
return;
}
report(productionRecord, organizeCode, userName, oldMesWorkOrders.get(0));
@ -633,7 +633,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPreparedPack.getStringEqualPack(productionRecord.getWorkOrderNo(), "workOrderNo", ddlPackBean);
}
DdlPreparedPack.getInPackList(list, "workOrderStatus", ddlPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"createDatetime"}, ddlPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
// 新增班次逻辑
//DdlPreparedPack.
List<MesWorkOrder> oldMesWorkOrders = workOrderRepository.findByHqlWhere(ddlPackBean);
@ -680,6 +680,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
}
@Override
public List<MesProductionRecord> getUnReportMesProduceSn(String organizeCode) {
//1.获取生产加工记录production_record表中report_status为待汇报状态的工单
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
List<Integer> statusList = Stream.of(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue()).collect(Collectors.toList());
@ -690,10 +691,17 @@ public class MesWorkOrderService implements IMesWorkOrderService {
List<String> centerList = Arrays.asList(workCenterCodes.split(","));
DdlPreparedPack.getInPackList(centerList, "workCenterCode",ddlPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"createDatetime"}, ddlPackBean);
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 1);
return mesProductionRecordList;
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 10);
List<MesProductionRecord> recordList = new ArrayList<>();
// 根据零件号分组
if(!CollectionUtils.isEmpty(mesProductionRecordList)) {
Map<String, List<MesProductionRecord>> map = mesProductionRecordList.stream().collect(Collectors.groupingBy(MesProductionRecord::getPartNo));
map.forEach((k, v) -> {
recordList.add(v.get(0));
});
}
return recordList;
}
@Override
@ -708,10 +716,17 @@ public class MesWorkOrderService implements IMesWorkOrderService {
List<String> centerList = Arrays.asList(workCenterCodes.split(","));
DdlPreparedPack.getInPackList(centerList, "workCenterCode",ddlPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"createDatetime"}, ddlPackBean);
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 1);
return mesProductionRecordList;
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 10);
List<MesProductionRecord> recordList = new ArrayList<>();
// 根据零件号分组
if(!CollectionUtils.isEmpty(mesProductionRecordList)) {
Map<String, List<MesProductionRecord>> map = mesProductionRecordList.stream().collect(Collectors.groupingBy(MesProductionRecord::getPartNo));
map.forEach((k, v) -> {
recordList.add(v.get(0));
});
}
return recordList;
}

@ -1,19 +1,48 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.equiplog;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesScanMonitorContext;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.swslog.ISwsWriteDbLogService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellScanMonitorLog;
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellScanMonitorLogRepository;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class MesWorkCellScanMonitorLogExtService implements ISwsWriteDbLogService {
@Override
public void doWriteDbLog(StationResultBean resultBean) {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private MesWorkCellScanMonitorLogRepository workCellScanMonitorLogRepository;
@Override
public void doWriteDbLog(StationResultBean resultBean) {
//获取上下文工位扫描监控信息
MesScanMonitorContext scanMonitorContext = productionProcessContextStepService.getScanMonitorContext(resultBean.getOrganizeCode(), resultBean.getWorkCenterCode(), resultBean.getWorkCellCode());
if (null == scanMonitorContext) {
log.info("工厂{}生产线{}工位{}: MesWorkCellScanMonitorLogExtService --- 上下文当前不存在工位扫描监控信息 --- {}", resultBean.getOrganizeCode(), resultBean.getWorkCenterCode(), resultBean.getWorkCellCode(), resultBean.toWriteDbString());
return;
}
MesWorkCellScanMonitorLog workCellScanMonitorLog = new MesWorkCellScanMonitorLog();
BeanUtils.copyProperties(scanMonitorContext, workCellScanMonitorLog);
workCellScanMonitorLog.setScanInfo(resultBean.getScanInfo());
workCellScanMonitorLog.setMessage(resultBean.getMessage());
workCellScanMonitorLog.setMessageType(MesExtEnumUtil.WORK_CELL_SCAN_MONITOR_MESSAGE_TYPE.codeOfValue(resultBean.getDataType()));
workCellScanMonitorLog.setLogType(resultBean.getLogType());
workCellScanMonitorLog.setServiceFlag(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
ConvertBean.serviceModelInitialize(workCellScanMonitorLog, resultBean.getUserInfo());
workCellScanMonitorLogRepository.insert(workCellScanMonitorLog);
}

@ -55,6 +55,9 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
@Autowired
private IMesProdRuleCfgExtService prodRuleCfgExtService;
@Autowired
private IMesProductionRecordService productionRecordService;
@Override
public StepResult execute(StationRequestBean reqBean) {
@ -109,7 +112,7 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
//判断是否存在未消费的装配件条码
Optional<MesEquipVariableCollectContext> optional = equipVariableCollectContextList.stream().filter(o -> (null != o && o.getIsConsume().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
if (CollectionUtils.isEmpty(prodRuleContextList) || (null != optional && optional.isPresent()))
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(assemblySn), stepResult, String.format("上下文中的装配件条码%s匹配失败!", assemblySn));
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(assemblySn), stepResult, String.format("上下文中的装配件条码%s匹配失败!%s", assemblySn, StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg()));
//保存上下文产品加工规则信息集合
productionDispatchContextStepService.saveProdRuleDataContext(reqBean, prodRuleContextList);
@ -190,8 +193,26 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
//匹配失败
if (CollectionUtils.isEmpty(filterList)) continue;
//前道防错
if (!StringUtils.isEmpty(filterList.get(0).getProductSnId()) && !StringUtils.isEmpty(productionAssemblyNosortContext.getPreCraftCode())) {
if (CollectionUtils.isEmpty(productionRecordService.findProductionRecordList(reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue(), productionAssemblyNosortContext.getPartNo(), productionAssemblyNosortContext.getPreCraftCode()))) {
stepResult.msg(String.format("%s%s", StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg(),
String.format("零件条码[%s]前道防错零件号[%s]工艺[%s]验证失败,未查询到加工记录信息!", equipVariableCollectContext.getEquipVariableValue(), productionAssemblyNosortContext.getPartNo(), productionAssemblyNosortContext.getPreCraftCode())));
continue;
}
}
//时效性验证
if (!StringUtils.isEmpty(filterList.get(0).getProductSnId())) {
Map<String, Object> result = productionRecordService.checkSnTimeliness(reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue(), filterList.get(0).getSourceId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE30.getValue());
if (!(Boolean)result.get(MesPcnExtConstWords.RESULT)) {
stepResult.msg(String.format("%s%s", StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg(), result.get(MesPcnExtConstWords.MESSAGE)));
continue;
}
}
//装配件清单该数据标记已装配
productionAssemblyNosortContext.assemblyStatus().assemblySn(equipVariableCollectContext.getEquipVariableValue());
productionAssemblyNosortContext.assemblyStatus().assemblySn(equipVariableCollectContext.getEquipVariableValue()).productSnId(filterList.get(0).getProductSnId());
}

@ -22,6 +22,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -127,7 +128,8 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
if (result) return execDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(assemblySn),
stepResult.nextTriggerEvent(MesPcnExtConstWords.NEXT_TRIGGER_EVENT_ASSEMBLY), false, MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, String.format("上下文中的装配件条码%s匹配成功!", assemblySn));
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(assemblySn), stepResult.nextTriggerEvent(MesPcnExtConstWords.NEXT_TRIGGER_EVENT_ASSEMBLY), String.format("上下文中的装配件条码%s匹配失败!", assemblySn));
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(assemblySn),
stepResult.nextTriggerEvent(MesPcnExtConstWords.NEXT_TRIGGER_EVENT_ASSEMBLY), String.format("上下文中的装配件条码%s匹配失败!%s", assemblySn, StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg()));
}
@ -183,9 +185,23 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
//匹配失败
if (CollectionUtils.isEmpty(filterList)) continue;
//TODO 判断类型 提示信息
if (!(Boolean) productionRecordService.checkSnTimeliness(
reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue(), filterList.get(0).getSourceId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE30.getValue(), true).get(MesPcnExtConstWords.RESULT)) continue;
//前道防错
if (!StringUtils.isEmpty(filterList.get(0).getProductSnId()) && !StringUtils.isEmpty(productionAssemblyNosortContext.getPreCraftCode())) {
if (CollectionUtils.isEmpty(productionRecordService.findProductionRecordList(reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue(), productionAssemblyNosortContext.getPartNo(), productionAssemblyNosortContext.getPreCraftCode()))) {
stepResult.msg(String.format("%s%s", StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg(),
String.format("零件条码[%s]前道防错零件号[%s]工艺[%s]验证失败,未查询到加工记录信息!", equipVariableCollectContext.getEquipVariableValue(), productionAssemblyNosortContext.getPartNo(), productionAssemblyNosortContext.getPreCraftCode())));
continue;
}
}
//时效性验证
if (!StringUtils.isEmpty(filterList.get(0).getProductSnId())) {
Map<String, Object> result = productionRecordService.checkSnTimeliness(reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue(), filterList.get(0).getSourceId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE30.getValue());
if (!(Boolean)result.get(MesPcnExtConstWords.RESULT)) {
stepResult.msg(String.format("%s%s", StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg(), result.get(MesPcnExtConstWords.MESSAGE)));
continue;
}
}
//匹配成功
equipVariableCollectContext.isConsume();

@ -12,7 +12,6 @@ import cn.estsh.i3plus.pojo.mes.bean.MesProductionAssembly;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesProductionAssemblyRepository;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import lombok.extern.slf4j.Slf4j;
@ -133,8 +132,8 @@ public class MesAssemblySaveNosortStepService extends BaseStepService {
productionAssembly.setCustSn(productionPsOutContext.getCustSn());
}
//TODO 赋开模记录ID
//productionAssembly.setMouldRecordId();
MesScanMonitorContext scanMonitorContext = productionProcessContextStepService.doHandleScanMonitorContext(reqBean, true);
if (null != scanMonitorContext) productionAssembly.setMouldRecordId(scanMonitorContext.getMouldRecordId());
productionAssembly.setOrganizeCode(reqBean.getOrganizeCode());
ConvertBean.serviceModelInitialize(productionAssembly, reqBean.getUserInfo());

@ -197,11 +197,14 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
"请检查非排序产品加工规则信息,根据设备[%s]进料零件条码[%s]查询到[%s]条加工规则配置信息,无法显示出装配件清单!", cellEquipContext.getEquipmentName(), productionPsInContext.getProductSn(), CollectionUtils.isEmpty(filterList) ? MesPcnExtConstWords.ZERO : filterList.size()));
}
if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !(Boolean) productionRecordService.checkSnTimeliness(
reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue(), false).get(MesPcnExtConstWords.RESULT)) {
if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(productionPsInContext.getProductSn()), stepResult, String.format("请检查进料主条码信息,进料主条码[%s]时效性验证不通过!", productionPsInContext.getProductSn()));
//时效性验证
if (!StringUtils.isEmpty(productionPsInContext.getPartNo())) {
Map<String, Object> result = productionRecordService.checkSnTimeliness(reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), filterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue());
if (!(Boolean)result.get(MesPcnExtConstWords.RESULT)) {
if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(productionPsInContext.getProductSn()), stepResult, (String) result.get(MesPcnExtConstWords.MESSAGE));
}
}
//【非排序线】获取产品加工规则对应的装配件信息
@ -261,11 +264,14 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
if (CollectionUtils.isEmpty(innerfilterList) || innerfilterList.size() > 1) continue;
if (!StringUtils.isEmpty(productionPsInContext.getPartNo()) && !(Boolean) productionRecordService.checkSnTimeliness(
reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), innerfilterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue(), false).get(MesPcnExtConstWords.RESULT)) {
if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(productionPsInContext.getProductSn()), stepResult, String.format("请检查进料主条码信息,进料主条码[%s]时效性验证不通过!", productionPsInContext.getProductSn()));
//时效性验证
if (!StringUtils.isEmpty(productionPsInContext.getPartNo())) {
Map<String, Object> result = productionRecordService.checkSnTimeliness(reqBean.getOrganizeCode(), productionPsInContext.getProductSn(), innerfilterList.get(0).getId(), MesExtEnumUtil.TIME_DATA_SOURCE.DATA_SOURCE20.getValue());
if (!(Boolean)result.get(MesPcnExtConstWords.RESULT)) {
if (productionPsInContext.getMessageSource().compareTo(MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue()) == 0) productionPsInContext.busiCheckToDelete();
else productionPsInContextList.forEach(o -> o.busiCheckToDelete());
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(productionPsInContext.getProductSn()), stepResult, (String) result.get(MesPcnExtConstWords.MESSAGE));
}
}
productionPartContext.foreignKey(productionPsInContext.foreignKey(foreignKey += 1).getForeignKey());

@ -18,6 +18,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesDefectType;
import cn.estsh.i3plus.pojo.mes.bean.MesPartSap;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection;
import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspectionDetail;
@ -108,6 +109,8 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
Long id = snowflakeIdMaker.nextId();
partInspection.setWorkCenterCode(reqBean.getWorkCenterCode());
partInspection.setSourceType(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue());
partInspection.setPartNo(mesProduceSn.getPartNo());
partInspection.setPartName(mesProduceSn.getPartName());
partInspection.setDefectTypeCode(mesDefectType.getDefectTypeCode());
@ -121,6 +124,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
partInspection.setRejectQty(mesProduceSn.getQty().intValue());
partInspection.setShiftCode(mesProduceSn.getShiftCode());
partInspection.setSn(mesProduceSn.getProductSn());
partInspection.setOrganizeCode(reqBean.getOrganizeCode());
partInspection.setQty(mesProduceSn.getQty().intValue());
partInspection.setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue());
partInspection.setId(id);
@ -134,6 +138,16 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
model.setPartInspection(partInspection);
model.setType(partInspection.getSourceType());
if (!Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) {
model.setType(MesExtEnumUtil.NC_TYPE.SCRAP.getValue());
} else if (!Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SUSPICIOUS.getValue(), result)) {
model.setType(MesExtEnumUtil.NC_TYPE.RELEASE.getValue());
}
MesPartSap mesPartSap = new MesPartSap();
mesPartSap.setPartNo(mesProduceSn.getPartNo());
model.setPart(mesPartSap);
model.setPartInspectionDetailList(Arrays.asList(mesPartInspectionDetail));
ncProcessingService.saveNc(model, reqBean.getOrganizeCode());
});

@ -32,7 +32,7 @@ public class MesProductionDataSaveStepService extends BaseStepService {
((IStepService) SpringContextsUtil.getBean("mesProductSnSaveStepService")).execute(reqBean);
//加工异常处理工步【此工步未整改】
//((IStepService) SpringContextsUtil.getBean("mesProductResultErrorHandleStepService")).execute(reqBean);
((IStepService) SpringContextsUtil.getBean("mesProductResultErrorHandleStepService")).execute(reqBean);
//生成加工记录工步
((IStepService) SpringContextsUtil.getBean("mesProductionRecordGenerateStepService")).execute(reqBean);

@ -3,7 +3,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.schedulejob.BaseMesScheduleJob;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
@ -111,16 +110,12 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
private void saveProductionRecordData(StationRequestBean reqBean, String mouldNo, List<MesProdRuleContext> prodRuleContextList,
MesProductionProcessContext productionProcessContext, MesProductionPsOutContext productionPsOutContext, Map<Integer, MesProdRuleContext> prMap, MesCellEquipContext cellEquipContext) {
MesScanMonitorContext mesScanMonitorContext = productionProcessContextStepService.doHandleScanMonitorContext(reqBean, true);
MesProdRuleContext prodRuleContext = CollectionUtils.isEmpty(prMap) ? null : prMap.get(productionPsOutContext.getForeignKey());
MesProductionRecord productionRecord = new MesProductionRecord();
BeanUtils.copyProperties(productionPsOutContext, productionRecord);
productionRecord.setMouldRecordId(mesScanMonitorContext.getMouldRecordId());
productionRecord.setStartDateTime(mesScanMonitorContext.getStartDateTime());
productionRecord.setMouldNo(mouldNo);
productionRecord.setEquipmentCode(cellEquipContext.getEquipmentCode());
productionRecord.setEquipmentName(cellEquipContext.getEquipmentName());
@ -137,10 +132,11 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
productionRecord.setProcessCode(reqBean.getProcessCode());
productionRecord.setCraftCode(productionProcessContext.getCraftCode());
//TODO 赋开模记录ID
//productionRecord.setMouldRecordId();
//TODO 工序开始时间
//productionRecord.setStartDateTime();
MesScanMonitorContext scanMonitorContext = productionProcessContextStepService.doHandleScanMonitorContext(reqBean, true);
if (null != scanMonitorContext) {
productionRecord.setMouldRecordId(scanMonitorContext.getMouldRecordId());
productionRecord.setStartDateTime(scanMonitorContext.getStartDateTime());
}
productionRecord.setIsComplete(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());

@ -67,6 +67,9 @@ public class MesProductionAssemblyContext implements Serializable {
@ApiParam(value = "音频文件")
private Long audioFileId;
@ApiParam("前道工艺代码")
private String preCraftCode;
@ApiParam("组织代码")
public String organizeCode;

@ -19,8 +19,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
private static final long serialVersionUID = -1492128619505737538L;
@ApiParam(value = "生产工单号")
public String workOrderNo;
@ApiParam(value = "零件条码")
private String productSn;
@ApiParam(value = "工艺顺序号")
private Integer processSeq;

@ -141,6 +141,11 @@ public class MesPcnExtConstWords {
public static final String CELL_MESSAGE_SOURCE = "cellMessageSource";
// 结果
public static final String RESULT = "result";
// 信息
public static final String MESSAGE = "message";
// 时间格式
public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
//设备数据变量读写访问配置

Loading…
Cancel
Save