| | |
| | | userRedPacketRecordService.updateBatchById(userRedPacketRecords); |
| | | } |
| | | orderLogistics.setRedPacketId(jsonArray.toJSONString()); |
| | | } |
| | | if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){ |
| | | }else if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){ |
| | | orderLogistics.setRedPacketMoney(total); |
| | | orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN); |
| | | //获取红包id |
| | |
| | | userCouponRecord.setEndTime(new Date()); |
| | | userCouponRecordService.updateById(userCouponRecord); |
| | | } |
| | | if(null != orderLogistics.getRedPacketId()){ |
| | | JSONArray jsonArray = JSON.parseArray(orderLogistics.getRedPacketId()); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer id1 = jsonObject.getInteger("id"); |
| | | Double money = jsonObject.getDouble("money"); |
| | | UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(id1); |
| | | userRedPacketRecord.setRemainingAmount(userRedPacketRecord.getRemainingAmount() - money); |
| | | if(0 == userRedPacketRecord.getRemainingAmount()){ |
| | | userRedPacketRecord.setState(2); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | | } |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | } |
| | | } |
| | | // if(null != orderLogistics.getRedPacketId()){ |
| | | // JSONArray jsonArray = JSON.parseArray(orderLogistics.getRedPacketId()); |
| | | // for (int i = 0; i < jsonArray.size(); i++) { |
| | | // JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // Integer id1 = jsonObject.getInteger("id"); |
| | | // Double money = jsonObject.getDouble("money"); |
| | | // UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(id1); |
| | | // userRedPacketRecord.setRemainingAmount(userRedPacketRecord.getRemainingAmount() - money); |
| | | // if(0 == userRedPacketRecord.getRemainingAmount()){ |
| | | // userRedPacketRecord.setState(2); |
| | | // userRedPacketRecord.setEndTime(new Date()); |
| | | // } |
| | | // userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | // } |
| | | // } |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | |
| | | if(orderLogistics.getState() == 10 || orderLogistics.getState() == 12){ |
| | | Car car = carService.selectById(orderLogistics.getCarId()); |
| | | //修改行程信息 |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null); |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderLogistics.getTripId(), null, null, null, null); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null); |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderLogistics.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | break; |
| | | } |