|
|
|
@ -7,6 +7,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
@ -221,10 +222,18 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
|
|
|
|
|
return new StringJoiner(MesPcnExtConstWords.COLON).add(organizeCode).add(workCenterCode).add(workCellCode).add(MesPcnExtConstWords.PRODUCTION_PROCESS_CONTEXT).add(MesPcnExtConstWords.REPEAT_ASSEMBLY_SN_CONTEXT).toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据装配件规则ID获取可复用条码
|
|
|
|
|
//根据装配件信息获取可复用条码
|
|
|
|
|
@Override
|
|
|
|
|
public String getRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, String assemblyNosortCfgId) {
|
|
|
|
|
String repeatAssemblySnJson = getFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), assemblyNosortCfgId);
|
|
|
|
|
public String getRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, MesProductionAssemblyContext productionAssemblyContext) {
|
|
|
|
|
if (productionAssemblyContext.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) != 0) return null;
|
|
|
|
|
if (null == productionAssemblyContext || StringUtils.isEmpty(productionAssemblyContext.getIsRepeat()) || productionAssemblyContext.getIsRepeat().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) return null;
|
|
|
|
|
return getRepeatAssemblySn(organizeCode, workCenterCode, workCellCode, productionAssemblyContext.repeatKeyToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据装配件信息获取可复用条码
|
|
|
|
|
@Override
|
|
|
|
|
public String getRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, String repeatKey) {
|
|
|
|
|
String repeatAssemblySnJson = getFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), repeatKey);
|
|
|
|
|
MesProductionAssemblyContext productionAssemblyContext = !StringUtils.isEmpty(repeatAssemblySnJson) ? JSONObject.parseObject(repeatAssemblySnJson, MesProductionAssemblyContext.class) : null;
|
|
|
|
|
return null != productionAssemblyContext ? productionAssemblyContext.getAssemblySn() : null;
|
|
|
|
|
}
|
|
|
|
@ -236,14 +245,15 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
|
|
|
|
|
return !StringUtils.isEmpty(countStr) ? Integer.valueOf(countStr) : MesPcnExtConstWords.ZERO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据装配件规则ID获取可复用条码
|
|
|
|
|
//保存可复用条码到上下文
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean dispatchRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, MesProductionAssemblyContext productionAssemblyContext) {
|
|
|
|
|
if (StringUtils.isEmpty(getRepeatAssemblySn(organizeCode, workCenterCode, workCellCode, productionAssemblyContext.getSourceId().toString()))) {
|
|
|
|
|
String repeatKey = productionAssemblyContext.repeatKeyToString();
|
|
|
|
|
if (StringUtils.isEmpty(getRepeatAssemblySn(organizeCode, workCenterCode, workCellCode, repeatKey))) {
|
|
|
|
|
Integer count = getRepeatAssemblySnCount(organizeCode, workCenterCode, workCellCode, productionAssemblyContext.getEquipmentCode()) + 1;
|
|
|
|
|
dispatchFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), productionAssemblyContext.getEquipmentCode(), count.toString());
|
|
|
|
|
}
|
|
|
|
|
return dispatchFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), productionAssemblyContext.getSourceId().toString(), JSONObject.toJSONString(productionAssemblyContext));
|
|
|
|
|
return dispatchFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), repeatKey, productionAssemblyContext.getAssemblySn());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除上下文可复用条码信息
|
|
|
|
|