diff --git a/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java b/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java index a2973f0c..3aafed83 100644 --- a/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java +++ b/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java @@ -3,7 +3,10 @@ package com.dxhy.order.consumer.openapi.service.impl; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSONObject; +import com.dxhy.order.baseservice.module.base.dao.DictionaryMapper; +import com.dxhy.order.baseservice.module.base.model.DictionaryEntity; import com.dxhy.order.baseservice.module.base.service.BaseService; +import com.dxhy.order.baseservice.module.base.service.DictionaryService; import com.dxhy.order.baseservice.module.buyer.dao.BuyerMapper; import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity; import com.dxhy.order.baseservice.module.buyer.model.BuyerEntityDetail; @@ -71,6 +74,10 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { @Resource private TaxClassCodeMapper taxClassCodeMapper; + + @Resource + private DictionaryService dictionaryService; + // ===========物料相关开始=========== // 物料主动查询接口 @Value("${mdm.groupTaxCode.url}") @@ -312,10 +319,22 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { public List matchRule(List mdmGmfxxtbReqBOS){ List list = Lists.newArrayList(); + // 物料单位中英文转换字典 + List dictData = dictionaryService.cacheDictionaries("productUnitConversion"); for (int i = 0; i < mdmGmfxxtbReqBOS.size(); i++) { MdmSyncGroupTaxCodeReqBO reqBO = mdmGmfxxtbReqBOS.get(i); CommodityCodeEntity commodityCodeEntity = new CommodityCodeEntity(); commodityCodeEntity.setWlflbm(reqBO.getCATEGORYCODE()); + // 进行单位中英文转换 + if (dictData!=null && dictData.size()>0) { + log.info("进行单位中英文转换,转换前:{}",reqBO.getDESC5()); + DictionaryEntity dictionaryEntity = dictData.stream().filter(item->item.getCode().equals(reqBO.getDESC5())).findFirst().get(); + if (dictionaryEntity!=null) { + reqBO.setDESC5(dictionaryEntity.getValue()); + } + log.info("进行单位中英文转换,转换后:{}",reqBO.getDESC5()); + } + // 1.先去所有子公司库中匹配税编,以第一条为准;如果未匹配到,再去根据物料编码匹配 // DecimalFormat g=new DecimalFormat("000000000000000000"); // String code = g.format(Integer.valueOf(reqBO.getCODE()));