|
@@ -392,9 +392,27 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
//根据订单金额匹配成本阶梯
|
|
|
List<TopCostTpItem> tpItems = new ArrayList<>();
|
|
|
for (TopCostTpItem x : items) {
|
|
|
+ BigDecimal price = goodsPrice;
|
|
|
+ if (x.getDockStatus() == 1){
|
|
|
+ //启用成本扣除项
|
|
|
+ switch (x.getDockType()){
|
|
|
+ case 1://百分比
|
|
|
+ //成本扣除金额
|
|
|
+ BigDecimal divide1 = x.getDockValue().divide(new BigDecimal("100"));
|
|
|
+ BigDecimal multiply = goodsPrice.multiply(divide1);
|
|
|
+ price = price.subtract(multiply);
|
|
|
+ break;
|
|
|
+ case 2://固定金额
|
|
|
+ price = price.subtract(x.getDockValue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ((ObjectUtils.isNull(x.getMinValue()) && ObjectUtils.isNull(x.getMaxValue()))
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) > 0 && goodsPrice.compareTo(x.getMaxValue()) < 0)
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) == 0 && goodsPrice.compareTo(x.getMaxValue()) == 0)){
|
|
|
+ || (price.compareTo(x.getMinValue()) > 0 && price.compareTo(x.getMaxValue()) < 0)
|
|
|
+ || (price.compareTo(x.getMinValue()) == 0 && price.compareTo(x.getMaxValue()) == 0)){
|
|
|
tpItems.add(x);
|
|
|
}
|
|
|
}
|
|
@@ -596,7 +614,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
BigDecimal costTotal = new BigDecimal("0.00");//成本
|
|
|
BigDecimal profitTotal = new BigDecimal("0.00"); //盈亏
|
|
|
List<TopOldOrderGoods> orderGoodsList = topOrderGoodsService.list(new LambdaQueryWrapper<TopOldOrderGoods>()
|
|
|
- .eq(TopOldOrderGoods::getOrderSn, order.getOrderSn()).ne(TopOldOrderGoods::getCheckStatus, -1).eq(TopOldOrderGoods::getStatus, 1));
|
|
|
+ .eq(TopOldOrderGoods::getOrderSn, order.getOrderSn()).in(TopOldOrderGoods::getCheckStatus, Arrays.asList(0,1)).eq(TopOldOrderGoods::getStatus, 1));
|
|
|
//佣金
|
|
|
BigDecimal brokerage = order.getPretaxBrokerage();
|
|
|
//平摊佣金
|
|
@@ -622,11 +640,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
if (item.getProjectId() == -1 && item.getBusinessId() == -1){
|
|
|
return true;
|
|
|
}
|
|
|
-// TopCourseProjectType projectType = topCourseProjectTypeService.getById(item.getProjectId());
|
|
|
TopCourseBusiness business = topCourseBusinessService.getById(item.getBusinessId());
|
|
|
-// if (businessFullName.contains(projectType.getProjectName()) && businessFullName.contains(business.getBusinessName())){
|
|
|
-// return true;
|
|
|
-// }
|
|
|
+
|
|
|
if (businessFullName.contains(business.getOldBusinessName())){
|
|
|
return true;
|
|
|
}
|
|
@@ -639,9 +654,27 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
//根据订单金额匹配成本阶梯
|
|
|
List<TopCostTpItemVo> tpItems = new ArrayList<>();
|
|
|
for (TopCostTpItemVo x : items) {
|
|
|
+ BigDecimal price = goodsPrice;
|
|
|
+ if (x.getDockStatus() == 1){
|
|
|
+ //启用成本扣除项
|
|
|
+ switch (x.getDockType()){
|
|
|
+ case 1://百分比
|
|
|
+ //成本扣除金额
|
|
|
+ BigDecimal divide1 = x.getDockValue().divide(new BigDecimal("100"));
|
|
|
+ BigDecimal multiply = goodsPrice.multiply(divide1);
|
|
|
+ price = price.subtract(multiply);
|
|
|
+ break;
|
|
|
+ case 2://固定金额
|
|
|
+ price = price.subtract(x.getDockValue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ((ObjectUtils.isNull(x.getMinValue()) && ObjectUtils.isNull(x.getMaxValue()))
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) > 0 && goodsPrice.compareTo(x.getMaxValue()) < 0)
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) == 0 && goodsPrice.compareTo(x.getMaxValue()) == 0)){
|
|
|
+ || (price.compareTo(x.getMinValue()) > 0 && price.compareTo(x.getMaxValue()) < 0)
|
|
|
+ || (price.compareTo(x.getMinValue()) == 0 && price.compareTo(x.getMaxValue()) == 0)){
|
|
|
tpItems.add(x);
|
|
|
}
|
|
|
}
|
|
@@ -2230,6 +2263,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
List<OrderGoods> orderGoodsList = orderGoodsService
|
|
|
.list(new LambdaQueryWrapper<OrderGoods>()
|
|
|
.eq(OrderGoods::getOrderSn, order.getOrderSn())
|
|
|
+ .ne(OrderGoods::getRefundStatus,2)
|
|
|
.eq(OrderGoods::getStatus, 1));
|
|
|
|
|
|
//成本项
|
|
@@ -2266,9 +2300,27 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
//根据订单金额匹配成本阶梯
|
|
|
List<TopCostTpItemVo> tpItems = new ArrayList<>();
|
|
|
for (TopCostTpItemVo x : items) {
|
|
|
+ BigDecimal price = goodsPrice;
|
|
|
+ if (x.getDockStatus() == 1){
|
|
|
+ //启用成本扣除项
|
|
|
+ switch (x.getDockType()){
|
|
|
+ case 1://百分比
|
|
|
+ //成本扣除金额
|
|
|
+ BigDecimal divide1 = x.getDockValue().divide(new BigDecimal("100"));
|
|
|
+ BigDecimal multiply = goodsPrice.multiply(divide1);
|
|
|
+ price = price.subtract(multiply);
|
|
|
+ break;
|
|
|
+ case 2://固定金额
|
|
|
+ price = price.subtract(x.getDockValue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ((ObjectUtils.isNull(x.getMinValue()) && ObjectUtils.isNull(x.getMaxValue()))
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) > 0 && goodsPrice.compareTo(x.getMaxValue()) < 0)
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) == 0 && goodsPrice.compareTo(x.getMaxValue()) == 0)){
|
|
|
+ || (price.compareTo(x.getMinValue()) > 0 && price.compareTo(x.getMaxValue()) < 0)
|
|
|
+ || (price.compareTo(x.getMinValue()) == 0 && price.compareTo(x.getMaxValue()) == 0)){
|
|
|
tpItems.add(x);
|
|
|
}
|
|
|
}
|
|
@@ -2336,6 +2388,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
List<TopOldOrderGoods> orderGoodsList = topOrderGoodsService
|
|
|
.list(new LambdaQueryWrapper<TopOldOrderGoods>()
|
|
|
.eq(TopOldOrderGoods::getOrderSn, order.getOrderSn())
|
|
|
+ .eq(TopOldOrderGoods::getCheckStatus,Arrays.asList(0,1))
|
|
|
.eq(TopOldOrderGoods::getStatus, 1));
|
|
|
if (ObjectUtils.isNotNull(order.getPretaxBrokerage()) && order.getPretaxBrokerage().compareTo(BigDecimal.ZERO) != 0){
|
|
|
halveBrokerage = brokerage.divide(new BigDecimal(orderGoodsList.size()),4,BigDecimal.ROUND_DOWN);
|
|
@@ -2359,11 +2412,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
if (x.getProjectId() == -1 && x.getBusinessId() == -1){
|
|
|
return true;
|
|
|
}
|
|
|
-// TopCourseProjectType projectType = topCourseProjectTypeService.getById(x.getProjectId());
|
|
|
TopCourseBusiness business = topCourseBusinessService.getById(x.getBusinessId());
|
|
|
-// if (businessName.contains(projectType.getProjectName()) && businessName.contains(business.getBusinessName())){
|
|
|
-// return true;
|
|
|
-// }
|
|
|
if (businessName.contains(business.getOldBusinessName())){
|
|
|
return true;
|
|
|
}
|
|
@@ -2376,9 +2425,27 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
//根据订单金额匹配成本阶梯
|
|
|
List<TopCostTpItemVo> tpItems = new ArrayList<>();
|
|
|
for (TopCostTpItemVo x : items) {
|
|
|
+ BigDecimal price = goodsPrice;
|
|
|
+ if (x.getDockStatus() == 1){
|
|
|
+ //启用成本扣除项
|
|
|
+ switch (x.getDockType()){
|
|
|
+ case 1://百分比
|
|
|
+ //成本扣除金额
|
|
|
+ BigDecimal divide1 = x.getDockValue().divide(new BigDecimal("100"));
|
|
|
+ BigDecimal multiply = goodsPrice.multiply(divide1);
|
|
|
+ price = price.subtract(multiply);
|
|
|
+ break;
|
|
|
+ case 2://固定金额
|
|
|
+ price = price.subtract(x.getDockValue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ((ObjectUtils.isNull(x.getMinValue()) && ObjectUtils.isNull(x.getMaxValue()))
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) > 0 && goodsPrice.compareTo(x.getMaxValue()) < 0)
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) == 0 && goodsPrice.compareTo(x.getMaxValue()) == 0)){
|
|
|
+ || (price.compareTo(x.getMinValue()) > 0 && price.compareTo(x.getMaxValue()) < 0)
|
|
|
+ || (price.compareTo(x.getMinValue()) == 0 && price.compareTo(x.getMaxValue()) == 0)){
|
|
|
tpItems.add(x);
|
|
|
}
|
|
|
}
|
|
@@ -2714,6 +2781,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
List<OrderGoods> orderGoodsList = orderGoodsService
|
|
|
.list(new LambdaQueryWrapper<OrderGoods>()
|
|
|
.eq(OrderGoods::getOrderSn, orderSn)
|
|
|
+ .ne(OrderGoods::getRefundStatus,2)
|
|
|
.eq(OrderGoods::getStatus, 1));
|
|
|
|
|
|
//成本项
|
|
@@ -2752,9 +2820,27 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
//根据订单金额匹配成本阶梯
|
|
|
List<TopCostTpItemVo> tpItems = new ArrayList<>();
|
|
|
for (TopCostTpItemVo x : items) {
|
|
|
+ BigDecimal price = goodsPrice;
|
|
|
+ if (x.getDockStatus() == 1){
|
|
|
+ //启用成本扣除项
|
|
|
+ switch (x.getDockType()){
|
|
|
+ case 1://百分比
|
|
|
+ //成本扣除金额
|
|
|
+ BigDecimal divide1 = x.getDockValue().divide(new BigDecimal("100"));
|
|
|
+ BigDecimal multiply = goodsPrice.multiply(divide1);
|
|
|
+ price = price.subtract(multiply);
|
|
|
+ break;
|
|
|
+ case 2://固定金额
|
|
|
+ price = price.subtract(x.getDockValue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ((ObjectUtils.isNull(x.getMinValue()) && ObjectUtils.isNull(x.getMaxValue()))
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) > 0 && goodsPrice.compareTo(x.getMaxValue()) < 0)
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) == 0 && goodsPrice.compareTo(x.getMaxValue()) == 0)){
|
|
|
+ || (price.compareTo(x.getMinValue()) > 0 && price.compareTo(x.getMaxValue()) < 0)
|
|
|
+ || (price.compareTo(x.getMinValue()) == 0 && price.compareTo(x.getMaxValue()) == 0)){
|
|
|
tpItems.add(x);
|
|
|
}
|
|
|
}
|
|
@@ -2828,6 +2914,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
List<TopOldOrderGoods> orderGoodsList = topOrderGoodsService
|
|
|
.list(new LambdaQueryWrapper<TopOldOrderGoods>()
|
|
|
.eq(TopOldOrderGoods::getOrderSn, orderSn)
|
|
|
+ .in(TopOldOrderGoods::getCheckStatus,Arrays.asList(0,1))
|
|
|
.eq(TopOldOrderGoods::getStatus, 1));
|
|
|
if (ObjectUtils.isNotNull(order.getPretaxBrokerage()) && order.getPretaxBrokerage().compareTo(BigDecimal.ZERO) != 0){
|
|
|
halveBrokerage = brokerage.divide(new BigDecimal(orderGoodsList.size()),4,BigDecimal.ROUND_DOWN);
|
|
@@ -2855,11 +2942,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
if (item.getProjectId() == -1 && item.getBusinessId() == -1){
|
|
|
return true;
|
|
|
}
|
|
|
-// TopCourseProjectType projectType = topCourseProjectTypeService.getById(item.getProjectId());
|
|
|
TopCourseBusiness business = topCourseBusinessService.getById(item.getBusinessId());
|
|
|
-// if (businessName.contains(projectType.getProjectName()) && businessName.contains(business.getBusinessName())){
|
|
|
-// return true;
|
|
|
-// }
|
|
|
+
|
|
|
if (businessName.contains(business.getOldBusinessName())){
|
|
|
return true;
|
|
|
}
|
|
@@ -2872,9 +2956,27 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
//根据订单金额匹配成本阶梯
|
|
|
List<TopCostTpItemVo> tpItems = new ArrayList<>();
|
|
|
for (TopCostTpItemVo x : items) {
|
|
|
+ BigDecimal price = goodsPrice;
|
|
|
+ if (x.getDockStatus() == 1){
|
|
|
+ //启用成本扣除项
|
|
|
+ switch (x.getDockType()){
|
|
|
+ case 1://百分比
|
|
|
+ //成本扣除金额
|
|
|
+ BigDecimal divide1 = x.getDockValue().divide(new BigDecimal("100"));
|
|
|
+ BigDecimal multiply = goodsPrice.multiply(divide1);
|
|
|
+ price = price.subtract(multiply);
|
|
|
+ break;
|
|
|
+ case 2://固定金额
|
|
|
+ price = price.subtract(x.getDockValue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ((ObjectUtils.isNull(x.getMinValue()) && ObjectUtils.isNull(x.getMaxValue()))
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) > 0 && goodsPrice.compareTo(x.getMaxValue()) < 0)
|
|
|
- || (goodsPrice.compareTo(x.getMinValue()) == 0 && goodsPrice.compareTo(x.getMaxValue()) == 0)){
|
|
|
+ || (price.compareTo(x.getMinValue()) > 0 && price.compareTo(x.getMaxValue()) < 0)
|
|
|
+ || (price.compareTo(x.getMinValue()) == 0 && price.compareTo(x.getMaxValue()) == 0)){
|
|
|
tpItems.add(x);
|
|
|
}
|
|
|
}
|