|
|
|
@ -11,14 +11,14 @@ import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.util.DateUtil;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesCustomerPart;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesNumberRule;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesCustPartInvoicedRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -52,6 +52,8 @@ public class ChengDuSplitFixCharPrintStrategy implements IPrintTemplateStrategyS
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesCustomerPartService mesCustomerPartService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCustPartInvoicedRepository partInvoicedRao;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesProduceSnPrintModel execute(GenSerialNoModel genSerialNoModel, MesProduceSnPrintModel mesProduceSnPrintModel, MesNumberRule numberRule, StepResult stepResult, StationRequestBean reqBean, Boolean isStep) {
|
|
|
|
@ -135,13 +137,21 @@ public class ChengDuSplitFixCharPrintStrategy implements IPrintTemplateStrategyS
|
|
|
|
|
|
|
|
|
|
result.put(MesPcnExtConstWords.PART_NO, produceSn.getPartNo());
|
|
|
|
|
result.put(MesPcnExtConstWords.PART_NAME, produceSn.getPartName());
|
|
|
|
|
if (!Objects.isNull(customerPart)) {
|
|
|
|
|
result.put(MesPcnExtConstWords.CUST_PART_NO, customerPart.getCustPartNo());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(splitSn[0])) {
|
|
|
|
|
result.put("FIX_PART", splitSn[0].substring(0, 1));
|
|
|
|
|
result.put(MesPcnExtConstWords.CUST_PART_NO, splitSn[0].substring(1));
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(produceSn.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(produceSn.getPartNo(), "partNo", ddlPackBean);
|
|
|
|
|
MesCustPartInvoiced invoiced = partInvoicedRao.getByProperty(ddlPackBean);
|
|
|
|
|
if (invoiced != null && !StringUtils.isEmpty(invoiced.getCustPartNo())) {
|
|
|
|
|
result.put(MesPcnExtConstWords.CUST_PART_NO, invoiced.getCustPartNo());
|
|
|
|
|
} else {
|
|
|
|
|
if (!Objects.isNull(customerPart)) {
|
|
|
|
|
result.put(MesPcnExtConstWords.CUST_PART_NO, customerPart.getCustPartNo());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(splitSn[0])) {
|
|
|
|
|
result.put("FIX_PART", splitSn[0].substring(0, 1));
|
|
|
|
|
result.put(MesPcnExtConstWords.CUST_PART_NO, splitSn[0].substring(1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(splitSn[1])) {
|
|
|
|
|
result.put("FIX_DATE", splitSn[1].substring(0, 1));
|
|
|
|
|
result.put(MesPcnExtConstWords.PRODUCT_DATE, splitSn[1].substring(1));
|
|
|
|
|