Commit fac64741c9245bd3debd5a444dffbfdbf7b8b222

Authored by liujun001
1 parent 131c84e9

酒测未通过审核

Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
... ... @@ -53,7 +53,10 @@ import org.apache.commons.lang3.StringUtils;
53 53 import org.apache.commons.lang3.time.DateUtils;
54 54 import org.springframework.beans.factory.annotation.Autowired;
55 55 import org.springframework.validation.BindingResult;
56   -import org.springframework.web.bind.annotation.*;
  56 +import org.springframework.web.bind.annotation.PostMapping;
  57 +import org.springframework.web.bind.annotation.RequestBody;
  58 +import org.springframework.web.bind.annotation.RequestMapping;
  59 +import org.springframework.web.bind.annotation.RestController;
57 60  
58 61 import javax.validation.Valid;
59 62 import java.io.IOException;
... ... @@ -112,7 +115,7 @@ public class DssDriverController extends BaseController {
112 115 if (Objects.isNull(driver)) {
113 116 return ResponseResult.error404();
114 117 }
115   - driver = faceService.checkFace(convertLoginDriverDTO(loginDriverDTO));
  118 +// driver = faceService.checkFace(convertLoginDriverDTO(loginDriverDTO));
116 119 return ResponseResult.success(convertNewDriver(driver));
117 120 }
118 121  
... ... @@ -365,7 +368,9 @@ public class DssDriverController extends BaseController {
365 368 loginDriverVo.setSignOutType(signInService.signOutType(newDriver));
366 369  
367 370  
368   - Set<Integer> postSets = new HashSet<>();
  371 + Collection<Integer> postSets = newDriver.getPostValue();
  372 +
  373 +// loginDriverVo.setStaffTypeItem(postSets);
369 374 loginDriverVo.setStaffTypeItem(postSets);
370 375  
371 376 LoginUserInfoVo loginUserInfoVo = new LoginUserInfoVo();
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
... ... @@ -205,7 +205,7 @@ public class KeyBoxController extends BaseController {
205 205 nbbms = schedulings.stream().map(LinggangScheduling::getNbbm).collect(Collectors.toSet());
206 206 }
207 207  
208   - scheduling.setEndScheduleDate(scheduling.getStartScheduleDate());
  208 + scheduling.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(scheduling.getStartScheduleDate(),1));
