|
|
|
@ -8,6 +8,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.api.iservice.base.IConfigService;
|
|
|
|
|
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.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
@ -70,7 +71,6 @@ public class GqaaPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
|
}
|
|
|
|
|
//获取工厂名称
|
|
|
|
|
String organizeName = mesConfig.getCfgValue();
|
|
|
|
|
String format ="yyyy/MM/dd";
|
|
|
|
|
MesCustomerPart mesCustomerPart = getMesCustomerPart(mesProduceSnPrintModel);
|
|
|
|
|
//物料信息
|
|
|
|
|
MesPart mesPart = mesPartService.getMesPartByPartNo(mesProduceSnPrintModel.getPartNo(), organizeCode);
|
|
|
|
@ -87,7 +87,7 @@ public class GqaaPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
|
serialNo34 = stringFormat(serialNo34, 4, false, "0");
|
|
|
|
|
sn = snPrefix + serialNo34 + snSuffix;
|
|
|
|
|
//保存条码信息
|
|
|
|
|
MesProduceSn produceSn = generateMesProduceSn(mesPart, sn, mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getQty(), format);
|
|
|
|
|
MesProduceSn produceSn = generateMesProduceSn(mesPart, sn, mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getQty());
|
|
|
|
|
//封装打印信息
|
|
|
|
|
MesProduceSnPrintDataModel printDataModel = getModel(produceSn, serialNo, mesCustomerPart.getCustPartNo(), organizeName);
|
|
|
|
|
mesProduceSnPrintModel.getMesProduceSnPrintDataModelList().add(printDataModel);
|
|
|
|
@ -132,7 +132,7 @@ public class GqaaPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
|
mesProduceSnPrintDataModel.setNo(no);
|
|
|
|
|
mesProduceSnPrintDataModel.setBarcode(produceSn.getProductSn());
|
|
|
|
|
mesProduceSnPrintDataModel.setCustPartNo(custPartNo);
|
|
|
|
|
mesProduceSnPrintDataModel.setProductDate(produceSn.getLotNo());
|
|
|
|
|
mesProduceSnPrintDataModel.setProductDate(TimeTool.parseStringFormat(produceSn.getLotNo(),DateUtil.SHORT_FORMAT,"yyyy/MM/dd"));
|
|
|
|
|
return mesProduceSnPrintDataModel;
|
|
|
|
|
}
|
|
|
|
|
private MesNumberRule getNumberRule(String organizeCode, MesPart part) {
|
|
|
|
@ -185,7 +185,7 @@ public class GqaaPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
|
return dataBuffer.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MesProduceSn generateMesProduceSn(MesPart mesPart, String sn, String userName, Double qty, String format) {
|
|
|
|
|
private MesProduceSn generateMesProduceSn(MesPart mesPart, String sn, String userName, Double qty) {
|
|
|
|
|
MesProduceSn mesProduceSn = new MesProduceSn();
|
|
|
|
|
mesProduceSn.setSerialNumber(snowflakeIdMaker.nextId() + "");
|
|
|
|
|
mesProduceSn.setProductSn(sn);
|
|
|
|
@ -198,7 +198,7 @@ public class GqaaPrintStrategy implements IPrintTemplateStrategyService {
|
|
|
|
|
mesProduceSn.setQty(qty);
|
|
|
|
|
mesProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.CREATE.getValue());
|
|
|
|
|
mesProduceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
|
mesProduceSn.setLotNo(TimeTool.getNowTime(format));
|
|
|
|
|
mesProduceSn.setLotNo(TimeTool.getToday());
|
|
|
|
|
mesProduceSn.setPrintCount(MesPcnExtConstWords.ONE);
|
|
|
|
|
mesProduceSn.setPrintStatus(MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue());
|
|
|
|
|
mesProduceSn.setOrganizeCode(mesPart.getOrganizeCode());
|
|
|
|
|