Explorar el Código

1、司机档案接口调整

zk hace 2 años
padre
commit
9fa6595fae

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

@@ -76,6 +76,11 @@ public class KwfDriverController {
      **/
     @GetMapping("/findByPhone")
     public HttpResult findByPhone(String phone) throws SystemException {
+        if (StringUtils.isBlank(phone)) {
+            return HttpResult.error("手机号不能为空!");
+        }
+
+        //获取司机信息
         Long id = null;
         List<Map<String, Object>> drivers = driverService.findList(new HashMap(){{ put("phone", phone); }});
         if (com.sckw.core.utils.CollectionUtils.isEmpty(drivers)) {

+ 7 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfDriverDto.java

@@ -34,6 +34,7 @@ public class KwfDriverDto {
     /**
      * 身份证号
      */
+    @NotBlank(message = "司机身份证号不能为空!")
     @Pattern(regexp = "[0-9A-Za-z]{18}", message = "身份证号码格式不正确!")
     private String idcard;
 
@@ -42,6 +43,12 @@ public class KwfDriverDto {
      */
     private Long fleetId;
 
+    /**
+     * 备注
+     */
+    @Size(max=200, message = "remark长度不能大于200个字符!")
+    private String remark;
+
     /**
      * 身份证信息
      */

+ 2 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -279,6 +279,8 @@ public class KwfDriverService {
                 if (driverEntDao.updateById(driverEnt) <= 0) {
                     throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
                 }
+            } else {
+                HttpResult.error("选择删除的数据已不存在!");
             }
         }
         return HttpResult.ok("删除成功!");

+ 2 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfFleetService.java

@@ -150,6 +150,8 @@ public class KwfFleetService {
                 if (fleetDao.updateById(fleet) <= 0) {
                     throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
                 }
+            } else {
+                HttpResult.error("选择删除的数据已不存在!");
             }
         }
         return HttpResult.ok("删除成功!");

+ 2 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java

@@ -300,6 +300,8 @@ public class KwfTruckReportService {
                 if (truckReportDao.updateById(truckReport) <= 0) {
                     throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
                 }
+            } else {
+                HttpResult.error("选择删除的数据已不存在!");
             }
         }
         return HttpResult.ok("删除成功!");

+ 2 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java

@@ -277,6 +277,8 @@ public class KwfTruckService {
                 if (truckEntDao.updateById(truckEnt) <= 0) {
                     throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
                 }
+            } else {
+                HttpResult.error("选择删除的数据已不存在!");
             }
         }
         return HttpResult.ok("删除成功!");

+ 7 - 7
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

@@ -44,8 +44,8 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            dr.name like concat('%',#{keyWords},'%')
-            or dr.phone like concat('%',#{keyWords},'%')
+            dr.name like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
             )
         </if>
         GROUP BY dr.`status`
@@ -56,7 +56,7 @@
         dr.id, dr.name, dr.phone, dr.idcard, dr.status, drc.expire_time idcardExpireTime, drc.address, drl.driver_no driverNo,
         drl.type licenseType, drl.expire_time licenseExpireTime, drl.grant_unit licenseGrantUnit,
         drq.quali_no qualiNo, dr.ent_id entId, dr.create_by createBy, dr.create_time createTime,
-        dr.update_time updateTime, dr.remark, trr.truck_no truckNo, fl.name fleetName
+        dr.update_time updateTime, dr.remark, tr.truck_no truckNo, fl.name fleetName
         from kwf_driver dr
         left join kwf_driver_ent dre on dre.driver_id = dr.id
         left join kwf_driver_card drc on drc.driver_id = dr.id and drc.del_flag = 0
@@ -99,8 +99,8 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            dr.name like concat('%',#{keyWords},'%')
-            or dr.phone like concat('%',#{keyWords},'%')
+            dr.name like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
             )
         </if>
         ORDER BY dr.create_time desc
@@ -139,8 +139,8 @@
         <if test="keywords != null and keywords != ''">
             and (
             dr.name like concat('%',#{keyWords},'%')
-            or dr.idcard like concat('%',#{keyWords},'%')
-            or dr.phone like concat('%',#{keyWords},'%')
+            or dr.idcard like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
             )
         </if>
         ORDER BY dr.create_time desc

+ 3 - 3
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetMapper.xml

@@ -55,9 +55,9 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-                fl.name like concat('%',#{keyWords},'%')
-                or fl.contacts like concat('%',#{keyWords},'%')
-                or fl.phone like concat('%',#{keyWords},'%')
+                fl.name like concat('%',#{keywords},'%')
+                or fl.contacts like concat('%',#{keywords},'%')
+                or fl.phone like concat('%',#{keywords},'%')
             )
         </if>
         ORDER BY fl.create_time desc

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

@@ -44,7 +44,7 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            tr.truck_no like concat('%',#{keyWords},'%')
+            tr.truck_no like concat('%',#{keywords},'%')
             )
         </if>
         GROUP BY tr.`status`
@@ -99,7 +99,7 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            tr.truck_no like concat('%',#{keyWords},'%')
+            tr.truck_no like concat('%',#{keywords},'%')
             )
         </if>
         ORDER BY tr.create_time desc
@@ -144,7 +144,7 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            tr.truck_no like concat('%',#{keyWords},'%')
+            tr.truck_no like concat('%',#{keywords},'%')
             )
         </if>
         ORDER BY tr.create_time desc

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

@@ -37,9 +37,9 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            tr.truck_no like concat('%',#{keyWords},'%')
-            or dr.name like concat('%',#{keyWords},'%')
-            or dr.phone like concat('%',#{keyWords},'%')
+            tr.truck_no like concat('%',#{keywords},'%')
+            or dr.name like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
             )
         </if>
         GROUP BY tr.`status`
@@ -84,9 +84,9 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            tr.truck_no like concat('%',#{keyWords},'%')
-            or dr.name like concat('%',#{keyWords},'%')
-            or dr.phone like concat('%',#{keyWords},'%')
+            tr.truck_no like concat('%',#{keywords},'%')
+            or dr.name like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
             )
         </if>
         ORDER BY tr.create_time desc
@@ -120,9 +120,9 @@
         </if>
         <if test="keywords != null and keywords != ''">
             and (
-            tr.truck_no like concat('%',#{keyWords},'%')
-            or dr.name like concat('%',#{keyWords},'%')
-            or dr.phone like concat('%',#{keyWords},'%')
+            tr.truck_no like concat('%',#{keywords},'%')
+            or dr.name like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
             )
         </if>
         ORDER BY tr.create_time desc