| | |
| | | orderLogistics.setPayType(3); |
| | | orderLogistics.setPayMoney(orderMoney); |
| | | |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = company.getCrossLogisticsMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsCrossLogisticsFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 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); |
| | | |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = company.getCrossLogisticsMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsCrossLogisticsFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 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); |
| | | |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |