|
@@ -1,5 +1,6 @@
|
|
package com.palmnest.service.estateserve.airconditioner.impl;
|
|
package com.palmnest.service.estateserve.airconditioner.impl;
|
|
|
|
|
|
|
|
+import cn.superdesk.libs.common.json.JsonUtils;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.palmnest.application.AppConstants;
|
|
import com.palmnest.application.AppConstants;
|
|
import com.palmnest.application.CodeConstants;
|
|
import com.palmnest.application.CodeConstants;
|
|
@@ -173,7 +174,8 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
String applyTimeStr = DateUtils.getTime(airConditionerAddTime.getUseStartTime(), "yyyy-MM-dd");
|
|
String applyTimeStr = DateUtils.getTime(airConditionerAddTime.getUseStartTime(), "yyyy-MM-dd");
|
|
try {
|
|
try {
|
|
String jsonStr = HttpKit.holidayGet("https://timor.tech/api/holiday/info/" + applyTimeStr, false);
|
|
String jsonStr = HttpKit.holidayGet("https://timor.tech/api/holiday/info/" + applyTimeStr, false);
|
|
- System.out.println("节假日接口调用返回===>" + jsonStr);
|
|
|
|
|
|
+ log.info("节假日接口调用返回===>" + jsonStr);
|
|
|
|
+
|
|
Map<String, Object> jsApiMap = com.alibaba.fastjson.JSONObject.parseObject(jsonStr);
|
|
Map<String, Object> jsApiMap = com.alibaba.fastjson.JSONObject.parseObject(jsonStr);
|
|
if (null != jsApiMap && jsApiMap.containsKey("code")) {
|
|
if (null != jsApiMap && jsApiMap.containsKey("code")) {
|
|
if (jsApiMap.get("code").equals(0)) {
|
|
if (jsApiMap.get("code").equals(0)) {
|
|
@@ -233,9 +235,10 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
* 项目的空调使用规则信息
|
|
* 项目的空调使用规则信息
|
|
*/
|
|
*/
|
|
List<AirRule> airRules = airRuleManager.getAirRule(airConditionerAddTime.getOrganizationId(), applicationType, applicationAirAddTime, dataType, "", "");
|
|
List<AirRule> airRules = airRuleManager.getAirRule(airConditionerAddTime.getOrganizationId(), applicationType, applicationAirAddTime, dataType, "", "");
|
|
- log.info("空调加时申请,查询到到的空调加时规则为:{}", airRules);
|
|
|
|
|
|
+ log.info("空调加时申请,查询到到的空调加时规则为:{}", JsonUtils.toJson(airRules));
|
|
AirRule airRule = null;
|
|
AirRule airRule = null;
|
|
if (null == airRules || airRules.isEmpty()) {
|
|
if (null == airRules || airRules.isEmpty()) {
|
|
|
|
+ log.info("空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请 apply 1");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
}
|
|
}
|
|
int airRulesSize = 0;
|
|
int airRulesSize = 0;
|
|
@@ -252,8 +255,9 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
++airRulesSize;
|
|
++airRulesSize;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ log.info("空调加时申请:airRulesSize :" + airRulesSize);
|
|
if (airRulesSize == 0) {
|
|
if (airRulesSize == 0) {
|
|
|
|
+ log.info("空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请 apply 2");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
}
|
|
}
|
|
if (airRulesSize > 1) {
|
|
if (airRulesSize > 1) {
|
|
@@ -1855,6 +1859,7 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
String jsonStr;
|
|
String jsonStr;
|
|
|
|
|
|
jsonStr = HttpKit.get("http://api.goseek.cn/Tools/holiday?date=" + applyTimeStr, false);
|
|
jsonStr = HttpKit.get("http://api.goseek.cn/Tools/holiday?date=" + applyTimeStr, false);
|
|
|
|
+ log.info("空调加时申请,getIsShowSelectBox jsonStr:{}", jsonStr);
|
|
Map<String, Object> jsApiMap = com.alibaba.fastjson.JSONObject.parseObject(jsonStr);
|
|
Map<String, Object> jsApiMap = com.alibaba.fastjson.JSONObject.parseObject(jsonStr);
|
|
if (null != jsApiMap && jsApiMap.containsKey("code")) {
|
|
if (null != jsApiMap && jsApiMap.containsKey("code")) {
|
|
if (jsApiMap.get("code").equals(10000)) {
|
|
if (jsApiMap.get("code").equals(10000)) {
|
|
@@ -1906,7 +1911,10 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
}*/
|
|
}*/
|
|
List<AirRule> airRules = airRuleManager.getAirRule(virtual.getOrganizationId(), applicationType, applicationMeeting, dataType, "", "");
|
|
List<AirRule> airRules = airRuleManager.getAirRule(virtual.getOrganizationId(), applicationType, applicationMeeting, dataType, "", "");
|
|
AirRule airRule = null;
|
|
AirRule airRule = null;
|
|
|
|
+
|
|
|
|
+
|
|
if (null == airRules || (null != airRules && airRules.size() == 0)) {
|
|
if (null == airRules || (null != airRules && airRules.size() == 0)) {
|
|
|
|
+ log.info("空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请 getIsShowSelectBox 1");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
}
|
|
}
|
|
int airRulesSize = 0;
|
|
int airRulesSize = 0;
|
|
@@ -1922,8 +1930,9 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
++airRulesSize;
|
|
++airRulesSize;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ log.info("空调加时申请2 airRulesSize: " + airRulesSize);
|
|
if (airRulesSize == 0) {
|
|
if (airRulesSize == 0) {
|
|
|
|
+ log.info("空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请 getIsShowSelectBox 2");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
}
|
|
}
|
|
if (airRulesSize > 1) {
|
|
if (airRulesSize > 1) {
|