|
@@ -47,7 +47,6 @@ import java.math.MathContext;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service("conditionerAddTimeService")
|
|
@Service("conditionerAddTimeService")
|
|
@@ -66,8 +65,6 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
private ScWxuserManager scWxuserManager;
|
|
private ScWxuserManager scWxuserManager;
|
|
@Autowired
|
|
@Autowired
|
|
private ConditionerAddTimeManager conditionerAddTimeManager;
|
|
private ConditionerAddTimeManager conditionerAddTimeManager;
|
|
-
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private VirtualArchManager virtualArchManager;
|
|
private VirtualArchManager virtualArchManager;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -599,9 +596,15 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(allRoomIds)) {
|
|
if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(allRoomIds)) {
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用房间,请联系系统管理员");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用房间,请联系系统管理员");
|
|
}
|
|
}
|
|
- List<RoomInfo> allRoomInfos = roomInfoManager.getRoomListByRoomNos(
|
|
|
|
- allRoomIds.stream().map(String::valueOf).collect(Collectors.joining(";"))
|
|
|
|
- );
|
|
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < allRoomIds.size(); i++) {
|
|
|
|
+ sb.append(allRoomIds.get(i));
|
|
|
|
+ if (i < allRoomIds.size() - 1) {
|
|
|
|
+ sb.append(";");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<RoomInfo> allRoomInfos = roomInfoManager.getRoomListByRoomNos(sb.toString());
|
|
if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(allRoomInfos)) {
|
|
if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(allRoomInfos)) {
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用房间,请联系系统管理员");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用房间,请联系系统管理员");
|
|
}
|
|
}
|
|
@@ -2391,7 +2394,10 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(roomInfos)) {
|
|
if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(roomInfos)) {
|
|
throw new RuntimeException("空调加时订单可用房间信息不存在");
|
|
throw new RuntimeException("空调加时订单可用房间信息不存在");
|
|
}
|
|
}
|
|
- Set<Integer> allRoomIds = roomInfos.stream().map(RoomInfo::getId).collect(Collectors.toSet());
|
|
|
|
|
|
+ Set<Integer> allRoomIds = new HashSet<>();
|
|
|
|
+ for (RoomInfo roomInfo : roomInfos) {
|
|
|
|
+ allRoomIds.add(roomInfo.getId());
|
|
|
|
+ }
|
|
if (!allRoomIds.containsAll(order.getRoomIds())) {
|
|
if (!allRoomIds.containsAll(order.getRoomIds())) {
|
|
throw new RuntimeException("参数异常,可用房间信息不存在");
|
|
throw new RuntimeException("参数异常,可用房间信息不存在");
|
|
}
|
|
}
|