| | |
| | | } |
| | | |
| | | //开始处理明细 |
| | | SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS"); |
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm"); |
| | | Date start = null; |
| | | Date end = null; |
| | | try { |
| | | start = sdf3.parse(vo.getStart_time()); |
| | | end = sdf3.parse(vo.getEnd_time()); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | for (AccountingStrategyDetailOrderVo strategyDetail : lists) { |
| | | for (int i = 0; i < lists.size(); i++) { |
| | | AccountingStrategyDetailOrderVo strategyDetail = lists.get(i); |
| | | BigDecimal sharp_peak_charge = strategyDetail.getChargingCapacity(); |
| | | TChargingOrderAccountingStrategy chargingOrderAccountingStrategy = new TChargingOrderAccountingStrategy(); |
| | | chargingOrderAccountingStrategy.setChargingOrderId(chargingOrder.getId()); |
| | |
| | | chargingOrderAccountingStrategy.setElectrovalence(strategyDetail.getElectrovalence()); |
| | | chargingOrderAccountingStrategy.setServiceCharge(strategyDetail.getServiceCharge()); |
| | | chargingOrderAccountingStrategy.setCostServiceCharge(strategyDetail.getCostServiceCharge()); |
| | | |
| | | if(start.getTime() >= strategyDetail.getStart()){ |
| | | chargingOrderAccountingStrategy.setStartTime(sdf2.format(start)); |
| | | if(i == 0){ |
| | | String time = vo.getStart_time().split(" ")[1]; |
| | | chargingOrderAccountingStrategy.setStartTime(time.substring(0, time.lastIndexOf(":"))); |
| | | }else{ |
| | | chargingOrderAccountingStrategy.setStartTime(strategyDetail.getStartTime()); |
| | | } |
| | | if(end.getTime() >= strategyDetail.getEnd()){ |
| | | chargingOrderAccountingStrategy.setEndTime(strategyDetail.getEndTime()); |
| | | if(i == lists.size() - 1){ |
| | | String time = vo.getEnd_time().split(" ")[1]; |
| | | chargingOrderAccountingStrategy.setEndTime(time.substring(0, time.lastIndexOf(":"))); |
| | | }else{ |
| | | chargingOrderAccountingStrategy.setEndTime(sdf2.format(end)); |
| | | chargingOrderAccountingStrategy.setEndTime(strategyDetail.getEndTime()); |
| | | } |
| | | |
| | | //已充电总度数 |
| | |
| | | periodElectricPrice_total = periodElectricPrice_total.add(electrovalenc); |
| | | periodServicePrice_total = periodServicePrice_total.add(originalServicePrice); |
| | | total = total.add(electrovalenc.add(originalServicePrice)); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //原金额 |