Jelajahi Sumber

空调加时列表查询fix

xiachuang 1 tahun lalu
induk
melakukan
7d3bdb8d0c

+ 1 - 1
src/main/java/com/palmnest/dao/airconditioner/impl/ConditionerAddTimeDaoImpl.java

@@ -27,7 +27,7 @@ public class ConditionerAddTimeDaoImpl extends GenericDaoHibernate<AirConditione
 		LOG.info("ConditionerAddTimeDaoImpl findPageBy======");
 
 		StringBuilder sql = new StringBuilder("select").append("\n");
-		sql.append("bill.type,org.name orgName,bill.roleId,permConfig.name auditRoleName,bill.sort,bill.id billId,bill.code code,vir.name virtualName,bill.roomNames,bill.applyArea,date_format(bill.create_time, '%Y-%m-%d %H:%i') applyTime,bill.useDisplayTime,bill.modification_disabled modificationDisabled").append("\n");
+		sql.append("bill.type,org.name orgName,bill.roleId,permConfig.name auditRoleName,bill.sort,bill.id billId,bill.code code,vir.name virtualName,bill.roomNames,bill.applyArea,date_format(bill.create_time, '%Y-%m-%d %H:%i') applyTime,bill.useDisplayTime,bill.modification_disabled modificationDisabled,").append("\n");
 		sql.append("useLengthTime,bill.priceDisplay,bill.freeTotal,bill.apply_user applyUser,bill.apply_tel applyTel,").append("\n");
 		sql.append("bill.billSource billSource,bill.status billStatus,bill.switchUser,bill.switchTel ").append("\n");
 		sql.append("from tb_airconditioner_addtime bill").append("\n");

+ 1 - 1
src/main/java/com/palmnest/dao/airconditioner/impl/ConditionerAddTimeOrderExtendDaoImpl.java

@@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
  * @author xc
  * @since 2023/8/9 09:42
  */
-@Repository("conditionerAddTimeOrderExtendDao")
+@Repository
 public class ConditionerAddTimeOrderExtendDaoImpl extends GenericDaoHibernate<AirConditionerAddTimeOrderExtend, Long> implements ConditionerAddTimeOrderExtendDao {
     private final Logger logger = Logger.getLogger(ConditionerAddTimeOrderExtendDaoImpl.class);
     public ConditionerAddTimeOrderExtendDaoImpl() {

+ 0 - 1
src/main/java/com/palmnest/service/estateserve/airconditioner/ConditionerAddTimeService.java

@@ -11,7 +11,6 @@ import com.palmnest.model.airconditioner.AirConditionerAddTime;
 import com.palmnest.model.airconditioner.AirRule;
 
 import javax.servlet.http.HttpServletRequest;
-
 import java.util.List;
 import java.util.Map;
 

+ 2 - 7
src/main/java/com/palmnest/service/estateserve/airconditioner/impl/ConditionerAddTimeOrderExtendManagerImpl.java

@@ -11,15 +11,10 @@ import org.springframework.stereotype.Service;
  * @author xc
  * @since 2023/8/9 09:39
  */
-@Service("ConditionerAddTimeOrderExtendManager")
+@Service
 public class ConditionerAddTimeOrderExtendManagerImpl extends GenericManagerImpl<AirConditionerAddTimeOrderExtend, Long> implements ConditionerAddTimeOrderExtendManager {
-    private ConditionerAddTimeOrderExtendDao conditionerAddTimeOrderExtendDao;
-
     @Autowired
-    public void setConditionerAddTimeOrderExtendDao(ConditionerAddTimeOrderExtendDao conditionerAddTimeOrderExtendDao) {
-        this.conditionerAddTimeOrderExtendDao = conditionerAddTimeOrderExtendDao;
-        this.dao = conditionerAddTimeOrderExtendDao;
-    }
+    private ConditionerAddTimeOrderExtendDao conditionerAddTimeOrderExtendDao;
 
     @Override
     public AirConditionerAddTimeOrderExtend getByOrderNo(String orderNo) {

+ 13 - 7
src/main/java/com/palmnest/service/estateserve/airconditioner/impl/ConditionerAddTimeServiceImpl.java

@@ -47,7 +47,6 @@ import java.math.MathContext;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.util.*;
-import java.util.stream.Collectors;
 
 @Slf4j
 @Service("conditionerAddTimeService")
@@ -66,8 +65,6 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
     private ScWxuserManager scWxuserManager;
     @Autowired
     private ConditionerAddTimeManager conditionerAddTimeManager;
-
-
     @Autowired
     private VirtualArchManager virtualArchManager;
     @Autowired
@@ -599,9 +596,15 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
             if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(allRoomIds)) {
                 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)) {
                 return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用房间,请联系系统管理员");
             }
@@ -2391,7 +2394,10 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
             if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(roomInfos)) {
                 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())) {
                 throw new RuntimeException("参数异常,可用房间信息不存在");
             }