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