tags/yfai-pcn-ext-v1.0
微笑着面对明天 10 months ago
parent 8fff60d726
commit 963a373b9c

@ -28,5 +28,6 @@ public interface IMesInputDefectRecordService {
@ApiOperation(value = "完成质检")
public void savePartInspection(MesPartInspectionInputModel model, String org);
@ApiOperation(value = "可疑品录入")
public void saveSusPartInspection(MesPartInspectionInputModel model, String org);
}

@ -34,7 +34,7 @@ public interface IMesNcProcessingService {
public ListPager<MesNcProcessingPartAndLotModel> queryPartLot(String partNo, String lot, String org, Pager pager);
@ApiOperation(value = "NC处理")
public void saveNc(MesNcProcessingInputModel model, String org);
public void saveNc(MesNcProcessingInputModel model, String org, boolean isOrder);
}

@ -99,7 +99,7 @@ public class MesNcProcessingController {
if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) {
throw new ImppBusiException(String.format("不存在可疑信息,请检查数据", model.getType()));
}
ncProcessingService.saveNc(model, AuthUtil.getOrganizeCode());
ncProcessingService.saveNc(model, AuthUtil.getOrganizeCode(), false);
return ResultBean.success("NC处理成功");
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);

@ -26,6 +26,7 @@ import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -195,8 +196,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
//零件检测详情为空,则代表本次校验为合格。
if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) {
MesPartInspection partInspection;
//返工单返修完成,需可疑品移正常库
@ -808,5 +807,18 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
return detailList;
}
@Override
public void saveSusPartInspection(MesPartInspectionInputModel model, String org) {
//
MesPartInspection partInspection = new MesPartInspection();
BeanUtils.copyProperties(model, partInspection);
partInspection.setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue());
partInspectionRepository.save(partInspection);
//
//移库
MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org);
moveRepository.save(move);
}
}

