|
|
@@ -545,6 +545,7 @@ public class DistributeController {
|
|
|
@PutMapping("/put/business/rate")
|
|
|
@Log(module = "分销管理/修改商务人员比例", businessType = BusinessType.PUT, isSaveRequestData = true)
|
|
|
public Result<String> updateBusinessRate(@RequestBody @Validated List<UserDistributeBusinessRate> rates) {
|
|
|
+ List<Long> newDsSkuIds = new ArrayList<>();
|
|
|
rates.forEach(userDistributeBusinessRate -> {
|
|
|
Long rateId = userDistributeBusinessRate.getId();
|
|
|
UserDistributeBusinessRate businessRate = Optional.ofNullable(userDistributeBusinessRateMapper.selectById(rateId)).orElse(new UserDistributeBusinessRate());
|
|
|
@@ -565,16 +566,19 @@ public class DistributeController {
|
|
|
try {
|
|
|
userDistributeBusinessRateMapper.insert(businessRate);
|
|
|
|
|
|
- //删除存在告警的平台规格
|
|
|
- distributeGoodsSkuAlertMapper.delete(Wrappers.lambdaQuery(DistributeGoodsSkuAlert.class)
|
|
|
- .eq(DistributeGoodsSkuAlert::getSkuId, businessRate.getSkuId()));
|
|
|
-
|
|
|
+ newDsSkuIds.add(businessRate.getSkuId());
|
|
|
} catch (DuplicateKeyException e) {
|
|
|
}
|
|
|
} else {
|
|
|
userDistributeBusinessRateMapper.updateById(businessRate);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(newDsSkuIds)) {
|
|
|
+ //删除存在告警的平台规格
|
|
|
+ distributeGoodsSkuAlertMapper.delete(Wrappers.lambdaQuery(DistributeGoodsSkuAlert.class)
|
|
|
+ .in(DistributeGoodsSkuAlert::getSkuId, newDsSkuIds));
|
|
|
+ }
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult("修改比例成功");
|
|
|
}
|
|
|
|