Browse Source

fix: 异常信息

master
李永德 1 year ago
parent
commit
40946aa2d6
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/RedisUtils.java
  2. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/secutiry/impl/OnlineUserService.java
  3. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/RedisUtils.java

@ -94,7 +94,7 @@ public class RedisUtils {
/** /**
* 查找匹配key * 查找匹配key
* * 例如online-* : 就会选择key是online-开头的数据
* @param pattern key * @param pattern key
* @return / * @return /
*/ */

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/secutiry/impl/OnlineUserService.java

@ -118,21 +118,12 @@ public class OnlineUserService {
* @return / * @return /
*/ */
public List<OnlineUserDto> getAll(String filter){ public List<OnlineUserDto> getAll(String filter){
List<String> keys = redisUtils.scan("*"); List<String> keys = redisUtils.scan("oline-*");
Collections.reverse(keys); Collections.reverse(keys);
List<OnlineUserDto> onlineUserDtos = new ArrayList<>(); List<OnlineUserDto> onlineUserDtos = new ArrayList<>();
for (String key : keys) { for (String key : keys) {
if (key.startsWith("oline-")) { OnlineUserDto onlineUserDto = (OnlineUserDto) redisUtils.get(key);
OnlineUserDto onlineUserDto = (OnlineUserDto) redisUtils.get(key); onlineUserDtos.add(onlineUserDto);
if(StrUtil.isNotEmpty(filter)){
if(onlineUserDto.toString().contains(filter)){
onlineUserDtos.add(onlineUserDto);
}
} else {
onlineUserDtos.add(onlineUserDto);
}
}
} }
onlineUserDtos.sort((o1, o2) -> o2.getLoginTime().compareTo(o1.getLoginTime())); onlineUserDtos.sort((o1, o2) -> o2.getLoginTime().compareTo(o1.getLoginTime()));
return onlineUserDtos; return onlineUserDtos;

16
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -499,9 +499,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
ApplyTaskResponse taskResponse = ApplyTaskResponse.responseOk(requestNo); ApplyTaskResponse taskResponse = ApplyTaskResponse.responseOk(requestNo);
SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code()); SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code());
if (ObjectUtil.isEmpty(baseRequest.getVehicle_code())) { if (ObjectUtil.isEmpty(baseRequest.getVehicle_code())) {
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); throw new BadRequestException("载具编码不能为空!");
taskResponse.setMessage("载具编码不能为空!");
return taskResponse;
} }
if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) { if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) {
baseRequest.setVehicle_type(GeneralDefinition.MATERIAL_CUP); baseRequest.setVehicle_type(GeneralDefinition.MATERIAL_CUP);
@ -511,24 +509,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue()); baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue());
if (ObjectUtil.isEmpty(one)) { if (ObjectUtil.isEmpty(one)) {
// 返回400,物料不存在 // 返回400,物料不存在
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); throw new BadRequestException("组盘不存在或已静置完成!");
taskResponse.setMessage("组盘不存在或已静置完成!");
return taskResponse;
} }
String yjDeviceCode = basePoint.getParent_point_code(); // 压机设备编码 String yjDeviceCode = basePoint.getParent_point_code(); // 压机设备编码
// 获取当前工单 // 获取当前工单
PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(yjDeviceCode); PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(yjDeviceCode);
// 校验物料是否正确 // 校验物料是否正确
if (ObjectUtil.isEmpty(productionTask)) { if (ObjectUtil.isEmpty(productionTask)) {
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); throw new BadRequestException("压机" + yjDeviceCode + "工单不存在!");
taskResponse.setMessage("压机" + yjDeviceCode + "工单不存在!");
return taskResponse;
} }
String rawMaterialCode = productionTask.getRaw_material_code(); String rawMaterialCode = productionTask.getRaw_material_code();
if (!rawMaterialCode.equals(one.getRedundance_material_code())) { if (!rawMaterialCode.equals(one.getRedundance_material_code())) {
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); throw new BadRequestException("物料不一样!");
taskResponse.setMessage("物料不一样!");
return taskResponse;
} }
// 判断是否静置完成 // 判断是否静置完成

Loading…
Cancel
Save