Commit 264b2a7aa3899186ef127f3ddfa84f3f1893efb1

Authored by 2c2c2c
1 parent 29fa5c7f

新增修改头像,人脸图片记录日志表

Bsth-admin/src/main/java/com/ruoyi/driver/mapper/DriverMapper.java
@@ -95,7 +95,7 @@ public interface DriverMapper @@ -95,7 +95,7 @@ public interface DriverMapper
95 95
96 Driver getDriverInfoByJobCode(@Param("jobCode")String jobCode); 96 Driver getDriverInfoByJobCode(@Param("jobCode")String jobCode);
97 97
98 - Integer insertDriverFace(@Param("deviceId") String deviceId, @Param("jobCodes")List<String> jobCodes); 98 + Integer insertDriverFace(@Param("deviceId") String deviceId, @Param("jobCodes")List<String> jobCodes,@Param("createTime")String createTime,@Param("createBy")String createBy);
99 99
100 void updateDriverByComputed(@Param("count")Integer count); 100 void updateDriverByComputed(@Param("count")Integer count);
101 101
@@ -138,4 +138,6 @@ public interface DriverMapper @@ -138,4 +138,6 @@ public interface DriverMapper
138 void updateDriverBaseInfoByJobCodes(@Param("list") List<Driver> list,@Param("filterImage") Integer filterImage); 138 void updateDriverBaseInfoByJobCodes(@Param("list") List<Driver> list,@Param("filterImage") Integer filterImage);
139 139
140 List<Driver> selectDriverListAll(); 140 List<Driver> selectDriverListAll();
  141 +
  142 + int insertFaceUpdateLog(@Param("jobCode") String jobCode,@Param("image") String image,@Param("createTime") String createTime,@Param("createBy") String createBy);
141 } 143 }
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
1 package com.ruoyi.driver.service.impl; 1 package com.ruoyi.driver.service.impl;
2 2
3 import cn.hutool.core.collection.CollectionUtil; 3 import cn.hutool.core.collection.CollectionUtil;
  4 +import cn.hutool.core.date.DateUtil;
4 import cn.hutool.http.HttpUtil; 5 import cn.hutool.http.HttpUtil;
5 import com.github.pagehelper.util.StringUtil; 6 import com.github.pagehelper.util.StringUtil;
6 import com.ruoyi.common.cache.NowSchedulingCache; 7 import com.ruoyi.common.cache.NowSchedulingCache;
@@ -468,7 +469,8 @@ public class DriverServiceImpl implements IDriverService { @@ -468,7 +469,8 @@ public class DriverServiceImpl implements IDriverService {
468 469
469 @Override 470 @Override
470 public AjaxResult faceRegistrationFeedback(String deviceId, List<String> jobCodes) { 471 public AjaxResult faceRegistrationFeedback(String deviceId, List<String> jobCodes) {
471 - threadJobService.asyncInsertSignInContactEquipment(deviceId, jobCodes); 472 + String createTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
  473 + threadJobService.asyncInsertSignInContactEquipment(deviceId, jobCodes,createTime,"酒测接口");
472 return AjaxResult.success("注册成功"); 474 return AjaxResult.success("注册成功");
473 } 475 }
474 476
@@ -578,6 +580,8 @@ public class DriverServiceImpl implements IDriverService { @@ -578,6 +580,8 @@ public class DriverServiceImpl implements IDriverService {
578 } 580 }
579 driver.setImage(fileName); 581 driver.setImage(fileName);
580 driver.setUpdateTime(new Date()); 582 driver.setUpdateTime(new Date());
  583 + String createTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
  584 + driverMapper.insertFaceUpdateLog(driver.getJobCode(),driver.getImage(),createTime,"酒测接口");
581 driverMapper.updateSignStatusDriversByJobCodes(new ArrayList<>(Arrays.asList(driver))); 585 driverMapper.updateSignStatusDriversByJobCodes(new ArrayList<>(Arrays.asList(driver)));
582 driverMapper.deleteDeviceIdAssociatedJobCode(new ArrayList<>(Arrays.asList(driver.getJobCode()))); 586 driverMapper.deleteDeviceIdAssociatedJobCode(new ArrayList<>(Arrays.asList(driver.getJobCode())));
583 log.info("进行人员数据更新完毕"); 587 log.info("进行人员数据更新完毕");
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
@@ -158,8 +158,8 @@ public class ThreadJobService { @@ -158,8 +158,8 @@ public class ThreadJobService {
158 * @param jobCodes 158 * @param jobCodes
159 */ 159 */
160 @Async 160 @Async
161 - public void asyncInsertSignInContactEquipment(String deviceId, List<String> jobCodes) {  
162 - Integer result = driverMapper.insertDriverFace(deviceId, jobCodes); 161 + public void asyncInsertSignInContactEquipment(String deviceId, List<String> jobCodes,String createTime,String createBy) {
  162 + Integer result = driverMapper.insertDriverFace(deviceId, jobCodes,createTime,createBy);
163 log.info("注册设备与员工关联完毕:{}", result); 163 log.info("注册设备与员工关联完毕:{}", result);
164 } 164 }
165 165
Bsth-admin/src/main/resources/application-druid-dev.yml
@@ -28,7 +28,7 @@ spring: @@ -28,7 +28,7 @@ spring:
28 # 主库数据源 28 # 主库数据源
29 master: 29 master:
30 # 测试地址 30 # 测试地址
31 - url: jdbc:mysql://192.168.168.124:3306/all-in-one?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useAffectedRows=true&allowMultiQueries=true 31 + url: jdbc:mysql://192.168.168.124:3306/all-in-one1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useAffectedRows=true&allowMultiQueries=true
32 username: root 32 username: root
33 password: guzijian 33 password: guzijian
34 # 从库数据源 34 # 从库数据源
Bsth-admin/src/main/resources/application.yml
@@ -66,7 +66,7 @@ spring: @@ -66,7 +66,7 @@ spring:
66 # 国际化资源文件路径 66 # 国际化资源文件路径
67 basename: i18n/messages 67 basename: i18n/messages
68 profiles: 68 profiles:
69 - active: druid-prd 69 + active: druid-dev
70 # 文件上传 70 # 文件上传
71 servlet: 71 servlet:
72 multipart: 72 multipart:
Bsth-admin/src/main/resources/mapper/driver/DriverMapper.xml
@@ -435,11 +435,11 @@ @@ -435,11 +435,11 @@
435 job_code = values(job_code) 435 job_code = values(job_code)
436 </insert> 436 </insert>
437 <insert id="insertDriverFace"> 437 <insert id="insertDriverFace">
438 - INSERT INTO driver_face_device_id ( job_code,device_id ) 438 + INSERT INTO driver_face_device_id ( job_code,device_id,create_time,create_by )
439 values 439 values
440 <foreach collection="jobCodes" item="item" index="index" separator=","> 440 <foreach collection="jobCodes" item="item" index="index" separator=",">
441 ( 441 (
442 - #{item},#{deviceId} 442 + #{item},#{deviceId},#{createTime},#{createBy}
443 ) 443 )
444 </foreach> 444 </foreach>
445 on duplicate key update 445 on duplicate key update
@@ -484,4 +484,9 @@ @@ -484,4 +484,9 @@
484 484
485 </insert> 485 </insert>
486 486
  487 + <insert id="insertFaceUpdateLog">
  488 + insert into face_update_log(job_code,image,create_time,create_by)
  489 + value(#{jobCode},#{image},#{createTime},#{createBy})
  490 + </insert>
  491 +
487 </mapper> 492 </mapper>
488 \ No newline at end of file 493 \ No newline at end of file