|
@@ -232,6 +232,7 @@ 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);
|
|
AirRule airRule = null;
|
|
AirRule airRule = null;
|
|
if (null == airRules || airRules.isEmpty()) {
|
|
if (null == airRules || airRules.isEmpty()) {
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,不能匹配到空调加时规则或该时段有免费的空调加时无需申请");
|
|
@@ -576,17 +577,11 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
/**
|
|
/**
|
|
* 下单时保存可用的规则 修改订单时需要用
|
|
* 下单时保存可用的规则 修改订单时需要用
|
|
*/
|
|
*/
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
|
- param.put("organizationId", airConditionerAddTime.getOrganizationId());
|
|
|
|
- param.put("isEnabled", 1);
|
|
|
|
- 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)) {
|
|
|
|
|
|
+ if (cn.superdesk.libs.common.util.CollectionUtils.isEmpty(airRules)) {
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用规则,请联系系统管理员");
|
|
return AppResultUtil.createErrorDto(AppConstants.ERROR_CODE, "空调加时申请失败,没有可用规则,请联系系统管理员");
|
|
}
|
|
}
|
|
|
|
|
|
- String allAirRulesStr = JSON.toJSONString(items);
|
|
|
|
|
|
+ String allAirRulesStr = JSON.toJSONString(airRules);
|
|
|
|
|
|
/**
|
|
/**
|
|
* 下单时保存所有可用房间信息 修改订单时需要用
|
|
* 下单时保存所有可用房间信息 修改订单时需要用
|
|
@@ -2411,6 +2406,7 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
}
|
|
}
|
|
|
|
|
|
List<AirRule> airRules = JSON.parseArray(extend.getAirRules(), AirRule.class);
|
|
List<AirRule> airRules = JSON.parseArray(extend.getAirRules(), AirRule.class);
|
|
|
|
+ log.info("空调加时订单计算费用,订单编号:{},订单id:{},空调加时规则:{}", order.getOrderNo(), order.getOrderId(), JSON.toJSONString(airRules));
|
|
|
|
|
|
AirRule airRule = null;
|
|
AirRule airRule = null;
|
|
if (null == airRules || airRules.isEmpty()) {
|
|
if (null == airRules || airRules.isEmpty()) {
|
|
@@ -2451,6 +2447,10 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
* 使用面积
|
|
* 使用面积
|
|
*/
|
|
*/
|
|
String applyArea;
|
|
String applyArea;
|
|
|
|
+
|
|
|
|
+ List<Integer> roomIds = order.getRoomIds();
|
|
|
|
+
|
|
|
|
+
|
|
BigDecimal calcapplyArea = BigDecimal.ZERO;// 按层申请的面积
|
|
BigDecimal calcapplyArea = BigDecimal.ZERO;// 按层申请的面积
|
|
Map<Integer, BigDecimal> floorSumAreaMap = new HashMap<>();// 每层楼的合计申请面积
|
|
Map<Integer, BigDecimal> floorSumAreaMap = new HashMap<>();// 每层楼的合计申请面积
|
|
Map<Integer, Boolean> mapIsHaveFloor = new HashMap<>();// 当前楼层是有-一层起订
|
|
Map<Integer, Boolean> mapIsHaveFloor = new HashMap<>();// 当前楼层是有-一层起订
|
|
@@ -2460,10 +2460,13 @@ public class ConditionerAddTimeServiceImpl implements ConditionerAddTimeService
|
|
for (RoomInfo roomInfo : roomInfos) {
|
|
for (RoomInfo roomInfo : roomInfos) {
|
|
|
|
|
|
Integer floorId = roomInfo.getFloorId().intValue();
|
|
Integer floorId = roomInfo.getFloorId().intValue();
|
|
- String roomName = roomInfo.getName();
|
|
|
|
|
|
|
|
BigDecimal area = roomInfo.getArea();
|
|
BigDecimal area = roomInfo.getArea();
|
|
Integer areaRuleType = roomInfo.getAreaRuleType();
|
|
Integer areaRuleType = roomInfo.getAreaRuleType();
|
|
|
|
+ // 选择的房间不包含当前房间则跳过
|
|
|
|
+ if (!roomIds.contains(roomInfo.getId())) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
|
|
if (floorSumAreaMap.containsKey(floorId)) {
|
|
if (floorSumAreaMap.containsKey(floorId)) {
|
|
BigDecimal temp_area = floorSumAreaMap.get(floorId);
|
|
BigDecimal temp_area = floorSumAreaMap.get(floorId);
|