|
|
|
@ -11,6 +11,8 @@ import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.dao.GroupTaxClassCodeMapper; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.dto.AddUserRequestDto; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; |
|
|
|
|
import com.dxhy.order.consumer.modules.taxcodematch.dao.SdenergyTaxCodeMatchDao; |
|
|
|
|
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.AjaxResult; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.*; |
|
|
|
|
import com.dxhy.order.model.R; |
|
|
|
@ -51,6 +53,9 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { |
|
|
|
|
@Resource |
|
|
|
|
private BaseService baseService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private SdenergyTaxCodeMatchDao sdenergyTaxCodeMatchDao; |
|
|
|
|
|
|
|
|
|
// ===========物料相关开始===========
|
|
|
|
|
// 物料主动查询接口
|
|
|
|
|
@Value("${mdm.groupTaxCode.url}") |
|
|
|
@ -188,7 +193,20 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { |
|
|
|
|
// entity.setDescription(reqBO.getDESCSHORT());
|
|
|
|
|
// entity.setUUID(reqBO.getUUID());
|
|
|
|
|
// if (groupTaxClassCodeMapper.insertOnDuplicateKey(commodityCodeEntity) <= 0) {
|
|
|
|
|
// TODO 先查找物料分类编码和税收分类编码对应的字段
|
|
|
|
|
// 先查找物料分类编码和税收分类编码对应的字段
|
|
|
|
|
// 1.先去所有子公司库中匹配税编,以第一条为准;如果未匹配到,再去根据物料编码匹配
|
|
|
|
|
CommodityCodeEntity codeEntityForMatch = commodityMapper.queryByCommodityXmmcCompany(reqBO.getDESC1()); |
|
|
|
|
if (codeEntityForMatch == null) { |
|
|
|
|
// 2.如果未匹配到,再去根据物料编码匹配
|
|
|
|
|
SdenergyTaxCodeMatch taxCodeMatch = sdenergyTaxCodeMatchDao.queryByWlflbm(reqBO.getCATEGORYCODE()); |
|
|
|
|
if (taxCodeMatch != null) { |
|
|
|
|
codeEntityForMatch = new CommodityCodeEntity(); |
|
|
|
|
codeEntityForMatch.setSsflMc(taxCodeMatch.getSsflmc()); |
|
|
|
|
codeEntityForMatch.setSpbm(taxCodeMatch.getSsflbm()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// sdenergyTaxCodeMatchDao.queryByWlflbm(requestBody.get)
|
|
|
|
|
|
|
|
|
|
commodityCodeEntity.setId(DistributedKeyMaker.generateShotKey()); |
|
|
|
|
commodityCodeEntity.setSortId((long) i); |
|
|
|
@ -200,6 +218,15 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { |
|
|
|
|
commodityCodeEntity.setUUID(reqBO.getUUID()); |
|
|
|
|
commodityCodeEntity.setWlflbm(reqBO.getCATEGORYCODE()); |
|
|
|
|
commodityCodeEntity.setWlflmc(reqBO.getCATEGORYNAME()); |
|
|
|
|
|
|
|
|
|
// 维护税编和商品编码
|
|
|
|
|
if (codeEntityForMatch != null && StringUtils.isNotBlank(codeEntityForMatch.getSsflMc())) { |
|
|
|
|
commodityCodeEntity.setSsflMc(codeEntityForMatch.getSsflMc()); |
|
|
|
|
} |
|
|
|
|
if (codeEntityForMatch != null && StringUtils.isNotBlank(codeEntityForMatch.getSpbm())) { |
|
|
|
|
commodityCodeEntity.setSpbm(codeEntityForMatch.getSpbm()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
commodityCodeEntity.setCommodityId(baseService.getGenerateShotKey()); |
|
|
|
|
commodityCodeEntity.setXhfNsrsbh("-1"); |
|
|
|
|
if (commodityMapper.insertCommodityOnDuplicateKey(commodityCodeEntity) > 0) { |
|
|
|
|