SPS单据打印车型名称

tags/yfai-pcn-ext-v2.3
jun 6 months ago
parent f95fbb750d
commit a25c3993c5

@ -39,19 +39,12 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
public static final Logger LOGGER = LoggerFactory.getLogger(MesPullingOrderInfoService.class);
@Autowired
private MesPullingOrderInfoRepository mesPullingOrderInfoRepository;
@Autowired
private MesPullingOrderPartInfoRepository mesPullingOrderPartInfoRepository;
@Autowired
private MesPartPullRepository mesPartPullRDao;
@Autowired
private MesPartPullDetailRepository mesPartPullDetailRDao;
@Autowired
private MesWorkOrderPartRepository workOrderPartRepository;
@Autowired
private MesWorkCenterRepository mesWorkCenterRepository;
@Autowired
private MesPullingOrderExtendsRepository mesPullingOrderExtendsRepository;
private MesPartPullDetailRepository mesPartPullDetailRDao;
@Autowired
private IMesProduceSnExtService mesProduceSnExtService;
@ -65,6 +58,9 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
@Autowired
private MesConfigRepository configRao;
@Autowired
private MesCustomerCarModelRepository carModelRepository;
@Override
public ListPager<MesPullingOrderInfo> queryMesPullingOrderInfoByPager(MesPullingOrderInfo bean, Pager pager) {
@ -186,6 +182,8 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
List<MesPullingOrderInfo> pullingOrderInfos = mesPullingOrderInfoRepository.findByHqlWhere(packBean);
if (!CollectionUtils.isEmpty(pullingOrderInfos)) {
//根据车型代码查询车型信息
Map<String, List<MesCustomerCarModel>> mesCustomerCarModelMap = getMesCustomerCarModelMap(bean.getOrganizeCode(), pullingOrderInfos.stream().map(MesPullingOrderInfo::getCarModelCode).distinct().collect(Collectors.toList()));
//把查出来的拉动单打印并修改打印状态为已打印
List<MesPrintedSnLog> snLogList = new ArrayList<>();
for (MesPullingOrderInfo pullingOrderInfo : pullingOrderInfos) {
@ -206,7 +204,7 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
pullingOrderInfo.setWorkOrderNoLast(!StringUtil.isEmpty(pullingOrderInfo.getWorkOrderNo())?pullingOrderInfo.getWorkOrderNo().substring(pullingOrderInfo.getWorkOrderNo().length() - MesPcnExtConstWords.THREE):"");
pullingOrderInfo.setWorkOrderNoPre(!StringUtil.isEmpty(pullingOrderInfo.getWorkOrderNo())?pullingOrderInfo.getWorkOrderNo().substring(MesPcnExtConstWords.ZERO,pullingOrderInfo.getWorkOrderNo().length() - MesPcnExtConstWords.THREE):"");
pullingOrderInfo.setCustOrderNoLast(!StringUtil.isEmpty(pullingOrderInfo.getCustOrderNo())?pullingOrderInfo.getCustOrderNo().substring(pullingOrderInfo.getCustOrderNo().length() - MesPcnExtConstWords.FOUR):"");
pullingOrderInfo.setPartNamePrint("车型:"+pullingOrderInfo.getPartName());
pullingOrderInfo.setCarModelName("车型:" + (Objects.isNull(mesCustomerCarModelMap) || StringUtil.isEmpty(pullingOrderInfo.getCarModelCode()) || !mesCustomerCarModelMap.containsKey(pullingOrderInfo.getCarModelCode()) ? "" : mesCustomerCarModelMap.get(pullingOrderInfo.getCarModelCode()).iterator().next().getCarModelName()));
pullingOrderInfo.setPrintTime(TimeTool.getNowTime(true));
pullingOrderInfo.setPrintStatus(MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue());
@ -557,4 +555,16 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
return mesPullingOrder;
}
public Map<String, List<MesCustomerCarModel>> getMesCustomerCarModelMap(String organizeCode, List<String> carModelCodeList) {
if (StringUtil.isEmpty(organizeCode) || CollectionUtils.isEmpty(carModelCodeList)) return null;
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
if (carModelCodeList.size() == MesPcnExtConstWords.ONE) {
DdlPreparedPack.getStringEqualPack(carModelCodeList.get(MesPcnExtConstWords.ZERO), MesPcnExtConstWords.CAR_MODEL_CODE, packBean);
} else {
DdlPreparedPack.getInPackList(carModelCodeList, MesPcnExtConstWords.CAR_MODEL_CODE, packBean);
}
List<MesCustomerCarModel> customerCarModelList = carModelRepository.findByHqlWhere(packBean);
return CollectionUtils.isEmpty(customerCarModelList) ? null : customerCarModelList.stream().collect(Collectors.groupingBy(MesCustomerCarModel::getCarModelCode));
}
}

Loading…
Cancel
Save