Commit b9a40c498360ab989152396e720a65c7eb00f152

Authored by liujun001
1 parent 5ce3372c

蓝斯接口 模糊查询车辆车牌列表\司机获取当前工作的车辆钥匙信息

Showing 22 changed files with 577 additions and 26 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
1 1 package com.ruoyi.controller.dss;
2 2  
3 3 import cn.hutool.core.convert.Convert;
  4 +import com.baomidou.mybatisplus.core.metadata.IPage;
  5 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 6 import com.ruoyi.common.core.controller.BaseController;
5 7 import com.ruoyi.common.core.domain.AjaxResult;
6 8 import com.ruoyi.common.core.domain.ResponseResult;
7 9 import com.ruoyi.common.core.domain.entity.SysDictData;
8 10 import com.ruoyi.common.exception.file.FileUploadException;
  11 +import com.ruoyi.domain.OrderEntity;
  12 +import com.ruoyi.domain.caiinfo.CarInfo;
9 13 import com.ruoyi.domain.driver.NewDriver;
10 14 import com.ruoyi.domain.driver.dss.syn.DrivePosEnum;
11 15 import com.ruoyi.domain.driver.dss.syn.login.dto.LoginDriverDTO;
12 16 import com.ruoyi.domain.driver.dss.syn.login.vo.LoginDriverVo;
13 17 import com.ruoyi.domain.driver.dss.syn.login.vo.LoginUserInfoVo;
  18 +import com.ruoyi.domain.dss.driver.dto.GetBeforeWorkListDTO;
  19 +import com.ruoyi.domain.dss.driver.dto.GetBusPlanListDTO;
  20 +import com.ruoyi.domain.dss.driver.vo.GetBeforeWorkListVo;
  21 +import com.ruoyi.domain.dss.driver.vo.GetBusPlanListVo;
14 22 import com.ruoyi.domain.dss.sign.dto.DssGetWineRecordDTO;
15 23 import com.ruoyi.domain.dss.sign.dto.DssSignDTO;
16 24 import com.ruoyi.domain.dss.sign.dto.DssSignOutDTO;
17 25 import com.ruoyi.domain.dss.sign.vo.DssSignVo;
18 26 import com.ruoyi.domain.dss.sign.vo.GetWineRecordVo;
19 27 import com.ruoyi.domain.dss.sign.vo.SignOutVo;
  28 +import com.ruoyi.domain.scheduling.LinggangScheduling;
  29 +import com.ruoyi.equipment.domain.Equipment;
  30 +import com.ruoyi.equipment.service.IEquipmentService;
20 31 import com.ruoyi.in.domain.SignIn;
21 32 import com.ruoyi.in.service.ISignInService;
22 33 import com.ruoyi.pojo.response.SignInResponseVo;
  34 +import com.ruoyi.service.carinfo.CarInfoService;
23 35 import com.ruoyi.service.driver.NewDriverService;
24 36 import com.ruoyi.service.dss.FaceService;
  37 +import com.ruoyi.service.scheduling.LinggangSchedulingService;
25 38 import com.ruoyi.system.service.ISysDictDataService;
26 39 import io.swagger.annotations.Api;
27 40 import io.swagger.annotations.ApiOperation;
28 41 import lombok.extern.slf4j.Slf4j;
  42 +import org.apache.commons.collections4.CollectionUtils;
29 43 import org.apache.commons.lang3.StringUtils;
  44 +import org.apache.commons.lang3.time.DateUtils;
30 45 import org.springframework.beans.factory.annotation.Autowired;
31 46 import org.springframework.validation.BindingResult;
32 47 import org.springframework.web.bind.annotation.*;
33 48  
34 49 import javax.validation.Valid;
35 50 import java.io.IOException;
36   -import java.util.HashSet;
37   -import java.util.Objects;
38   -import java.util.Set;
  51 +import java.util.*;
  52 +import java.util.stream.Collectors;
39 53  
40 54 /**
41 55 * @author liujun
... ... @@ -43,7 +57,7 @@ import java.util.Set;
43 57 */
44 58 @RestController
45 59 @Slf4j
46   -@RequestMapping("/dss/Driver")
  60 +@RequestMapping("/dss")
