|
@@ -410,7 +410,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
}
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(settleList)) {
|
|
if (CollectionUtils.isNotEmpty(settleList)) {
|
|
|
BigDecimal money = settleList.stream().filter(item -> ObjectUtils.isNotNull(item.getSettleMoney()) && item.getSettleMoney().compareTo(BigDecimal.ZERO) > 0)
|
|
BigDecimal money = settleList.stream().filter(item -> ObjectUtils.isNotNull(item.getSettleMoney()) && item.getSettleMoney().compareTo(BigDecimal.ZERO) > 0)
|
|
|
- .map(x -> x.getSettleMoney().divide(new BigDecimal(x.getOrderNum()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
|
+ .map(x -> x.getSettleMoney().divide(new BigDecimal(x.getOrderNum()),BigDecimal.ROUND_CEILING)).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
return money;
|
|
return money;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -537,6 +537,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
|
//换算订单成本和盈亏
|
|
//换算订单成本和盈亏
|
|
|
TopCostTpItem topCostTpItem = tpItem;
|
|
TopCostTpItem topCostTpItem = tpItem;
|
|
|
|
|
+ orderGoods.setDivideType(topCostTpItem.getDockType());
|
|
|
|
|
+ orderGoods.setDivideRate(topCostTpItem.getDockValue());
|
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
|
//启用成本扣除项
|
|
//启用成本扣除项
|
|
|
switch (topCostTpItem.getDockType()) {
|
|
switch (topCostTpItem.getDockType()) {
|
|
@@ -566,6 +568,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ orderGoods.setDivideMoney(cost);
|
|
|
costTotal = costTotal.add(cost);
|
|
costTotal = costTotal.add(cost);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -809,6 +812,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
|
//换算订单成本和盈亏
|
|
//换算订单成本和盈亏
|
|
|
TopCostTpItemVo topCostTpItem = tpItem;
|
|
TopCostTpItemVo topCostTpItem = tpItem;
|
|
|
|
|
+ orderGoods.setDivideType(topCostTpItem.getDockType());
|
|
|
|
|
+ orderGoods.setDivideRate(topCostTpItem.getDockValue());
|
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
|
//启用成本扣除项
|
|
//启用成本扣除项
|
|
|
switch (topCostTpItem.getDockType()) {
|
|
switch (topCostTpItem.getDockType()) {
|
|
@@ -838,6 +843,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ orderGoods.setDivideMoney(cost);
|
|
|
costTotal = costTotal.add(cost);
|
|
costTotal = costTotal.add(cost);
|
|
|
}
|
|
}
|
|
|
order.setOrderCost(costTotal);
|
|
order.setOrderCost(costTotal);
|
|
@@ -899,6 +905,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
BigDecimal brokerage = bo.getPretaxBrokerage().subtract(multiply);
|
|
BigDecimal brokerage = bo.getPretaxBrokerage().subtract(multiply);
|
|
|
order.setBrokerage(brokerage);
|
|
order.setBrokerage(brokerage);
|
|
|
}
|
|
}
|
|
|
|
|
+ BigDecimal repairMoneyTotal = BigDecimal.ZERO;
|
|
|
if (CollectionUtils.isNotEmpty(bo.getOrderGoodsList())) {
|
|
if (CollectionUtils.isNotEmpty(bo.getOrderGoodsList())) {
|
|
|
List<TopOldOrderGoods> add = new ArrayList<>();
|
|
List<TopOldOrderGoods> add = new ArrayList<>();
|
|
|
List<Long> signIds = new ArrayList<>();
|
|
List<Long> signIds = new ArrayList<>();
|
|
@@ -919,6 +926,10 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ //订单补款
|
|
|
|
|
+ if (ObjectUtils.isNotNull(orderGoods.getRepairMoney()) && orderGoods.getRepairMoney().compareTo(BigDecimal.ZERO) > 0){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(add)) {
|
|
if (CollectionUtils.isNotEmpty(add)) {
|
|
|
topOrderGoodsService.saveBatch(add);
|
|
topOrderGoodsService.saveBatch(add);
|
|
@@ -1021,6 +1032,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
userCount = 1;
|
|
userCount = 1;
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
list.forEach(item -> {
|
|
list.forEach(item -> {
|
|
|
|
|
+ item.setPretaxBrokerage(BigDecimal.ZERO);
|
|
|
item.setUserCount(1);
|
|
item.setUserCount(1);
|
|
|
item.setCheckStatusStr(item.getCheckStr(item.getCheckStatus()));
|
|
item.setCheckStatusStr(item.getCheckStr(item.getCheckStatus()));
|
|
|
//专业
|
|
//专业
|
|
@@ -1047,6 +1059,12 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
item.setStudyStatus("未开始");
|
|
item.setStudyStatus("未开始");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //分成模式
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getDivideType()) && item.getDivideType() == 1){
|
|
|
|
|
+ item.setDivideRateStr(item.getDivideRate().multiply(new BigDecimal("100.00"))+"%");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ item.setDivideRateStr(item.getDivideRate().toString());
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -1063,6 +1081,10 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
if (query.getOrderFrom() != 4){
|
|
if (query.getOrderFrom() != 4){
|
|
|
// 老系统查询学习状态
|
|
// 老系统查询学习状态
|
|
|
TopOldOrder order = getOne(new LambdaQueryWrapper<TopOldOrder>().eq(TopOldOrder::getOrderSn, query.getOrderSn()));
|
|
TopOldOrder order = getOne(new LambdaQueryWrapper<TopOldOrder>().eq(TopOldOrder::getOrderSn, query.getOrderSn()));
|
|
|
|
|
+ BigDecimal bonus = BigDecimal.ZERO;
|
|
|
|
|
+ if (ObjectUtils.isNotNull(order.getPretaxBrokerage()) && order.getPretaxBrokerage().compareTo(BigDecimal.ZERO) > 0){
|
|
|
|
|
+ bonus = order.getPretaxBrokerage().divide(new BigDecimal(list.size()),BigDecimal.ROUND_CEILING);
|
|
|
|
|
+ }
|
|
|
Map<String, String> params = new HashMap<>();
|
|
Map<String, String> params = new HashMap<>();
|
|
|
Long nowTime = DateUtils.getNowTime();
|
|
Long nowTime = DateUtils.getNowTime();
|
|
|
String sign = ToolsUtils.EncoderByMd5(query.getOrderSn() + nowTime.toString() + "pubilc2022");
|
|
String sign = ToolsUtils.EncoderByMd5(query.getOrderSn() + nowTime.toString() + "pubilc2022");
|
|
@@ -1080,10 +1102,20 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
Object data = jsonObject.get("Data");
|
|
Object data = jsonObject.get("Data");
|
|
|
if (ObjectUtils.isNull(data)) {
|
|
if (ObjectUtils.isNull(data)) {
|
|
|
//data 为空
|
|
//data 为空
|
|
|
- list.forEach(x -> x.setStudyStatus("未开始"));
|
|
|
|
|
|
|
+ for (TopOldOrderGoodsListVo x : list) {
|
|
|
|
|
+ x.setPretaxBrokerage(bonus);
|
|
|
|
|
+ x.setStudyStatus("未开始");
|
|
|
|
|
+ //分成模式
|
|
|
|
|
+ if (ObjectUtils.isNotNull(x.getDivideType()) && x.getDivideType() == 1){
|
|
|
|
|
+ x.setDivideRateStr(x.getDivideRate().multiply(new BigDecimal("100.00"))+"%");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ x.setDivideRateStr(x.getDivideRate().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
List<TopOldOrderStudyVo> studyVos = JSONArray.parseArray(JSONObject.toJSONString(data), TopOldOrderStudyVo.class);
|
|
List<TopOldOrderStudyVo> studyVos = JSONArray.parseArray(JSONObject.toJSONString(data), TopOldOrderStudyVo.class);
|
|
|
- list.forEach(item -> {
|
|
|
|
|
|
|
+ for (TopOldOrderGoodsListVo item : list) {
|
|
|
|
|
+ item.setPretaxBrokerage(bonus);
|
|
|
item.setStudyStatus("未开始");
|
|
item.setStudyStatus("未开始");
|
|
|
TopOldOrderStudyVo studyVo = studyVos.stream().filter(x -> x.getUnderOrdeEnrollItemId().equals(item.getSignId())
|
|
TopOldOrderStudyVo studyVo = studyVos.stream().filter(x -> x.getUnderOrdeEnrollItemId().equals(item.getSignId())
|
|
|
&& x.getIdNum().equals(item.getUserCard())).findFirst().orElse(null);
|
|
&& x.getIdNum().equals(item.getUserCard())).findFirst().orElse(null);
|
|
@@ -1096,7 +1128,13 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
item.setStudyStatus("已结束");
|
|
item.setStudyStatus("已结束");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ //分成模式
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getDivideType()) && item.getDivideType() == 1){
|
|
|
|
|
+ item.setDivideRateStr(item.getDivideRate().multiply(new BigDecimal("100.00"))+"%");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ item.setDivideRateStr(item.getDivideRate().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
log.error("旧系统订单学员学习情况接口请求错误" + respone);
|
|
log.error("旧系统订单学员学习情况接口请求错误" + respone);
|
|
@@ -3262,6 +3300,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
|
//换算订单成本和盈亏
|
|
//换算订单成本和盈亏
|
|
|
TopCostTpItemVo topCostTpItem = tpItem;
|
|
TopCostTpItemVo topCostTpItem = tpItem;
|
|
|
|
|
+ orderGoods.setDivideType(topCostTpItem.getDockType());
|
|
|
|
|
+ orderGoods.setDivideRate(topCostTpItem.getDockValue());
|
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
|
//启用成本扣除项
|
|
//启用成本扣除项
|
|
|
switch (topCostTpItem.getDockType()) {
|
|
switch (topCostTpItem.getDockType()) {
|
|
@@ -3291,6 +3331,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ orderGoods.setDivideMoney(cost);
|
|
|
costTotal = costTotal.add(cost);
|
|
costTotal = costTotal.add(cost);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3407,6 +3448,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
BigDecimal goodsPriceDecimal = goodsPrice;
|
|
|
//换算订单成本和盈亏
|
|
//换算订单成本和盈亏
|
|
|
TopCostTpItemVo topCostTpItem = tpItem;
|
|
TopCostTpItemVo topCostTpItem = tpItem;
|
|
|
|
|
+ orderGoods.setDivideType(topCostTpItem.getDockType());
|
|
|
|
|
+ orderGoods.setDivideRate(topCostTpItem.getDockValue());
|
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
if (ObjectUtil.isNotNull(topCostTpItem.getDockStatus()) && topCostTpItem.getDockStatus() == 1) {
|
|
|
//启用成本扣除项
|
|
//启用成本扣除项
|
|
|
switch (topCostTpItem.getDockType()) {
|
|
switch (topCostTpItem.getDockType()) {
|
|
@@ -3436,6 +3479,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ orderGoods.setDivideMoney(cost);
|
|
|
costTotal = costTotal.add(cost);
|
|
costTotal = costTotal.add(cost);
|
|
|
}
|
|
}
|
|
|
BigDecimal cost = costTotal.add(brokerage);
|
|
BigDecimal cost = costTotal.add(brokerage);
|