|
|
|
@ -4,22 +4,18 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepSer
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
|
|
|
|
|
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.mes.bean.MesPart;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesRawPartCharging;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
|
import com.google.common.base.Objects;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.StringJoiner;
|
|
|
|
@ -163,31 +159,32 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
|
|
|
|
|
deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.FIRST_MOULD_NO_CONTEXT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取上下文一模多腔信息
|
|
|
|
|
//获取上下文产出零件信息
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesProductionPartContext> getProductionPartContext(StationRequestBean reqBean) {
|
|
|
|
|
String productionPartJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT);
|
|
|
|
|
return !StringUtils.isEmpty(productionPartJson) ? JSONObject.parseArray(productionPartJson, MesProductionPartContext.class) : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证上下文一模多腔信息是否存在
|
|
|
|
|
//验证上下文产出零件信息是否存在
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean checkProductionPartIsExistContext(StationRequestBean reqBean) {
|
|
|
|
|
String productionPartJson = getFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT);
|
|
|
|
|
return !StringUtils.isEmpty(productionPartJson) ? true : false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//保存上下文一模多腔信息 [JSON]List<MesProductionPartContext>
|
|
|
|
|
//保存上下文产出零件信息 [JSON]List<MesProductionPartContext>
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean saveProductionPartContext(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList) {
|
|
|
|
|
if (CollectionUtils.isEmpty(productionPartContextList)) return false;
|
|
|
|
|
if (CollectionUtils.isEmpty(productionPartContextList)) return deleteProductionPartContext(reqBean);
|
|
|
|
|
return saveFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT, JSONObject.toJSONString(productionPartContextList));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除上下文一模多腔信息
|
|
|
|
|
//删除上下文产出零件信息
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteProductionPartContext(StationRequestBean reqBean) {
|
|
|
|
|
public Boolean deleteProductionPartContext(StationRequestBean reqBean) {
|
|
|
|
|
deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PART_CONTEXT);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取上下文零件数据信息
|
|
|
|
@ -335,14 +332,15 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
|
|
|
|
|
//保存上下文进料主条码数据信息集合 [JSON]List<MesProductionPsInContext>
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean saveProductionPsInContext(StationRequestBean reqBean, List<MesProductionPsInContext> productionPsInContextList) {
|
|
|
|
|
if (CollectionUtils.isEmpty(productionPsInContextList)) return false;
|
|
|
|
|
if (CollectionUtils.isEmpty(productionPsInContextList)) return deleteProductionPsInContext(reqBean);
|
|
|
|
|
return saveFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PS_IN_CONTEXT, JSONObject.toJSONString(productionPsInContextList));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除上下文进料主条码数据信息集合
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteProductionPsInContext(StationRequestBean reqBean) {
|
|
|
|
|
public Boolean deleteProductionPsInContext(StationRequestBean reqBean) {
|
|
|
|
|
deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), MesPcnExtConstWords.PRODUCTION_PS_IN_CONTEXT);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取上下文产出条码数据信息集合
|
|
|
|
|