工步调配原料功能

mes-uat-changshu0609^2
jason 2 weeks ago
parent 3a1a45777c
commit 1b22d0a8bc

@ -1,12 +1,12 @@
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyNosortContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext;
import java.util.List;
public interface IMesRawSnWeightRecordService {
void insertRawRemainWeightRecord(MesProductionAssemblyContext context, String organizeCode, String username);
void insertOutPartNoWeightRecord(MesProdRuleContext prodRuleContext, List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList, String organizeCode, String username);
void insertOutPartNoWeightRecord(MesProductionPsOutContext productionPsOutContext, List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList, String organizeCode, String username);
}

@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesRawSnWeightRecordService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyNosortContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
@ -63,8 +64,8 @@ public class MesRawSnWeightRecordServiceImpl implements IMesRawSnWeightRecordSer
}
@Override
public void insertOutPartNoWeightRecord(MesProdRuleContext prodRuleContext, List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList, String organizeCode, String username) {
MesPart mesPart = partService.getMesPartByPartNo(prodRuleContext.getOutPartNo(), organizeCode);
public void insertOutPartNoWeightRecord(MesProductionPsOutContext productionPsOutContext, List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList, String organizeCode, String username) {
MesPart mesPart = partService.getMesPartByPartNo(productionPsOutContext.getPartNo(), organizeCode);
if (mesPart == null) {
return;
}
@ -77,10 +78,11 @@ public class MesRawSnWeightRecordServiceImpl implements IMesRawSnWeightRecordSer
MesRawSnWeightRecord record = new MesRawSnWeightRecord();
record.setOrganizeCode(organizeCode);
record.setBarCode(prodRuleContext.getProductSn());
record.setBarCode(productionPsOutContext.getProductSn());
record.setPartNo(mesPart.getPartNo());
record.setPartName(mesPart.getPartName());
record.setNetWeight(totalWeight);
record.setNetUnit(mesPart.getWeightUom());
record.setRawType(MesExtEnumUtil.RAW_MIX_DETAIL_TYPE.RAW_MIX_DETAIL_TYPE_10.getValue());
ConvertBean.serviceModelInitialize(record, username);
rawSnWeightRecordRDao.insert(record);

@ -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);

@ -140,7 +140,7 @@ public class MesAssemblySaveStepService extends BaseStepService {
}
}
//写入调配产出物重量记录
rawSnWeightRecordService.insertOutPartNoWeightRecord(prodRuleContext, productionAssemblyNosortContextList, reqBean.getOrganizeCode(), reqBean.getUserInfo());
rawSnWeightRecordService.insertOutPartNoWeightRecord(productionPsOutContext, productionAssemblyNosortContextList, reqBean.getOrganizeCode(), reqBean.getUserInfo());
}
//保存装配件绑定记录

Loading…
Cancel
Save