Commit b6f145b75e26f1df1549180e7fffd687e6f89afa

Authored by liujun001
1 parent decaea49

酒测复测

Bsth-admin/sql/DDL.sql
... ... @@ -4,3 +4,7 @@ ALTER TABLE equipment_exception ADD sign_id INT NULL COMMENT '打卡表ID';
4 4 ALTER TABLE equipment_exception_report ADD sign_in varchar(100) NULL COMMENT '签到类型 1 人脸 2 刷卡 3 其他 4 酒精;104 线下酒测';
5 5  
6 6  
  7 +ALTER TABLE sign_in ADD exception_Id BIGINT NULL COMMENT '异常ID复测签到';
  8 +
  9 +
  10 +
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/sign/in/exception/report/EquipmentExceptionReportController.java
... ... @@ -77,7 +77,7 @@ public class EquipmentExceptionReportController extends BaseController {
77 77 // request.setDriverJobs(driverJobs);
78 78 }
79 79 Set<String> notSignIn = new HashSet<>();
80   - notSignIn.add("104");
  80 + // notSignIn.add("104");
81 81 request.setNotSignIn(notSignIn);
82 82  
83 83  
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss2/driver/dto/DssSignV2DTO.java
... ... @@ -61,6 +61,8 @@ public class DssSignV2DTO {
61 61 @ApiModelProperty(value = "视频内容Base64")
62 62 private String videoContent;
63 63  
  64 + private Long exceptionId;
  65 +
64 66  
65 67 @Override
66 68 public String toString() {
... ...
Bsth-admin/src/main/java/com/ruoyi/in/domain/SignIn.java
... ... @@ -14,11 +14,11 @@ import java.util.Date;
14 14  
15 15 /**
16 16 * 签到对象 sign_in
17   - *
  17 + *
18 18 * @author guzijian
19 19 * @date 2023-07-05
20 20 */
21   -@ApiModel(value = "签到对象",description = "签到记录参数")
  21 +@ApiModel(value = "签到对象", description = "签到记录参数")
22 22 @Data
23 23 public class SignIn extends BaseEntity {
24 24 private static final long serialVersionUID = 1L;
... ... @@ -94,7 +94,7 @@ public class SignIn extends BaseEntity {
94 94 @Excel(name = "酒精摄入量")
95 95 @ApiModelProperty("酒精摄入量 52.12")
96 96 private BigDecimal alcoholIntake;
97   - @Excel(name = "异常类型",readConverterExp = "0=无异常,1=超时异常,2=无排班异常,3=酒精超标异常,44饮酒")
  97 + @Excel(name = "异常类型", readConverterExp = "0=无异常,1=超时异常,2=无排班异常,3=酒精超标异常,44饮酒")
98 98 @ApiModelProperty("异常类型")
99 99 private Integer exType;
100 100  
... ... @@ -114,5 +114,7 @@ public class SignIn extends BaseEntity {
114 114  
115 115 @TableField(exist = false)
116 116 private Date endCreateTime;
  117 +
  118 + private Long exceptionId;
117 119 }
118 120  
... ...
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceV1Impl.java
... ... @@ -21,6 +21,7 @@ import com.ruoyi.common.utils.ip.IpUtils;
21 21 import com.ruoyi.common.utils.uuid.Seq;
22 22 import com.ruoyi.common.utils.uuid.UUID;
23 23 import com.ruoyi.domain.DriverScheduling;
  24 +import com.ruoyi.domain.sign.in.exception.report.EquipmentExceptionReport;
24 25 import com.ruoyi.domain.sign.in.resource.LinggangSignInResource;
25 26 import com.ruoyi.driver.domain.Driver;
26 27 import com.ruoyi.driver.mapper.DriverMapper;
... ... @@ -38,6 +39,7 @@ import com.ruoyi.scheduling.service.SchedulingServiceV1;
38 39 import com.ruoyi.service.BigViewServiceV1;
39 40 import com.ruoyi.service.SchedulingService;
40 41 import com.ruoyi.service.ThreadJobService;
  42 +import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService;
41 43 import com.ruoyi.service.sign.in.resource.LinggangSignInResourceService;
42 44 import com.ruoyi.utils.ConstDateUtil;
43 45 import com.ruoyi.utils.UploadUtil;
... ... @@ -90,6 +92,8 @@ public class SignInServiceV1Impl extends ServiceImpl&lt;SignInMapperV1, SignInV1&gt; i
90 92 @Autowired
91 93 private ISignInService signInService;
92 94  
  95 + private EquipmentExceptionReportService equipmentExceptionReportService;
  96 +
93 97 private static final FastDateFormat HHMM = FastDateFormat.getInstance("HH:mm");
94 98  
95 99 @Override
... ... @@ -340,6 +344,13 @@ public class SignInServiceV1Impl extends ServiceImpl&lt;SignInMapperV1, SignInV1&gt; i
340 344 // 异常保存到异常异常中
341 345 threadJobService.asyncInsertExceptionRecord(signIn, driver, scheduling);
342 346  
  347 + if (Objects.nonNull(signIn.getExceptionId())) {
  348 + LambdaUpdateWrapper<EquipmentExceptionReport> reportLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
  349 + reportLambdaUpdateWrapper.set(EquipmentExceptionReport::getStatus, 3).set(EquipmentExceptionReport::getUpdateTime, new Date())
  350 + .set(EquipmentExceptionReport::getUpdateBy, signIn.getCreateBy()).eq(EquipmentExceptionReport::getId, signIn.getExceptionId());
  351 + equipmentExceptionReportService.update(reportLambdaUpdateWrapper);
  352 + }
  353 +
343 354 return handleAjaxResult(signIn, signInV1);
344 355 }
345 356  
... ...
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
... ... @@ -205,6 +205,8 @@ public class ThreadJobService {
205 205 exception.setCreateTime(signIn.getCreateTime());
206 206 exception.setFleetName(driver.getFleetName());
207 207 exception.setSignId(signIn.getId());
  208 + exception.setCreateTime(signIn.getCreateTime());
  209 + exception.setCreateBy(signIn.getCreateBy());
208 210 if (Objects.nonNull(scheduling)) {
209 211 exception.setNbbm(scheduling.getNbbm());
210 212 exception.setLineName(scheduling.getLineName());
... ... @@ -217,10 +219,13 @@ public class ThreadJobService {
217 219 BeanUtils.copyProperties(exception, exceptionReport);
218 220 exceptionReport.setSignId(signIn.getId());
219 221 exceptionReport.setSignIn(signIn.getSingnIn());
  222 + exceptionReport.setStatus(1);
220 223 equipmentExceptionReportService.save(exceptionReport);
221 224  
222   - // 发送通知
223   - sendNotice(signIn, driver, scheduling);
  225 + if (Objects.isNull(signIn.getExceptionId())) {
  226 + // 发送通知
  227 + sendNotice(signIn, driver, scheduling);
  228 + }
224 229 }
225 230 }
226 231  
... ... @@ -369,9 +374,14 @@ public class ThreadJobService {
369 374  
370 375 String key = SignatureUtils.generateSignature(map, "your_secret_key_here");
371 376 map.put("signature", key);
  377 + String result = null;
  378 + try {
  379 + result = HttpUtil.get(processSignExceptionURL, map, 10000);
  380 + log.info("processSignExceptionURL:[{}],paramMap:[{}],result:[{}]", processSignExceptionURL, JSONUtil.toJsonStr(map), result);
  381 + } catch (Exception e) {
  382 + log.error("processSignExceptionURL:[{}],paramMap:[{}],result:[{}]", processSignExceptionURL, JSONUtil.toJsonStr(map), result, e);
  383 + }
372 384  
373   - String result = HttpUtil.get(processSignExceptionURL, map, 10000);
374   - log.info("processSignExceptionURL:[{}],paramMap:[{}],result:[{}]", processSignExceptionURL, JSONUtil.toJsonStr(map), result);
375 385 }
376 386  
377 387 }
... ...
Bsth-admin/src/main/resources/application-druid-devTest.yml
... ... @@ -215,5 +215,8 @@ bsth:
215 215 # path: D:/work/code/jienengjiancha/bsth-alcohol-sign/Bsth-admin/src/main/resources/libs/WIN64
216 216 faceFeature:
217 217 url: http://222.76.217.238:8880/fcgi-bin/entry.fcgi/system
  218 + process:
  219 + sign:
  220 + url: http://127.0.0.1:9103/commonOpenDataApi/sendAppAndSmsNotice
218 221 skip:
219 222 url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/login/no/code;/uploadPath/**;/doc.html
... ...
Bsth-admin/src/main/resources/mapper/in/SignInMapper.xml
... ... @@ -173,6 +173,7 @@
173 173 <if test="exType != null">ex_type,</if>
174 174 <if test="null!=schedulingId">scheduling_id,</if>
175 175 <if test="null!=exType1">ex_type1,</if>
  176 + <if test="null!=exceptionId">exception_Id,</if>
176 177 </trim>
177 178 <trim prefix="values (" suffix=")" suffixOverrides=",">
178 179 <if test="createTime != null">#{createTime},</if>
... ... @@ -191,6 +192,7 @@
191 192 <if test="exType != null">#{exType},</if>
192 193 <if test="null!=schedulingId">#{schedulingId,jdbcType=INTEGER},</if>
193 194 <if test="null!=exType1">#{exType1,jdbcType=INTEGER},</if>
  195 + <if test="null!=exceptionId">#{exceptionId},</if>
194 196 </trim>
195 197 </insert>
196 198  
... ...