|
|
@ -3,7 +3,10 @@ package com.dxhy.order.consumer.openapi.service.impl; |
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
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.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.dao.BuyerMapper; |
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity; |
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity; |
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntityDetail; |
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntityDetail; |
|
|
@ -71,6 +74,10 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private TaxClassCodeMapper taxClassCodeMapper; |
|
|
|
private TaxClassCodeMapper taxClassCodeMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private DictionaryService dictionaryService; |
|
|
|
|
|
|
|
|
|
|
|
// ===========物料相关开始===========
|
|
|
|
// ===========物料相关开始===========
|
|
|
|
// 物料主动查询接口
|
|
|
|
// 物料主动查询接口
|
|
|
|
@Value("${mdm.groupTaxCode.url}") |
|
|
|
@Value("${mdm.groupTaxCode.url}") |
|
|
@ -312,10 +319,22 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { |
|
|
|
|
|
|
|
|
|
|
|
public List<CommodityCodeEntity> matchRule(List<MdmSyncGroupTaxCodeReqBO> mdmGmfxxtbReqBOS){ |
|
|
|
public List<CommodityCodeEntity> matchRule(List<MdmSyncGroupTaxCodeReqBO> mdmGmfxxtbReqBOS){ |
|
|
|
List<CommodityCodeEntity> list = Lists.newArrayList(); |
|
|
|
List<CommodityCodeEntity> list = Lists.newArrayList(); |
|
|
|
|
|
|
|
// 物料单位中英文转换字典
|
|
|
|
|
|
|
|
List<DictionaryEntity> dictData = dictionaryService.cacheDictionaries("productUnitConversion"); |
|
|
|
for (int i = 0; i < mdmGmfxxtbReqBOS.size(); i++) { |
|
|
|
for (int i = 0; i < mdmGmfxxtbReqBOS.size(); i++) { |
|
|
|
MdmSyncGroupTaxCodeReqBO reqBO = mdmGmfxxtbReqBOS.get(i); |
|
|
|
MdmSyncGroupTaxCodeReqBO reqBO = mdmGmfxxtbReqBOS.get(i); |
|
|
|
CommodityCodeEntity commodityCodeEntity = new CommodityCodeEntity(); |
|
|
|
CommodityCodeEntity commodityCodeEntity = new CommodityCodeEntity(); |
|
|
|
commodityCodeEntity.setWlflbm(reqBO.getCATEGORYCODE()); |
|
|
|
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.先去所有子公司库中匹配税编,以第一条为准;如果未匹配到,再去根据物料编码匹配
|
|
|
|
// 1.先去所有子公司库中匹配税编,以第一条为准;如果未匹配到,再去根据物料编码匹配
|
|
|
|
// DecimalFormat g=new DecimalFormat("000000000000000000");
|
|
|
|
// DecimalFormat g=new DecimalFormat("000000000000000000");
|
|
|
|
// String code = g.format(Integer.valueOf(reqBO.getCODE()));
|
|
|
|
// String code = g.format(Integer.valueOf(reqBO.getCODE()));
|
|
|
|