|
|
|
@ -4,7 +4,9 @@ import com.dxhy.order.baseservice.module.base.service.BaseService; |
|
|
|
|
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; |
|
|
|
|
import com.dxhy.order.constant.ConfigureConstant; |
|
|
|
|
import com.dxhy.order.constant.TaxClassCodeEnum; |
|
|
|
|
import com.dxhy.order.consumer.dao.GroupCommodityCodeMapper; |
|
|
|
|
import com.dxhy.order.consumer.modules.commodity.domain.dto.QueryGroupCommodityDTO; |
|
|
|
|
import com.dxhy.order.consumer.modules.commodity.domain.dto.QuoteGroupCommodityDTO; |
|
|
|
@ -28,6 +30,7 @@ import javax.annotation.Resource; |
|
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -54,6 +57,9 @@ public class GroupCommodityCodeServiceImpl implements IGroupCommodityCodeService |
|
|
|
|
@Resource |
|
|
|
|
private TaxClassCodeMapper taxClassCodeMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private UserInfoService userInfoService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询集团物料库 |
|
|
|
|
* |
|
|
|
@ -136,7 +142,15 @@ public class GroupCommodityCodeServiceImpl implements IGroupCommodityCodeService |
|
|
|
|
log.error("{}引用物料异常", LOGGER_MSG, e); |
|
|
|
|
} |
|
|
|
|
if(queryCommodityEntity != null){ |
|
|
|
|
//如果优先级更高则不进行更新
|
|
|
|
|
if(Arrays.asList("1,2,6,7,8,10").contains(queryCommodityEntity.getDataSource())){ |
|
|
|
|
return R.error("第" + (i + 1) + "条数据,已存在"); |
|
|
|
|
} |
|
|
|
|
newCommodityCodeEntity.setId(queryCommodityEntity.getId()); |
|
|
|
|
newCommodityCodeEntity.setModifyTime(new Date()); |
|
|
|
|
newCommodityCodeEntity.setCreateTime(null); |
|
|
|
|
newCommodityCodeEntity.setUserId(null); |
|
|
|
|
newCommodityCodeEntity.setModifyUserId(userInfoService.getUser() != null && userInfoService.getUser().getUserId() != null ? userInfoService.getUser().getUserId().toString():""); |
|
|
|
|
if (groupCommodityMapper.updateCommodityCode(newCommodityCodeEntity) <= 0) { |
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|
|
|
|
return R.error("第" + (i + 1) + "条数据,引用失败"); |
|
|
|
@ -144,10 +158,12 @@ public class GroupCommodityCodeServiceImpl implements IGroupCommodityCodeService |
|
|
|
|
}else{ |
|
|
|
|
newCommodityCodeEntity.setId(baseService.getGenerateShotKey()); |
|
|
|
|
newCommodityCodeEntity.setXhfNsrsbh(quoteGroupCommodityDTO.getXhfNsrsbh()); |
|
|
|
|
newCommodityCodeEntity.setDataState("0"); |
|
|
|
|
newCommodityCodeEntity.setDataState(TaxClassCodeEnum.DATA_SOURCE_9.getKey()); |
|
|
|
|
newCommodityCodeEntity.setXhfMc(quoteGroupCommodityDTO.getXhfMc()); |
|
|
|
|
newCommodityCodeEntity.setHsbz("1"); |
|
|
|
|
newCommodityCodeEntity.setYhzcbs("0"); |
|
|
|
|
newCommodityCodeEntity.setHsbz(ConfigureConstant.STRING_1); |
|
|
|
|
newCommodityCodeEntity.setYhzcbs(ConfigureConstant.STRING_0); |
|
|
|
|
newCommodityCodeEntity.setCreateTime(new Date()); |
|
|
|
|
newCommodityCodeEntity.setUserId(userInfoService.getUser() != null && userInfoService.getUser().getUserId() != null ? userInfoService.getUser().getUserId().toString():""); |
|
|
|
|
if(StringUtils.isNotBlank(newCommodityCodeEntity.getSpbm())){ |
|
|
|
|
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeMapper.queryTaxClassCodeEntityBySpbm(newCommodityCodeEntity.getSpbm()); |
|
|
|
|
if(taxClassCodeEntity != null){ |
|
|
|
|