|
|
|
@ -4,16 +4,14 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IProduceSnTravelExtService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.jx.IJxProdBusiStrategyService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.jx.IJxProduceSnExtService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.jx.IJxProduceSnMcRecordService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesManageCode;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesProduceSnExt;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesProduceSnMcRecord;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.jx.JxProdBusiStrategyParamsBuilder;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.MesProduceSnExtRepository;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.MesProduceSnMcRecordRepository;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.*;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.ConvertBeanExt;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -48,6 +46,18 @@ public class JxProdBusiStrategyCommonService implements IJxProdBusiStrategyServi
|
|
|
|
|
@Autowired
|
|
|
|
|
private IProduceSnTravelExtService produceSnTravelExtService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesBadCellDetailRepository badCellDetailRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesProdBindRecordExtRepository prodBindRecordExtRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesRepairRecordExtRepository repairRecordExtRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesRepairTaskRepository repairTaskRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public StepResult checkLineOn(JxProdBusiStrategyParamsBuilder params) {
|
|
|
|
|
if (MesPcnExtEnumUtil.WORK_ORDER_TYPE.REWORK_ORDER.getValue() != params.getOrderModel().getWorkOrderType()) queryBusiData4Mc(params.manageCode(params.getScanInfo()));
|
|
|
|
@ -232,6 +242,8 @@ public class JxProdBusiStrategyCommonService implements IJxProdBusiStrategyServi
|
|
|
|
|
|
|
|
|
|
saveProduceSn4FinalInspection(params);
|
|
|
|
|
|
|
|
|
|
doRestoreBusiData(params);
|
|
|
|
|
|
|
|
|
|
insertProduceSnTravel(params);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -249,9 +261,8 @@ public class JxProdBusiStrategyCommonService implements IJxProdBusiStrategyServi
|
|
|
|
|
if (StringUtils.isEmpty(produceSnMcRecordDb.getProductSn())) produceSnMcRecordDb.setProductSn(params.getScanInfo());
|
|
|
|
|
ConvertBean.serviceModelUpdate(produceSnMcRecordDb, params.getUserInfo());
|
|
|
|
|
produceSnMcRecordDb.setSystemSyncStatus(MesPcnExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue());
|
|
|
|
|
produceSnMcRecordRepository.save(produceSnMcRecordDb);
|
|
|
|
|
|
|
|
|
|
params.manageCode(produceSnMcRecordDb.getManageCode());
|
|
|
|
|
params.produceSnMcRecordDb(produceSnMcRecordRepository.save(produceSnMcRecordDb)).manageCode(produceSnMcRecordDb.getManageCode());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -272,6 +283,113 @@ public class JxProdBusiStrategyCommonService implements IJxProdBusiStrategyServi
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void doRestoreBusiData(JxProdBusiStrategyParamsBuilder params) {
|
|
|
|
|
|
|
|
|
|
if (null == params.getProduceSnMcRecordDb()) return;
|
|
|
|
|
|
|
|
|
|
doRestoreProdBindRecord(params);
|
|
|
|
|
|
|
|
|
|
if (!doRestoreBadCellDetail(params)) return;
|
|
|
|
|
|
|
|
|
|
doRestoreRepairRecord(params);
|
|
|
|
|
|
|
|
|
|
doRestoreRepairTask(params);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void doRestoreProdBindRecord(JxProdBusiStrategyParamsBuilder params) {
|
|
|
|
|
|
|
|
|
|
if (null == params.getProduceSnMcRecordDb()) return;
|
|
|
|
|
|
|
|
|
|
List<MesProdBindRecordExt> prodBindRecordExtList = prodBindRecordExtRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.THIRD_PARTY_PID},
|
|
|
|
|
new Object[]{params.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), params.getProduceSnMcRecordDb().getId().toString()});
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(prodBindRecordExtList)) return;
|
|
|
|
|
|
|
|
|
|
for (MesProdBindRecordExt item : prodBindRecordExtList) {
|
|
|
|
|
if (null == item) continue;
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(item.getSerialNumber()) && !StringUtils.isEmpty(item.getProductSn())) continue;
|
|
|
|
|
item.setSerialNumber(params.getProduceSnMcRecordDb().getSerialNumber());
|
|
|
|
|
item.setProductSn(params.getProduceSnMcRecordDb().getProductSn());
|
|
|
|
|
ConvertBean.serviceModelUpdate(item, params.getUserInfo());
|
|
|
|
|
new ConvertBeanExt(item).convertBean(item);
|
|
|
|
|
prodBindRecordExtRepository.save(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Boolean doRestoreBadCellDetail(JxProdBusiStrategyParamsBuilder params) {
|
|
|
|
|
|
|
|
|
|
if (null == params.getProduceSnMcRecordDb()) return false;
|
|
|
|
|
|
|
|
|
|
List<MesBadCellDetail> badCellDetailList = badCellDetailRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.THIRD_PARTY_PID},
|
|
|
|
|
new Object[]{params.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), params.getProduceSnMcRecordDb().getId().toString()});
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(badCellDetailList)) return false;
|
|
|
|
|
|
|
|
|
|
Boolean result = false;
|
|
|
|
|
for (MesBadCellDetail item : badCellDetailList) {
|
|
|
|
|
if (null == item) continue;
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(item.getSerialNumber()) && !StringUtils.isEmpty(item.getProductSn())) continue;
|
|
|
|
|
item.setSerialNumber(params.getProduceSnMcRecordDb().getSerialNumber());
|
|
|
|
|
item.setProductSn(params.getProduceSnMcRecordDb().getProductSn());
|
|
|
|
|
ConvertBean.serviceModelUpdate(item, params.getUserInfo());
|
|
|
|
|
badCellDetailRepository.save(item);
|
|
|
|
|
|
|
|
|
|
result = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void doRestoreRepairRecord(JxProdBusiStrategyParamsBuilder params) {
|
|
|
|
|
|
|
|
|
|
if (null == params.getProduceSnMcRecordDb()) return;
|
|
|
|
|
|
|
|
|
|
List<MesRepairRecordExt> repairRecordExtList = repairRecordExtRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.THIRD_PARTY_PID},
|
|
|
|
|
new Object[]{params.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), params.getProduceSnMcRecordDb().getId().toString()});
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(repairRecordExtList)) return;
|
|
|
|
|
|
|
|
|
|
for (MesRepairRecordExt item : repairRecordExtList) {
|
|
|
|
|
if (null == item) continue;
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(item.getSerialNumber()) && !StringUtils.isEmpty(item.getProductSn())) continue;
|
|
|
|
|
item.setSerialNumber(params.getProduceSnMcRecordDb().getSerialNumber());
|
|
|
|
|
item.setProductSn(params.getProduceSnMcRecordDb().getProductSn());
|
|
|
|
|
ConvertBean.serviceModelUpdate(item, params.getUserInfo());
|
|
|
|
|
repairRecordExtRepository.save(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void doRestoreRepairTask(JxProdBusiStrategyParamsBuilder params) {
|
|
|
|
|
|
|
|
|
|
if (null == params.getProduceSnMcRecordDb()) return;
|
|
|
|
|
|
|
|
|
|
List<MesRepairTask> repairTaskList = repairTaskRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.THIRD_PARTY_PID},
|
|
|
|
|
new Object[]{params.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), params.getProduceSnMcRecordDb().getId().toString()});
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(repairTaskList)) return;
|
|
|
|
|
|
|
|
|
|
for (MesRepairTask item : repairTaskList) {
|
|
|
|
|
if (null == item) continue;
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(item.getSerialNumber()) && !StringUtils.isEmpty(item.getProductSn())) continue;
|
|
|
|
|
item.setSerialNumber(params.getProduceSnMcRecordDb().getSerialNumber());
|
|
|
|
|
item.setProductSn(params.getProduceSnMcRecordDb().getProductSn());
|
|
|
|
|
ConvertBean.serviceModelUpdate(item, params.getUserInfo());
|
|
|
|
|
repairTaskRepository.save(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execFinalInspectionMarkRepair(JxProdBusiStrategyParamsBuilder params) {
|
|
|
|
|
|
|
|
|
|