feat: 设备管理优化-0512-修改提示语

dev_kcyj
chenhc 1 year ago
parent 958aa625ad
commit 44bc4aa00a

@ -55,7 +55,7 @@ public class DevicePlanDetailItemParam {
public List<DevicePlanDetailItemEntity> getEntity(DeviceCheckItemDictService deviceCheckItemDictService) { public List<DevicePlanDetailItemEntity> getEntity(DeviceCheckItemDictService deviceCheckItemDictService) {
List<DeviceCheckItemDictEntity> list = deviceCheckItemDictService.listByIds(itemCodes); List<DeviceCheckItemDictEntity> list = deviceCheckItemDictService.listByIds(itemCodes);
if (CollectionUtil.isEmpty(list)) { if (CollectionUtil.isEmpty(list)) {
throw new JsonException("所有项目编码都不存在,疑似非法操作"); throw new JsonException("项目编码不存在,请确认");
} }
if (list.size() != itemCodes.size()) { if (list.size() != itemCodes.size()) {
Map<String, List<DeviceCheckItemDictEntity>> collect = list.stream().collect(Collectors.groupingBy(DeviceCheckItemDictEntity::getCode)); Map<String, List<DeviceCheckItemDictEntity>> collect = list.stream().collect(Collectors.groupingBy(DeviceCheckItemDictEntity::getCode));

@ -41,7 +41,7 @@ public class DevicePlanDetailParam {
public List<DevicePlanDetailEntity> getEntity(DeviceInfoService deviceInfoService) { public List<DevicePlanDetailEntity> getEntity(DeviceInfoService deviceInfoService) {
List<DeviceInfoEntity> deviceList = deviceInfoService.listByIds(deviceCodes); List<DeviceInfoEntity> deviceList = deviceInfoService.listByIds(deviceCodes);
if (CollectionUtil.isEmpty(deviceList)) { if (CollectionUtil.isEmpty(deviceList)) {
throw new JsonException("未找到设备,疑似非法操作"); throw new JsonException("设备编码不存在,请确认");
} }
List<DevicePlanDetailEntity> list = deviceList.stream().map(d -> { List<DevicePlanDetailEntity> list = deviceList.stream().map(d -> {

@ -67,7 +67,7 @@ public class DevicePlanParam {
public void valid(DeptService deptService) { public void valid(DeptService deptService) {
DeptEntity dept = deptService.selectByCode(chargeDeptCode); DeptEntity dept = deptService.selectByCode(chargeDeptCode);
if (dept == null) { if (dept == null) {
throw new JsonException("负责部门不存在,疑似非法操作"); throw new JsonException("负责部门不存在,请确认");
} }
if (startDate.isAfter(endDate)) { if (startDate.isAfter(endDate)) {
throw new JsonException("计划开始日期不能在计划结束日期之后"); throw new JsonException("计划开始日期不能在计划结束日期之后");

@ -91,7 +91,7 @@ public class DeviceRepairApplyAddParam {
public List<DeviceRepairApplyDetailEntity> getDetailEntityList(Long applyId, DeviceInfoService deviceInfoService, AuthAdmin user) { public List<DeviceRepairApplyDetailEntity> getDetailEntityList(Long applyId, DeviceInfoService deviceInfoService, AuthAdmin user) {
List<DeviceInfoVo> list = deviceInfoService.listVoByCodes(details.stream().map(ApplyDetail::getDeviceCode).collect(Collectors.toList()), user.getLocDeptCode(), DeviceStatusEnum.NORMAL); List<DeviceInfoVo> list = deviceInfoService.listVoByCodes(details.stream().map(ApplyDetail::getDeviceCode).collect(Collectors.toList()), user.getLocDeptCode(), DeviceStatusEnum.NORMAL);
if (list.size() != details.size()) { if (list.size() != details.size()) {
throw new JsonException("设备信息不匹配,疑似非法操作"); throw new JsonException("设备状态异常或信息不符,请确认");
} }
Map<String, List<DeviceInfoEntity>> deviceMap = list.stream().collect(Collectors.groupingBy(DeviceInfoEntity::getDeviceCode)); Map<String, List<DeviceInfoEntity>> deviceMap = list.stream().collect(Collectors.groupingBy(DeviceInfoEntity::getDeviceCode));
return details.stream().map(d -> { return details.stream().map(d -> {

Loading…
Cancel
Save