| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void saveData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money) throws Exception { |
| | | public void saveData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money,String orgReqSeqId) throws Exception { |
| | | Income income = new Income(); |
| | | income.setUserType(userType); |
| | | income.setObjectId(objectId); |
| | |
| | | income.setMoney(new BigDecimal(money).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | income.setInsertTime(new Date()); |
| | | income.setActivityType(2); |
| | | income.setOrgReqSeqId(orgReqSeqId); |
| | | this.insert(income); |
| | | } |
| | | |
| | |
| | | BigDecimal multiply1 = new BigDecimal(payMoney).multiply(new BigDecimal(percent / 100)); |
| | | //抽成金额小于最低金额,司机收入为0 |
| | | if(multiply1.compareTo(new BigDecimal(d)) < 0){ |
| | | saveData(1, 1, 2, orderId, orderType, d); |
| | | saveData(1, 1, 2, orderId, orderType, d,null); |
| | | //司机收入 |
| | | BigDecimal subtract = new BigDecimal(payMoney).subtract(new BigDecimal(d)); |
| | | if(subtract.compareTo(BigDecimal.ZERO) > 0){ |
| | | saveData(2, driverId, 2, orderId, orderType, subtract.doubleValue()); |
| | | saveData(2, driverId, 2, orderId, orderType, subtract.doubleValue(),null); |
| | | return subtract; |
| | | } |
| | | return new BigDecimal(0); |
| | |
| | | if(multiply1.compareTo(new BigDecimal(d)) >= 0 && multiply1.compareTo(new BigDecimal(g)) < 0){ |
| | | //司机收入 |
| | | BigDecimal subtract = new BigDecimal(payMoney).subtract(multiply1); |
| | | saveData(2, driverId, 2, orderId, orderType, subtract.doubleValue()); |
| | | saveData(1, 1, 2, orderId, orderType, multiply1.doubleValue()); |
| | | saveData(2, driverId, 2, orderId, orderType, subtract.doubleValue(),null); |
| | | saveData(1, 1, 2, orderId, orderType, multiply1.doubleValue(),null); |
| | | return subtract; |
| | | } |
| | | if(multiply1.compareTo(new BigDecimal(g)) >= 0){ |
| | | //司机收入 |
| | | BigDecimal subtract = new BigDecimal(payMoney).subtract(new BigDecimal(g)); |
| | | saveData(2, driverId, 2, orderId, orderType, subtract.doubleValue()); |
| | | saveData(1, 1, 2, orderId, orderType, g); |
| | | saveData(2, driverId, 2, orderId, orderType, subtract.doubleValue(),null); |
| | | saveData(1, 1, 2, orderId, orderType, g,null); |
| | | return subtract; |
| | | } |
| | | } |