From 18fee22d4f1722085daadc61098eef20923eb512 Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Thu, 21 Nov 2024 17:12:50 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=89=93=E5=8D=B0=E7=9B=AE=E8=A7=86?= =?UTF-8?q?=E5=8D=95-=E8=A3=85=E9=85=8D=E4=BB=B6=E6=9C=89=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E5=B1=95=E7=A4=BA=E5=BA=8F=E5=8F=B7=E7=9A=84=E9=9B=B6?= =?UTF-8?q?=E4=BB=B6=E9=9C=80=E8=A6=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../print/strategy/AssemblyVisualListPrintStrategy.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java index 98c000e..e553d34 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/AssemblyVisualListPrintStrategy.java @@ -89,12 +89,21 @@ public class AssemblyVisualListPrintStrategy implements IPrintTemplateStrategySe resultMap.put(MesPcnExtConstWords.REPLACE_CSN,MesPcnExtConstWords.REPLACE_CSN_CP+workOrder.getCustPartNo().substring(workOrder.getCustPartNo().length() -4)); // 总个数 Integer totalCount = partProdGroup.getTotalCount(); + + Map> collect = workOrderAssemblyList.stream().collect(Collectors.groupingBy(MesWorkOrderAssembly::getDisplaySeq)); // 为空时显示内容 String isNullViewContent = StringUtils.isEmpty(partProdGroup.getIsNullViewContent()) ? "" : partProdGroup.getIsNullViewContent(); - for (Integer index = 0; index < totalCount; index++) { - String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue(); + for (int index = 0; index < collect.size(); index++) { + List orderAssemblyList = collect.get(index+1); + List disPlayValues = orderAssemblyList.stream().map(MesWorkOrderAssembly::getDisplayValue).distinct().collect(Collectors.toList()); + String displayValue =isNullViewContent; + if(!disPlayValues.isEmpty()){ + displayValue = String.join("\r\n", disPlayValues); + } + // String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue(); - resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : isNullViewContent : displayValue); +// resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : isNullViewContent : displayValue); + resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), displayValue); } printDataMapList.add(resultMap); From fe3c342deef6cf17440e4e35762a41003b2fbcbc Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Fri, 22 Nov 2024 17:25:44 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/offlineprint/IMesOfflinePrintService.java | 8 ++ .../busi/offlinesn/MesWuhanOfflinePrint.java | 36 ++++++++ .../offlineprint/MesOfflinePrintServiceImpl.java | 99 ++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/offlineprint/IMesOfflinePrintService.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrint.java create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/offlineprint/MesOfflinePrintServiceImpl.java diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/offlineprint/IMesOfflinePrintService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/offlineprint/IMesOfflinePrintService.java new file mode 100644 index 0000000..104845c --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/offlineprint/IMesOfflinePrintService.java @@ -0,0 +1,8 @@ +package cn.estsh.i3plus.ext.mes.pcn.api.busi.offlineprint; + +import java.util.Map; + +public interface IMesOfflinePrintService { + + Map getCustSnOfflineInfo(String custSn,String templateCode,String organizeCode); +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrint.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrint.java new file mode 100644 index 0000000..733a8d0 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrint.java @@ -0,0 +1,36 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi.offlinesn; + +import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.offlineprint.MesOfflinePrintServiceImpl; +import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.impp.framework.boot.util.ResultBean; +import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@RestController +@Api(tags = "离线条码打印") +@RequestMapping(MesCommonConstant.MES_YANFEN + "/offline/print") +@Slf4j +public class MesWuhanOfflinePrint { + + @Autowired + private MesOfflinePrintServiceImpl mesOfflinePrintService; + @GetMapping("/cust-sn/{custSn}/{templateCode}/{organizeCode}") + public ResultBean custSn(@PathVariable("custSn") String custSn,@PathVariable("templateCode") String templateCode,@PathVariable("organizeCode") String organizeCode) { + + Map custSnOfflineInfo = null; + try { + custSnOfflineInfo = mesOfflinePrintService.getCustSnOfflineInfo(custSn, templateCode, organizeCode); + } catch (Exception e) { + ResultBean.fail().setErrorMsg(e.getMessage()); + } + return ResultBean.success("查询成功").setResultMap(custSnOfflineInfo); + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/offlineprint/MesOfflinePrintServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/offlineprint/MesOfflinePrintServiceImpl.java new file mode 100644 index 0000000..286065b --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/offlineprint/MesOfflinePrintServiceImpl.java @@ -0,0 +1,99 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.offlineprint; + +import cn.estsh.i3plus.ext.mes.pcn.api.busi.offlineprint.IMesOfflinePrintService; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.BarCodeUtils; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; +import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; +import cn.estsh.i3plus.pojo.mes.bean.MesLabelTemplate; +import cn.estsh.i3plus.pojo.mes.bean.MesLabelTemplateParam; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder; +import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateParamRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateRepository; +import cn.estsh.i3plus.pojo.mes.repository.MesWorkOrderRepository; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; +import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.ByteArrayOutputStream; +import java.util.*; + +@Service +@Slf4j +public class MesOfflinePrintServiceImpl implements IMesOfflinePrintService { + @Autowired + private MesWorkOrderRepository workOrderRepository; + + @Autowired + private MesLabelTemplateRepository labelTemplateRepository; + + @Autowired + private MesLabelTemplateParamRepository labelTemplateParamRepository; + + @Override + public Map getCustSnOfflineInfo(String custSn,String templateCode,String organizeCode) { + List> printDate = new ArrayList<>(); + Map data = new HashMap<>(); + if (custSn.length() != MesPcnExtConstWords.CUSTOMER_SN_LENGTH_GM) { + String a = custSn.substring(0, 3); + String b = custSn.substring(3, 5); + String c = custSn.substring(5, 20); + String d = custSn.substring(20, 29); + String e = custSn.substring(29, 41); + String f = custSn.substring(41, 58); + custSn= a + (char)30 + b + (char)29 + c + (char)29 + d + (char)29 + e + (char)29 + f + (char)30 + (char)04; + } + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(custSn,"custSn",ddlPackBean); + List workOrderList = workOrderRepository.findByHqlWhere(ddlPackBean); + if (workOrderList != null && !workOrderList.isEmpty()) { + MesWorkOrder mesWorkOrder = workOrderList.get(0); + String vpps = custSn.substring(8, 23); + String custPartNo = mesWorkOrder.getCustPartNo(); + String duns = custSn.substring(36, 46); + String custSnAfterContent = custSn.substring(47, custSn.length() - 2); + data.put("custSn", custSn); + data.put("custPartNoPrefix", custPartNo.substring(0, custPartNo.length() - 4)); + data.put("custPartNoAfterFour", custPartNo.substring(custPartNo.length() - 4).toUpperCase()); + data.put("custSnVPPS", vpps); + data.put("custSnDUNS", duns); + data.put("custSnAfterContent", custSnAfterContent); + } + + try { + ByteArrayOutputStream dataMatrixCode = BarCodeUtils.createDataMatrixCode(custSn); + data.put("custSnDataMatrix", Base64.getEncoder().encodeToString(dataMatrixCode.toByteArray())); + printDate.add(data); + } catch (Exception e) { + throw new ImppBusiException().setErrorDetail("生成条码出错!"); + } + MesLabelTemplate mesLabelTemplate = getMesLabelTemplate(templateCode, organizeCode); + Map templateMap = new HashMap<>(); + templateMap.put("labelTemplate", mesLabelTemplate); + templateMap.put("templateData", printDate); + return templateMap; + } + + private MesLabelTemplate getMesLabelTemplate(String templateCode,String organizeCode) { + + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(templateCode,"templateCode",ddlPackBean); + List mesLabelTemplates = labelTemplateRepository.findByHqlWhere(ddlPackBean); + if (mesLabelTemplates == null ||mesLabelTemplates.isEmpty()){ + log.error(String.format("标签模板代码【%s】在标签模板表不存在!", templateCode)); + throw ImppExceptionBuilder.newInstance().setErrorDetail(String.format("标签模板代码【%s】在标签模板表不存在!", templateCode)).build(); + } + DdlPackBean templateParamPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(templateCode,"templateCode",templateParamPackBean); + List mesLabelTemplateParams = labelTemplateParamRepository.findByHqlWhere(templateParamPackBean); + if (mesLabelTemplateParams == null || mesLabelTemplateParams.isEmpty()){ + log.error(String.format("标签模板代码【%s】在标签模板明细表不存在!", templateCode)); + throw ImppExceptionBuilder.newInstance().setErrorDetail(String.format("标签模板代码【%s】在标签模板明细表不存在!", templateCode)).build(); + } + MesLabelTemplate mesLabelTemplate = mesLabelTemplates.get(0); + mesLabelTemplate.setLabelTemplateParamList(mesLabelTemplateParams); + return mesLabelTemplate; + } +} From b93e9c737cd4dd4de5f28b439d7fc0a97dcb5e36 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Fri, 22 Nov 2024 17:31:42 +0800 Subject: [PATCH 3/7] =?UTF-8?q?jis=E6=8B=89=E5=8A=A8=E5=8D=95=E6=98=8E?= =?UTF-8?q?=E7=BB=86=20=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=20=20=E8=BD=A6?= =?UTF-8?q?=E5=9E=8B=E4=BB=A3=E7=A0=81=20=E8=BD=A6=E5=9E=8B=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=20=E5=B1=9E=E6=80=A7=E5=88=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesPullingOrderInfoController.java | 4 ++ .../busi/MesPullingOrderInfoService.java | 68 +++++++++++++++++----- 2 files changed, 57 insertions(+), 15 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java index a0795c0..d98f5c2 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java @@ -35,6 +35,7 @@ public class MesPullingOrderInfoController { @Autowired private IMesTemplateService mesTemplateService; + @GetMapping(value = "/query-pager") @ApiOperation(value = "查询拉动单") public ResultBean queryMesPullingOrderInfoByPager(MesPullingOrderInfo mesPullingOrderInfo, Pager pager) { @@ -49,6 +50,7 @@ public class MesPullingOrderInfoController { return ResultBean.fail(e); } } + @PostMapping(value = "/doScan") @ApiOperation(value = "拉动单扫描") public ResultBean doMesPullingOrderInfoScan(@RequestBody MesPullingOrderInfo mesPullingOrderInfo) { @@ -97,6 +99,7 @@ public class MesPullingOrderInfoController { return ImppExceptionBuilder.newInstance().buildExceptionResult(e); } } + @GetMapping(value = "/jis-part-info/query-pager") @ApiOperation(value = "查询JIS拉动单明细") public ResultBean queryMesPullingOrderPartInfoByPager(MesPullingOrderInfo mesPullingOrderInfo, Pager pager) { @@ -114,6 +117,7 @@ public class MesPullingOrderInfoController { return ResultBean.fail(e); } } + @PostMapping(value = "/doJisScan") @ApiOperation(value = "JIS物料拉动-校验条码") public ResultBean doMesPullingOrderInfoJisScan(@RequestBody MesPullingOrderPartInfo info) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java index 41133a1..255c574 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java @@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory; 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.*; import java.util.stream.Collectors; @@ -247,25 +248,62 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService { List resultList = mesPullingOrderPartInfoRepository.findByHqlWherePage(packBean, pager); if (!CollectionUtils.isEmpty(resultList)) { + + Map> pullCodePartMap = null; + List pullingOrderInfoList = null; + Map> pullingOrderInfoMap = null; + Map> customerCarModelMap = null; + //查拉动单明细对应的拉动组规则 - DdlPackBean packBeanDetail = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); - DdlPreparedPack.getInPackList(resultList.stream().map(MesPullingOrderPartInfo::getPullCode).collect(Collectors.toList()), "pullCode", packBeanDetail); - List mesPartPullDetails = mesPartPullDetailRDao.findByHqlWhere(packBeanDetail); - if (!CollectionUtils.isEmpty(mesPartPullDetails)) { - Map> pullCodePartMap = mesPartPullDetails.stream().collect(Collectors.groupingBy(a -> a.getPullCode() + "=" + a.getPartNo())); - for (MesPullingOrderPartInfo partInfo : resultList) { - if (!CollectionUtils.isEmpty(pullCodePartMap.get(partInfo.getPullCode() + "=" + partInfo.getPartNo()))) { - MesPartPullDetail mesPartPullDetail = pullCodePartMap.get(partInfo.getPullCode() + "=" + partInfo.getPartNo()).get(0); - partInfo.setScanValidationType(StringUtil.isEmpty(mesPartPullDetail.getScanValidationType()) ? 10 : mesPartPullDetail.getScanValidationType()); - partInfo.setRuleValidation(StringUtil.isEmpty(mesPartPullDetail.getRuleValidation()) ? "" : mesPartPullDetail.getRuleValidation()); - if (Objects.isNull(mesPartPullDetail.getScanValidationType()) || mesPartPullDetail.getScanValidationType() == MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.UN_VALIDATE.getValue()) { - partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode()); - } else if (partInfo.getColor() == MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode()) { - partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.RED.getCode()); - } + List list = (resultList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getPullCode()))).map(MesPullingOrderPartInfo::getPullCode).collect(Collectors.toList())).stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(list)) { + DdlPackBean packBeanDetail = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getInPackList(list, "pullCode", packBeanDetail); + List mesPartPullDetails = mesPartPullDetailRDao.findByHqlWhere(packBeanDetail); + pullCodePartMap = CollectionUtils.isEmpty(mesPartPullDetails) ? null : + mesPartPullDetails.stream().filter(o -> null != o).collect(Collectors.groupingBy(o -> new StringJoiner(MesPcnExtConstWords.AND).add(o.getPullCode()).add(o.getPartNo()).toString())); + } + + list = resultList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getPullingOrderNo()))).map(MesPullingOrderPartInfo::getPullingOrderNo).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(list)) { + packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getInPackList(list, "pullingOrderNo", packBean); + pullingOrderInfoList = mesPullingOrderInfoRepository.findByHqlWhere(packBean); + pullingOrderInfoMap = CollectionUtils.isEmpty(pullingOrderInfoList) ? null : + pullingOrderInfoList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesPullingOrderInfo::getPullingOrderNo)); + } + + if (!CollectionUtils.isEmpty(pullingOrderInfoList)) { + list = (pullingOrderInfoList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getCarModelCode()))).map(MesPullingOrderInfo::getCarModelCode).collect(Collectors.toList())).stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()); + packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getInPackList(list, MesPcnExtConstWords.CAR_MODEL_CODE, packBean); + List customerCarModelList = carModelRepository.findByHqlWhere(packBean); + customerCarModelMap = CollectionUtils.isEmpty(customerCarModelList) ? null : + customerCarModelList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesCustomerCarModel::getCarModelCode)); + } + + String key; + for (MesPullingOrderPartInfo partInfo : resultList) { + key = new StringJoiner(MesPcnExtConstWords.AND).add(partInfo.getPullCode()).add(partInfo.getPartNo()).toString(); + if (!CollectionUtils.isEmpty(pullCodePartMap) && pullCodePartMap.containsKey(key)) { + MesPartPullDetail mesPartPullDetail = pullCodePartMap.get(key).get(0); + partInfo.setScanValidationType(StringUtil.isEmpty(mesPartPullDetail.getScanValidationType()) ? 10 : mesPartPullDetail.getScanValidationType()); + partInfo.setRuleValidation(StringUtil.isEmpty(mesPartPullDetail.getRuleValidation()) ? MesPcnExtConstWords.EMPTY : mesPartPullDetail.getRuleValidation()); + if (Objects.isNull(mesPartPullDetail.getScanValidationType()) || mesPartPullDetail.getScanValidationType().compareTo(MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.UN_VALIDATE.getValue()) == 0) { + partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode()); + } else if (partInfo.getColor() == MesExtEnumUtil.PART_PULL_DETAIL_COLOR.WHITE.getCode()) { + partInfo.setColor(MesExtEnumUtil.PART_PULL_DETAIL_COLOR.RED.getCode()); + } + if (!CollectionUtils.isEmpty(pullingOrderInfoMap) && pullingOrderInfoMap.containsKey(partInfo.getPullingOrderNo())) { + partInfo.setCarModelCode(pullingOrderInfoMap.get(partInfo.getPullingOrderNo()).get(0).getCarModelCode()); } + if (!StringUtils.isEmpty(partInfo.getCarModelCode()) && !CollectionUtils.isEmpty(customerCarModelMap) && customerCarModelMap.containsKey(partInfo.getCarModelCode())) { + partInfo.setCarModelName(customerCarModelMap.get(partInfo.getCarModelCode()).get(0).getCarModelName()); + } + } } + } return new ListPager<>(resultList, pager); } From abc094b35ae22df32e3fb63a3633606e78f0f19f Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Fri, 22 Nov 2024 17:32:04 +0800 Subject: [PATCH 4/7] =?UTF-8?q?jis=E6=8B=89=E5=8A=A8=E5=8D=95=E6=98=8E?= =?UTF-8?q?=E7=BB=86=20=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=20=20=E8=BD=A6?= =?UTF-8?q?=E5=9E=8B=E4=BB=A3=E7=A0=81=20=E8=BD=A6=E5=9E=8B=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=20=E5=B1=9E=E6=80=A7=E5=88=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pcn/apiservice/controller/busi/MesPullingOrderInfoController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java index d98f5c2..a66ebc0 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPullingOrderInfoController.java @@ -7,7 +7,9 @@ import cn.estsh.i3plus.pojo.base.bean.ListPager; import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; import cn.estsh.i3plus.pojo.base.util.StringUtil; -import cn.estsh.i3plus.pojo.mes.bean.*; +import cn.estsh.i3plus.pojo.mes.bean.MesLabelTemplate; +import cn.estsh.i3plus.pojo.mes.bean.MesPullingOrderInfo; +import cn.estsh.i3plus.pojo.mes.bean.MesPullingOrderPartInfo; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.exception.ImppBusiException; From d4e349fc4c0ba5ff436ef49225d1d948c1237802 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Fri, 22 Nov 2024 17:38:58 +0800 Subject: [PATCH 5/7] =?UTF-8?q?jis=E6=8B=89=E5=8A=A8=E5=8D=95=E6=98=8E?= =?UTF-8?q?=E7=BB=86=20=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=20=20=E8=BD=A6?= =?UTF-8?q?=E5=9E=8B=E4=BB=A3=E7=A0=81=20=E8=BD=A6=E5=9E=8B=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=20=E5=B1=9E=E6=80=A7=E5=88=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/busi/MesPullingOrderInfoService.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java index 255c574..52f7dfa 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPullingOrderInfoService.java @@ -275,11 +275,13 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService { if (!CollectionUtils.isEmpty(pullingOrderInfoList)) { list = (pullingOrderInfoList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getCarModelCode()))).map(MesPullingOrderInfo::getCarModelCode).collect(Collectors.toList())).stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()); - packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); - DdlPreparedPack.getInPackList(list, MesPcnExtConstWords.CAR_MODEL_CODE, packBean); - List customerCarModelList = carModelRepository.findByHqlWhere(packBean); - customerCarModelMap = CollectionUtils.isEmpty(customerCarModelList) ? null : - customerCarModelList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesCustomerCarModel::getCarModelCode)); + if (!CollectionUtils.isEmpty(list)) { + packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode()); + DdlPreparedPack.getInPackList(list, MesPcnExtConstWords.CAR_MODEL_CODE, packBean); + List customerCarModelList = carModelRepository.findByHqlWhere(packBean); + customerCarModelMap = CollectionUtils.isEmpty(customerCarModelList) ? null : + customerCarModelList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesCustomerCarModel::getCarModelCode)); + } } String key; From 378196579810500ad48c102ad4fda01bf1310753 Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Fri, 22 Nov 2024 17:46:00 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{MesWuhanOfflinePrint.java => MesWuhanOfflinePrintController.java} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/{MesWuhanOfflinePrint.java => MesWuhanOfflinePrintController.java} (93%) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrint.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrintController.java similarity index 93% rename from modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrint.java rename to modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrintController.java index 733a8d0..9602d3a 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrint.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrintController.java @@ -2,7 +2,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi.offlinesn; import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.offlineprint.MesOfflinePrintServiceImpl; import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; -import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; @@ -18,7 +17,7 @@ import java.util.Map; @Api(tags = "离线条码打印") @RequestMapping(MesCommonConstant.MES_YANFEN + "/offline/print") @Slf4j -public class MesWuhanOfflinePrint { +public class MesWuhanOfflinePrintController { @Autowired private MesOfflinePrintServiceImpl mesOfflinePrintService; From a136ddb88270b767a852061a2eeddb0840c6bdff Mon Sep 17 00:00:00 2001 From: "castle.zang" Date: Fri, 22 Nov 2024 18:00:39 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/offlinesn/MesWuhanOfflinePrintController.java | 12 +++++------- .../ext/mes/pcn/apiservice/model/MesCustSnOfflineModel.java | 12 ++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesCustSnOfflineModel.java diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrintController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrintController.java index 9602d3a..e9db51e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrintController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/offlinesn/MesWuhanOfflinePrintController.java @@ -1,15 +1,13 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi.offlinesn; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.model.MesCustSnOfflineModel; import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.offlineprint.MesOfflinePrintServiceImpl; import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.Map; @@ -21,12 +19,12 @@ public class MesWuhanOfflinePrintController { @Autowired private MesOfflinePrintServiceImpl mesOfflinePrintService; - @GetMapping("/cust-sn/{custSn}/{templateCode}/{organizeCode}") - public ResultBean custSn(@PathVariable("custSn") String custSn,@PathVariable("templateCode") String templateCode,@PathVariable("organizeCode") String organizeCode) { + @PostMapping("/cust-sn") + public ResultBean custSn(@RequestBody MesCustSnOfflineModel model) { Map custSnOfflineInfo = null; try { - custSnOfflineInfo = mesOfflinePrintService.getCustSnOfflineInfo(custSn, templateCode, organizeCode); + custSnOfflineInfo = mesOfflinePrintService.getCustSnOfflineInfo(model.getCustSn(), model.getTemplateCode(), model.getOrganizeCode()); } catch (Exception e) { ResultBean.fail().setErrorMsg(e.getMessage()); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesCustSnOfflineModel.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesCustSnOfflineModel.java new file mode 100644 index 0000000..9a9b3a2 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/model/MesCustSnOfflineModel.java @@ -0,0 +1,12 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.model; + +import lombok.Data; + +@Data +public class MesCustSnOfflineModel { + private String custSn; + + private String templateCode; + + private String organizeCode; +}