|
|
@ -327,7 +327,9 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void saveDate(MesNcProcessingInputModel model, MesPartSap part, Integer type, MesDefectType person, String org,String areaCode, boolean isOrder) {
|
|
|
|
private void saveDate(MesNcProcessingInputModel model, MesPartSap part, Integer type, MesDefectType person, String org,String areaCode, boolean isOrder) {
|
|
|
|
|
|
|
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
String workCenterCode = null == model.getPartInspection() ? null : model.getPartInspection().getWorkCenterCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MesProduceSn sn = getProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
|
|
|
|
String source = configService.getCfgValue(org, "LGORT");
|
|
|
|
String source = configService.getCfgValue(org, "LGORT");
|
|
|
|
if (!StringUtils.isEmpty(model.getProductVersion())) {
|
|
|
|
if (!StringUtils.isEmpty(model.getProductVersion())) {
|
|
|
@ -344,6 +346,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (type == MesExtEnumUtil.NC_TYPE.NORMAL.getValue()) {
|
|
|
|
if (type == MesExtEnumUtil.NC_TYPE.NORMAL.getValue()) {
|
|
|
|
|
|
|
|
checkProduceSn(sn, model.getSn());
|
|
|
|
//更新条码质量状态
|
|
|
|
//更新条码质量状态
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS_TO_QUALIFIED.getValue());
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS_TO_QUALIFIED.getValue());
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
@ -360,7 +363,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
|
|
//移库 转正常、放行:8000移至2000
|
|
|
|
//移库 转正常、放行:8000移至2000
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org);
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org);
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.REWORK.getValue()) {
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.REWORK.getValue()) {
|
|
|
@ -410,11 +413,12 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
model.getPartInspection().setReworkTaskId(reworkTask.getId());
|
|
|
|
model.getPartInspection().setReworkTaskId(reworkTask.getId());
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
|
|
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE);
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE);
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.SCRAP.getValue()) {
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.SCRAP.getValue()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkProduceSn(sn, model.getSn());
|
|
|
|
//更新条码质量状态
|
|
|
|
//更新条码质量状态
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue());
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue());
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
@ -432,17 +436,17 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
if (isOrder) {
|
|
|
|
if (isOrder) {
|
|
|
|
MesMove move = createMove(model, source, configService.getCfgValue(org, "SCRAP"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
MesMove move = createMove(model, source, configService.getCfgValue(org, "SCRAP"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//移库 转报废 根据责任方库区对应关系的主数据,选择哪个责任方,就移动到哪个库区(8000移至8002/8003)
|
|
|
|
//移库 转报废 根据责任方库区对应关系的主数据,选择哪个责任方,就移动到哪个库区(8000移至8002/8003)
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "SCRAP"), org);
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "SCRAP"), org);
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.RELEASE.getValue()) {
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.RELEASE.getValue()) {
|
|
|
|
|
|
|
|
checkProduceSn(sn, model.getSn());
|
|
|
|
//更新条码质量状态
|
|
|
|
//更新条码质量状态
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
@ -460,7 +464,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
|
|
//移库 转正常、放行:8000移至2000
|
|
|
|
//移库 转正常、放行:8000移至2000
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org);
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org);
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -482,6 +486,25 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
return produceSn;
|
|
|
|
return produceSn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MesProduceSn getProduceSn(String serialNumber, String org) {
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(serialNumber)) return null;
|
|
|
|
|
|
|
|
//根据扫描的条码查询条码是否存在
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(serialNumber, "productSn", packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
|
|
|
|
|
|
|
|
return produceSnRepository.getByProperty(packBean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MesProduceSn checkProduceSn(MesProduceSn produceSn, String serialNumber) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//若不存在则提示条码不存在
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(produceSn)) {
|
|
|
|
|
|
|
|
throw new ImppBusiException(String.format("【%s】此条码不存在,请检查数据", serialNumber));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return produceSn;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org, String workCenterCode, MesExtEnumUtil.MOVE_TYPE moveType) {
|
|
|
|
private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org, String workCenterCode, MesExtEnumUtil.MOVE_TYPE moveType) {
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
|
|
|
|
serialNoModel.setPartNo(model.getPart().getPartNo());
|
|
|
|
serialNoModel.setPartNo(model.getPart().getPartNo());
|
|
|
|