Commit 264b2a7aa3899186ef127f3ddfa84f3f1893efb1
1 parent
29fa5c7f
新增修改头像,人脸图片记录日志表
Showing
6 changed files
with
19 additions
and
8 deletions
Bsth-admin/src/main/java/com/ruoyi/driver/mapper/DriverMapper.java
| ... | ... | @@ -95,7 +95,7 @@ public interface DriverMapper |
| 95 | 95 | |
| 96 | 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 | 100 | void updateDriverByComputed(@Param("count")Integer count); |
| 101 | 101 | |
| ... | ... | @@ -138,4 +138,6 @@ public interface DriverMapper |
| 138 | 138 | void updateDriverBaseInfoByJobCodes(@Param("list") List<Driver> list,@Param("filterImage") Integer filterImage); |
| 139 | 139 | |
| 140 | 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 | 1 | package com.ruoyi.driver.service.impl; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollectionUtil; |
| 4 | +import cn.hutool.core.date.DateUtil; | |
| 4 | 5 | import cn.hutool.http.HttpUtil; |
| 5 | 6 | import com.github.pagehelper.util.StringUtil; |
| 6 | 7 | import com.ruoyi.common.cache.NowSchedulingCache; |
| ... | ... | @@ -468,7 +469,8 @@ public class DriverServiceImpl implements IDriverService { |
| 468 | 469 | |
| 469 | 470 | @Override |
| 470 | 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 | 474 | return AjaxResult.success("注册成功"); |
| 473 | 475 | } |
| 474 | 476 | |
| ... | ... | @@ -578,6 +580,8 @@ public class DriverServiceImpl implements IDriverService { |
| 578 | 580 | } |
| 579 | 581 | driver.setImage(fileName); |
| 580 | 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 | 585 | driverMapper.updateSignStatusDriversByJobCodes(new ArrayList<>(Arrays.asList(driver))); |
| 582 | 586 | driverMapper.deleteDeviceIdAssociatedJobCode(new ArrayList<>(Arrays.asList(driver.getJobCode()))); |
| 583 | 587 | log.info("进行人员数据更新完毕"); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
| ... | ... | @@ -158,8 +158,8 @@ public class ThreadJobService { |
| 158 | 158 | * @param jobCodes |
| 159 | 159 | */ |
| 160 | 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 | 163 | log.info("注册设备与员工关联完毕:{}", result); |
| 164 | 164 | } |
| 165 | 165 | ... | ... |
Bsth-admin/src/main/resources/application-druid-dev.yml
| ... | ... | @@ -28,7 +28,7 @@ spring: |
| 28 | 28 | # 主库数据源 |
| 29 | 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 | 32 | username: root |
| 33 | 33 | password: guzijian |
| 34 | 34 | # 从库数据源 | ... | ... |
Bsth-admin/src/main/resources/application.yml
Bsth-admin/src/main/resources/mapper/driver/DriverMapper.xml
| ... | ... | @@ -435,11 +435,11 @@ |
| 435 | 435 | job_code = values(job_code) |
| 436 | 436 | </insert> |
| 437 | 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 | 439 | values |
| 440 | 440 | <foreach collection="jobCodes" item="item" index="index" separator=","> |
| 441 | 441 | ( |
| 442 | - #{item},#{deviceId} | |
| 442 | + #{item},#{deviceId},#{createTime},#{createBy} | |
| 443 | 443 | ) |
| 444 | 444 | </foreach> |
| 445 | 445 | on duplicate key update |
| ... | ... | @@ -484,4 +484,9 @@ |
| 484 | 484 | |
| 485 | 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 | 492 | </mapper> |
| 488 | 493 | \ No newline at end of file | ... | ... |