puzhibing
2023-09-09 9ef2e272c6ef99d152c5d6afc95af70a3822c57d
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -189,8 +189,12 @@
            }
        }).start();
        systemNoticeService.addSystemNotice(2, "您已成功抢得包裹订单,请及时联系客户!", orderLogistics.getDriverId());
        systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getLastName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId());
        systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得包裹订单,请及时联系客户!" :
                language == 2 ? "You have successfully captured the parcel order, please contact the customer in time!"
                        : "Vous avez saisi avec succès la commande de colis, veuillez contacter le client à temps!", orderLogistics.getDriverId());
        systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" :
                language == 2 ? "Your order has been assigned to " + driver.getFirstName() + " master, please keep the phone open!"
                        : "Votre commande a été attribuée à " + driver.getFirstName() + " master, veuillez garder le téléphone ouvert!", orderLogistics.getUserId());
        return ResultUtil.success();
    }
@@ -249,6 +253,31 @@
                orderLogistics.setGetoffTime(new Date());
                orderLogistics.setEndServiceTime(new Date());
                orderLogistics.setState(6);
                if(orderLogistics.getPayType() != 4){
                    //添加已收入明细
                    Company company = companyService.selectById(orderLogistics.getCompanyId());
                    Double speMoney = company.getSameLogisticsMoney();
                    BigDecimal d = null;//企业收入
                    BigDecimal c = null;//司机收入
                    if(company.getIsSameLogisticsFixedOrProportional() == 2){//固定
                        d = new BigDecimal(speMoney);
                        c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
                    }
                    if(company.getIsSameLogisticsFixedOrProportional() == 1){//比例
                        Double price = orderLogistics.getOrderMoney();
                        d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
                        c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                    }
                    incomeService.saveData(1, orderLogistics.getCompanyId(), 2, orderLogistics.getId(), 4, d.doubleValue());
                    incomeService.saveData(2, orderLogistics.getDriverId(), 2, orderLogistics.getId(), 4, c.doubleValue());
                    Driver driver = driverService.selectById(orderLogistics.getDriverId());
                    driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                    driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                    driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                    driverService.updateById(driver);
                }
                break;
        }
        this.updateById(orderLogistics);
@@ -859,8 +888,12 @@
            }
        }).start();
        systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderLogistics.getDriverId());
        systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getLastName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId());
        systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得出租车订单,请及时联系客户!" :
                language == 2 ? "You have successfully captured the taxi order, please contact the customer in time!"
                        : "Vous avez saisi avec succès la commande de taxi, veuillez contacter le client à temps!", orderLogistics.getDriverId());
        systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" :
                language == 2 ? "Your order has been assigned to " + driver.getFirstName() + " master, please keep the phone open!"
                        : "Votre commande a été attribuée à " + driver.getFirstName() + " master, veuillez garder le téléphone ouvert!", orderLogistics.getUserId());
        return ResultUtil.success();
    }