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
*
* 例如online-* : 就会选择key是online-开头的数据
* @param pattern key
* @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 /
*/
public List<OnlineUserDto> getAll(String filter){
List<String> keys = redisUtils.scan("*");
List<String> keys = redisUtils.scan("oline-*");
Collections.reverse(keys);
List<OnlineUserDto> onlineUserDtos = new ArrayList<>();
for (String key : keys) {
if (key.startsWith("oline-")) {
OnlineUserDto onlineUserDto = (OnlineUserDto) redisUtils.get(key);
if(StrUtil.isNotEmpty(filter)){
if(onlineUserDto.toString().contains(filter)){
onlineUserDtos.add(onlineUserDto);
}
} else {
onlineUserDtos.add(onlineUserDto);
}
}
OnlineUserDto onlineUserDto = (OnlineUserDto) redisUtils.get(key);
onlineUserDtos.add(onlineUserDto);
}
onlineUserDtos.sort((o1, o2) -> o2.getLoginTime().compareTo(o1.getLoginTime()));
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);
SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code());
if (ObjectUtil.isEmpty(baseRequest.getVehicle_code())) {
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("载具编码不能为空!");
return taskResponse;
throw new BadRequestException("载具编码不能为空!");
}
if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) {
baseRequest.setVehicle_type(GeneralDefinition.MATERIAL_CUP);
@ -511,24 +509,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue());
if (ObjectUtil.isEmpty(one)) {
// 返回400,物料不存在
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("组盘不存在或已静置完成!");
return taskResponse;
throw new BadRequestException("组盘不存在或已静置完成!");
}
String yjDeviceCode = basePoint.getParent_point_code(); // 压机设备编码
// 获取当前工单
PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(yjDeviceCode);
// 校验物料是否正确
if (ObjectUtil.isEmpty(productionTask)) {
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("压机" + yjDeviceCode + "工单不存在!");
return taskResponse;
throw new BadRequestException("压机" + yjDeviceCode + "工单不存在!");
}
String rawMaterialCode = productionTask.getRaw_material_code();
if (!rawMaterialCode.equals(one.getRedundance_material_code())) {
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("物料不一样!");
return taskResponse;
throw new BadRequestException("物料不一样!");
}
// 判断是否静置完成

Loading…
Cancel
Save