|
|
|
@ -93,25 +93,23 @@ public class MesFunctionDialogInputRawMixWeightService extends BaseSwsService im
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean bOverCapacity = false;
|
|
|
|
|
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
|
|
|
|
|
MesProductionAssemblyContext assemblyContext = getProductionAssemblyContext(organizeCode, workCenter, prodRuleContextList, buttonDynamicModel.getFunctionValue(), stepResult);
|
|
|
|
|
if (assemblyContext == null) {
|
|
|
|
|
if (doHandleProductionAssemblyContext(organizeCode, workCenter, prodRuleContextList, buttonDynamicModel.getFunctionValue(), stepResult)) {
|
|
|
|
|
if (isAllAssemblyMatchRawMix(workCenter, prodRuleContextList)) {
|
|
|
|
|
if (!checkRawMixWeight(organizeCode, workCenter, prodRuleContextList, reqBean.getUserInfo())) {
|
|
|
|
|
this.sendMessage(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PICK.getValue()).scanInfo(buttonDynamicModel.getFunctionValue()),
|
|
|
|
|
"输入数量超出了容差范围",
|
|
|
|
|
MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
|
|
|
|
|
bOverCapacity = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
bOverCapacity = true;
|
|
|
|
|
this.sendMessage(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PICK.getValue()).scanInfo(buttonDynamicModel.getFunctionValue()),
|
|
|
|
|
String.format("生产线[%s]工位[%s]裁片工单打印弹框提交信息有误!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()),
|
|
|
|
|
stepResult.getMsg(),
|
|
|
|
|
MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean bOverCapacity = false;
|
|
|
|
|
if (isAllAssemblyMatchRawMix(workCenter, prodRuleContextList)) {
|
|
|
|
|
if (!checkRawMixWeight(organizeCode, workCenter, prodRuleContextList, reqBean.getUserInfo())) {
|
|
|
|
|
this.sendMessage(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PICK.getValue()).scanInfo(buttonDynamicModel.getFunctionValue()),
|
|
|
|
|
"输入数量超出了容差范围",
|
|
|
|
|
MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
|
|
|
|
|
bOverCapacity = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
productionDispatchContextStepService.dispatchProdRuleDataContext(reqBean, prodRuleContextList);
|
|
|
|
|
if (bOverCapacity) {
|
|
|
|
|
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList);
|
|
|
|
@ -126,8 +124,9 @@ public class MesFunctionDialogInputRawMixWeightService extends BaseSwsService im
|
|
|
|
|
return !bOverCapacity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MesProductionAssemblyContext getProductionAssemblyContext(String organizeCode, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList, String qty, StepResult stepResult) {
|
|
|
|
|
private boolean doHandleProductionAssemblyContext(String organizeCode, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList, String qty, StepResult stepResult) {
|
|
|
|
|
final double rawWeight = new Double(qty);
|
|
|
|
|
stepResult.setCompleted(true);
|
|
|
|
|
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
|
|
|
|
|
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getIsMatchRawMix())) {
|
|
|
|
|
continue;
|
|
|
|
@ -139,12 +138,16 @@ public class MesFunctionDialogInputRawMixWeightService extends BaseSwsService im
|
|
|
|
|
if (StringUtils.isEmpty(productionAssemblyContext.getIsCheckedRawMix()) && Objects.equals(productionAssemblyContext.getAssemblyStatus(), MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue())) {
|
|
|
|
|
double remainQty = getRemainQty(organizeCode, productionAssemblyContext.getAssemblyPartNo());
|
|
|
|
|
if (rawWeight > remainQty) {
|
|
|
|
|
productionAssemblyContext.setIsCheckedRawMix(null);
|
|
|
|
|
productionAssemblyContext.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue());
|
|
|
|
|
productionAssemblyContext.setAssemblySn(null);
|
|
|
|
|
|
|
|
|
|
stepResult.setCompleted(false);
|
|
|
|
|
stepResult.setMsg(String.format("剩余数量[%s]不足!", remainQty));
|
|
|
|
|
return null;
|
|
|
|
|
stepResult.setMsg(String.format("零件号[%s], 输入数量[%s], 剩余数量[%s]不足!", productionAssemblyContext.getAssemblyPartNo(), rawWeight, remainQty));
|
|
|
|
|
} else {
|
|
|
|
|
productionAssemblyContext.setQty(rawWeight);
|
|
|
|
|
productionAssemblyContext.setIsCheckedRawMix("1");
|
|
|
|
|
}
|
|
|
|
|
productionAssemblyContext.setQty(rawWeight);
|
|
|
|
|
productionAssemblyContext.setIsCheckedRawMix("1");
|
|
|
|
|
findAssemblyContext = productionAssemblyContext;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -153,10 +156,13 @@ public class MesFunctionDialogInputRawMixWeightService extends BaseSwsService im
|
|
|
|
|
//存在匹配成功的数据
|
|
|
|
|
if (findAssemblyContext != null) {
|
|
|
|
|
prodRuleContext.assemblyDataJson(productionAssemblyContextList);
|
|
|
|
|
return findAssemblyContext;
|
|
|
|
|
return stepResult.isCompleted();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
stepResult.setCompleted(false);
|
|
|
|
|
stepResult.setMsg("未匹配到装配原料,请重新扫描装配件原料!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean isAllAssemblyMatchRawMix(MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
|
|
|
|
@ -217,6 +223,7 @@ public class MesFunctionDialogInputRawMixWeightService extends BaseSwsService im
|
|
|
|
|
for (MesProductionAssemblyContext productionAssemblyContext : productionAssemblyContextList) {
|
|
|
|
|
productionAssemblyContext.setIsCheckedRawMix(null);
|
|
|
|
|
productionAssemblyContext.setQty(0.0);
|
|
|
|
|
productionAssemblyContext.setAssemblySn(null);
|
|
|
|
|
productionAssemblyContext.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue());
|
|
|
|
|
}
|
|
|
|
|
prodRuleContext.assemblyDataJson(productionAssemblyContextList);
|
|
|
|
|