|
|
@@ -1,10 +1,7 @@
|
|
|
package com.aoyang.tms.service.impl;
|
|
|
|
|
|
|
|
|
-import com.aoyang.tms.controller.vo.TmsLineCostDetail;
|
|
|
-import com.aoyang.tms.controller.vo.TmsLineCostListVO;
|
|
|
-import com.aoyang.tms.controller.vo.TmsOtherFeeListVO;
|
|
|
-import com.aoyang.tms.controller.vo.WorkLogTplVO;
|
|
|
+import com.aoyang.tms.controller.vo.*;
|
|
|
import com.aoyang.tms.entity.*;
|
|
|
import com.aoyang.tms.service.*;
|
|
|
import com.aoyang.tms.util.FileUtil;
|
|
|
@@ -39,10 +36,22 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
private TmsGasFeeService tmsGasFeeService;
|
|
|
@Resource
|
|
|
private WorkOrderService workOrderService;
|
|
|
+ @Resource
|
|
|
+ private WorkCycleService workCycleService;
|
|
|
+ @Resource
|
|
|
+ private RestInfoService restInfoService;
|
|
|
+ @Resource
|
|
|
+ private TruckRepairInfoService truckRepairInfoService;
|
|
|
+ @Resource
|
|
|
+ private TruckCheckInfoService truckCheckInfoService;
|
|
|
|
|
|
@Override
|
|
|
public WorkLogTplVO workLogTplVO(WorkOrder param) {
|
|
|
WorkLogTplVO workLogTplVO = new WorkLogTplVO();
|
|
|
+
|
|
|
+ WorkCycle workCycle = workCycleService.getById(param.getCycleId());
|
|
|
+ workLogTplVO.setWorkCycle(workCycle);
|
|
|
+
|
|
|
//根据行程周期获取运单列表,按时间正序,第一单为装单,接下来为顺序卸单
|
|
|
QueryWrapper<WorkOrder> workOrderQueryWrapper = new QueryWrapper<WorkOrder>();
|
|
|
if (param.getCycleId() != null) {
|
|
|
@@ -66,13 +75,12 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
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()+";");
|
|
|
+ tmsLineCostListVO.setLineOtherCost(tmsLineCostListVO.getLineOtherCost() + tmsLineCostOther.getCostName() + tmsLineCostOther.getCostFee() + ";");
|
|
|
}
|
|
|
}
|
|
|
workLogTplVO.setTmsLineCostList(tmsLineCostList);
|
|
|
@@ -82,7 +90,23 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
tmsGasFee.setTruckId(param.getTruckId());
|
|
|
tmsGasFee.setCycleId(param.getCycleId());
|
|
|
List<TmsGasFee> tmsGasFeeList = tmsGasFeeService.list(tmsGasFee);
|
|
|
- workLogTplVO.setTmsGasFeeList(tmsGasFeeList);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ workLogTplVO.setTmsGasFeeList(tmsGasFeeVOList);
|
|
|
|
|
|
//其他费用
|
|
|
TmsOtherFee tmsOtherFee = new TmsOtherFee();
|
|
|
@@ -93,6 +117,23 @@ public class JxlsExportTestServiceImpl implements JxlsExportTestService {
|
|
|
tmsOtherFee = tmsOtherFeeService.getById(tmsOtherFeeListVO.getOtherFeeId());
|
|
|
workLogTplVO.setTmsOtherFee(tmsOtherFee);
|
|
|
}
|
|
|
+
|
|
|
+ //车辆休息
|
|
|
+ List<RestInfo> restInfoList = restInfoService.findRestInfoList(param.getTruckId(), param.getCycleId());
|
|
|
+ if (restInfoList != null && restInfoList.size() > 0) {
|
|
|
+ workLogTplVO.setRestInfoList(restInfoList);
|
|
|
+ }
|
|
|
+ //车辆维修
|
|
|
+ List<TruckRepairInfo> truckRepairInfoList = truckRepairInfoService.findTruckRepairInfoList(param.getTruckId(), param.getCycleId());
|
|
|
+ if (truckRepairInfoList != null && truckRepairInfoList.size() > 0) {
|
|
|
+ workLogTplVO.setTruckRepairInfoList(truckRepairInfoList);
|
|
|
+ }
|
|
|
+ //车辆检查
|
|
|
+ List<TruckCheckInfo> truckCheckInfoList = truckCheckInfoService.findTruckCheckInfoList(param.getTruckId(), param.getCycleId(), 3);
|
|
|
+ if (truckCheckInfoList != null && truckCheckInfoList.size() > 0) {
|
|
|
+ workLogTplVO.setTruckCheckInfoList(truckCheckInfoList);
|
|
|
+ }
|
|
|
+
|
|
|
return workLogTplVO;
|
|
|
}
|
|
|
|