|
|
@@ -51,7 +51,7 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
WorkLogTplVO workLogTplVO = new WorkLogTplVO();
|
|
|
|
|
|
WorkCycle workCycle = workCycleService.getById(param.getCycleId());
|
|
|
- workCycle.setSumKilometre(workCycle.getEndTrip()-workCycle.getStartTrip());
|
|
|
+ workCycle.setSumKilometre(workCycle.getEndTrip() - workCycle.getStartTrip());
|
|
|
param.setTruckId(workCycle.getTruckId());
|
|
|
workLogTplVO.setWorkCycle(workCycle);
|
|
|
workLogTplVO.setBetweenTime(DateUtils.betweenTime(workCycle.getStartTime(), workCycle.getEndTime()));
|
|
|
@@ -66,15 +66,16 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
}
|
|
|
List<WorkOrder> workOrderList = workOrderService.list(workOrderQueryWrapper.orderByAsc("execute_time"));
|
|
|
//根据每个运单以及行程周期获取各个log日志,拿取且赋值
|
|
|
- List<WorkOrder> workOrders = new ArrayList<>();
|
|
|
- int listSize = workOrderList.size();
|
|
|
- for (int i = 0; i < listSize; i++) {
|
|
|
- WorkOrder workOrderParam = workOrderList.get(i);
|
|
|
- workOrderParam.setBetweenTime(DateUtils.betweenTime(workOrderParam.getActualReachTime(), workOrderParam.getActualLeaveTime()));
|
|
|
- workOrders.add(workOrderParam);
|
|
|
+ if (workOrderList != null && workOrderList.size() > 0) {
|
|
|
+ List<WorkOrder> workOrders = new ArrayList<>();
|
|
|
+ int listSize = workOrderList.size();
|
|
|
+ for (int i = 0; i < listSize; i++) {
|
|
|
+ WorkOrder workOrderParam = workOrderList.get(i);
|
|
|
+ workOrderParam.setBetweenTime(DateUtils.betweenTime(workOrderParam.getActualReachTime(), workOrderParam.getActualLeaveTime()));
|
|
|
+ workOrders.add(workOrderParam);
|
|
|
+ }
|
|
|
+ workLogTplVO.setWorkOrderList(workOrders);
|
|
|
}
|
|
|
- workLogTplVO.setWorkOrderList(workOrders);
|
|
|
-
|
|
|
//根据行程周期和卡车id获取行程费用、加气费用、其他费用
|
|
|
|
|
|
//行程费用
|
|
|
@@ -82,39 +83,46 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
tmsLineCost.setTruckId(param.getTruckId());
|
|
|
tmsLineCost.setCycleId(param.getCycleId());
|
|
|
List<TmsLineCostListVO> tmsLineCostList = tmsLineCostService.list(tmsLineCost);
|
|
|
- for (TmsLineCostListVO tmsLineCostListVO : tmsLineCostList) {
|
|
|
- TmsLineCost tmsLineCostParam = new TmsLineCost();
|
|
|
- tmsLineCostParam.setId(tmsLineCostListVO.getId());
|
|
|
- List<TmsLineCostOther> tmsLineCostOtherList = tmsLineCostOtherService.list(tmsLineCostParam);
|
|
|
- tmsLineCostListVO.setLineOtherCost("其他费用:");
|
|
|
- for (TmsLineCostOther tmsLineCostOther : tmsLineCostOtherList) {
|
|
|
- tmsLineCostListVO.setLineOtherCost(tmsLineCostListVO.getLineOtherCost() + tmsLineCostOther.getCostName() + tmsLineCostOther.getCostFee() + ";");
|
|
|
+ if (tmsLineCostList != null && tmsLineCostList.size() > 0) {
|
|
|
+ for (TmsLineCostListVO tmsLineCostListVO : tmsLineCostList) {
|
|
|
+ TmsLineCost tmsLineCostParam = new TmsLineCost();
|
|
|
+ tmsLineCostParam.setId(tmsLineCostListVO.getId());
|
|
|
+ List<TmsLineCostOther> tmsLineCostOtherList = tmsLineCostOtherService.list(tmsLineCostParam);
|
|
|
+ if (tmsLineCostOtherList != null && tmsLineCostOtherList.size() > 0) {
|
|
|
+ tmsLineCostListVO.setLineOtherCost("其他费用:");
|
|
|
+ for (TmsLineCostOther tmsLineCostOther : tmsLineCostOtherList) {
|
|
|
+ tmsLineCostListVO.setLineOtherCost(tmsLineCostListVO.getLineOtherCost() + tmsLineCostOther.getCostName() + tmsLineCostOther.getCostFee() + ";");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ workLogTplVO.setTmsLineCostList(tmsLineCostList);
|
|
|
}
|
|
|
- workLogTplVO.setTmsLineCostList(tmsLineCostList);
|
|
|
+
|
|
|
|
|
|
//加气费用
|
|
|
TmsGasFee tmsGasFee = new TmsGasFee();
|
|
|
tmsGasFee.setTruckId(param.getTruckId());
|
|
|
tmsGasFee.setCycleId(param.getCycleId());
|
|
|
List<TmsGasFee> tmsGasFeeList = tmsGasFeeService.list(tmsGasFee);
|
|
|
- List<TmsGasFeeVO> tmsGasFeeVOList = new ArrayList<>();
|
|
|
- for (TmsGasFee tmsGasFee1 : tmsGasFeeList) {
|
|
|
- TmsGasFeeVO tmsGasFeeVO = new TmsGasFeeVO();
|
|
|
- BeanUtils.copyProperties(tmsGasFee1, tmsGasFeeVO);
|
|
|
- //(1现金2大象加气3固定加气站)
|
|
|
- if (tmsGasFee1.getType() == 1) {
|
|
|
- tmsGasFeeVO.setTplCash(tmsGasFee1.getGasQtyFee());
|
|
|
- }
|
|
|
- if (tmsGasFee1.getType() == 2) {
|
|
|
- tmsGasFeeVO.setTplGasElephant(tmsGasFee1.getGasQtyFee());
|
|
|
- }
|
|
|
- if (tmsGasFee1.getType() == 3) {
|
|
|
- tmsGasFeeVO.setTplGasStation(tmsGasFee1.getGasQtyFee());
|
|
|
+ if (tmsGasFeeList != null && tmsGasFeeList.size() > 0) {
|
|
|
+ List<TmsGasFeeVO> tmsGasFeeVOList = new ArrayList<>();
|
|
|
+ for (TmsGasFee tmsGasFee1 : tmsGasFeeList) {
|
|
|
+ TmsGasFeeVO tmsGasFeeVO = new TmsGasFeeVO();
|
|
|
+ BeanUtils.copyProperties(tmsGasFee1, tmsGasFeeVO);
|
|
|
+ //(1现金2大象加气3固定加气站)
|
|
|
+ if (tmsGasFee1.getType() == 1) {
|
|
|
+ tmsGasFeeVO.setTplCash(tmsGasFee1.getGasQtyFee());
|
|
|
+ }
|
|
|
+ if (tmsGasFee1.getType() == 2) {
|
|
|
+ tmsGasFeeVO.setTplGasElephant(tmsGasFee1.getGasQtyFee());
|
|
|
+ }
|
|
|
+ if (tmsGasFee1.getType() == 3) {
|
|
|
+ tmsGasFeeVO.setTplGasStation(tmsGasFee1.getGasQtyFee());
|
|
|
+ }
|
|
|
+ tmsGasFeeVOList.add(tmsGasFeeVO);
|
|
|
}
|
|
|
- tmsGasFeeVOList.add(tmsGasFeeVO);
|
|
|
+ workLogTplVO.setTmsGasFeeList(tmsGasFeeVOList);
|
|
|
}
|
|
|
- workLogTplVO.setTmsGasFeeList(tmsGasFeeVOList);
|
|
|
|
|
|
//其他费用
|
|
|
TmsOtherFee tmsOtherFee = new TmsOtherFee();
|
|
|
@@ -169,13 +177,29 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
if (os != null && inputStream != null) {
|
|
|
Map<String, Object> model = new HashMap<String, Object>();
|
|
|
model.put("workLogTplVO", workLogTplVO);
|
|
|
- model.put("workOrderList", workLogTplVO.getWorkOrderList());
|
|
|
- model.put("tmsGasFeeList", workLogTplVO.getTmsGasFeeList());
|
|
|
- model.put("tmsLineCostList", workLogTplVO.getTmsLineCostList());
|
|
|
+ if (workLogTplVO.getWorkOrderList() != null && workLogTplVO.getWorkOrderList().size() > 0) {
|
|
|
+ model.put("workOrderList", workLogTplVO.getWorkOrderList());
|
|
|
+ }
|
|
|
+ if (workLogTplVO.getTmsGasFeeList() != null && workLogTplVO.getTmsGasFeeList().size() > 0) {
|
|
|
+ model.put("tmsGasFeeList", workLogTplVO.getTmsGasFeeList());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (workLogTplVO.getTmsLineCostList() != null && workLogTplVO.getTmsLineCostList().size() > 0) {
|
|
|
+ model.put("tmsLineCostList", workLogTplVO.getTmsLineCostList());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (workLogTplVO.getTruckRepairInfoList() != null && workLogTplVO.getTruckRepairInfoList().size() > 0) {
|
|
|
+ model.put("truckRepairInfoList", workLogTplVO.getTruckRepairInfoList());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (workLogTplVO.getRestInfoList() != null && workLogTplVO.getRestInfoList().size() > 0) {
|
|
|
+ model.put("restInfoList", workLogTplVO.getRestInfoList());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (workLogTplVO.getTruckCheckInfoList() != null && workLogTplVO.getTruckCheckInfoList().size() > 0) {
|
|
|
+ model.put("truckCheckInfoList", workLogTplVO.getTruckCheckInfoList());
|
|
|
+ }
|
|
|
|
|
|
- model.put("truckRepairInfoList", workLogTplVO.getTruckRepairInfoList());
|
|
|
- model.put("restInfoList", workLogTplVO.getRestInfoList());
|
|
|
- model.put("truckCheckInfoList", workLogTplVO.getTruckCheckInfoList());
|
|
|
|
|
|
model.put("driverOneSignUrl", driverOneSignUrl);
|
|
|
model.put("driverTwoSignUrl", driverTwoSignUrl);
|