|
|
|
@ -140,16 +140,15 @@ public class MesProductSnPrintSortStepService extends BaseStepService {
|
|
|
|
|
MesNumberRule numberRule = numberRuleRepository.getByProperty(packBean);
|
|
|
|
|
if (null == numberRule) stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("工单号[%s]零件号[%s]客户条码编码规则[%s]无效!", productionPartContext.getWorkOrderNo(), productionPartContext.getPartNo(), custMatchRule));
|
|
|
|
|
|
|
|
|
|
//过滤打印配置信息
|
|
|
|
|
//获取零件表的打印模版和打印机
|
|
|
|
|
String labelTemplateCode = mesPart.getCustLabelTemplate();;
|
|
|
|
|
String printer = mesPart.getProductPrinterCode();
|
|
|
|
|
if (StringUtils.isEmpty(labelTemplateCode)) {
|
|
|
|
|
//获取工单装配件的打印模版和打印机
|
|
|
|
|
MesProdRuleContext prodRuleContext = prodRuleContextMap.get(productionPartContext.getForeignKey());
|
|
|
|
|
MesProductionAssemblySortContext productionAssemblySortContext = filterPrintInfo(prodRuleContext);
|
|
|
|
|
|
|
|
|
|
//获取打印模版和打印机
|
|
|
|
|
String labelTemplateCode = null != productionAssemblySortContext ? productionAssemblySortContext.getPrintTemplate() : null;
|
|
|
|
|
String printer = null != productionAssemblySortContext ? productionAssemblySortContext.getPrinter() : null;
|
|
|
|
|
if (StringUtils.isEmpty(labelTemplateCode)) {
|
|
|
|
|
labelTemplateCode = mesPart.getCustLabelTemplate();
|
|
|
|
|
printer = mesPart.getProductPrinterCode();
|
|
|
|
|
labelTemplateCode = null != productionAssemblySortContext ? productionAssemblySortContext.getPrintTemplate() : null;
|
|
|
|
|
printer = null != productionAssemblySortContext ? productionAssemblySortContext.getPrinter() : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null == labelTemplateCode) stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("工单号[%s]零件号[%s]未在ERP物料信息维护打印模板,请检查并修改!", productionPartContext.getWorkOrderNo(), productionPartContext.getPartNo()));
|
|
|
|
|