Commit 60f20ca23689cd4a4a01f271bbd39c73346a1bf5
1 parent
ade1de37
fix: 新增注册反馈接口
Showing
8 changed files
with
90 additions
and
41 deletions
ruoyi-admin/src/main/java/com/ruoyi/driver/controller/DriverController.java
| @@ -109,16 +109,7 @@ public class DriverController extends BaseController { | @@ -109,16 +109,7 @@ public class DriverController extends BaseController { | ||
| 109 | return toAjax(driverService.insertDriver(driver)); | 109 | return toAjax(driverService.insertDriver(driver)); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | - /** | ||
| 113 | - * 人脸注册 | ||
| 114 | - * @param driver | ||
| 115 | - * @return | ||
| 116 | - */ | ||
| 117 | - @PostMapping("/addDriver") | ||
| 118 | - @ApiOperation("新增驾驶员信息(酒精一体机)") | ||
| 119 | - public AjaxResult addDriver(@ApiParam @RequestBody Driver driver) { | ||
| 120 | - return toAjax(driverService.addDriver(driver)); | ||
| 121 | - } | 112 | + |
| 122 | 113 | ||
| 123 | /** | 114 | /** |
| 124 | * 修改驾驶员信息 | 115 | * 修改驾驶员信息 |
| @@ -174,4 +165,13 @@ public class DriverController extends BaseController { | @@ -174,4 +165,13 @@ public class DriverController extends BaseController { | ||
| 174 | driverService.downloadHeadImage(jobCode, response); | 165 | driverService.downloadHeadImage(jobCode, response); |
| 175 | } | 166 | } |
| 176 | 167 | ||
| 168 | + /** | ||
| 169 | + * 人脸注册状态 | ||
| 170 | + */ | ||
| 171 | + @ApiOperation("注册反馈") | ||
| 172 | + @GetMapping("/faceSignIn") | ||
| 173 | + public AjaxResult faceRegistrationFeedback(@RequestParam("deviceId") String deviceId,@RequestParam("jobCode")List<String> jobCode){ | ||
| 174 | + return driverService.faceRegistrationFeedback(deviceId,jobCode); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | } | 177 | } |
ruoyi-admin/src/main/java/com/ruoyi/driver/domain/Driver.java
| @@ -145,4 +145,7 @@ public class Driver extends BaseEntity { | @@ -145,4 +145,7 @@ public class Driver extends BaseEntity { | ||
| 145 | @ApiModelProperty("更新时间") | 145 | @ApiModelProperty("更新时间") |
| 146 | private Date update_time; | 146 | private Date update_time; |
| 147 | 147 | ||
| 148 | + @ApiModelProperty("注册设备列表") | ||
| 149 | + private String signInEquipment; | ||
| 150 | + | ||
| 148 | } | 151 | } |
ruoyi-admin/src/main/java/com/ruoyi/driver/mapper/DriverMapper.java
| @@ -93,7 +93,11 @@ public interface DriverMapper | @@ -93,7 +93,11 @@ public interface DriverMapper | ||
| 93 | */ | 93 | */ |
| 94 | Integer jobCodeIsEmpty(@Param("jobCode") String jobCode); | 94 | Integer jobCodeIsEmpty(@Param("jobCode") String jobCode); |
| 95 | 95 | ||
| 96 | - String getDriverInfoByJobCode(@Param("jobCode") String jobCode); | 96 | + String getDriverImageByJobCode(@Param("jobCode") String jobCode); |
| 97 | 97 | ||
| 98 | List<Driver> getDrivers(Driver driver); | 98 | List<Driver> getDrivers(Driver driver); |
| 99 | + | ||
| 100 | + Driver getDriverInfoByJobCode(@Param("jobCode")String jobCode); | ||
| 101 | + | ||
| 102 | + Integer insertDriverFace(@Param("deviceId") String deviceId, @Param("jobCodes")List<String> jobCodes); | ||
| 99 | } | 103 | } |
ruoyi-admin/src/main/java/com/ruoyi/driver/service/IDriverService.java
| @@ -87,5 +87,6 @@ public interface IDriverService | @@ -87,5 +87,6 @@ public interface IDriverService | ||
| 87 | 87 | ||
| 88 | List<Driver> getDrivers(Driver driver); | 88 | List<Driver> getDrivers(Driver driver); |
| 89 | 89 | ||
| 90 | - int addDriver(Driver driver); | 90 | + |
| 91 | + AjaxResult faceRegistrationFeedback(String deviceId, List<String> jobCode); | ||
| 91 | } | 92 | } |
ruoyi-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
| @@ -15,6 +15,7 @@ import com.ruoyi.common.utils.file.MimeTypeUtils; | @@ -15,6 +15,7 @@ import com.ruoyi.common.utils.file.MimeTypeUtils; | ||
| 15 | import com.ruoyi.framework.config.ServerConfig; | 15 | import com.ruoyi.framework.config.ServerConfig; |
| 16 | import com.ruoyi.job.DriverJob; | 16 | import com.ruoyi.job.DriverJob; |
| 17 | import com.ruoyi.pojo.response.ResponseScheduling; | 17 | import com.ruoyi.pojo.response.ResponseScheduling; |
| 18 | +import com.ruoyi.service.ThreadJobService; | ||
| 18 | import com.ruoyi.utils.ConstDateUtil; | 19 | import com.ruoyi.utils.ConstDateUtil; |
| 19 | import com.ruoyi.utils.ListUtils; | 20 | import com.ruoyi.utils.ListUtils; |
| 20 | import org.apache.commons.io.FilenameUtils; | 21 | import org.apache.commons.io.FilenameUtils; |
| @@ -55,6 +56,9 @@ public class DriverServiceImpl implements IDriverService { | @@ -55,6 +56,9 @@ public class DriverServiceImpl implements IDriverService { | ||
| 55 | private DriverMapper driverMapper; | 56 | private DriverMapper driverMapper; |
| 56 | 57 | ||
| 57 | @Autowired | 58 | @Autowired |
| 59 | + private ThreadJobService threadJobService; | ||
| 60 | + | ||
| 61 | + @Autowired | ||
| 58 | private RedisCache redisCache; | 62 | private RedisCache redisCache; |
| 59 | 63 | ||
| 60 | /** | 64 | /** |
| @@ -233,14 +237,16 @@ public class DriverServiceImpl implements IDriverService { | @@ -233,14 +237,16 @@ public class DriverServiceImpl implements IDriverService { | ||
| 233 | return drivers; | 237 | return drivers; |
| 234 | } | 238 | } |
| 235 | 239 | ||
| 240 | + | ||
| 241 | + | ||
| 236 | @Override | 242 | @Override |
| 237 | - public int addDriver(Driver driver) { | ||
| 238 | - // TODO 人脸注册 | ||
| 239 | - return 0; | 243 | + public AjaxResult faceRegistrationFeedback(String deviceId, List<String> jobCodes) { |
| 244 | + threadJobService.asyncUpdateDriver(deviceId,jobCodes); | ||
| 245 | + return AjaxResult.success("注册成功"); | ||
| 240 | } | 246 | } |
| 241 | 247 | ||
| 242 | private File getLocationFile(String jobCode) { | 248 | private File getLocationFile(String jobCode) { |
| 243 | - String image = driverMapper.getDriverInfoByJobCode(jobCode); | 249 | + String image = driverMapper.getDriverImageByJobCode(jobCode); |
| 244 | 250 | ||
| 245 | return new File(RuoYiConfig.getProfile() + File.separator + image.replace("/profile", "")); | 251 | return new File(RuoYiConfig.getProfile() + File.separator + image.replace("/profile", "")); |
| 246 | } | 252 | } |
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| @@ -89,9 +89,9 @@ public class SignInServiceImpl implements ISignInService { | @@ -89,9 +89,9 @@ public class SignInServiceImpl implements ISignInService { | ||
| 89 | if (signIn.getType() == null) { | 89 | if (signIn.getType() == null) { |
| 90 | signIn.setType(SignInEnum.SIGN_IN); | 90 | signIn.setType(SignInEnum.SIGN_IN); |
| 91 | } | 91 | } |
| 92 | - if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag())){ | 92 | + if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag())) { |
| 93 | signIn.setStatus(signIn.getAlcoholIntake().compareTo(new BigDecimal(20)) < 0 ? SIGN_IN_SUCCESS : SIGN_IN_FAIL); | 93 | signIn.setStatus(signIn.getAlcoholIntake().compareTo(new BigDecimal(20)) < 0 ? SIGN_IN_SUCCESS : SIGN_IN_FAIL); |
| 94 | - signIn.setRemark(signIn.getStatus().equals(SIGN_IN_FAIL)? "酒精测试不通过超标:" + signIn.getAlcoholIntake().floatValue() + "%" : ""); | 94 | + signIn.setRemark(signIn.getStatus().equals(SIGN_IN_FAIL) ? "酒精测试不通过超标:" + signIn.getAlcoholIntake().floatValue() + "%" : ""); |
| 95 | } | 95 | } |
| 96 | return signInMapper.insertSignIn(signIn); | 96 | return signInMapper.insertSignIn(signIn); |
| 97 | } | 97 | } |
| @@ -131,7 +131,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -131,7 +131,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | @Override | 133 | @Override |
| 134 | - public AjaxResult addSignIn(SignIn signIn) throws IOException { | 134 | + public AjaxResult addSignIn(SignIn signIn) throws IOException { |
| 135 | // 签到检查 | 135 | // 签到检查 |
| 136 | checkSignIn(signIn); | 136 | checkSignIn(signIn); |
| 137 | // base64转图片 | 137 | // base64转图片 |
| @@ -140,33 +140,35 @@ public class SignInServiceImpl implements ISignInService { | @@ -140,33 +140,35 @@ public class SignInServiceImpl implements ISignInService { | ||
| 140 | uploadImage(signIn); | 140 | uploadImage(signIn); |
| 141 | signInMapper.insertSignIn(signIn); | 141 | signInMapper.insertSignIn(signIn); |
| 142 | // TODO 驾驶人员二次签到酒精测试异常 | 142 | // TODO 驾驶人员二次签到酒精测试异常 |
| 143 | - if (true){ | 143 | + if (true) { |
| 144 | Integer count = redisCache.getCacheMapValue(ConstDateUtil.formatDate("yyyyMMdd") + REDIS_SIGN_IN, signIn.getJobCode()); | 144 | Integer count = redisCache.getCacheMapValue(ConstDateUtil.formatDate("yyyyMMdd") + REDIS_SIGN_IN, signIn.getJobCode()); |
| 145 | - if (Objects.isNull(count)){ | ||
| 146 | - redisCache.setCacheMapValue(ConstDateUtil.formatDate("yyyyMMdd") + REDIS_SIGN_IN, signIn.getJobCode(),0); | 145 | + if (Objects.isNull(count)) { |
| 146 | + redisCache.setCacheMapValue(ConstDateUtil.formatDate("yyyyMMdd") + REDIS_SIGN_IN, signIn.getJobCode(), 0); | ||
| 147 | + } else { | ||
| 148 | + count = redisCache.increment(ConstDateUtil.formatDate("yyyyMMdd") + REDIS_SIGN_IN, signIn.getJobCode(), 1); | ||
| 147 | } | 149 | } |
| 148 | - count = redisCache.increment(ConstDateUtil.formatDate("yyyyMMdd") + REDIS_SIGN_IN, signIn.getJobCode(), 1); | ||
| 149 | - if (count.equals(2) || count.compareTo(2) == 1){ | ||
| 150 | - | 150 | + if (count.compareTo(2) >= 0) { |
| 151 | + // TODO | ||
| 152 | + return SIGN_IN_SUCCESS.equals(signIn.getStatus()) ? AjaxResult.success(SIGN_IN_SUCCESS_STRING) : AjaxResult.error(SIGN_IN_ERROR + signIn.getRemark() + ",酒精测试不通过两次请更换车辆驾驶员"); | ||
| 151 | } | 153 | } |
| 152 | } | 154 | } |
| 153 | 155 | ||
| 154 | 156 | ||
| 155 | - return SIGN_IN_SUCCESS.equals(signIn.getStatus()) ? AjaxResult.success(SIGN_IN_SUCCESS_STRING): AjaxResult.error(SIGN_IN_ERROR + signIn.getRemark()); | 157 | + return SIGN_IN_SUCCESS.equals(signIn.getStatus()) ? AjaxResult.success(SIGN_IN_SUCCESS_STRING) : AjaxResult.error(SIGN_IN_ERROR + signIn.getRemark()); |
| 156 | } | 158 | } |
| 157 | 159 | ||
| 158 | private void checkSignIn(SignIn signIn) { | 160 | private void checkSignIn(SignIn signIn) { |
| 159 | // TODO 更具工号获取人员信息 | 161 | // TODO 更具工号获取人员信息 |
| 160 | Driver driver = getDriverInfoByJobCode(signIn.getJobCode()); | 162 | Driver driver = getDriverInfoByJobCode(signIn.getJobCode()); |
| 161 | - if (Objects.isNull(driver)){ | 163 | + if (Objects.isNull(driver)) { |
| 162 | signIn.setStatus(SIGN_IN_SUCCESS); | 164 | signIn.setStatus(SIGN_IN_SUCCESS); |
| 163 | return; | 165 | return; |
| 164 | } | 166 | } |
| 165 | // TODO 排班校验 非司售未作 | 167 | // TODO 排班校验 非司售未作 |
| 166 | - checkWorkDay(signIn,driver.getPersonnelType()); | 168 | + checkWorkDay(signIn, driver.getPersonnelType()); |
| 167 | 169 | ||
| 168 | // 酒精测试校验 TODO 判断人员类型 | 170 | // 酒精测试校验 TODO 判断人员类型 |
| 169 | - if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag())){ | 171 | + if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag())) { |
| 170 | signIn.setStatus(signIn.getAlcoholIntake().compareTo(new BigDecimal(20)) < 0 ? SIGN_IN_SUCCESS : SIGN_IN_FAIL); | 172 | signIn.setStatus(signIn.getAlcoholIntake().compareTo(new BigDecimal(20)) < 0 ? SIGN_IN_SUCCESS : SIGN_IN_FAIL); |
| 171 | signIn.setRemark(signIn.getStatus().equals(SIGN_IN_FAIL) ? ALCOHOL_SIGN_IN_ERROR : ""); | 173 | signIn.setRemark(signIn.getStatus().equals(SIGN_IN_FAIL) ? ALCOHOL_SIGN_IN_ERROR : ""); |
| 172 | } | 174 | } |
| @@ -178,11 +180,11 @@ public class SignInServiceImpl implements ISignInService { | @@ -178,11 +180,11 @@ public class SignInServiceImpl implements ISignInService { | ||
| 178 | 180 | ||
| 179 | private void checkWorkDay(SignIn signIn, String personnelType) { | 181 | private void checkWorkDay(SignIn signIn, String personnelType) { |
| 180 | List<ResponseScheduling> jobs = null; | 182 | List<ResponseScheduling> jobs = null; |
| 181 | - switch (personnelType){ | 183 | + switch (personnelType) { |
| 182 | case "0": | 184 | case "0": |
| 183 | // 查询工号对应的排班 司售人员 | 185 | // 查询工号对应的排班 司售人员 |
| 184 | - jobs = redisCache.getCacheMapValue(ConstDateUtil.formatDate("yyyyMMdd"),signIn.getJobCode()); | ||
| 185 | - if (Objects.isNull(jobs)|| jobs.size() == 0){ | 186 | + jobs = redisCache.getCacheMapValue(ConstDateUtil.formatDate("yyyyMMdd"), signIn.getJobCode()); |
| 187 | + if (Objects.isNull(jobs) || jobs.size() == 0) { | ||
| 186 | signIn.setStatus(SIGN_IN_FAIL); | 188 | signIn.setStatus(SIGN_IN_FAIL); |
| 187 | signIn.setRemark(WORK_DAY_ERROR); | 189 | signIn.setRemark(WORK_DAY_ERROR); |
| 188 | } | 190 | } |
| @@ -194,7 +196,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -194,7 +196,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 194 | } | 196 | } |
| 195 | 197 | ||
| 196 | // 超时校验司售人员 | 198 | // 超时校验司售人员 |
| 197 | - checkTimeOut(signIn,jobs); | 199 | + checkTimeOut(signIn, jobs); |
| 198 | // TODO 非司售人员 | 200 | // TODO 非司售人员 |
| 199 | 201 | ||
| 200 | } | 202 | } |
| @@ -231,7 +233,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -231,7 +233,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 231 | String pathFileName = getPathFileName(filePath, fileName); | 233 | String pathFileName = getPathFileName(filePath, fileName); |
| 232 | signIn.setImage(pathFileName); | 234 | signIn.setImage(pathFileName); |
| 233 | // 异步上传文件 | 235 | // 异步上传文件 |
| 234 | - threadJobConfig.startUpload(absPath,base64); | 236 | + threadJobConfig.asyncStartUpload(absPath, base64); |
| 235 | } | 237 | } |
| 236 | 238 | ||
| 237 | /** | 239 | /** |
ruoyi-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
| @@ -8,7 +8,7 @@ import com.ruoyi.common.utils.DateUtils; | @@ -8,7 +8,7 @@ import com.ruoyi.common.utils.DateUtils; | ||
| 8 | import com.ruoyi.common.utils.StringUtils; | 8 | import com.ruoyi.common.utils.StringUtils; |
| 9 | import com.ruoyi.common.utils.uuid.Seq; | 9 | import com.ruoyi.common.utils.uuid.Seq; |
| 10 | import com.ruoyi.common.utils.uuid.UUID; | 10 | import com.ruoyi.common.utils.uuid.UUID; |
| 11 | -import com.ruoyi.in.mapper.SignInMapper; | 11 | +import com.ruoyi.driver.mapper.DriverMapper; |
| 12 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | import org.apache.commons.io.FilenameUtils; | 13 | import org.apache.commons.io.FilenameUtils; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -21,6 +21,7 @@ import java.io.File; | @@ -21,6 +21,7 @@ import java.io.File; | ||
| 21 | import java.io.FileOutputStream; | 21 | import java.io.FileOutputStream; |
| 22 | import java.io.IOException; | 22 | import java.io.IOException; |
| 23 | import java.util.Base64; | 23 | import java.util.Base64; |
| 24 | +import java.util.List; | ||
| 24 | import java.util.Objects; | 25 | import java.util.Objects; |
| 25 | 26 | ||
| 26 | 27 | ||
| @@ -34,6 +35,10 @@ import java.util.Objects; | @@ -34,6 +35,10 @@ import java.util.Objects; | ||
| 34 | @Slf4j | 35 | @Slf4j |
| 35 | public class ThreadJobService { | 36 | public class ThreadJobService { |
| 36 | 37 | ||
| 38 | + @Autowired | ||
| 39 | + private DriverMapper driverMapper; | ||
| 40 | + | ||
| 41 | + | ||
| 37 | 42 | ||
| 38 | /** | 43 | /** |
| 39 | * 异步上传图片 | 44 | * 异步上传图片 |
| @@ -44,10 +49,9 @@ public class ThreadJobService { | @@ -44,10 +49,9 @@ public class ThreadJobService { | ||
| 44 | * @throws IOException | 49 | * @throws IOException |
| 45 | */ | 50 | */ |
| 46 | @Async | 51 | @Async |
| 47 | - public void startUpload(String url, String base64) { | 52 | + public void asyncStartUpload(String url, String base64) { |
| 48 | FileOutputStream outputStream = null; | 53 | FileOutputStream outputStream = null; |
| 49 | base64 = base64.replaceAll(" ", ""); | 54 | base64 = base64.replaceAll(" ", ""); |
| 50 | -// byte[] imageBytes = Base64.getDecoder().decode(base64); | ||
| 51 | BASE64Decoder decoder = new BASE64Decoder(); | 55 | BASE64Decoder decoder = new BASE64Decoder(); |
| 52 | try { | 56 | try { |
| 53 | byte[] photoBase64 = decoder.decodeBuffer(base64); | 57 | byte[] photoBase64 = decoder.decodeBuffer(base64); |
| @@ -72,6 +76,14 @@ public class ThreadJobService { | @@ -72,6 +76,14 @@ public class ThreadJobService { | ||
| 72 | } | 76 | } |
| 73 | } | 77 | } |
| 74 | } | 78 | } |
| 79 | + @Async | ||
| 80 | + public void asyncUpdateDriver(String deviceId, List<String> jobCodes){ | ||
| 81 | + // 获取员工信息 | ||
| 82 | + // 加锁 | ||
| 83 | + // 同步锁实现 | ||
| 84 | + Integer result = driverMapper.insertDriverFace(deviceId, jobCodes); | ||
| 85 | + log.info("注册设备与员工关联完毕:{}",result); | ||
| 86 | + } | ||
| 75 | 87 | ||
| 76 | /** | 88 | /** |
| 77 | * 检查文件类型 | 89 | * 检查文件类型 |
| @@ -137,4 +149,6 @@ public class ThreadJobService { | @@ -137,4 +149,6 @@ public class ThreadJobService { | ||
| 137 | return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; | 149 | return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; |
| 138 | } | 150 | } |
| 139 | 151 | ||
| 152 | + | ||
| 153 | + | ||
| 140 | } | 154 | } |
ruoyi-admin/src/main/resources/mapper/driver/DriverMapper.xml
| @@ -45,12 +45,13 @@ | @@ -45,12 +45,13 @@ | ||
| 45 | line_code, | 45 | line_code, |
| 46 | face_sign_in, | 46 | face_sign_in, |
| 47 | image, | 47 | image, |
| 48 | - update_time | 48 | + update_time, |
| 49 | + sign_in_equipment | ||
| 49 | from driver | 50 | from driver |
| 50 | </sql> | 51 | </sql> |
| 51 | <sql id="insertDriverVo"> | 52 | <sql id="insertDriverVo"> |
| 52 | job_code | 53 | job_code |
| 53 | - , company_code, branche_company_code, personnel_name, papers_code, ic_card_code, personnel_type, posts, card, telphone, ic_rfid, id_rfid, tag_rfid, remark, line_name, line_code,face_sign_in,image,update_time | 54 | + , company_code, branche_company_code, personnel_name, papers_code, ic_card_code, personnel_type, posts, card, telphone, ic_rfid, id_rfid, tag_rfid, remark, line_name, line_code,face_sign_in,image,update_time,sign_in_equipment |
| 54 | </sql> | 55 | </sql> |
| 55 | 56 | ||
| 56 | <select id="selectDriverList" parameterType="Driver" resultMap="DriverResult"> | 57 | <select id="selectDriverList" parameterType="Driver" resultMap="DriverResult"> |
| @@ -111,7 +112,7 @@ | @@ -111,7 +112,7 @@ | ||
| 111 | from driver | 112 | from driver |
| 112 | where job_code = #{jobCode} | 113 | where job_code = #{jobCode} |
| 113 | </select> | 114 | </select> |
| 114 | - <select id="getDriverInfoByJobCode" resultType="String"> | 115 | + <select id="getDriverImageByJobCode" resultType="String"> |
| 115 | select image from driver | 116 | select image from driver |
| 116 | where job_code = #{jobCode} | 117 | where job_code = #{jobCode} |
| 117 | </select> | 118 | </select> |
| @@ -140,6 +141,10 @@ | @@ -140,6 +141,10 @@ | ||
| 140 | <if test="faceSignIn != null and faceSignIn != ''">and face_sign_in = #{faceSignIn}</if> | 141 | <if test="faceSignIn != null and faceSignIn != ''">and face_sign_in = #{faceSignIn}</if> |
| 141 | </where> | 142 | </where> |
| 142 | </select> | 143 | </select> |
| 144 | + <select id="getDriverInfoByJobCode" resultType="com.ruoyi.driver.domain.Driver"> | ||
| 145 | + <include refid="selectDriverVo"></include> | ||
| 146 | + where job_code = #{jobCode} | ||
| 147 | + </select> | ||
| 143 | 148 | ||
| 144 | <insert id="insertDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id"> | 149 | <insert id="insertDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id"> |
| 145 | insert into driver | 150 | insert into driver |
| @@ -206,6 +211,7 @@ | @@ -206,6 +211,7 @@ | ||
| 206 | <if test="lineCode != null">line_code = #{lineCode},</if> | 211 | <if test="lineCode != null">line_code = #{lineCode},</if> |
| 207 | <if test="faceSignIn != null">face_sign_in = #{faceSignIn},</if> | 212 | <if test="faceSignIn != null">face_sign_in = #{faceSignIn},</if> |
| 208 | <if test="image != null">image = #{image}</if> | 213 | <if test="image != null">image = #{image}</if> |
| 214 | + <if test="signInEquipment != null">sign_in_equipment = #{signInEquipment}</if> | ||
| 209 | </trim> | 215 | </trim> |
| 210 | where id = #{id} | 216 | where id = #{id} |
| 211 | </update> | 217 | </update> |
| @@ -293,11 +299,24 @@ | @@ -293,11 +299,24 @@ | ||
| 293 | #{item.lineCode,jdbcType=VARCHAR}, | 299 | #{item.lineCode,jdbcType=VARCHAR}, |
| 294 | #{item.faceSignIn}, | 300 | #{item.faceSignIn}, |
| 295 | #{item.image}, | 301 | #{item.image}, |
| 296 | - #{item.updateTime} | 302 | + #{item.updateTime}, |
| 303 | + #{item.signInEquipment} | ||
| 304 | + ) | ||
| 305 | + </foreach> | ||
| 306 | + on duplicate key update | ||
| 307 | + job_code = values(job_code) | ||
| 308 | + </insert> | ||
| 309 | + <insert id="insertDriverFace" useGeneratedKeys="true" keyProperty="id"> | ||
| 310 | + INSERT INTO driver_face_device_id ( job_code,device_id ) | ||
| 311 | + values | ||
| 312 | + <foreach collection="jobCodes" item="item" index="index" separator=","> | ||
| 313 | + ( | ||
| 314 | + #{item},#{deviceId} | ||
| 297 | ) | 315 | ) |
| 298 | </foreach> | 316 | </foreach> |
| 299 | on duplicate key update | 317 | on duplicate key update |
| 300 | job_code = values(job_code) | 318 | job_code = values(job_code) |
| 319 | + device_id = values(device_id) | ||
| 301 | </insert> | 320 | </insert> |
| 302 | 321 | ||
| 303 | </mapper> | 322 | </mapper> |
| 304 | \ No newline at end of file | 323 | \ No newline at end of file |