跨班次计数

tags/yfai-pcn-ext-v1.0
微笑着面对明天 10 months ago
parent ee84f26953
commit f29a349df2

@ -165,6 +165,8 @@ public class MesEquipmentLogService implements IMesEquipmentLogService {
}
MesEquipmentLog equipmentLog = mesEquipmentLogExtService.queryMesEquipmentLog(mesEquipmentVariable.getOrganizeCode(), Integer.valueOf(equipLogMqttMsg.getPTCode()), mesEquipmentVariable.getId());
ConvertBean.serviceModelUpdate(equipmentLog, "mqtt");
equipmentLog.setEquipVariableValue(equipLogMqttMsg.getValue());
equipmentLog.setEquipVariableStatus(MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getEquipVariableStatus());
mesEquipmentLogRepository.update(equipmentLog);
MesEquipmentLogDetail mesEquipmentLogDetail = new MesEquipmentLogDetail();

@ -298,7 +298,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
mesProductionRepeatAssembly.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue());
mesProductionRepeatAssembly.setId(null);
mesProductionRepeatAssembly.setIsOrigSn(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
mesProductionRepeatAssembly.setFid(UUID.randomUUID().toString());
mesProductionRepeatAssembly.setFid(UUID .randomUUID().toString());
mesProductionAssembly.setRepeatAssemblySn(sn);
mesProductionAssemblyRepository.update(mesProductionAssembly);

@ -99,10 +99,11 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
//保存上下文产品加工规则信息集合
productionDispatchContextStepService.saveProdRuleDataContext(reqBean, prodRuleContextList);
LOGGER.info("产线【{}】,工位【{}】,加工数累加{},{}",reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), productionPsOutContextList.size(),mesWorkCell.getIsCountFinish());
if (Objects.equal(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),mesWorkCell.getIsCountFinish())) {
// 保存班次加工数量上下文
productionCustomContextStepService.addProductionStatisticsContext(reqBean,productionPsOutContextList.size());
}
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "生成加工记录成功!");

@ -22,6 +22,7 @@ import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;
import java.util.logging.Logger;
/**
* @Description : BUSI
@ -182,7 +183,8 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
public Boolean addProductionStatisticsContext(StationRequestBean reqBean, int count) {
MesProdShiftContext mesProdShiftKvBean = getMesProdShiftKvBean(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
String key = new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString();
//String key = new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString();
String key = new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).toString();
List<StationKvBean> stationKvBeans = getProductionStatisticsContext(reqBean);
if (CollectionUtils.isEmpty(stationKvBeans)) {
@ -193,7 +195,7 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
saveProductionStatisticsContext(reqBean, generateStationKvBeans);
} else {
stationKvBeans.stream().forEach(stationKvBean -> {
if (Objects.equal(stationKvBean.getKey(), key)) {
if (stationKvBean.getKey().contains(key)) {
stationKvBean.setValue(stationKvBean == null ? count + "" : (Integer.valueOf(stationKvBean.getValue()) + count) + "");
}
});

Loading…
Cancel
Save