|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package com.dxhy.order.baseservice.module.commodity.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEnum; |
|
|
|
|
import com.dxhy.order.baseservice.module.commodity.service.CommodityCodeModifyLogService; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; |
|
|
|
|
import com.dxhy.order.constant.*; |
|
|
|
@ -139,7 +140,7 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
codeEntity.setDataSource(TaxClassCodeEnum.DATA_SOURCE_1.getKey()); |
|
|
|
|
codeEntity.setDataSource(CommodityCodeEnum.DATA_SOURCE_1.getKey()); |
|
|
|
|
codeEntity.setCreateTime(new Date()); |
|
|
|
|
codeEntity.setUserId(userId.toString()); |
|
|
|
|
codeEntity.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_1.getKey()); |
|
|
|
@ -352,7 +353,7 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
String tempMerchandiseName = StringUtil.replaceStr(commodityCodeEntity.getXmmc()); |
|
|
|
|
commodityCodeEntity.setXmmc(tempMerchandiseName); |
|
|
|
|
|
|
|
|
|
commodityCodeEntity.setDataSource(TaxClassCodeEnum.DATA_SOURCE_2.getKey()); |
|
|
|
|
commodityCodeEntity.setDataSource(CommodityCodeEnum.DATA_SOURCE_2.getKey()); |
|
|
|
|
commodityCodeEntity.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_1.getKey()); |
|
|
|
|
commodityCodeEntity.setDataState(TaxClassCodeEnum.DATA_STATE_1.getKey()); |
|
|
|
|
if (StringUtils.isNotEmpty(commodityCodeEntity.getSsflMc()) |
|
|
|
@ -415,7 +416,7 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
entity.setSpbm(taxClassCodeParam.getSsbm()); |
|
|
|
|
entity.setXhfNsrsbh(nsrsbh); |
|
|
|
|
entity.setSpjc(taxClassCodeParam.getSsjc()); |
|
|
|
|
entity.setDataSource(TaxClassCodeEnum.DATA_SOURCE_0.getKey());//接口已放弃不在使用
|
|
|
|
|
entity.setDataSource(CommodityCodeEnum.DATA_SOURCE_0.getKey());//接口已放弃不在使用
|
|
|
|
|
entity.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_0.getKey()); |
|
|
|
|
entity.setDataState(TaxClassCodeEnum.DATA_STATE_0.getKey()); |
|
|
|
|
entity.setUserId(userId); |
|
|
|
@ -621,13 +622,11 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
commodityCodeCheckQuery.setSl(receiveSpxxReq.getSl()); |
|
|
|
|
commodityCodeCheckQuery.setDeptId(receiveSpxxReq.getEntId()); |
|
|
|
|
Map<String,String> map = new HashMap<>(); |
|
|
|
|
// map.put("productName", xmmc);
|
|
|
|
|
map.put("zxbm", receiveSpxxReq.getZxbm()); |
|
|
|
|
map.put("entId",receiveSpxxReq.getEntId()); |
|
|
|
|
|
|
|
|
|
log.debug("{}校验名称是否存在 参数:{}", LOGGER_MSG, map); |
|
|
|
|
List<CommodityCodeEntity> commodityCodeEntityList = commodityMapper.queryProductList(map, null); |
|
|
|
|
//R r = commodityService.checkRepeat(commodityCodeCheckQuery, NsrsbhUtils.transShListByNsrsbh(receiveSpxxReq.getXhfNsrsbh()), false);
|
|
|
|
|
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeService.queryTaxClassCodeFromCache(receiveSpxxReq.getSpbm()); |
|
|
|
|
CommodityCodeEntity commodityCodeEntity = null; |
|
|
|
|
if (ObjectUtil.isNotEmpty(taxClassCodeEntity)) { |
|
|
|
@ -640,12 +639,17 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
if (commodityCodeEntity != null){ |
|
|
|
|
commodityCodeEntity.setUserId(userInfoService.getUser() != null && userInfoService.getUser().getUserId() != null ? userInfoService.getUser().getUserId().toString():""); |
|
|
|
|
commodityCodeEntity.setCreateTime(new Date()); |
|
|
|
|
commodityMapper.insertCommodity(commodityCodeEntity); |
|
|
|
|
log.debug("添加成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
// 简称、商品编码、规格型号、单位、优惠政策标识、零税率标识
|
|
|
|
|
//todo 优先级
|
|
|
|
|
commodityCodeEntity.setModifyTime(new Date()); |
|
|
|
|
commodityCodeEntity.setModifyUserId(userInfoService.getUser() != null && userInfoService.getUser().getUserId() != null ? userInfoService.getUser().getUserId().toString():""); |
|
|
|
|
if (commodityCodeEntity != null){ |
|
|
|
|
commodityMapper.updateCommodityByZxbm(commodityCodeEntity, map); |
|
|
|
|
} |
|
|
|
@ -721,10 +725,6 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
commodityCodeEntity.setSsflMc(taxClassCodeEntity.getSpmc()); |
|
|
|
|
commodityCodeEntity.setLslbs(receiveSpxxReq.getLslbs()); |
|
|
|
|
commodityCodeEntity.setZzstsgl(receiveSpxxReq.getZzstsgl()); |
|
|
|
|
commodityCodeEntity.setUserId(""); |
|
|
|
|
commodityCodeEntity.setCreateTime(new Date()); |
|
|
|
|
commodityCodeEntity.setModifyTime(new Date()); |
|
|
|
|
commodityCodeEntity.setModifyUserId(""); |
|
|
|
|
commodityCodeEntity.setGroupId(""); |
|
|
|
|
commodityCodeEntity.setGroupName(""); |
|
|
|
|
commodityCodeEntity.setGroupCode(""); |
|
|
|
@ -740,7 +740,7 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
// commodityCodeEntity.setStatus("1");
|
|
|
|
|
commodityCodeEntity.setInvoiceName(CommonUtils.subSpmc(receiveSpxxReq.getXmmc())); |
|
|
|
|
|
|
|
|
|
commodityCodeEntity.setDataSource(TaxClassCodeEnum.DATA_SOURCE_6.getKey()); |
|
|
|
|
commodityCodeEntity.setDataSource(CommodityCodeEnum.DATA_SOURCE_11.getKey()); |
|
|
|
|
commodityCodeEntity.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_0.getKey()); |
|
|
|
|
commodityCodeEntity.setDataState(TaxClassCodeEnum.DATA_STATE_0.getKey()); |
|
|
|
|
|
|
|
|
|