209 209 List<LinggangScheduling> schedulings1 = schedulingService.listByCZ(scheduling);
210 210 if (CollectionUtils.isNotEmpty(schedulings1)) {
211 211 nbbms1 = schedulings1.stream().map(LinggangScheduling::getNbbm).collect(Collectors.toSet());
... ... @@ -467,12 +467,18 @@ public class KeyBoxController extends BaseController {
467 467 LinggangKeyWorkLocation locationEq = new LinggangKeyWorkLocation();
468 468 locationEq.setYardId(sourceEq.getYardId());
469 469 locationEq.setStartScheduleDate(locations.get(0).getScheduleDate());
470   -
471 470 List<LinggangKeyWorkLocation> locationsOfEq = linggangKeyWorkLocationService.list(locationEq);
472 471  
473 472 locationEq = new LinggangKeyWorkLocation();
474 473 locationEq.setYardId(sourceEq.getYardId());
475 474 locationEq.setStartScheduleDate(locations.get(0).getScheduleDate());
  475 + locationEq.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(locationEq.getStartScheduleDate(),1));
  476 +
  477 + Set<Integer> types = new HashSet<>();
  478 + types.add(1);
  479 + types.add(0);
  480 + locationEq.setTypes(types);
  481 +
476 482 IPage<LinggangKeyWorkLocation> page = linggangKeyWorkLocationService.pageList(new Page<>(dto.getPageNum(), dto.getPageSize()), locationEq, new OrderEntity());
477 483  
478 484 List<LinggangScheduling> schedulings = Collections.emptyList();
... ... @@ -742,6 +748,7 @@ public class KeyBoxController extends BaseController {
742 748 location.setKey(item.getKey());
743 749 location.setScheduleDate(DateUtil.shortDate(dto.getTime()));
744 750 location.setType(item.getState());
  751 + location.setPlate(item.getPlate());
745 752 if (CollectionUtils.isNotEmpty(schedulings)) {
746 753 Optional<LinggangKeyWorkLocation> opt = schedulings.stream().filter(s -> Objects.equals(item.getKey(), s.getCabinetNo())).findFirst();
747 754 if (opt.isPresent()) {
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/NewDriver.java
... ... @@ -9,6 +9,12 @@ import lombok.Data;
9 9 import lombok.EqualsAndHashCode;
10 10 import lombok.experimental.Accessors;
11 11 import lombok.extern.slf4j.Slf4j;
  12 +import org.apache.commons.collections4.CollectionUtils;
  13 +import org.apache.commons.lang3.StringUtils;
  14 +
  15 +import java.util.Collection;
  16 +import java.util.HashSet;
  17 +import java.util.Set;
12 18  
13 19 @Data
14 20 @Slf4j
... ... @@ -169,6 +175,28 @@ public class NewDriver {
169 175 this.integer1 = integer1;
170 176 }
171 177  
  178 + public Collection<Integer> getPostValue(){
  179 +
  180 + Set<Integer> postValue = new HashSet<>();
  181 + if(StringUtils.indexOf(this.posts,"管理员") > -1){
  182 + postValue.add(3);
  183 + }
  184 +
  185 + if(StringUtils.indexOf(this.posts,"司机") > -1){
  186 + postValue.add(2);
  187 + }
  188 +
  189 + if(StringUtils.indexOf(this.posts,"移车员") > -1){
  190 + postValue.add(4);
  191 + }
  192 +
  193 + if(CollectionUtils.isEmpty(postValue)){
  194 + postValue.add(1);
  195 + }
  196 +
  197 + return postValue;
  198 + }
  199 +
172 200 @Override
173 201 public String toString() {
174 202 return com.alibaba.fastjson2.JSON.toJSONString(this);
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/login/vo/LoginDriverVo.java
... ... @@ -10,7 +10,7 @@ import lombok.EqualsAndHashCode;
10 10 import lombok.NoArgsConstructor;
11 11 import lombok.experimental.Accessors;
12 12  
13   -import java.util.Set;
  13 +import java.util.Collection;
14 14  
15 15 /**
16 16 * @author liujun
... ... @@ -41,7 +41,7 @@ public class LoginDriverVo {
41 41 @ApiModelProperty("解析后的访问图片地址")
42 42 private String cropFacePhotoUrl;
43 43 @ApiModelProperty("角色编码列表:1员工,2司机,3钥匙柜管理员,4移车员")
44   - private Set<Integer> staffTypeItem;
  44 + private Collection<Integer> staffTypeItem;
45 45  
46 46 @ApiModelProperty("手环蓝牙名称")
47 47 private String blueTooth;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/LinggangKeyWorkLocation.java
... ... @@ -12,10 +12,7 @@ import lombok.NoArgsConstructor;
12 12 import lombok.experimental.Accessors;
13 13 import lombok.extern.slf4j.Slf4j;
14 14  
15   -import java.util.Arrays;
16   -import java.util.Date;
17   -import java.util.Objects;
18   -import java.util.Optional;
  15 +import java.util.*;
19 16  
20 17  
21 18 @Data
... ... @@ -114,6 +111,9 @@ public class LinggangKeyWorkLocation {
114 111 @TableField(exist = false)
115 112 private String plate;
116 113  
  114 + @TableField(exist = false)
  115 + private Set<Integer> types;
  116 +
117 117  
118 118 public enum LinggangKeyWorkLocationEventTypeEnum {
119 119 TAKE_OUT(0, "取出"),
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/info/KeyInfoServiceImpl.java
... ... @@ -69,6 +69,16 @@ public class KeyInfoServiceImpl extends ServiceImpl&lt;com.ruoyi.mapper.key.info.Ke
69 69 }
70 70  
71 71 @Override
  72 + public List<KeyInfo> listPlateNums(Collection<String> plateNum) {
  73 + if(CollectionUtils.isEmpty(plateNum)){
  74 + return Collections.emptyList();
  75 + }
  76 + LambdaQueryWrapper<KeyInfo> wrapper = new LambdaQueryWrapper<>();
  77 + wrapper.in(KeyInfo::getPlateNum, plateNum);
  78 + return list(wrapper);
  79 + }
  80 +
  81 + @Override
72 82 public List<KeyInfo> list(KeyInfo entity, Collection<String> plateNums) {
73 83 LambdaQueryWrapper<KeyInfo> wrapper = null;
74 84 if(Objects.isNull(entity)){
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
... ... @@ -77,6 +77,7 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
77 77 LambdaQueryWrapper<LinggangKeyWorkLocation> countWrapper = new LambdaQueryWrapper<>(entity);
78 78 countWrapper.select(LinggangKeyWorkLocation::getId);
79 79 switchTime(entity, countWrapper);
  80 + switchTypes(entity,countWrapper);
80 81 int count = count(countWrapper);
81 82  
82 83 List<LinggangKeyWorkLocation> lists = Collections.emptyList();
... ... @@ -84,6 +85,7 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
84 85 PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false);
85 86 LambdaQueryWrapper<LinggangKeyWorkLocation> selectWrapper = new LambdaQueryWrapper<>(entity);
86 87 switchTime(entity, selectWrapper);
  88 + switchTypes(entity,selectWrapper);
87 89 orderColumn(selectWrapper, orderEntity);
88 90 lists = list(selectWrapper);
89 91 }
... ... @@ -108,10 +110,17 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
108 110 }
109 111 }
110 112  
  113 + private static void switchTypes(LinggangKeyWorkLocation entity, LambdaQueryWrapper<LinggangKeyWorkLocation> wrapper){
  114 + if(CollectionUtils.isNotEmpty(entity.getTypes())){
  115 + wrapper.in(LinggangKeyWorkLocation::getType,entity.getTypes());
  116 + }
  117 + }
  118 +
111 119 @Override
112 120 public List<LinggangKeyWorkLocation> list(LinggangKeyWorkLocation entity) {
113 121 LambdaQueryWrapper<LinggangKeyWorkLocation> wrapper = new LambdaQueryWrapper<>(entity);
114 122 switchTime(entity, wrapper);
  123 + switchTypes(entity,wrapper);
115 124 return list(wrapper);
116 125 }
117 126  
... ... @@ -183,13 +192,21 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
183 192 return linggangKeyWorkLocationMapper.listRecent(locations);
184 193 }
185 194  
186   - private List<LinggangKeyWorkLocation> listRecentDates(Collection<Date> dates) {
  195 + private List<LinggangKeyWorkLocation> listRecentDates(Collection<Date> dates,Set<Integer> keyInfoIds) {
187 196 if (CollectionUtils.isEmpty(dates)) {
188 197 return Collections.emptyList();
189 198 }
190 199  
191 200 LambdaQueryWrapper<LinggangKeyWorkLocation> wrapper = new LambdaQueryWrapper<>();
192   - wrapper.in(LinggangKeyWorkLocation::getScheduleDate, dates);
  201 + if(CollectionUtils.isNotEmpty(keyInfoIds)){
  202 + wrapper.in(LinggangKeyWorkLocation::getKeyInfoId,keyInfoIds);
  203 + }
  204 + for (Date date : dates) {
  205 + Date endDate = DateUtils.addDays(date,1);
  206 + wrapper.or().between(LinggangKeyWorkLocation::getScheduleDate,date,endDate);
  207 +
  208 + }
  209 +
193 210 return list(wrapper);
194 211 }
195 212  
... ... @@ -428,9 +445,20 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
428 445 keyInfos = keyInfoService.listByIds(keyCodes);
429 446 }
430 447  
  448 + Set<Integer> keyIds = null;
  449 + Set<String> plates = locations.stream().map(LinggangKeyWorkLocation::getPlate).collect(Collectors.toSet());
  450 + if(CollectionUtils.isNotEmpty(plates)){
  451 + keyInfos = keyInfoService.listPlateNums(plates);
  452 + if(CollectionUtils.isNotEmpty(keyInfos)){
  453 + keyIds = keyInfos.stream().map(KeyInfo::getId).collect(Collectors.toSet());
  454 + }
  455 + }
  456 +
  457 +
431 458 Set<Date> dates = locations.stream().map(LinggangKeyWorkLocation::getScheduleDate).collect(Collectors.toSet());
432 459  
433   - List<LinggangKeyWorkLocation> sources = listRecentDates(dates).stream().filter(s -> !Objects.equals(s.getType(), typeEnum.getValue())).collect(Collectors.toList());
  460 +
  461 + List<LinggangKeyWorkLocation> sources = listRecentDates(dates,keyIds).stream().filter(s -> !Objects.equals(s.getType(), typeEnum.getValue())).collect(Collectors.toList());
434 462 if (CollectionUtils.isEmpty(sources)) {
435 463 return ResponseResult.error404("无法找到钥匙归还信息");
436 464 }
... ...
Bsth-admin/src/main/java/com/ruoyi/service/key/info/KeyInfoService.java
... ... @@ -22,6 +22,8 @@ public interface KeyInfoService extends IService&lt;KeyInfo&gt; {
22 22  
23 23 List<KeyInfo> list(Collection<String> codes);
24 24  
  25 + List<KeyInfo> listPlateNums(Collection<String> plateNum);
  26 +
25 27 List<KeyInfo> list(KeyInfo entity,Collection<String> plateNums);
26 28  
27 29 /***
... ...
Bsth-admin/src/main/resources/application-druid-dev.yml
... ... @@ -137,7 +137,7 @@ ruoyi:
137 137 # 实例演示开关
138 138 demoEnabled: true
139 139 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
140   - profile: /data/test/bath-alcoho-sign/apache-tomcat-8.5.61/webapps/ROOT/uploadPath
  140 + profile: D:/temp/temp/bsth
141 141 # 获取ip地址开关
142 142 addressEnabled: false
143 143 # 验证码类型 math 数字计算 char 字符验证
... ...
Bsth-admin/src/main/resources/mapper/scheduling/LinggangSchedulingMapper.xml
... ... @@ -174,5 +174,6 @@
174 174 <if test="null!=qdzname">AND qdzName = #{qdzname,jdbcType=VARCHAR}, </if>
175 175 <if test="null!=zdzcode">AND zdzCode = #{zdzcode,jdbcType=VARCHAR}, </if>
176 176 <if test="null!=zdzname">AND zdzName = #{zdzname,jdbcType=VARCHAR}, </if>
  177 + <if test="null!=type">AND scheduling_type = #{type} </if>
177 178 </sql>
178 179 </mapper>
179 180 \ No newline at end of file
... ...