|
@@ -5,12 +5,15 @@ import com.google.gson.reflect.TypeToken;
|
|
|
import com.happy.Model.AdminManager;
|
|
import com.happy.Model.AdminManager;
|
|
|
import com.happy.Model.AdminManager;
|
|
import com.happy.Model.AdminManager;
|
|
|
import com.happy.Model.AdminPower;
|
|
import com.happy.Model.AdminPower;
|
|
|
|
|
+import com.happy.Model.File;
|
|
|
import com.happy.Until.GetHttpParam;
|
|
import com.happy.Until.GetHttpParam;
|
|
|
import com.happy.Until.PwdDefind;
|
|
import com.happy.Until.PwdDefind;
|
|
|
import com.happy.Until.ResUtil;
|
|
import com.happy.Until.ResUtil;
|
|
|
|
|
+import com.happy.Until.UUIDUtil;
|
|
|
import com.happy.dto.IPage;
|
|
import com.happy.dto.IPage;
|
|
|
import com.happy.service.AdminManagerService;
|
|
import com.happy.service.AdminManagerService;
|
|
|
import com.happy.service.AdminService;
|
|
import com.happy.service.AdminService;
|
|
|
|
|
+import com.happy.service.FileService;
|
|
|
import com.opensymphony.xwork2.ActionSupport;
|
|
import com.opensymphony.xwork2.ActionSupport;
|
|
|
import net.sf.json.JSONObject;
|
|
import net.sf.json.JSONObject;
|
|
|
import org.apache.struts2.ServletActionContext;
|
|
import org.apache.struts2.ServletActionContext;
|
|
@@ -21,7 +24,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
-public class adminManagerAction extends ActionSupport {
|
|
|
|
|
|
|
+public class adminManagerAction extends ActionSupport implements ServletRequestAware{
|
|
|
|
|
|
|
|
private HttpServletRequest request;
|
|
private HttpServletRequest request;
|
|
|
public HttpServletResponse response;
|
|
public HttpServletResponse response;
|
|
@@ -32,6 +35,9 @@ public class adminManagerAction extends ActionSupport {
|
|
|
@Resource
|
|
@Resource
|
|
|
public AdminManagerService adminManagerService;
|
|
public AdminManagerService adminManagerService;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ public FileService fileService;
|
|
|
|
|
+
|
|
|
public String adminName;
|
|
public String adminName;
|
|
|
public String password;
|
|
public String password;
|
|
|
public String hotelTownship;
|
|
public String hotelTownship;
|
|
@@ -127,6 +133,21 @@ public class adminManagerAction extends ActionSupport {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ admin.setId(Math.toIntExact(UUIDUtil.generateID()));
|
|
|
|
|
+ //保存详细图附件
|
|
|
|
|
+ if(admin.getFileList()!=null && admin.getFileList().size()>0){
|
|
|
|
|
+ if(admin.getId()!= null){
|
|
|
|
|
+ fileService.delLinkFile(admin.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ for(File file : admin.getFileList()){
|
|
|
|
|
+ file.setLinkId(admin.getId());
|
|
|
|
|
+ fileService.insertFile(file);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ resultJson.put("message", "请上传详细图");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
int m = adminManagerService.insertAdmin(admin);
|
|
int m = adminManagerService.insertAdmin(admin);
|
|
|
if (m > 0) {
|
|
if (m > 0) {
|
|
|
resultJson.put("message", "添加成功");
|
|
resultJson.put("message", "添加成功");
|
|
@@ -354,7 +375,7 @@ public class adminManagerAction extends ActionSupport {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
if (adminName!=null){
|
|
if (adminName!=null){
|
|
|
- s1.append(" and admin_name like '%").append(adminName).append("'");
|
|
|
|
|
|
|
+ s1.append(" and admin_name like '%").append(adminName).append("%'");
|
|
|
}
|
|
}
|
|
|
if (hotelTownship!=null){
|
|
if (hotelTownship!=null){
|
|
|
s1.append(" and hotel_township like '%").append(hotelTownship).append("'");
|
|
s1.append(" and hotel_township like '%").append(hotelTownship).append("'");
|