|
|
@@ -622,26 +622,26 @@ public class DistributeController {
|
|
|
if (id == null) {
|
|
|
try {
|
|
|
businessDefaultRateConfigMapper.insert(config);
|
|
|
- //新品编辑成功 给渠道自动添加对应值
|
|
|
- List<Long> distributeIds = userDistributeBusinessRateMapper.selectNoThisGoodsDistribute(config.getGoodsId());
|
|
|
- if (!distributeIds.isEmpty()) {
|
|
|
- List<UserPlatDistributeRate> save = new ArrayList<>(distributeIds.size());
|
|
|
- distributeIds.forEach(distributeId->{
|
|
|
- Integer secondRate = config.getSecondRate();
|
|
|
- if (secondRate==null) secondRate = 0;
|
|
|
- UserPlatDistributeRate userPlatDistributeRate = new UserPlatDistributeRate();
|
|
|
- userPlatDistributeRate.setDistributeId(distributeId);
|
|
|
- userPlatDistributeRate.setRate(rate);
|
|
|
- userPlatDistributeRate.setGoodsId(config.getGoodsId());
|
|
|
- userPlatDistributeRate.setSecondRate(secondRate);
|
|
|
- save.add(userPlatDistributeRate);
|
|
|
- });
|
|
|
- Lists.partition(save, 100).forEach(part -> userDistributeBusinessRateMapper.batchInsertDistributePlatRate(part));
|
|
|
- }
|
|
|
} catch (DuplicateKeyException e) {
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
+ //新品编辑成功 给渠道自动添加对应值
|
|
|
+ List<Long> distributeIds = userDistributeBusinessRateMapper.selectNoThisGoodsDistribute(config.getGoodsId());
|
|
|
+ if (!distributeIds.isEmpty()) {
|
|
|
+ List<UserPlatDistributeRate> save = new ArrayList<>(distributeIds.size());
|
|
|
+ distributeIds.forEach(distributeId -> {
|
|
|
+ Integer secondRate = config.getSecondRate();
|
|
|
+ if (secondRate == null) secondRate = 0;
|
|
|
+ UserPlatDistributeRate userPlatDistributeRate = new UserPlatDistributeRate();
|
|
|
+ userPlatDistributeRate.setDistributeId(distributeId);
|
|
|
+ userPlatDistributeRate.setRate(rate);
|
|
|
+ userPlatDistributeRate.setGoodsId(config.getGoodsId());
|
|
|
+ userPlatDistributeRate.setSecondRate(secondRate);
|
|
|
+ save.add(userPlatDistributeRate);
|
|
|
+ });
|
|
|
+ Lists.partition(save, 100).forEach(part -> userDistributeBusinessRateMapper.batchInsertDistributePlatRate(part));
|
|
|
+ }
|
|
|
businessDefaultRateConfigMapper.updateById(config);
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|