如果是本人接单,则需要计算剩余金额

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-07-21 16:20:56 +08:00
parent 999ab95487
commit 90c5d83da9
1 changed files with 7 additions and 0 deletions

View File

@ -133,6 +133,13 @@ public class OrderController extends BaseController {
if(!om.getWorkerId().equals(request.getWorkerId())){ if(!om.getWorkerId().equals(request.getWorkerId())){
boolean checkInTeam = workerService.checkInTeam(assignWorker.getWorkerId(), acceptWorker.getWorkerId()); boolean checkInTeam = workerService.checkInTeam(assignWorker.getWorkerId(), acceptWorker.getWorkerId());
Assert.isTrue(checkInTeam, "接单师傅不在本团队"); Assert.isTrue(checkInTeam, "接单师傅不在本团队");
}else {
// 自己接单 -- 计算剩余金额
BigDecimal realPay = fm.getPayMoney();
for (FinancialDetail financialDetail : financialDetailService.selectByFinancialMasterId(fm.getId())) {
realPay = realPay.subtract(financialDetail.getPayMoney());
}
request.setTotalPay(realPay);
} }
// 判断是否全部派完 // 判断是否全部派完