Browse Source

1、导出提示语及车辆档案类型查询无效修复;

zk 2 năm trước cách đây
mục cha
commit
1305bba81c

+ 5 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java

@@ -2,14 +2,16 @@ package com.sckw.fleet.controller;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.core.web.response.ResponseUtil;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.fleet.model.dto.*;
 import com.sckw.fleet.model.vo.KwfDriverDetailVo;
@@ -22,7 +24,7 @@ import org.springframework.http.MediaType;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -133,10 +135,9 @@ public class KwfDriverController {
         List<KwfDriverVo> drivers = driverService.findPage(params);
 
         if (CollectionUtils.isEmpty(drivers)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfDriverVo.class, drivers);
-        //ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
     }
 
     /**

+ 3 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java

@@ -3,10 +3,12 @@ package com.sckw.fleet.controller;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.ResponseUtil;
@@ -85,12 +87,11 @@ public class KwfFleetController {
      **/
     @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
     public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
-        params.put("entId", LoginUserHolder.getEntId());
         /**查询分页数据**/
         List<KwfFleetVo> fleets = fleetService.findPage(params);
 
         if (CollectionUtils.isEmpty(fleets)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfFleetVo.class, fleets);
     }

+ 3 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -6,12 +6,14 @@ import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
@@ -144,7 +146,7 @@ public class KwfTruckController {
         List<KwfTruckVo> trucks = truckService.findPage(params);
 
         if (CollectionUtils.isEmpty(trucks)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfTruckVo.class, trucks);
     }

+ 2 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java

@@ -3,6 +3,7 @@ package com.sckw.fleet.controller;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
@@ -84,7 +85,7 @@ public class KwfTruckReportController {
         List<KwfTruckReportVo> trucks = reportService.findPage(params);
 
         if (CollectionUtils.isEmpty(trucks)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
     }

+ 8 - 8
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml

@@ -15,8 +15,8 @@
         <if test="truckNo != null and truckNo != ''">
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
-        <if test="type != null and type != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+        <if test="truckType != null and truckType != ''">
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -57,8 +57,8 @@
         <if test="truckNo != null and truckNo != ''">
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
-        <if test="type != null and type != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+        <if test="truckType != null and truckType != ''">
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -110,7 +110,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -170,7 +170,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -232,8 +232,8 @@
         <if test="wholeTruckNo != null and wholeTruckNo != ''">
             and tr.truck_no = #{wholeTruckNo, jdbcType=VARCHAR}
         </if>
-        <if test="type != null and type != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+        <if test="truckType != null and truckType != ''">
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}

+ 2 - 2
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml

@@ -18,7 +18,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="fleetId != null and fleetId != ''">
             and fl.id = #{fleetId, jdbcType=VARCHAR}
@@ -66,7 +66,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="fleetId != null and fleetId != ''">
             and fl.id = #{fleetId, jdbcType=VARCHAR}