问题清单修复

tags/yfai-pcn-ext-v1.1
jun 10 months ago
parent 0439e49640
commit 655f495f7b

@ -118,6 +118,8 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
@Override
public MesProduceSnPrintModel doPrint(MesProduceSnPrintModel mesProduceSnPrintModel) {
String organizeCode = mesProduceSnPrintModel.getOrganizeCode();
//获取产线信息
String workCenterCode = getWorkCenterCode(organizeCode);
//物料信息
MesPart mesPart = mesPartService.getMesPartByPartNo(mesProduceSnPrintModel.getPartNo(), organizeCode);
@ -132,7 +134,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
DdlPreparedPack.getStringEqualPack(snRule, "ruleCode", mesRulePackBean);
List<MesNumberRule> ruleList = mesNumberRuleRDao.findByHqlWhere(mesRulePackBean);
if (ruleList.isEmpty()) {
MesPcnException.throwMesBusiException("零件号【】打印规则查询不到!", mesPart.getPartNo());
MesPcnException.throwMesBusiException("零件号【%s】打印规则查询不到!", mesPart.getPartNo());
}
MesNumberRule numberRule = ruleList.get(0);
String methodNameExt = numberRule.getMethodNameExt();
@ -166,6 +168,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
MesProduceSnPrintModel resultModel = templateStrategy.execute(genSerialNoModel, mesProduceSnPrintModel, numberRule,null,null,false);
resultModel.getMesProduceSnList().forEach(mesProduceSn -> {
mesProduceSn.setWorkCenterCode(workCenterCode);
mesProduceSn.setFid(UUID.randomUUID().toString());
//保存条码
mesProduceSnRDao.insert(mesProduceSn);
@ -186,7 +189,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
DdlPreparedPack.getStringEqualPack(mesProduceSnPrintModel.getProductSn(), "barcode", snLogPackBean);
List<MesPrintedSnLog> snLogList = mesPrintedSnRao.findByHqlWhere(snLogPackBean);
if (snLogList.isEmpty()) {
MesPcnException.throwMesBusiException("条码【】查询不到打印记录!", mesProduceSnPrintModel.getProductSn());
MesPcnException.throwMesBusiException("条码【%s】查询不到打印记录!", mesProduceSnPrintModel.getProductSn());
}
MesPrintedSnLog mesPrintedSnLog = snLogList.get(0);
MesProduceSnPrintDataModel model = new MesProduceSnPrintDataModel();
@ -198,6 +201,14 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
return mesProduceSnPrintModel;
}
private String getWorkCenterCode(String organizeCode) {
List<MesConfig> mesConfigList = configService.findMesConfigByCfgCode(MesPcnExtConstWords.PRINT_WORK_CENTER_COED, organizeCode);
if(CollectionUtils.isEmpty(mesConfigList)){
MesPcnException.throwMesBusiException("条码打印产线参数【%s】未维护",MesPcnExtConstWords.PRINT_WORK_CENTER_COED);
}
return mesConfigList.iterator().next().getCfgValue();
}
private String getTemplate(MesProduceSnPrintModel mesProduceSnPrintModel, MesPart mesPart) {
Date date = new Date();
StringBuilder template = new StringBuilder();

@ -379,5 +379,8 @@ public class MesPcnExtConstWords {
public static final String SEND_DATA = "SEND_DATA";
public static final String SEND_ITEM_DATA = "SEND_ITEM_DATA";
//条码打印产线
public static final String PRINT_WORK_CENTER_COED = "PRINT_WORK_CENTER_COED";
}

Loading…
Cancel
Save