|
|
@ -1,16 +1,21 @@
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.strategy;
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.strategy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesPartService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.IPrintTemplateStrategyService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.IPrintTemplateStrategyService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.BarCodeUtils;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.BarCodeUtils;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesNumberRule;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesNumberRule;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesNumberRuleRepository;
|
|
|
|
import com.google.zxing.WriterException;
|
|
|
|
import com.google.zxing.WriterException;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
@ -29,11 +34,18 @@ import java.util.*;
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
public class WuhanSnPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
public class WuhanSnPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IMesPartService mesPartService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private MesNumberRuleRepository numberRuleRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MesProduceSnPrintModel execute(GenSerialNoModel genSerialNoModel, MesProduceSnPrintModel model,
|
|
|
|
public MesProduceSnPrintModel execute(GenSerialNoModel genSerialNoModel, MesProduceSnPrintModel model,
|
|
|
|
MesNumberRule numberRule , StepResult stepResult, StationRequestBean reqBean,
|
|
|
|
MesNumberRule numberRule , StepResult stepResult, StationRequestBean reqBean,
|
|
|
|
Boolean isStep) {
|
|
|
|
Boolean isStep) {
|
|
|
|
|
|
|
|
//物料信息
|
|
|
|
|
|
|
|
MesPart mesPart = mesPartService.getMesPartByPartNo(model.getPartNo(), model.getOrganizeCode());
|
|
|
|
// 客户零件号
|
|
|
|
// 客户零件号
|
|
|
|
String custPartNo = model.getCustPartNo();
|
|
|
|
String custPartNo = model.getCustPartNo();
|
|
|
|
// 客户零件号 前缀 排除后四位
|
|
|
|
// 客户零件号 前缀 排除后四位
|
|
|
@ -69,6 +81,10 @@ public class WuhanSnPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
String[] split2 = gsStr.toString().split("");
|
|
|
|
String[] split2 = gsStr.toString().split("");
|
|
|
|
|
|
|
|
|
|
|
|
String sn = split2[0]+"%EOT%";
|
|
|
|
String sn = split2[0]+"%EOT%";
|
|
|
|
|
|
|
|
String custMatchRule = StringUtils.isEmpty(mesPart.getCustMatchRule()) ? "WH_CUST_SN_RULE" : mesPart.getCustMatchRule();
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesPart.getOrganizeCode());
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(custMatchRule, MesPcnExtConstWords.RULE_CODE, packBean);
|
|
|
|
|
|
|
|
numberRule = numberRuleRepository.getByProperty(packBean);
|
|
|
|
|
|
|
|
|
|
|
|
if (numberRule == null) {
|
|
|
|
if (numberRule == null) {
|
|
|
|
log.error("CustSnPrintStrategy --- exec --- numberRule 为空");
|
|
|
|
log.error("CustSnPrintStrategy --- exec --- numberRule 为空");
|
|
|
|