xiachuang 1 rok temu
rodzic
commit
983d05e85f

+ 0 - 13
src/main/java/com/palmnest/application/dto/input/AirConditionerAddTimeInputDto.java

@@ -4,7 +4,6 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
-import java.util.List;
 
 public class AirConditionerAddTimeInputDto implements Serializable{
 
@@ -54,11 +53,6 @@ public class AirConditionerAddTimeInputDto implements Serializable{
 	//currentBillStatus
 	private String cancelReason;//取消原因
 
-	/**
-	 * 空调加时下单时,传递所有房号
-	 */
-	private List<Integer> allRoomIds;
-
 	public String getRoomNos() {
 		return roomNos;
 	}
@@ -203,11 +197,4 @@ public class AirConditionerAddTimeInputDto implements Serializable{
 		this.wxUserId = wxUserId;
 	}
 
-	public List<Integer> getAllRoomIds() {
-		return allRoomIds;
-	}
-
-	public void setAllRoomIds(List<Integer> allRoomIds) {
-		this.allRoomIds = allRoomIds;
-	}
 }

+ 2 - 1
src/main/java/com/palmnest/model/airconditioner/AirConditionerAddTimeOrderExtend.java

@@ -5,6 +5,7 @@ import lombok.Builder;
 import lombok.NoArgsConstructor;
 
 import javax.persistence.*;
+import java.io.Serializable;
 
 /**
  * @author xc
@@ -15,7 +16,7 @@ import javax.persistence.*;
 @Builder
 @NoArgsConstructor
 @AllArgsConstructor
-public class AirConditionerAddTimeOrderExtend {
+public class AirConditionerAddTimeOrderExtend implements Serializable {
     private Long id;
     private String code;//订单号
     private String roomInfos;//所有可用房间信息缓存

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

@@ -15,7 +15,7 @@ import java.util.List;
  * @author xc
  * @since 2023/8/9 09:39
  */
-@Service
+@Service("conditionerAddTimeOrderExtendManager")
 public class ConditionerAddTimeOrderExtendManagerImpl extends GenericManagerImpl<AirConditionerAddTimeOrderExtend, Long> implements ConditionerAddTimeOrderExtendManager {
     private ConditionerAddTimeOrderExtendDao conditionerAddTimeOrderExtendDao;
     private AirConditionerAddTimeOrderHistoryDao airConditionerAddTimeOrderHistoryDao;
@@ -24,6 +24,7 @@ public class ConditionerAddTimeOrderExtendManagerImpl extends GenericManagerImpl
     @Autowired
     public void setConditionerAddTimeOrderExtendDao(ConditionerAddTimeOrderExtendDao conditionerAddTimeOrderExtendDao) {
         this.conditionerAddTimeOrderExtendDao = conditionerAddTimeOrderExtendDao;
+        this.dao = conditionerAddTimeOrderExtendDao;
     }
 
     @Autowired

+ 8 - 4
src/main/java/com/palmnest/service/estateserve/airconditioner/impl/ConditionerAddTimeServiceImpl.java

@@ -105,6 +105,7 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
              * 空调加时订单属性填充
              */
             AirConditionerAddTime airConditionerAddTime = new AirConditionerAddTime();
+            airConditionerAddTime.setModificationDisabled(0);
             BeanUtils.copyProperties(airConditionerAddTime, dto);
             if (dto.getBillFrom().equals(CodeConstants.WECHAT)) {
                 String openId = request.getParameter("openId");
@@ -576,9 +577,10 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
              * 下单时保存可用的规则 修改订单时需要用
              */
             Map<String, Object> param = new HashMap<>();
-            param.put("orgId", airConditionerAddTime.getOrganizationId());
+            param.put("organizationId", airConditionerAddTime.getOrganizationId());
             param.put("isEnabled", 1);
-            Page airRulePage = airRuleManager.findPageBy(param, 1, 100);
+            Page airRulePage = airRuleManager.findPageBy(param, 100, 1);
+            log.info("空调加时申请,查询所有可用规则,airConditionerAddTime={},结果:{}", JSON.toJSONString(airConditionerAddTime), JSON.toJSONString(airRulePage));
             List items = airRulePage.getItems();
             if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(items)) {
                 return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用规则,请联系系统管理员");
@@ -589,7 +591,9 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
             /**
              * 下单时保存所有可用房间信息 修改订单时需要用
              */
-            List<Integer> allRoomIds = dto.getAllRoomIds();
+            VirtualArchitecture vir = virtualArchManager.get(Integer.valueOf(virtualId));
+            String[] split = vir.getRoomIds().split(";");
+            List<String> allRoomIds = Arrays.asList(split);
             if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(allRoomIds)) {
                 return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用房间,请联系系统管理员");
             }
@@ -598,7 +602,7 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
             for (int i = 0; i < allRoomIds.size(); i++) {
                 sb.append(allRoomIds.get(i));
                 if (i < allRoomIds.size() - 1) {
-                    sb.append(";");
+                    sb.append(",");
                 }
             }
             List<RoomInfo> allRoomInfos = roomInfoManager.getRoomListByRoomNos(sb.toString());

+ 2 - 0
src/main/resources/hibernate.cfg.xml

@@ -120,6 +120,8 @@
 
 
         <mapping class="com.palmnest.model.airconditioner.AirConditionerAddTime"/>
+        <mapping class="com.palmnest.model.airconditioner.AirConditionerAddTimeOrderExtend"/>
+        <mapping class="com.palmnest.model.airconditioner.AirConditionerAddTimeOrderHistory"/>
         <mapping class="com.palmnest.model.airconditioner.AirRule"/>
         <mapping class="com.palmnest.model.airconditioner.ProjectConfig"/>
         <mapping class="com.palmnest.model.OrgElement"/>