|
|
|
@ -25,6 +25,7 @@ import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
@ -92,6 +93,7 @@ public class MesProductSnPrintNosortStepService extends BaseStepService {
|
|
|
|
|
* 重构,返回给前端打印数据
|
|
|
|
|
*/
|
|
|
|
|
List<MesProduceSnPrintModel> printModelList = new ArrayList<>();
|
|
|
|
|
List<Map<String, Object>> resultMapList = new ArrayList<>();
|
|
|
|
|
//2. 获取条码需要模板、模板代码、打印机 --- 循环遍历条码 封装数据
|
|
|
|
|
for (MesProductionPsOutContext sn : productionPsOutContextList) {
|
|
|
|
|
List<MesProdRuleContext> mesProdRuleContexts = prodRuleContextMap.get(sn.getForeignKey());
|
|
|
|
@ -132,12 +134,20 @@ public class MesProductSnPrintNosortStepService extends BaseStepService {
|
|
|
|
|
// GenSerialNoModel model , MesProduceSnPrintModel mesProduceSnPrintModel, MesNumberRule numberRule, StepResult stepResult, StationRequestBean reqBean, Boolean isStep
|
|
|
|
|
MesProduceSnPrintModel printModel = strategyService.execute(null, mesProduceSnPrintModel, null, stepResult, reqBean, true);
|
|
|
|
|
printModelList.add(printModel);
|
|
|
|
|
if (!CollectionUtils.isEmpty(printModel.getPrintContextList()) && printModel.getPrintContextList().size() > MesPcnExtConstWords.ZERO) {
|
|
|
|
|
resultMapList.addAll(printModel.getPrintContextList());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//前端接收到busiTyep是customComponent,并且 dataType是file类型的消息,就需要打印后续消息里的数据,一个模板对应多个打印数据
|
|
|
|
|
resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.CUSTOM_COMPONENT.getValue());
|
|
|
|
|
resultBean.setDataType(MesPcnEnumUtil.STATION_DATA_TYPE.FILE.getValue());
|
|
|
|
|
resultBean.setResultObj(printModelList);
|
|
|
|
|
if (!CollectionUtils.isEmpty(resultMapList) && resultMapList.size() > MesPcnExtConstWords.ZERO) {
|
|
|
|
|
resultBean.setCustomPageName(MesPcnExtConstWords.SORT_WORK_CENTER_PRINT);
|
|
|
|
|
resultBean.setResultObj(resultMapList);
|
|
|
|
|
} else {
|
|
|
|
|
resultBean.setResultObj(printModelList);
|
|
|
|
|
}
|
|
|
|
|
//3. 发送数据给到前端
|
|
|
|
|
this.sendMessage(reqBean, resultBean);
|
|
|
|
|
List<MesPrintedSnLog> snLogList = printModelList.stream().map(MesProduceSnPrintModel::getMesPrintedSnLogList).flatMap(List::stream).collect(Collectors.toList());
|
|
|
|
|