|
@@ -329,62 +329,6 @@ public class SynProfitHandle {
|
|
QueryWrapper<ProfitRuleDetail> profitRuleDetailQuery = new QueryWrapper<>();
|
|
QueryWrapper<ProfitRuleDetail> profitRuleDetailQuery = new QueryWrapper<>();
|
|
profitRuleDetailQuery.eq("type", 3); //下级分润
|
|
profitRuleDetailQuery.eq("type", 3); //下级分润
|
|
List<ProfitRuleDetail> profitRuleDetailList = profitRuleDetailService.list(profitRuleDetailQuery);
|
|
List<ProfitRuleDetail> profitRuleDetailList = profitRuleDetailService.list(profitRuleDetailQuery);
|
|
-
|
|
|
|
-// QueryWrapper<PartnerRecommend> partnerRecommendQuery = new QueryWrapper<>();
|
|
|
|
-// partnerRecommendQuery.eq("status", 1);
|
|
|
|
-// partnerRecommendQuery.eq("subordinate_id", item.getUserRoleId());
|
|
|
|
-// PartnerRecommend partnerRecommend = partnerRecommendService.getOne(partnerRecommendQuery);
|
|
|
|
-// if (partnerRecommend == null) {
|
|
|
|
-// item.setIsHandle(true);
|
|
|
|
-// calculationProfitService.updateById(item);
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// QueryWrapper<UserRole> userRoleQuery = new QueryWrapper<>();
|
|
|
|
-// userRoleQuery.eq("user_role_id", partnerRecommend.getSubordinateId());
|
|
|
|
-// UserRole subUserRole = userRoleService.getOne(userRoleQuery);
|
|
|
|
-// QueryWrapper<UserRole> userRoleQuery1 = new QueryWrapper<>();
|
|
|
|
-// userRoleQuery1.eq("user_role_id", partnerRecommend.getSuperiorId());
|
|
|
|
-// UserRole userRole = userRoleService.getOne(userRoleQuery1);
|
|
|
|
-// if (userRole == null) {
|
|
|
|
-// item.setIsHandle(true);
|
|
|
|
-// calculationProfitService.updateById(item);
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// ProfitRuleDetail ruleDetail = null;
|
|
|
|
-// for (ProfitRuleDetail ruleDetailItem : profitRuleDetailList) {
|
|
|
|
-// if (ruleDetailItem.getUserRoleType().equals(subUserRole.getUserRoleType())) {
|
|
|
|
-// ruleDetail = ruleDetailItem;
|
|
|
|
-// break;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// if (ruleDetail == null) {
|
|
|
|
-// item.setIsHandle(true);
|
|
|
|
-// calculationProfitService.updateById(item);
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// CalculationProfit profit = new CalculationProfit();
|
|
|
|
-// double price = item.getPrice() / 100D;
|
|
|
|
-// profit.setCalculationFormula("(" + price + "*" + ruleDetail.getIncomeRatio() + "%)=" + item.getPrice() * ruleDetail.getIncomeRatio() / 10000D);
|
|
|
|
-// profit.setPrice((int) (item.getPrice() * ruleDetail.getIncomeRatio() / 100D));
|
|
|
|
-// profit.setProfitRuleDetailId(ruleDetail.getId());
|
|
|
|
-// profit.setProfitRuleId(ruleDetail.getProfitRuleId());
|
|
|
|
-// profit.setAccountId(userRole.getAccountId());
|
|
|
|
-// profit.setCreateTime(new Date());
|
|
|
|
-// profit.setIsHandle(false);
|
|
|
|
-// profit.setOrderCode(item.getOrderCode());
|
|
|
|
-// profit.setOrderId(item.getOrderId());
|
|
|
|
-// profit.setPaidPrice(item.getPaidPrice());
|
|
|
|
-// profit.setStatus(1);
|
|
|
|
-// profit.setEntryTime(new Date());
|
|
|
|
-// profit.setSynOrderTime(item.getSynOrderTime());
|
|
|
|
-// profit.setType(3);
|
|
|
|
-// profit.setUpdateTime(new Date());
|
|
|
|
-// profit.setUserRoleId(partnerRecommend.getSuperiorId());
|
|
|
|
-// profit.setSubordinateCalculationId(item.getId());
|
|
|
|
-// calculationProfitService.save(profit);
|
|
|
|
-// item.setIsHandle(true);
|
|
|
|
-// calculationProfitService.updateById(item);
|
|
|
|
-
|
|
|
|
//医生上级分润
|
|
//医生上级分润
|
|
CalculationProfit calculationProfit= this.createSuperProfit(null, item, profitRuleDetailList);
|
|
CalculationProfit calculationProfit= this.createSuperProfit(null, item, profitRuleDetailList);
|
|
//医生上级的上级分润
|
|
//医生上级的上级分润
|
|
@@ -454,9 +398,10 @@ public class SynProfitHandle {
|
|
profit.setUserRoleId(partnerRecommend.getSuperiorId());
|
|
profit.setUserRoleId(partnerRecommend.getSuperiorId());
|
|
profit.setSubordinateCalculationId(item.getId());
|
|
profit.setSubordinateCalculationId(item.getId());
|
|
calculationProfitService.save(profit);
|
|
calculationProfitService.save(profit);
|
|
-
|
|
|
|
item.setIsHandle(true);
|
|
item.setIsHandle(true);
|
|
calculationProfitService.updateById(item);
|
|
calculationProfitService.updateById(item);
|
|
|
|
+ //添加账户收益
|
|
|
|
+ calculationProfitService.accountProfitOfEntry(profit);
|
|
return profit;
|
|
return profit;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -517,6 +462,8 @@ public class SynProfitHandle {
|
|
calculationProfit.setUpdateTime(new Date());
|
|
calculationProfit.setUpdateTime(new Date());
|
|
calculationProfit.setUserRoleId(userRuleId);
|
|
calculationProfit.setUserRoleId(userRuleId);
|
|
calculationProfitService.save(calculationProfit);
|
|
calculationProfitService.save(calculationProfit);
|
|
|
|
+ //添加账户收益
|
|
|
|
+ calculationProfitService.accountProfitOfEntry(calculationProfit);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|