Commit 1b83bb7ce9c4ae2b311685b8d00ca2247fd14e95

Authored by liujun001
1 parent 84f2b7d5

数据字典添加分别字符key

Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
... ... @@ -437,7 +437,7 @@ public class KeyBoxController extends BaseController {
437 437 if (StringUtils.isNotEmpty(dto.getPlate())) {
438 438 KeyInfo keyInfo = new KeyInfo();
439 439 keyInfo.setPlateNum(dto.getPlate());
440   - keyInfos = keyInfoService.list(keyInfo);
  440 + keyInfos = keyInfoService.listLikePlate(keyInfo);
441 441 if (CollectionUtils.isNotEmpty(keyInfos)) {
442 442 keyInfoIds = keyInfos.stream().map(KeyInfo::getId).collect(Collectors.toSet());
443 443 }
... ... @@ -472,6 +472,7 @@ public class KeyBoxController extends BaseController {
472 472 locationEq = new LinggangKeyWorkLocation();
473 473 locationEq.setYardId(sourceEq.getYardId());
474 474 locationEq.setStartScheduleDate(date);
  475 + locationEq.setKeyInfoIds(keyInfoIds);
475 476 locationEq.setEndScheduleDate(org.apache.commons.lang3.time.DateUtils.addDays(locationEq.getStartScheduleDate(),1));
476 477  
477 478 // Set<Integer> types = new HashSet<>();
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/LinggangKeyWorkLocation.java
... ... @@ -119,6 +119,8 @@ public class LinggangKeyWorkLocation {
119 119  
120 120 @TableField(exist = false)
121 121 private Long zdsjT;
  122 + @TableField(exist = false)
  123 + private Collection<Integer> keyInfoIds;
122 124  
123 125  
124 126 public enum LinggangKeyWorkLocationEventTypeEnum {
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/info/KeyInfoServiceImpl.java
... ... @@ -58,6 +58,18 @@ public class KeyInfoServiceImpl extends ServiceImpl&lt;com.ruoyi.mapper.key.info.Ke
58 58 return list(new LambdaQueryWrapper<>(entity));
59 59 }
60 60  
  61 + public List<KeyInfo> listLikePlate(KeyInfo entity) {
  62 + String plate = entity.getPlateNum();
  63 + if (StringUtils.isEmpty(plate)) {
  64 + return Collections.emptyList();
  65 + }
  66 + entity.setPlateNum(null);
  67 + LambdaQueryWrapper<KeyInfo> wrapper = new LambdaQueryWrapper<>(entity);
  68 + wrapper.like(KeyInfo::getPlateNum, plate);
  69 +
  70 + return list(wrapper);
  71 + }
  72 +
61 73 @Override
62 74 public List<KeyInfo> list(Collection<String> codes) {
63 75 if (CollectionUtils.isEmpty(codes)) {
... ... @@ -70,7 +82,7 @@ public class KeyInfoServiceImpl extends ServiceImpl&lt;com.ruoyi.mapper.key.info.Ke
70 82  
71 83 @Override
72 84 public List<KeyInfo> listPlateNums(Collection<String> plateNum) {
73   - if(CollectionUtils.isEmpty(plateNum)){
  85 + if (CollectionUtils.isEmpty(plateNum)) {
74 86 return Collections.emptyList();
75 87 }
76 88 LambdaQueryWrapper<KeyInfo> wrapper = new LambdaQueryWrapper<>();
... ... @@ -81,14 +93,14 @@ public class KeyInfoServiceImpl extends ServiceImpl&lt;com.ruoyi.mapper.key.info.Ke
81 93 @Override
82 94 public List<KeyInfo> list(KeyInfo entity, Collection<String> plateNums) {
83 95 LambdaQueryWrapper<KeyInfo> wrapper = null;
84   - if(Objects.isNull(entity)){
  96 + if (Objects.isNull(entity)) {
85 97 wrapper = new LambdaQueryWrapper<>();
86   - }else{
  98 + } else {
87 99 wrapper = new LambdaQueryWrapper<>(entity);
88 100 }
89 101  
90   - if(CollectionUtils.isNotEmpty(plateNums)){
91   - wrapper.in(KeyInfo::getPlateNum,plateNums);
  102 + if (CollectionUtils.isNotEmpty(plateNums)) {
  103 + wrapper.in(KeyInfo::getPlateNum, plateNums);
92 104 }
93 105 return list(wrapper);
94 106 }
... ... @@ -192,7 +204,7 @@ public class KeyInfoServiceImpl extends ServiceImpl&lt;com.ruoyi.mapper.key.info.Ke
192 204 if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) {
193 205 wrapper.orderByDesc(KeyInfo::getUpdateTime);
194 206 }
195   -
  207 +
196 208 if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "plateNum")) {
197 209 wrapper.orderByDesc(KeyInfo::getPlateNum);
198 210 }
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/key/location/LinggangKeyWorkLocationServiceImpl.java
... ... @@ -78,6 +78,7 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
78 78 countWrapper.select(LinggangKeyWorkLocation::getId);
79 79 switchTime(entity, countWrapper);
80 80 switchTypes(entity, countWrapper);
  81 + switchKeyInfoIds(entity,countWrapper);
81 82 int count = count(countWrapper);
82 83  
83 84 List<LinggangKeyWorkLocation> lists = Collections.emptyList();
... ... @@ -86,6 +87,7 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
86 87 LambdaQueryWrapper<LinggangKeyWorkLocation> selectWrapper = new LambdaQueryWrapper<>(entity);
87 88 switchTime(entity, selectWrapper);
88 89 switchTypes(entity, selectWrapper);
  90 + switchKeyInfoIds(entity,selectWrapper);
89 91 orderColumn(selectWrapper, orderEntity);
90 92 lists = list(selectWrapper);
91 93 }
... ... @@ -123,6 +125,16 @@ public class LinggangKeyWorkLocationServiceImpl extends ServiceImpl&lt;LinggangKeyW
123 125 }
124 126 }
125 127  
  128 + private static void switchKeyInfoIds(LinggangKeyWorkLocation entity, LambdaQueryWrapper<LinggangKeyWorkLocation> wrapper) {
  129 + if (Objects.isNull(entity) || Objects.isNull(wrapper)) {
  130 + return;
  131 + }
  132 +
  133 + if (CollectionUtils.isNotEmpty(entity.getKeyInfoIds())) {
  134 + wrapper.in(LinggangKeyWorkLocation::getKeyInfoId, entity.getKeyInfoIds());
  135 + }
  136 + }
  137 +
126 138 @Override
127 139 public List<LinggangKeyWorkLocation> list(LinggangKeyWorkLocation entity) {
128 140 LambdaQueryWrapper<LinggangKeyWorkLocation> wrapper = new LambdaQueryWrapper<>(entity);
... ...
Bsth-admin/src/main/java/com/ruoyi/service/key/info/KeyInfoService.java
... ... @@ -20,6 +20,8 @@ public interface KeyInfoService extends IService&lt;KeyInfo&gt; {
20 20 */
21 21 List<KeyInfo> list(KeyInfo entity);
22 22  
  23 + List<KeyInfo> listLikePlate(KeyInfo entity);
  24 +
23 25 List<KeyInfo> list(Collection<String> codes);
24 26  
25 27 List<KeyInfo> listPlateNums(Collection<String> plateNum);
... ...