裁片功能优化

tags/yfai-pcn-ext-v2.3
yxw 8 months ago
parent ab3fd934cf
commit e783d75ae2

@ -15,10 +15,7 @@ import cn.estsh.i3plus.pojo.base.common.PagerHelper;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.repository.MesCutModifyRawLengthRecordRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesMaterialSnRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesWorkOrderCutMaterialRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesWorkOrderCutRepository;
import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -55,6 +52,9 @@ public class MesCutRawErrorProofingService implements IMesCutRawErrorProofingSer
@Autowired
private MesCutModifyRawLengthRecordRepository cutModifyRawLengthRecordRepository;
@Autowired
private MesCutSchemeRepository cutSchemeRepository;
@Override
public MesCutRawErrorProofingModel doScanSn(MesCutRawErrorProofingModel model) {
@ -67,6 +67,14 @@ public class MesCutRawErrorProofingService implements IMesCutRawErrorProofingSer
if (workOrderCutDb == null) MesPcnException.throwMesBusiException("裁片工单【%s】不存在", model.getSn());
DdlPackBean packBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(workOrderCutDb.getCutCode(), MesPcnExtConstWords.CUT_CODE, packBean);
MesCutScheme cutScheme = cutSchemeRepository.getByProperty(packBean);
if (cutScheme == null) MesPcnException.throwMesBusiException("裁片工单【%s】所属裁片方案无效", model.getSn());
if (workOrderCutDb.getWorkOrderStatus() == MesExtEnumUtil.CUT_ORDER_STATUS.RELEASED.getValue() && cutScheme.getIsCheckMaterial() == CommonEnumUtil.FALSE) MesPcnException.throwMesBusiException("裁片工单【%s】无需校验原材料", model.getSn());
if (workOrderCutDb.getWorkOrderStatus() != MesExtEnumUtil.CUT_ORDER_STATUS.RELEASED.getValue()) MesPcnException.throwMesBusiException("裁片工单【%s】状态不为【%s】", model.getSn(), MesExtEnumUtil.CUT_ORDER_STATUS.RELEASED.getDescription());
result.setCurScanType(CUR_SCAN_TYPE_BY_RAW_SN);

@ -4,6 +4,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepSer
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesWorkOrderCutDetailModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmRouteDataService;
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
@ -27,6 +28,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -138,11 +140,12 @@ public class MesWorkOrderCutPackageSnSaveStepService extends BaseStepService {
cutPackage.setOrganizeCode(reqBean.getOrganizeCode());
BeanUtils.copyProperties(workOrderCutDetailModel, cutPackage);
cutPackage.setQty(qty);
cutPackage.setLotNo(nowTime);
cutPackage.setLotNo(nowTime.substring(0,10));
cutPackage.setSn(doGenerateSerialNo(reqBean, resultBean, mesPartContext.getPackageSnRule(), mesPartContext));
MesWorkOrderCutDetailModel newWorkOrderCutDetailModel = new MesWorkOrderCutDetailModel();
BeanUtils.copyProperties(workOrderCutDetailModel, newWorkOrderCutDetailModel);
newWorkOrderCutDetailModel.setPackageNo(cutPackage.getSn());
newWorkOrderCutDetailModel.setQty(qty);
newWorkOrderCutDetailModel.setCreateDatetime(cutPackage.getCreateDatetime());
newWorkOrderCutDetailModel.setLotNo(cutPackage.getLotNo());
@ -166,7 +169,7 @@ public class MesWorkOrderCutPackageSnSaveStepService extends BaseStepService {
private String doGenerateSerialNo(StationRequestBean reqBean, StationResultBean resultBean, String ruleCode, MesPart part) {
try {
return syncFuncService.syncSerialNo(
new GenSerialNoModel(ruleCode).prodLocation(reqBean.getWorkCenterCode()).partNo(part.getPartNo()).putDataMap(MesPart.class.getSimpleName(), part).organizeCode(reqBean.getOrganizeCode()),
new GenSerialNoModel(ruleCode).prodLocation(reqBean.getWorkCenterCode()).partNo(part.getPartNo()).putDataMap(MesPart.class.getSimpleName(), part).year(TimeTool.pareDateToString(MesPcnExtConstWords.DATE_FORMAT_YY, new Date())).organizeCode(reqBean.getOrganizeCode()),
reqBean.getUserInfo(), reqBean.getOrganizeCode(), 1).getResultList().get(0).toString();
} catch (ImppBusiException e) {
stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), e.getErrorDetail());

Loading…
Cancel
Save