47 61 @Api(tags = "【蓝斯一期】人员信息")
48 62 public class DssDriverController extends BaseController {
49 63 @Autowired
... ... @@ -54,8 +68,14 @@ public class DssDriverController extends BaseController {
54 68 private ISignInService signInService;
55 69 @Autowired
56 70 private FaceService faceService;
  71 + @Autowired
  72 + private LinggangSchedulingService schedulingService;
  73 + @Autowired
  74 + private CarInfoService carInfoService;
  75 + @Autowired
  76 + private IEquipmentService equipmentService;
57 77  
58   - @PostMapping(value = "Login")
  78 + @PostMapping(value = "/Driver/Login")
59 79 @ApiOperation("人员登录设备")
60 80 public ResponseResult<LoginDriverVo> login(@Valid @RequestBody LoginDriverDTO loginDriverDTO, BindingResult bindingResult) {
61 81 if (bindingResult.hasErrors()) {
... ... @@ -70,7 +90,7 @@ public class DssDriverController extends BaseController {
70 90 return ResponseResult.success(convertNewDriver(driver));
71 91 }
72 92  
73   - @PostMapping(value = "SignIn")
  93 + @PostMapping(value = "/Driver/SignIn")
74 94 @ApiOperation("人员签到")
75 95 public ResponseResult<DssSignVo> sign(@Valid @RequestBody DssSignDTO dto, BindingResult bindingResult) {
76 96 if (bindingResult.hasErrors()) {
... ... @@ -94,7 +114,7 @@ public class DssDriverController extends BaseController {
94 114 }
95 115  
96 116  
97   - @PostMapping(value = "SignOut")
  117 + @PostMapping(value = "/Driver/SignOut")
98 118 @ApiOperation("人员签退")
99 119 public ResponseResult<SignOutVo> signOut(@Valid @RequestBody DssSignOutDTO dto, BindingResult bindingResult) {
100 120 if (bindingResult.hasErrors()) {
... ... @@ -115,7 +135,7 @@ public class DssDriverController extends BaseController {
115 135 }
116 136 }
117 137  
118   - @GetMapping(value = "GetWineRecord")
  138 + @GetMapping(value = "/Driver/GetWineRecord")
119 139 @ApiOperation("校验司机酒测记录是否有效")
120 140 public ResponseResult<GetWineRecordVo> getWineRecord(@Valid @RequestBody DssGetWineRecordDTO dto, BindingResult bindingResult) {
121 141 if (bindingResult.hasErrors()) {
... ... @@ -127,9 +147,68 @@ public class DssDriverController extends BaseController {
127 147 return ResponseResult.success(convertGetWineRecordVo(dataSignIn));
128 148 }
129 149  
  150 + @PostMapping(value = "/Info/GetBusPlanList")
  151 + @ApiOperation(value = "22.查询司机排班计划信息")
  152 + public ResponseResult<Map<String, Object>> GetBusPlanList(@Valid @RequestBody GetBusPlanListDTO dto, BindingResult bindingResult) {
  153 + if (bindingResult.hasErrors()) {
  154 + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage());
  155 + }
130 156  
  157 + LinggangScheduling scheduling = convertScheduling(dto);
  158 + IPage<LinggangScheduling> iPage = schedulingService.pageList(new Page<LinggangScheduling>(dto.getPageNumber(), dto.getPageRow()), scheduling, new OrderEntity());
131 159  
  160 + if (Objects.isNull(iPage)) {
  161 + return ResponseResult.error();
  162 + }
  163 + if (CollectionUtils.isNotEmpty(iPage.getRecords())) {
  164 + Set<String> nbbm = iPage.getRecords().stream().map(LinggangScheduling::getNbbm).collect(Collectors.toSet());
  165 + List<CarInfo> carInfos = carInfoService.list(nbbm);
132 166  
  167 + Map<String, Object> getBusPlanListVo = convertGetBusPlanListVo(iPage, dto, carInfos);
  168 + return ResponseResult.success(getBusPlanListVo);
  169 + }
  170 + return ResponseResult.success();
  171 + }
  172 +
  173 +
  174 + @PostMapping(value = "/workResult/GetBeforeWorkList")
  175 + @ApiOperation(value = "23.获取酒测记录列表")
  176 + public ResponseResult<List<GetBeforeWorkListVo>> getBeforeWorkList(@Valid @RequestBody GetBeforeWorkListDTO dto, BindingResult bindingResult) {
  177 + if (bindingResult.hasErrors()) {
  178 + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage());
  179 + }
  180 +
  181 + NewDriver newDriver = convertGetBeforeWorkListDTO(dto);
  182 + SignIn signIn = convertSignIn(dto);
  183 +
  184 + Set<String> jobCodes = null;
  185 + List<NewDriver> drivers = null;
  186 + if (Objects.nonNull(newDriver)) {
  187 + drivers = newDriverService.listOficRfidAndLikePersonnelNameJobCodeIcCardCode(newDriver);
  188 + if (CollectionUtils.isNotEmpty(drivers)) {
  189 + jobCodes = drivers.stream().map(NewDriver::getJobCode).collect(Collectors.toSet());
  190 + }
  191 + }
  192 + List<SignIn> signIns = signInService.selectByEntityOrNewDriverId(signIn, jobCodes);
  193 + if (CollectionUtils.isEmpty(signIns)) {
  194 + return ResponseResult.success();
  195 + }
  196 +
  197 + if (CollectionUtils.isEmpty(jobCodes)) {
  198 + jobCodes = signIns.stream().map(SignIn::getJobCode).collect(Collectors.toSet());
  199 + drivers = newDriverService.list(jobCodes);
  200 + }
  201 +
  202 + Set<Long> schedulingIds = signIns.stream().map(SignIn::getSchedulingId).collect(Collectors.toSet());
  203 + List<LinggangScheduling> schedulings = schedulingService.listByIds(schedulingIds);
  204 +
  205 + Set<String> deviceIds = signIns.stream().map(SignIn::getDeviceId).collect(Collectors.toSet());
  206 + List<Equipment> equipmentList = equipmentService.listNameAndIDBydeviceIds(deviceIds);
  207 +
  208 + List<GetBeforeWorkListVo> vos = convertGetBeforeWorkListVos(signIns, drivers, schedulings, equipmentList);
  209 +
  210 + return ResponseResult.success(vos);
  211 + }
133 212  
134 213  
135 214 /***
... ... @@ -202,6 +281,64 @@ public class DssDriverController extends BaseController {
202 281 return driver;
203 282 }
204 283  
  284 + private NewDriver convertGetBeforeWorkListDTO(GetBeforeWorkListDTO dto) {
  285 + Boolean flag = Boolean.TRUE;
  286 + NewDriver newDriver = new NewDriver();
  287 + if (StringUtils.isNotEmpty(dto.getIcCardNo())) {
  288 + newDriver.setIcRfid(dto.getIcCardNo());
  289 + flag = Boolean.FALSE;
  290 + }
  291 + if (StringUtils.isNotEmpty(dto.getDriver())) {
  292 + newDriver.setPersonnelName(dto.getDriver());
  293 + newDriver.setJobCode(dto.getDriver());
  294 + newDriver.setIcCardCode(dto.getDriver());
  295 + flag = Boolean.FALSE;
  296 + }
  297 +
  298 + return flag ? null : newDriver;
  299 + }
  300 +
  301 + private SignIn convertSignIn(GetBeforeWorkListDTO dto) {
  302 + SignIn signIn = new SignIn();
  303 + Boolean flag = Boolean.TRUE;
  304 + if (Objects.nonNull(dto.getCheckTime())) {
  305 + signIn.setCreateTime(dto.getCheckTime());
  306 + flag = false;
  307 + }
  308 +
  309 + if (Objects.nonNull(dto.getDrunkStatus())) {
  310 + switch (dto.getDrunkStatus()) {
  311 + case 0:
  312 + signIn.setExType(0);
  313 + flag = false;
  314 + break;
  315 + case 11:
  316 + signIn.setExType(44);
  317 + flag = false;
  318 + break;
  319 +
  320 + case 12:
  321 + signIn.setExType(3);
  322 + flag = false;
  323 + break;
  324 + }
  325 + }
  326 +
  327 + if (Objects.nonNull(dto.getCheckResult())) {
  328 + switch (dto.getCheckResult()) {
  329 + case 0:
  330 + signIn.setStatus(1);
  331 + flag = false;
  332 + break;
  333 + case 1:
  334 + signIn.setStatus(2);
  335 + flag = false;
  336 + break;
  337 + }
  338 + }
  339 + return flag ? null : signIn;
  340 + }
  341 +
205 342 private SignIn convertSignIn(DssSignDTO dto) {
206 343 SignIn signIn = new SignIn();
207 344 signIn.setDeviceId(dto.getDevice());
... ... @@ -269,5 +406,83 @@ public class DssDriverController extends BaseController {
269 406 return vo;
270 407 }
271 408  
  409 + private LinggangScheduling convertScheduling(GetBusPlanListDTO dto) {
  410 + LinggangScheduling scheduling = new LinggangScheduling();
  411 + if (Objects.equals(0, dto.getDateType())) {
  412 + scheduling.setScheduleDate(new Date());
  413 + } else if (Objects.equals(1, dto.getDateType())) {
  414 + scheduling.setScheduleDate(DateUtils.addDays(new Date(), 1));
  415 + }
  416 +
  417 + return scheduling;
  418 + }
  419 +
  420 + private Map<String, Object> convertGetBusPlanListVo(IPage<LinggangScheduling> iPage, GetBusPlanListDTO dto, List<CarInfo> carInfos) {
  421 + if (Objects.isNull(iPage)) {
  422 + return null;
  423 + }
  424 + Map<String, Object> result = new HashMap<>();
  425 + result.put("total", iPage.getTotal());
  426 + result.put("size", dto.getPageRow());
  427 + result.put("current", dto.getPageNumber());
  428 +
  429 + if (CollectionUtils.isNotEmpty(iPage.getRecords())) {
  430 + List<GetBusPlanListVo> vos = iPage.getRecords().stream().map(scheduling -> {
  431 + GetBusPlanListVo vo = new GetBusPlanListVo();
  432 + vo.setDriverName(scheduling.getName());
  433 + vo.setSelfCode(scheduling.getNbbm());
  434 + if (CollectionUtils.isNotEmpty(carInfos)) {
  435 + Optional<CarInfo> optional = carInfos.stream().filter(c -> Objects.equals(c.getNbbm(), scheduling.getNbbm())).findFirst();
  436 + if (optional.isPresent()) {
  437 + vo.setCarNo(optional.get().getPlateNum());
  438 + }
  439 + }
  440 + vo.setRouteName(scheduling.getLineName());
  441 + vo.setFache(new Date(scheduling.getFcsjT()));
  442 +
  443 + return vo;
  444 + }).collect(Collectors.toList());
  445 + result.put("records", vos);
  446 + }
  447 + return result;
  448 + }
  449 +
  450 + private List<GetBeforeWorkListVo> convertGetBeforeWorkListVos(List<SignIn> signIns, List<NewDriver> drivers, List<LinggangScheduling> schedulings,
  451 + List<Equipment> equipmentList) {
  452 + if (CollectionUtils.isEmpty(signIns)) {
  453 + return Collections.emptyList();
  454 + }
  455 + return signIns.stream().map(s -> {
  456 + GetBeforeWorkListVo vo = new GetBeforeWorkListVo();
  457 + vo.setCheckTime(s.getCreateTime());
  458 + if (CollectionUtils.isNotEmpty(schedulings)) {
  459 + Optional<LinggangScheduling> optional = schedulings.stream().filter(sc -> Objects.equals(sc.getId(), s.getSchedulingId())).findFirst();
  460 + if (optional.isPresent()) {
  461 + vo.setRouteName(optional.get().getLineName());
  462 + }
  463 + }
  464 +
  465 + if (CollectionUtils.isNotEmpty(drivers)) {
  466 + Optional<NewDriver> optional = drivers.stream().filter(d -> Objects.equals(d.getJobCode(), s.getJobCode())).findFirst();
  467 + if (optional.isPresent()) {
  468 + vo.setStaffId(Convert.toStr(optional.get().getId()));
  469 + vo.setStaffName(optional.get().getPersonnelName());
  470 + vo.setIcCardNo(optional.get().getIcCardCode());
  471 + }
  472 + }
  473 +
  474 + if (CollectionUtils.isNotEmpty(equipmentList)) {
  475 + Optional<Equipment> optional = equipmentList.stream().filter(e -> Objects.equals(e.getDeviceId(), s.getDeviceId())).findFirst();
  476 + if (optional.isPresent()) {
  477 + vo.setDeviceName(optional.get().getSiteName());
  478 + }
  479 + }
  480 + vo.setCheckResult(Convert.toStr(s.getStatus()));
  481 + vo.setDrunkNum(Convert.toStr(s.getAlcoholIntake()));
  482 +
  483 + return vo;
  484 + }).collect(Collectors.toList());
  485 + }
  486 +
272 487  
273 488 }
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
... ... @@ -201,7 +201,23 @@ public class KeyBoxController extends BaseController {
201 201 return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage());
202 202 }
203 203 List<LinggangKeyWorkLocation> locations = convert(dto);
204   - ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations);
  204 + ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.TAKE_OUT);
  205 + if (Objects.isNull(responseResult)) {
  206 + return ResponseResult.error();
  207 + }
  208 + TakeKeyVo vo = convertTakeKeyVo(dto, responseResult);
  209 +
  210 + return new ResponseResult<>(responseResult.getCode(), responseResult.getMsg(), vo);
  211 + }
  212 +
  213 + @PostMapping(value = "Driver/TurnKey")
  214 + @ApiModelProperty(value = "21.人员归还钥匙")
  215 + public ResponseResult<TakeKeyVo> turnKey(@Valid TakeKeyDTO dto, BindingResult bindingResult) {
  216 + if (bindingResult.hasErrors()) {
  217 + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage());
  218 + }
  219 + List<LinggangKeyWorkLocation> locations = convert(dto);
  220 + ResponseResult<Boolean> responseResult = linggangKeyWorkLocationService.updateTakeKey(locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum.REPAY);
205 221 if (Objects.isNull(responseResult)) {
206 222 return ResponseResult.error();
207 223 }
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/driver/dto/GetBeforeWorkListDTO.java 0 → 100644
  1 +package com.ruoyi.domain.dss.driver.dto;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +import lombok.EqualsAndHashCode;
  8 +import lombok.experimental.Accessors;
  9 +
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * @author liujun
  14 + * @date 2024年07月24日 16:32
  15 + */
  16 +@Data
  17 +@ApiModel(value = "获取酒测记录列表")
  18 +@Accessors(chain = true)
  19 +@EqualsAndHashCode(callSuper = false)
  20 +public class GetBeforeWorkListDTO implements java.io.Serializable {
  21 +
  22 + private static final long serialVersionUID = -19813580197166104L;
  23 +
  24 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  25 + @ApiModelProperty(value = "酒测时间")
  26 + private Date checkTime;
  27 +
  28 + @ApiModelProperty(value = "IC卡号")
  29 + private String icCardNo;
  30 +
  31 + @ApiModelProperty(value = "酒测状态 0正常,11饮酒,12醉酒")
  32 + private Integer drunkStatus;
  33 +
  34 + @ApiModelProperty(value = "体温状态 0正常,1异常")
  35 + private Integer tempStatus;
  36 +
  37 + @ApiModelProperty(value = "模糊查询 姓名/卡号/工号")
  38 + private String driver;
  39 + @ApiModelProperty(value = "岗前检测结果 0通过,1不通过")
  40 + private Integer checkResult;
  41 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/driver/dto/GetBusPlanListDTO.java 0 → 100644
  1 +package com.ruoyi.domain.dss.driver.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.experimental.Accessors;
  8 +
  9 +import javax.validation.constraints.NotEmpty;
  10 +
  11 +/**
  12 + * @author liujun
  13 + * @date 2024年07月22日 13:42
  14 + */
  15 +@Data
  16 +@ApiModel(value = "查询司机排班计划信息")
  17 +@Accessors(chain = true)
  18 +@EqualsAndHashCode(callSuper = false)
  19 +public class GetBusPlanListDTO implements java.io.Serializable{
  20 +
  21 + private static final long serialVersionUID = 7253500856181067506L;
  22 +
  23 + @NotEmpty(message = "设备上线号不能为空")
  24 + @ApiModelProperty(value = "设备上线号",required = true)
  25 + private String device;
  26 +
  27 + @NotEmpty(message = "卡号不能为空")
  28 + @ApiModelProperty(value = "卡号",required = true)
  29 + private Integer driverCode;
  30 +
  31 + @NotEmpty(message = "数据类型为空")
  32 + @ApiModelProperty(value = "数据类型;0今天,1明天,2/null全部",required = true,example = "1")
  33 + private Integer dateType;
  34 +
  35 + @NotEmpty(message = "第几页为空")
  36 + @ApiModelProperty(value = "第几页",required = true,example = "1")
  37 + private Integer pageNumber;
  38 +
  39 + @NotEmpty(message = "每页条数为空")
  40 + @ApiModelProperty(value = "每页条数",required = true,example = "1")
  41 + private Integer pageRow;
  42 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/driver/vo/GetBeforeWorkListVo.java 0 → 100644
  1 +package com.ruoyi.domain.dss.driver.vo;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Data;
  8 +import lombok.EqualsAndHashCode;
  9 +import lombok.NoArgsConstructor;
  10 +import lombok.experimental.Accessors;
  11 +
  12 +import java.util.Date;
  13 +
  14 +/**
  15 + * @author liujun
  16 + * @date 2024年07月24日 16:37
  17 + */
  18 +
  19 +@Data
  20 +@NoArgsConstructor
  21 +@AllArgsConstructor
  22 +@ApiModel(value = "获取酒测记录列表")
  23 +@Accessors(chain = true)
  24 +@EqualsAndHashCode(callSuper = false)
  25 +public class GetBeforeWorkListVo {
  26 +
  27 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  28 + @ApiModelProperty(value = "酒测时间")
  29 + private Date checkTime;
  30 + @ApiModelProperty(value = "场站名称")
  31 + private String yarnName;
  32 + @ApiModelProperty(value = "线路名称")
  33 + private String routeName;
  34 + @ApiModelProperty(value = "员工ID")
  35 + private String staffId;
  36 + @ApiModelProperty(value = "员工姓名")
  37 + private String staffName;
  38 + @ApiModelProperty(value = "IC卡号")
  39 + private String icCardNo;
  40 + @ApiModelProperty(value = "测试结果 0通过,1不通过")
  41 + private String checkResult;
  42 +
  43 + @ApiModelProperty(value = "体温")
  44 + private String temperature;
  45 + @ApiModelProperty(value = "体温状态 0正常,1异常")
  46 + private String tempStatus;
  47 + @ApiModelProperty(value = "酒精含量")
  48 + private String drunkNum;
  49 + @ApiModelProperty(value = "酒测状态 0正常,11饮酒,12醉酒")
  50 + private String drunkStatus;
  51 + @ApiModelProperty(value = "表情 0无情绪,1愤怒,2厌恶,3恐惧,4高兴,5伤心,6惊讶")
  52 + private String emotion;
  53 + @ApiModelProperty(value = "收缩压")
  54 + private String diastolicPressure;
  55 + @ApiModelProperty(value = "舒张压")
  56 + private String systolicPressure;
  57 + @ApiModelProperty(value = "心率值")
  58 + private String heartRate;
  59 + @ApiModelProperty(value = "血氧值")
  60 + private String oxygenValue;
  61 + @ApiModelProperty(value = "设备名称")
  62 + private String deviceName;
  63 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/driver/vo/GetBusPlanListVo.java 0 → 100644
  1 +package com.ruoyi.domain.dss.driver.vo;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Data;
  8 +import lombok.EqualsAndHashCode;
  9 +import lombok.NoArgsConstructor;
  10 +import lombok.experimental.Accessors;
  11 +
  12 +import java.util.Date;
  13 +
  14 +/**
  15 + * @author liujun
  16 + * @date 2024年07月22日 13:47
  17 + */
  18 +@Data
  19 +@NoArgsConstructor
  20 +@AllArgsConstructor
  21 +@ApiModel(value = "司机排班计划信息")
  22 +@Accessors(chain = true)
  23 +@EqualsAndHashCode(callSuper = false)
  24 +public class GetBusPlanListVo implements java.io.Serializable {
  25 +
  26 + private static final long serialVersionUID = 6822862763627861841L;
  27 +
  28 +
  29 + @ApiModelProperty(value = "驾驶员名称")
  30 + private String driverName;
  31 + @ApiModelProperty(value = "车自编号")
  32 + private String selfCode;
  33 + @ApiModelProperty(value = "车牌号")
  34 + private String carNo;
  35 + @ApiModelProperty(value = "班次类型: 早班/晚班/全天班")
  36 + private String planType;
  37 +
  38 + @ApiModelProperty(value = "线路名")
  39 + private String routeName;
  40 + @ApiModelProperty(value = "行车方向 1上行,2下行")
  41 + private String upDown;
  42 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  43 + @ApiModelProperty(value = "发车时间;格式为:yyyy-MM-dd HH:mm:ss")
  44 + private Date fache;
  45 + @ApiModelProperty(value = "起点站名")
  46 + private String startStation;
  47 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/LinggangKeyWorkLocation.java
... ... @@ -99,9 +99,12 @@ public class LinggangKeyWorkLocation {
99 99 */
100 100 @TableField(exist = false)
101 101 private String key;
  102 + /***状态:1 是归还;0是借出*/
  103 + @Excel(name = "状态:1 是归还;0是借出")
  104 + private java.lang.Integer type;
102 105  
103 106  
104   - public static enum LinggangKeyWorkLocationEventTypeEnum {
  107 + public enum LinggangKeyWorkLocationEventTypeEnum {
105 108 TAKE_OUT(0, "取出"),
106 109 REPAY(1, "归还"),
107 110 ADMINISTRATOR_OPERATION(16, "管理员操作"),
... ... @@ -140,6 +143,45 @@ public class LinggangKeyWorkLocation {
140 143 }
141 144  
142 145  
  146 + public enum LinggangKeyWorkLocationTypeEnum {
  147 +
  148 + TAKE_OUT(0, "取出"),
  149 +
  150 + REPAY(1, "归还"),
  151 +
  152 + ;
  153 +
  154 + private String label;
  155 + private Integer value;
  156 +
  157 + LinggangKeyWorkLocationTypeEnum(Integer value, String label) {
  158 + this.value = value;
  159 + this.label = label;
  160 + }
  161 +
  162 + public String getLabel() {
  163 + return label;
  164 + }
  165 +
  166 + public Integer getValue() {
  167 + return value;
  168 + }
  169 +
  170 + public static LinggangKeyWorkLocationTypeEnum getObj(Integer value) {
  171 + if (Objects.isNull(value)) {
  172 + return null;
  173 + }
  174 + Optional<LinggangKeyWorkLocationTypeEnum> optional = Arrays.stream(LinggangKeyWorkLocationTypeEnum.values())
  175 + .filter(l -> Objects.equals(l.getValue(), value)).findFirst();
  176 + return optional.isPresent() ? optional.get() : null;
  177 + }
  178 +
  179 + public static String getLabel(Integer value) {
  180 + LinggangKeyWorkLocationTypeEnum eventTypeEnum = getObj(value);
  181 + return Objects.isNull(eventTypeEnum) ? null : eventTypeEnum.getLabel();
  182 + }
  183 + }
  184 +
143 185 @Override
144 186 public String toString() {
145 187 return com.alibaba.fastjson2.JSON.toJSONString(this);
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/dto/LinggangKeyWorkLocationAddDTO.java
1 1 package com.ruoyi.domain.key.location.dto;
2 2  
  3 +import com.ruoyi.common.annotation.Excel;
3 4 import io.swagger.annotations.ApiModel;
4 5 import io.swagger.annotations.ApiModelProperty;
5 6 import lombok.Data;
... ... @@ -59,6 +60,10 @@ public class LinggangKeyWorkLocationAddDTO implements java.io.Serializable {
59 60 @ApiModelProperty(value="排班ID")
60 61 private Long schedulingId;
61 62  
  63 + /***状态:1 是归还;0是借出*/
  64 + @Excel(name = "状态:1 是归还;0是借出")
  65 + private java.lang.Integer type;
  66 +
62 67 /***操作人员*/
63 68 @ApiModelProperty(value = "操作人员")
64 69 private String operator;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/dto/LinggangKeyWorkLocationQueryDTO.java
1 1 package com.ruoyi.domain.key.location.dto;
2 2  
  3 +import com.ruoyi.common.annotation.Excel;
3 4 import io.swagger.annotations.ApiModel;
4 5 import io.swagger.annotations.ApiModelProperty;
5 6 import lombok.Data;
... ... @@ -55,6 +56,10 @@ public class LinggangKeyWorkLocationQueryDTO implements java.io.Serializable {
55 56 @ApiModelProperty(value="排班ID")
56 57 private Long schedulingId;
57 58  
  59 + /***状态:1 是归还;0是借出*/
  60 + @Excel(name = "状态:1 是归还;0是借出")
  61 + private java.lang.Integer type;
  62 +
58 63 /***排班时间*/
59 64 @ApiModelProperty(value="排班时间")
60 65 private java.util.Date scheduleDate;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/dto/LinggangKeyWorkLocationUpdateDTO.java
1 1 package com.ruoyi.domain.key.location.dto;
2 2  
  3 +import com.ruoyi.common.annotation.Excel;
3 4 import io.swagger.annotations.ApiModel;
4 5 import io.swagger.annotations.ApiModelProperty;
5 6 import lombok.Data;
... ... @@ -58,6 +59,10 @@ public class LinggangKeyWorkLocationUpdateDTO implements java.io.Serializable {
58 59 /***排班ID*/
59 60 @ApiModelProperty(value="排班ID")
60 61 private Long schedulingId;
  62 +
  63 + /***状态:1 是归还;0是借出*/
  64 + @Excel(name = "状态:1 是归还;0是借出")
  65 + private java.lang.Integer type;
61 66 /***操作人员*/
62 67 @ApiModelProperty(value = "操作人员")
63 68 private String operator;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/dto/LinggangKeyWorkLocationUpdateStatusDTO.java
1 1 package com.ruoyi.domain.key.location.dto;
2 2  
  3 +import com.ruoyi.common.annotation.Excel;
3 4 import io.swagger.annotations.ApiModel;
4 5 import io.swagger.annotations.ApiModelProperty;
5 6 import lombok.Data;
... ... @@ -58,6 +59,10 @@ public class LinggangKeyWorkLocationUpdateStatusDTO implements java.io.Serializa
58 59 /***排班ID*/
59 60 @ApiModelProperty(value = "排班ID")
60 61 private Long schedulingId;
  62 +
  63 + /***状态:1 是归还;0是借出*/
  64 + @Excel(name = "状态:1 是归还;0是借出")
  65 + private java.lang.Integer type;
61 66 /***操作人员*/
62 67 @ApiModelProperty(value = "操作人员")
63 68 private String operator;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/vo/LinggangKeyWorkLocationVO.java
1 1 package com.ruoyi.domain.key.location.vo;
2 2  
  3 +import com.ruoyi.common.annotation.Excel;
3 4 import io.swagger.annotations.ApiModel;
4 5 import io.swagger.annotations.ApiModelProperty;
5   -
  6 +import lombok.AllArgsConstructor;
6 7 import lombok.Data;
7 8 import lombok.EqualsAndHashCode;
8   -import lombok.experimental.Accessors;
9 9 import lombok.NoArgsConstructor;
10   -import lombok.AllArgsConstructor;
  10 +import lombok.experimental.Accessors;
11 11  
12 12 @Data
13 13 @NoArgsConstructor
... ... @@ -60,6 +60,10 @@ public class LinggangKeyWorkLocationVO implements java.io.Serializable {
60 60 @ApiModelProperty(value = "排班时间")
61 61 private java.util.Date scheduleDate;
62 62  
  63 + /***状态:1 是归还;0是借出*/
  64 + @Excel(name = "状态:1 是归还;0是借出")
  65 + private java.lang.Integer type;
  66 +
63 67 /***排班ID*/
64 68 @ApiModelProperty(value = "排班ID")
65 69 private Long schedulingId;
... ...
Bsth-admin/src/main/java/com/ruoyi/equipment/service/IEquipmentService.java
... ... @@ -59,6 +59,8 @@ public interface IEquipmentService extends IService&lt;Equipment&gt; {
59 59 */
60 60 List<Equipment> listNameAndIDByIds(Collection<Integer> ids);
61 61  
  62 + List<Equipment> listNameAndIDBydeviceIds(Collection<String> deviceIds);
  63 +
62 64 /**
63 65 * 查询设备信息列表
64 66 *
... ...
Bsth-admin/src/main/java/com/ruoyi/equipment/service/impl/EquipmentServiceImpl.java
... ... @@ -82,6 +82,17 @@ public class EquipmentServiceImpl extends ServiceImpl&lt;EquipmentMapper, Equipment
82 82 return list(wrapper);
83 83 }
84 84  
  85 + @Override
  86 + public List<Equipment> listNameAndIDBydeviceIds(Collection<String> deviceIds) {
  87 + if (CollectionUtils.isEmpty(deviceIds)) {
  88 + return Collections.emptyList();
  89 + }
  90 +
  91 + LambdaQueryWrapper<Equipment> wrapper = new LambdaQueryWrapper<>();
  92 + wrapper.in(Equipment::getDeviceId, deviceIds);
  93 + return list(wrapper);
  94 + }
  95 +
85 96 /**
86 97 * 查询设备信息列表
87 98 *
... ...
Bsth-admin/src/main/java/com/ruoyi/in/domain/SignIn.java
1 1 package com.ruoyi.in.domain;
2 2  
3   -import java.io.UnsupportedEncodingException;
4   -import java.math.BigDecimal;
5   -
  3 +import com.ruoyi.common.annotation.Excel;
  4 +import com.ruoyi.common.core.domain.BaseEntity;
6 5 import io.swagger.annotations.ApiModel;
7 6 import io.swagger.annotations.ApiModelProperty;
8 7 import lombok.Data;
9   -import org.apache.commons.lang3.builder.ToStringBuilder;
10   -import org.apache.commons.lang3.builder.ToStringStyle;
11   -import com.ruoyi.common.annotation.Excel;
12   -import com.ruoyi.common.core.domain.BaseEntity;
13 8  
14 9 import javax.validation.constraints.NotBlank;
15 10 import javax.validation.constraints.NotNull;
  11 +import java.math.BigDecimal;
16 12  
17 13 /**
18 14 * 签到对象 sign_in
... ... @@ -95,8 +91,13 @@ public class SignIn extends BaseEntity {
95 91 @Excel(name = "酒精摄入量")
96 92 @ApiModelProperty("酒精摄入量 52.12")
97 93 private BigDecimal alcoholIntake;
98   - @Excel(name = "异常类型",readConverterExp = "0=无异常,1=超时异常,2=无排班异常,3=酒精超标异常")
  94 + @Excel(name = "异常类型",readConverterExp = "0=无异常,1=超时异常,2=无排班异常,3=酒精超标异常,44饮酒")
  95 +
99 96 @ApiModelProperty("异常类型")
100 97 private Integer exType;
  98 +
  99 + /***排班信息ID*/
  100 + @Excel(name = "排班信息ID")
  101 + private java.lang.Long schedulingId;
101 102 }
102 103  
... ...
Bsth-admin/src/main/java/com/ruoyi/in/service/ISignInService.java
... ... @@ -9,6 +9,7 @@ import com.ruoyi.pojo.response.SignInResponseVo;
9 9  
10 10 import javax.servlet.http.HttpServletRequest;
11 11 import java.io.IOException;
  12 +import java.util.Collection;
12 13 import java.util.List;
13 14  
14 15 /**
... ... @@ -26,6 +27,8 @@ public interface ISignInService extends IService&lt;SignIn&gt; {
26 27 */
27 28 public SignIn selectSignInById(Long id);
28 29  
  30 + List<SignIn> selectByEntityOrNewDriverId(SignIn signIn, Collection<String> jobCodes);
  31 +
29 32 /**
30 33 * 查询签到列表
31 34 *
... ...
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
... ... @@ -111,6 +111,15 @@ public class SignInServiceImpl extends ServiceImpl&lt;SignInMapper, SignIn&gt; impleme
111 111 return signInMapper.selectSignInById(id);
112 112 }
113 113  
  114 + @Override
  115 + public List<SignIn> selectByEntityOrNewDriverId(SignIn signIn, Collection<String> jobCodes) {
  116 + LambdaQueryWrapper<SignIn> wrapper = Objects.isNull(signIn) ? new LambdaQueryWrapper<>() : new LambdaQueryWrapper<>(signIn);
  117 + if (CollectionUtils.isNotEmpty(jobCodes)) {
  118 + wrapper.in(SignIn::getJobCode, jobCodes);
  119 + }
  120 + return list(wrapper);
  121 + }
  122 +
114 123 /**
115 124 * 查询签到列表
116 125 *
... ...
Bsth-admin/src/main/java/com/ruoyi/service/driver/NewDriverService.java
... ... @@ -21,6 +21,8 @@ public interface NewDriverService extends IService&lt;NewDriver&gt; {
21 21 */
22 22 List<NewDriver> list(NewDriver entity);
23 23  
  24 + List<NewDriver> listOficRfidAndLikePersonnelNameJobCodeIcCardCode(NewDriver newDriver);
  25 +
24 26 /***
25 27 * 根据工号查询司机
26 28 * @author liujun
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/driver/NewDriverServiceImpl.java
... ... @@ -64,6 +64,29 @@ public class NewDriverServiceImpl extends ServiceImpl&lt;NewDriverMapper, NewDriver
64 64 }
65 65  
66 66 @Override
  67 + public List<NewDriver> listOficRfidAndLikePersonnelNameJobCodeIcCardCode(NewDriver newDriver) {
  68 + LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>();
  69 +
  70 + if (org.apache.commons.lang3.StringUtils.isNotEmpty(newDriver.getIcRfid())) {
  71 + wrapper.eq(NewDriver::getIcRfid, newDriver.getIcRfid());
  72 + }
  73 +
  74 + if (org.apache.commons.lang3.StringUtils.isNotEmpty(newDriver.getPersonnelName())) {
  75 + wrapper.like(NewDriver::getPersonnelName, newDriver.getPersonnelName());
  76 + }
  77 +
  78 + if (org.apache.commons.lang3.StringUtils.isNotEmpty(newDriver.getJobCode())) {
  79 + wrapper.like(NewDriver::getJobCode, newDriver.getJobCode());
  80 + }
  81 +
  82 + if (org.apache.commons.lang3.StringUtils.isNotEmpty(newDriver.getIcCardCode())) {
  83 + wrapper.like(NewDriver::getIcCardCode, newDriver.getIcCardCode());
  84 + }
  85 +
  86 + return list(wrapper);
  87 + }
  88 +
  89 + @Override
67 90 public List<NewDriver> list(Collection<String> jobCodes) {
68 91 if (CollectionUtils.isEmpty(jobCodes)) {
69 92 return Collections.emptyList();
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
... ... @@ -134,12 +134,12 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
134 134 }
135 135  
136 136 @Override
137   - public ResponseResult<Boolean> updateTakeKey(List<LinggangKeyWorkLocation> locations) {
  137 + public ResponseResult<Boolean> updateTakeKey(List<LinggangKeyWorkLocation> locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum typeEnum) {
138 138 if (CollectionUtils.isEmpty(locations)) {
139 139 return ResponseResult.success();
140 140 }
141 141  
142   - ResponseResult<List<LinggangKeyWorkLocation>> responseResult = checkTaskKey(locations);
  142 + ResponseResult<List<LinggangKeyWorkLocation>> responseResult = checkTaskKey(locations,typeEnum);
143 143 if (!responseResult.isSuccess()) {
144 144 return ResponseResult.error(responseResult.getCode(), responseResult.getMsg());
145 145 }
... ... @@ -259,7 +259,7 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
259 259 }
260 260 }
261 261  
262   - private ResponseResult<List<LinggangKeyWorkLocation>> checkTaskKey(List<LinggangKeyWorkLocation> locations) {
  262 + private ResponseResult<List<LinggangKeyWorkLocation>> checkTaskKey(List<LinggangKeyWorkLocation> locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum typeEnum) {
263 263 Set<String> keyCodes = locations.stream().map(LinggangKeyWorkLocation::getKey).collect(Collectors.toSet());
264 264 List<KeyInfo> keyInfos = keyInfoService.list(keyCodes);
265 265 if (CollectionUtils.isEmpty(keyInfos)) {
... ... @@ -297,6 +297,7 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
297 297 location.setDevice(l.getDevice());
298 298 location.setKeyInfoId(l.getKeyInfoId());
299 299 location.setScheduleDate(l.getScheduleDate());
  300 + location.setType(typeEnum.getValue());
300 301 return location;
301 302 }).collect(Collectors.toList());
302 303  
... ...
Bsth-admin/src/main/java/com/ruoyi/service/key/location/LinggangKeyWorkLocationService.java
... ... @@ -56,7 +56,7 @@ public interface LinggangKeyWorkLocationService extends IService&lt;LinggangKeyWork
56 56 * @param locations
57 57 * @return com.ruoyi.common.core.domain.ResponseResult<T>
58 58 */
59   - ResponseResult<Boolean> updateTakeKey(List<LinggangKeyWorkLocation> locations);
  59 + ResponseResult<Boolean> updateTakeKey(List<LinggangKeyWorkLocation> locations, LinggangKeyWorkLocation.LinggangKeyWorkLocationTypeEnum typeEnum);
60 60  
61 61 boolean deleteById(Long id);
62 62  
... ...
Bsth-admin/src/main/resources/mapper/in/SignInMapper.xml
... ... @@ -20,6 +20,7 @@
20 20 <result property="remark" column="remark"/>
21 21 <result property="posts" column="posts"/>
22 22 <result property="name" column="personnel_name"/>
  23 + <result column="scheduling_id" jdbcType="INTEGER" property="schedulingId" />
23 24 </resultMap>
24 25 <resultMap type="SignIn" id="SignInResult">
25 26 <result property="id" column="id"/>
... ... @@ -36,6 +37,7 @@
36 37 <result property="updateTime" column="update_time"/>
37 38 <result property="alcoholIntake" column="alcohol_intake"/>
38 39 <result property="remark" column="remark"/>
  40 + <result column="scheduling_id" jdbcType="INTEGER" property="schedulingId" />
39 41 </resultMap>
40 42  
41 43 <sql id="selectSignInVo">
... ... @@ -52,7 +54,8 @@
52 54 type,
53 55 update_time,
54 56 alcohol_intake,
55   - remark
  57 + remark,
  58 + scheduling_id
56 59 from sign_in
57 60 </sql>
58 61  
... ... @@ -71,6 +74,7 @@
71 74 <if test="alcoholIntake != null ">and alcohol_intake = #{alcoholIntake}</if>
72 75 <if test="siteName != null ">and site_name = #{siteName}</if>
73 76 <if test="date != null ">and sign_in.create_time LIKE concat(#{date},'%')</if>
  77 + <if test="null!=schedulingId"> scheduling_id = #{schedulingId}</if>
74 78 order by create_time desc
75 79 </select>
76 80  
... ... @@ -93,6 +97,7 @@
93 97 <if test="name != '' and name != null">
94 98 and driver.personnel_name = #{name}
95 99 </if>
  100 + <if test="null!=schedulingId"> scheduling_id = #{schedulingId}</if>
96 101 <if test="ids != null and ids.size() > 0">
97 102 and sign_in.id in
98 103 <foreach collection="ids" item="id" open="(" close=")" separator=",">
... ... @@ -108,6 +113,7 @@
108 113 and DATE_FORMAT(create_time,'%Y-%m-%d') >= #{startTime}
109 114 and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endTime}
110 115 </if>
  116 + <if test="null!=schedulingId"> scheduling_id = #{schedulingId}</if>
111 117 <if test="jobCode != '' and jobCode != null">
112 118 and jobCode = #{jobCode}
113 119 </if>
... ... @@ -164,6 +170,7 @@
164 170 <if test="alcoholIntake != null">alcohol_intake,</if>
165 171 <if test="remark != null">remark,</if>
166 172 <if test="exType != null">ex_type,</if>
  173 + <if test="null!=schedulingId">scheduling_id,</if>
167 174 </trim>
168 175 <trim prefix="values (" suffix=")" suffixOverrides=",">
169 176 <if test="createTime != null">#{createTime},</if>
... ... @@ -180,6 +187,7 @@
180 187 <if test="alcoholIntake != null">#{alcoholIntake},</if>
181 188 <if test="remark != null">#{remark},</if>
182 189 <if test="exType != null">#{exType},</if>
  190 + <if test="null!=schedulingId">#{schedulingId,jdbcType=INTEGER},</if>
183 191 </trim>
184 192 </insert>
185 193  
... ... @@ -200,6 +208,7 @@
200 208 <if test="alcoholIntake != null">alcohol_intake = #{alcoholIntake},</if>
201 209 <if test="remark != null">remark = #{remark},</if>
202 210 <if test="exType != null">ex_type = #{exType},</if>
  211 + <if test="null!=schedulingId"> scheduling_id = #{schedulingId},</if>
203 212 </trim>
204 213 where id = #{id}
205 214 </update>
... ...