@ -160,20 +160,20 @@ public class MesNcProcessingService implements IMesNcProcessingService {
}
@Override
public void saveNc(MesNcProcessingInputModel model, String org) {
public void saveNc(MesNcProcessingInputModel model, String org, boolean isOrder) {
if (model.getPartInspection().getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
Integer type = model.getType();
MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson();
//保存数据
saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode());
saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(),isOrder);
} else {
Integer type = model.getType();
MesDefectType person = StringUtil.isEmpty(model.getPerson())?new MesDefectType():model.getPerson();
//保存数据
saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode());
saveDate(model, model.getPart(), type, person, org,model.getInventoryLocationCode(), isOrder);
}
}
@ -321,7 +321,8 @@ public class MesNcProcessingService implements IMesNcProcessingService {
* @param person
* @param org
*/
private void saveDate(MesNcProcessingInputModel model, MesPartSap part, Integer type, MesDefectType person, String org,String areaCode) {
private void saveDate(MesNcProcessingInputModel model, MesPartSap part, Integer type, MesDefectType person, String org,String areaCode, boolean
isOrder) {
if (type == MesExtEnumUtil.NC_TYPE.NORMAL.getValue()) {
@ -347,7 +348,6 @@ public class MesNcProcessingService implements IMesNcProcessingService {
} else if (type == MesExtEnumUtil.NC_TYPE.REWORK.getValue()) {
//生成返工单 根据责任方库区对应关系选择哪个责任方就移动到哪个库区8000移至8002/8003
GenSerialNoModel serialNoModel = new GenSerialNoModel("NC_REWORK");
serialNoModel.setPartNo(part.getPartNo());
@ -413,7 +413,10 @@ public class MesNcProcessingService implements IMesNcProcessingService {
model.getPartInspection().setRejectQty(model.getPartInspection().getQty());
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
partInspectionRepository.save(model.getPartInspection());
if (isOrder) {
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "SCRAP"), org,MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
moveRepository.save(move);
}
//移库 转报废 根据责任方库区对应关系的主数据选择哪个责任方就移动到哪个库区8000移至8002/8003
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org,MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "SCRAP"), org);

@ -159,7 +159,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
genSerialNoModel.putDataMap("mesCustomerPart",mesCustomerPart);
genSerialNoModel.setOrganizeCode(organizeCode);
genSerialNoModel = packStrategy.execute(genSerialNoModel);
genSerialNoModel.setCustPartNo(mesCustomerPart.getCustPartNo());
genSerialNoModel.setCustPartNo(mesCustomerPart == null ? null : mesCustomerPart.getCustPartNo());
IPrintTemplateStrategyService templateStrategy = (IPrintTemplateStrategyService) SpringContextsUtil.getBean(methodCode);
MesProduceSnPrintModel resultModel = templateStrategy.execute(genSerialNoModel, mesProduceSnPrintModel, numberRule,null,null,false);
@ -246,9 +246,6 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(mesProduceSnPrintModel.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(mesProduceSnPrintModel.getPartNo(), "erpPartNo", ddlPackBean);
MesCustomerPart mesCustomerPart = mesCustomerPartRDao.getByProperty(ddlPackBean);
if (Objects.isNull(mesCustomerPart)) {
MesPcnException.throwMesBusiException("物料【%s】客户零件关系未维护", mesProduceSnPrintModel.getPartNo());
}
return mesCustomerPart;
}

@ -2,6 +2,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesInputDefectRecordService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNcProcessingService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
@ -10,6 +11,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.ActorMessage;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingInputModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesPartInspectionInputModel;
import cn.estsh.i3plus.mes.pcn.config.SpringExtProvider;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
@ -59,6 +61,9 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
private IMesNcProcessingService ncProcessingService;
@Autowired
private IMesInputDefectRecordService inputDefectRecordService;
@Autowired
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT";
@ -82,6 +87,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
// 保存加工异常记录(NC判断记录)
saveProductResultException(reqBean, mesProduceSns, result);
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesExtEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "加工异常处理成功");
@ -114,9 +120,9 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
partInspection.setPartNo(mesProduceSn.getPartNo());
partInspection.setPartName(mesProduceSn.getPartName());
partInspection.setDefectTypeCode(mesDefectType.getDefectTypeCode());
partInspection.setInspectionDate(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MS_PATTERN));
partInspection.setInspectionDate(DateUtil.format(new Date(), DatePattern.NORM_DATE_FORMATTER));
partInspection.setLotNo(mesProduceSn.getLotNo());
if (!Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) {
if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) {
partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.SCRAP.getValue());
} else {
partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue());
@ -138,18 +144,28 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
model.setPartInspection(partInspection);
model.setType(partInspection.getSourceType());
if (!Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) {
if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) {
model.setType(MesExtEnumUtil.NC_TYPE.SCRAP.getValue());
} else if (!Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SUSPICIOUS.getValue(), result)) {
model.setType(MesExtEnumUtil.NC_TYPE.RELEASE.getValue());
}
MesPartSap mesPartSap = new MesPartSap();
mesPartSap.setPartNo(mesProduceSn.getPartNo());
model.setPart(mesPartSap);
model.setPartInspectionDetailList(Arrays.asList(mesPartInspectionDetail));
ncProcessingService.saveNc(model, reqBean.getOrganizeCode());
if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) {
ncProcessingService.saveNc(model, reqBean.getOrganizeCode(), true);
} else {
MesPartInspectionInputModel inspectModel = new MesPartInspectionInputModel();
inspectModel.setPart(mesPartSap);
inspectModel.setLotNo(mesProduceSn.getLotNo());
inspectModel.setPartNo(mesProduceSn.getPartNo());
inspectModel.setQty(mesProduceSn.getQty());
inspectModel.setSn(mesProduceSn.getProductSn());
inspectModel.setWorkCenterCode(mesProduceSn.getWorkCenterCode());
inspectModel.setPartInspection(partInspection);
inspectModel.setShiftCode(mesProduceSn.getShiftCode());
inputDefectRecordService.saveSusPartInspection(inspectModel, reqBean.getOrganizeCode());
}
});
}
}

Loading…
Cancel
Save