|
@@ -10,6 +10,7 @@ import com.gree.mall.manager.bean.supply.sales.price.ProductPriceUpdateBean;
|
|
|
import com.gree.mall.manager.bean.supply.sales.price.ProductPriceUpdateVO;
|
|
import com.gree.mall.manager.bean.supply.sales.price.ProductPriceUpdateVO;
|
|
|
import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
|
import com.gree.mall.manager.enums.ExamineStatusEnum;
|
|
import com.gree.mall.manager.enums.ExamineStatusEnum;
|
|
|
|
|
+import com.gree.mall.manager.enums.StatusEnum;
|
|
|
import com.gree.mall.manager.enums.material.StateEnum;
|
|
import com.gree.mall.manager.enums.material.StateEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
@@ -43,6 +44,7 @@ public class ProductPriceUpdateLogic {
|
|
|
private final WalletService walletService;
|
|
private final WalletService walletService;
|
|
|
private final RebateTypeService rebateTypeService;
|
|
private final RebateTypeService rebateTypeService;
|
|
|
private final GoodsMaterialService goodsMaterialService;
|
|
private final GoodsMaterialService goodsMaterialService;
|
|
|
|
|
+ private final RebateTypeUseRateService rebateTypeUseRateService;
|
|
|
|
|
|
|
|
public IPage<ProductPriceUpdateVO> list(ZfireParamBean zfireParamBean) {
|
|
public IPage<ProductPriceUpdateVO> list(ZfireParamBean zfireParamBean) {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
@@ -177,6 +179,11 @@ public class ProductPriceUpdateLogic {
|
|
|
List<RebateType> walletRebates = rebateTypeService.list();;
|
|
List<RebateType> walletRebates = rebateTypeService.list();;
|
|
|
Map<String, RebateType> walletRebateMap = walletRebates.stream().collect(Collectors.toMap(RebateType::getCode, v -> v));
|
|
Map<String, RebateType> walletRebateMap = walletRebates.stream().collect(Collectors.toMap(RebateType::getCode, v -> v));
|
|
|
|
|
|
|
|
|
|
+ final List<RebateTypeUseRate> typeUseRateList = rebateTypeUseRateService.lambdaQuery()
|
|
|
|
|
+ .eq(RebateTypeUseRate::getStatus, StatusEnum.ONE.getKey())
|
|
|
|
|
+ .list();
|
|
|
|
|
+ Map<String, RebateTypeUseRate> typeUseRateMap = typeUseRateList.stream().collect(Collectors.toMap(v -> v.getSalesTypeId() + v.getRebateTypeId(), v -> v));
|
|
|
|
|
+
|
|
|
List<ProductPriceUpdateItem> resultList = new ArrayList<>();
|
|
List<ProductPriceUpdateItem> resultList = new ArrayList<>();
|
|
|
|
|
|
|
|
int index = 2;
|
|
int index = 2;
|
|
@@ -259,10 +266,12 @@ public class ProductPriceUpdateLogic {
|
|
|
if (walletRebate == null) {
|
|
if (walletRebate == null) {
|
|
|
throw new RemoteServiceException("第" + index + "行, 返利钱包编码: " + name + ", 不存在");
|
|
throw new RemoteServiceException("第" + index + "行, 返利钱包编码: " + name + ", 不存在");
|
|
|
}
|
|
}
|
|
|
-// Integer count = commonLogic.getRebateSaleTypeCount(saleType.getId(), walletRebate.getWalletRebateId());
|
|
|
|
|
-// if (count == 0) {
|
|
|
|
|
-// throw new RemoteServiceException("返利钱包+【"+walletRebate.getName() + "】与销售类型【" + saleType.getSaleName() + "】对应关系不存在");
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ boolean exist = typeUseRateMap.containsKey(saleType.getId() + walletRebate.getId());
|
|
|
|
|
+ if (!exist) {
|
|
|
|
|
+ throw new RemoteServiceException("返利钱包+【" + walletRebate.getName() + "】与销售类型【" + saleType.getName() + "】对应关系不存在");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
rebateTypeIdList.add(walletRebate.getId());
|
|
rebateTypeIdList.add(walletRebate.getId());
|
|
|
rebateTypeCodeList.add(walletRebate.getCode());
|
|
rebateTypeCodeList.add(walletRebate.getCode());
|