|
|
|
@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step.context;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdShiftContext;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyNosortContext;
|
|
|
|
|
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;
|
|
|
|
@ -229,4 +230,39 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
|
|
|
|
|
deleteFsmBusiData(reqBean.getOrganizeCode(), getProductionStatisticsContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_STATISTICS_CONTEXT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//工位加工锁KEY
|
|
|
|
|
private String getRepeatAssemblySnContextKey(String organizeCode, String workCenterCode, String workCellCode) {
|
|
|
|
|
return new StringJoiner(MesPcnExtConstWords.COLON).add(organizeCode).add(MesPcnExtConstWords.PRODUCTION_PROCESS_CONTEXT).add(MesPcnExtConstWords.REPEAT_ASSEMBLY_SN_CONTEXT).add(workCenterCode).add(workCellCode).toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据装配件规则ID获取可复用条码
|
|
|
|
|
@Override
|
|
|
|
|
public String getRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, String assemblyNosortCfgId) {
|
|
|
|
|
String repeatAssemblySnJson = getFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), assemblyNosortCfgId);
|
|
|
|
|
MesProductionAssemblyNosortContext productionAssemblyNosortContext = !StringUtils.isEmpty(repeatAssemblySnJson) ? JSONObject.parseObject(repeatAssemblySnJson, MesProductionAssemblyNosortContext.class) : null;
|
|
|
|
|
return null != productionAssemblyNosortContext ? productionAssemblyNosortContext.getAssemblySn() : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据设备代码获取可复用条码的个数
|
|
|
|
|
@Override
|
|
|
|
|
public Integer getRepeatAssemblySnCount(String organizeCode, String workCenterCode, String workCellCode, String equipmentCode) {
|
|
|
|
|
String countStr = getFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), equipmentCode);
|
|
|
|
|
return !StringUtils.isEmpty(countStr) ? Integer.valueOf(countStr) : MesPcnExtConstWords.ZERO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据装配件规则ID获取可复用条码
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean saveRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, MesProductionAssemblyNosortContext productionAssemblyNosortContext) {
|
|
|
|
|
Integer count = getRepeatAssemblySnCount(organizeCode, workCenterCode, workCellCode, productionAssemblyNosortContext.getEquipmentCode()) + 1;
|
|
|
|
|
saveFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), productionAssemblyNosortContext.getEquipmentCode(), count.toString());
|
|
|
|
|
return saveFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), productionAssemblyNosortContext.getSourceId().toString(), JSONObject.toJSONString(productionAssemblyNosortContext));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除上下文可复用条码信息
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode) {
|
|
|
|
|
deleteFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|