From ff149f2a89bbd52f8f474e409f90b48cf2da33be Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期三, 05 十一月 2025 18:48:25 +0800
Subject: [PATCH] bug修改
---
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java | 42 +++++++++++++++++++-----------------------
1 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java
index 2ba8e6d..bbb93a5 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java
@@ -40,6 +40,7 @@
import com.dsh.guns.modular.system.service.TOperatorService;
import com.dsh.guns.modular.system.util.HttpRequestUtil;
import com.dsh.guns.modular.system.util.ResultUtil;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -54,6 +55,8 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -342,18 +345,14 @@
model.addAttribute("typeNames",strings3);
String halfNames = site.getHalfName();
- ArrayList<String> strings2 = new ArrayList<>();
- String[] split = halfNames.split(",");
- String halfName=null;
- for (int i = 0; i < split.length; i++) {
- if(i==0){
- halfName = split[0];
- }else {
- strings2.add(split[i]);
- }
+ if (StringUtils.isNotBlank(halfNames) && site.getIshalf().equals(1)) {
+ List<String> strings2 = Arrays.asList(halfNames.split(","));
+ model.addAttribute("halfNames",strings2);
+ model.addAttribute("halfName",strings2.get(0));
+ }else {
+ model.addAttribute("halfNames", Collections.emptyList());
+ model.addAttribute("halfName", "");
}
- model.addAttribute("halfNames",strings2);
- model.addAttribute("halfName",halfName);
// 显式传递运营商ID和是否可预约字段,确保回显正确
model.addAttribute("operatorId", site.getOperatorId());
model.addAttribute("reservation", site.getReservation());
@@ -443,18 +442,14 @@
String halfNames = site.getHalfName();
- ArrayList<String> strings2 = new ArrayList<>();
- String[] split = halfNames.split(",");
- String halfName=null;
- for (int i = 0; i < split.length; i++) {
- if(i==0){
- halfName = split[0];
- }else {
- strings2.add(split[i]);
- }
+ if (StringUtils.isNotBlank(halfNames) && site.getIshalf().equals(1)) {
+ List<String> strings2 = Arrays.asList(halfNames.split(","));
+ model.addAttribute("halfNames",strings2);
+ model.addAttribute("halfName",strings2.get(0));
+ }else {
+ model.addAttribute("halfNames", Collections.emptyList());
+ model.addAttribute("halfName", "");
}
- model.addAttribute("halfNames",strings2);
- model.addAttribute("halfName",halfName);
List<CityManager> accounts = cityManagerClient.getAccount(site.getCity());
model.addAttribute("list",site);
@@ -549,7 +544,8 @@
map.put("name",site.getName());
map.put("space_id",store.getId().toString());
String s = HttpRequestUtil.postRequest
- ("https://port.daowepark.com/v7/user_api/general/addSpaceArea", map);
+// ("https://port.daowepark.com/v7/user_api/general/addSpaceArea", map);
+ ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map);
JSONObject jsonObject = JSONObject.parseObject(s);
JSONObject data = jsonObject.getJSONObject("data");
String area_id = data.getString("area_id");
--
Gitblit v1.7.1