|
|
@@ -41,7 +41,6 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -465,29 +464,24 @@ public class UserController {
|
|
|
}
|
|
|
}
|
|
|
if (e.getIsSkuRate()) {
|
|
|
- BigDecimal price = e.getPrice();
|
|
|
- GoodsDonSku sku = skuMapper.selectOne(Wrappers.lambdaQuery(GoodsDonSku.class)
|
|
|
- .eq(GoodsDonSku::getGoodsId, e.getGoodsId())
|
|
|
- .eq(GoodsDonSku::getPrice, price)
|
|
|
- .last("limit 1"));
|
|
|
- if (sku != null) {
|
|
|
- if (userDistribute != null) {
|
|
|
- UserPlatSkuDistributeRate userPlatSkuDistributeRate = userPlatSkuDistributeRateMapper.selectOne(Wrappers.lambdaQuery(UserPlatSkuDistributeRate.class)
|
|
|
- .eq(UserPlatSkuDistributeRate::getDistributeId, userDistribute.getId())
|
|
|
- .eq(UserPlatSkuDistributeRate::getGoodsId, e.getGoodsId())
|
|
|
- .eq(UserPlatSkuDistributeRate::getSkuId, sku.getId())
|
|
|
- .last("limit 1"));
|
|
|
- if (userPlatSkuDistributeRate != null) {
|
|
|
- e.setRate(userPlatSkuDistributeRate.getRate());
|
|
|
- }
|
|
|
- } else {
|
|
|
- DistributeGeneralSkuRate distributeGeneralSkuRate = distributeGeneralSkuRateMapper.selectOne(Wrappers.lambdaQuery(DistributeGeneralSkuRate.class)
|
|
|
- .eq(DistributeGeneralSkuRate::getGoodsId, e.getGoodsId())
|
|
|
- .eq(DistributeGeneralSkuRate::getSkuId, sku.getId())
|
|
|
- .last("limit 1"));
|
|
|
- if (distributeGeneralSkuRate != null) {
|
|
|
- e.setRate(distributeGeneralSkuRate.getRate());
|
|
|
- }
|
|
|
+ if (userDistribute != null) {
|
|
|
+ UserPlatSkuDistributeRate userPlatSkuDistributeRate = userPlatSkuDistributeRateMapper.selectOne(Wrappers.lambdaQuery(UserPlatSkuDistributeRate.class)
|
|
|
+ .eq(UserPlatSkuDistributeRate::getDistributeId, userDistribute.getId())
|
|
|
+ .eq(UserPlatSkuDistributeRate::getGoodsId, e.getGoodsId())
|
|
|
+ .ne(UserPlatSkuDistributeRate::getRate, 0)
|
|
|
+ .orderByAsc(UserPlatSkuDistributeRate::getRate)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (userPlatSkuDistributeRate != null) {
|
|
|
+ e.setRate(userPlatSkuDistributeRate.getRate());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ DistributeGeneralSkuRate distributeGeneralSkuRate = distributeGeneralSkuRateMapper.selectOne(Wrappers.lambdaQuery(DistributeGeneralSkuRate.class)
|
|
|
+ .eq(DistributeGeneralSkuRate::getGoodsId, e.getGoodsId())
|
|
|
+ .ne(DistributeGeneralSkuRate::getRate, 0)
|
|
|
+ .orderByAsc(DistributeGeneralSkuRate::getRate)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (distributeGeneralSkuRate != null) {
|
|
|
+ e.setRate(distributeGeneralSkuRate.getRate());
|
|
|
}
|
|
|
}
|
|
|
}
|