feat:八项作业撤回上一步

0927cmt
dearLin 2024-12-13 13:50:03 +08:00
parent 05a14e2efc
commit f7177dd91d
5 changed files with 1416 additions and 1432 deletions

View File

@ -31,158 +31,170 @@ import java.util.Map;
@RequestMapping("/app/gfConfinedSpaceGasWh") @RequestMapping("/app/gfConfinedSpaceGasWh")
public class AppGFConfinedSpaceGasWHController extends BaseController { public class AppGFConfinedSpaceGasWHController extends BaseController {
@Resource @Resource
private GFConfinedSpaceGasWHService GFconfinedspacegaswhService; private GFConfinedSpaceGasWHService GFconfinedspacegaswhService;
/** /**
* @param *
* @throws Exception *
*/ * @param
@RequestMapping(value="/add") * @throws Exception
@ResponseBody */
@DockAnnotation(isAdd = true) @RequestMapping(value = "/add")
public Object add() throws Exception{ @ResponseBody
Map<String,Object> map = new HashMap<String,Object>(); @DockAnnotation(isAdd = true)
String errInfo = "success"; public Object add() throws Exception {
PageData pd = new PageData(); Map<String, Object> map = new HashMap<String, Object>();
pd = this.getPageData(); String errInfo = "success";
PageData dockData = new PageData(); // 主要对接数据 PageData pd = new PageData();
pd = this.getPageData();
PageData dockData = new PageData(); // 主要对接数据
PageData pd2 = new PageData(); PageData pd2 = new PageData();
pd2 = GFconfinedspacegaswhService.findById(pd); pd2 = GFconfinedspacegaswhService.findById(pd);
if(pd2 != null && pd2.size()>0){ if (pd2 != null && pd2.size() > 0) {
PageData confinedGasPageData = new PageData(); // pd对接数据 PageData confinedGasPageData = new PageData(); // pd对接数据
confinedGasPageData.putAll(pd); confinedGasPageData.putAll(pd);
dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); dockData.put("dockData", JSON.toJSONString(confinedGasPageData));
GFconfinedspacegaswhService.edit(pd); GFconfinedspacegaswhService.edit(pd);
// map.put("dockData", JSON.toJSONString(dockData)); // map.put("dockData", JSON.toJSONString(dockData));
}else{ } else {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CONFINEDSPACEGASWH_ID", this.get32UUID()); //主键 pd.put("CONFINEDSPACEGASWH_ID", this.get32UUID()); //主键
GFconfinedspacegaswhService.save(pd); GFconfinedspacegaswhService.save(pd);
PageData confinedGasPageData = new PageData(); // pd对接数据 PageData confinedGasPageData = new PageData(); // pd对接数据
confinedGasPageData.putAll(pd); confinedGasPageData.putAll(pd);
dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); dockData.put("dockData", JSON.toJSONString(confinedGasPageData));
// map.put("dockData", JSON.toJSONString(dockData)); // map.put("dockData", JSON.toJSONString(dockData));
} }
map.put("dockData", JSON.toJSONString(dockData)); map.put("dockData", JSON.toJSONString(dockData));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/** /**
* @param *
* @throws Exception *
*/ * @param
@RequestMapping(value="/delete") * @throws Exception
@ResponseBody */
@DockAnnotation @RequestMapping(value = "/delete")
public Object delete() throws Exception{ @ResponseBody
Map<String,String> map = new HashMap<String,String>(); @DockAnnotation
String errInfo = "success"; public Object delete() throws Exception {
PageData pd = new PageData(); Map<String, String> map = new HashMap<String, String>();
pd = this.getPageData(); String errInfo = "success";
PageData dockData = new PageData(); // 主要对接数据 PageData pd = new PageData();
pd = this.getPageData();
PageData dockData = new PageData(); // 主要对接数据
PageData confinedGasPageData = new PageData(); // pd对接数据 PageData confinedGasPageData = new PageData(); // pd对接数据
confinedGasPageData.putAll(pd); confinedGasPageData.putAll(pd);
dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); dockData.put("dockData", JSON.toJSONString(confinedGasPageData));
GFconfinedspacegaswhService.delete(pd); GFconfinedspacegaswhService.delete(pd);
map.put("dockData", JSON.toJSONString(dockData)); map.put("dockData", JSON.toJSONString(dockData));
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
return map; return map;
} }
/** /**
* @param *
* @throws Exception *
*/ * @param
@RequestMapping(value="/edit") * @throws Exception
@ResponseBody */
@DockAnnotation @RequestMapping(value = "/edit")
public Object edit() throws Exception{ @ResponseBody
Map<String,Object> map = new HashMap<String,Object>(); @DockAnnotation
String errInfo = "success"; public Object edit() throws Exception {
PageData pd = new PageData(); Map<String, Object> map = new HashMap<String, Object>();
pd = this.getPageData(); String errInfo = "success";
PageData dockData = new PageData(); // 主要对接数据 PageData pd = new PageData();
pd = this.getPageData();
PageData dockData = new PageData(); // 主要对接数据
PageData confinedGasPageData = new PageData(); // pd对接数据 PageData confinedGasPageData = new PageData(); // pd对接数据
confinedGasPageData.putAll(pd); confinedGasPageData.putAll(pd);
dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); dockData.put("dockData", JSON.toJSONString(confinedGasPageData));
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
GFconfinedspacegaswhService.edit(pd); GFconfinedspacegaswhService.edit(pd);
map.put("dockingData", JSON.toJSONString(dockData)); map.put("dockingData", JSON.toJSONString(dockData));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/** /**
* @param page *
* @throws Exception *
*/ * @param page
@RequestMapping(value="/list") * @throws Exception
@ResponseBody */
public Object list(Page page) throws Exception{ @RequestMapping(value = "/list")
Map<String,Object> map = new HashMap<String,Object>(); @ResponseBody
String errInfo = "success"; public Object list(Page page) throws Exception {
PageData pd = new PageData(); Map<String, Object> map = new HashMap<String, Object>();
pd = this.getPageData(); String errInfo = "success";
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 PageData pd = new PageData();
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); pd = this.getPageData();
page.setPd(pd); String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
List<PageData> varList = GFconfinedspacegaswhService.list(page); //列出ConfinedSpaceGasWH列表 if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
map.put("varList", varList); page.setPd(pd);
map.put("page", page); List<PageData> varList = GFconfinedspacegaswhService.list(page); //列出ConfinedSpaceGasWH列表
map.put("result", errInfo); map.put("varList", varList);
return map; map.put("page", page);
} map.put("result", errInfo);
return map;
}
/** /**
* @param *
* @throws Exception *
*/ * @param
@RequestMapping(value="/goEdit") * @throws Exception
@ResponseBody */
public Object goEdit() throws Exception{ @RequestMapping(value = "/goEdit")
Map<String,Object> map = new HashMap<String,Object>(); @ResponseBody
String errInfo = "success"; public Object goEdit() throws Exception {
PageData pd = new PageData(); Map<String, Object> map = new HashMap<String, Object>();
pd = this.getPageData(); String errInfo = "success";
pd = GFconfinedspacegaswhService.findById(pd); //根据ID读取 PageData pd = new PageData();
map.put("pd", pd); pd = this.getPageData();
map.put("result", errInfo); pd = GFconfinedspacegaswhService.findById(pd); //根据ID读取
return map; map.put("pd", pd);
} map.put("result", errInfo);
return map;
}
/** /**
* @param *
* @throws Exception *
*/ * @param
@RequestMapping(value="/deleteAll") * @throws Exception
@ResponseBody */
@DockAnnotation @RequestMapping(value = "/deleteAll")
public Object deleteAll() throws Exception{ @ResponseBody
Map<String,Object> map = new HashMap<String,Object>(); @DockAnnotation
String errInfo = "success"; public Object deleteAll() throws Exception {
PageData pd = new PageData(); Map<String, Object> map = new HashMap<String, Object>();
pd = this.getPageData(); String errInfo = "success";
PageData dockData = new PageData(); // 主要对接数据 PageData pd = new PageData();
pd = this.getPageData();
PageData dockData = new PageData(); // 主要对接数据
PageData confinedGasPageData = new PageData(); // pd对接数据 PageData confinedGasPageData = new PageData(); // pd对接数据
confinedGasPageData.putAll(pd); confinedGasPageData.putAll(pd);
dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); dockData.put("dockData", JSON.toJSONString(confinedGasPageData));
String DATA_IDS = pd.getString("DATA_IDS"); String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){ if (Tools.notEmpty(DATA_IDS)) {
String ArrayDATA_IDS[] = DATA_IDS.split(","); String ArrayDATA_IDS[] = DATA_IDS.split(",");
GFconfinedspacegaswhService.deleteAll(ArrayDATA_IDS); GFconfinedspacegaswhService.deleteAll(ArrayDATA_IDS);
map.put("dockData", JSON.toJSONString(dockData)); map.put("dockData", JSON.toJSONString(dockData));
errInfo = "success"; errInfo = "success";
}else{ } else {
errInfo = "error"; errInfo = "error";
} }
map.put("dockData", JSON.toJSONString(dockData)); map.put("dockData", JSON.toJSONString(dockData));
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
return map; return map;
} }
} }

View File

@ -591,8 +591,8 @@ public class AppGFHighWorkController extends BaseController {
String status = pd.get("STATUS").toString(); String status = pd.get("STATUS").toString();
String OTHER_PROTECTIVE_MEASURES = pd2.getString("OTHER_PROTECTIVE_MEASURES"); String OTHER_PROTECTIVE_MEASURES = pd2.getString("OTHER_PROTECTIVE_MEASURES");
if ("2".equals(status) || "3".equals(status) || "4".equals(status) || "5".equals(status)) { if ("2".equals(status) || "3".equals(status) || "4".equals(status) || "5".equals(status)) {
OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES"))
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"); ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
// pd2.put("OTHER_PROTECTIVE_MEASURES", (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + // pd2.put("OTHER_PROTECTIVE_MEASURES", (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
// (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;")); // (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"));
// pd2.put("HAZARD_IDENTIFICATION", (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") + // pd2.put("HAZARD_IDENTIFICATION", (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") +

View File

@ -7,7 +7,7 @@ showCount=10
;在线管理IP ;在线管理IP
onlineIp=127.0.0.1 onlineIp=127.0.0.1
;在线管理端口 ;在线管理端口
onlinePort=8869 onlinePort=18869
;信息提示音 ;信息提示音
fhsmsSound=m1 fhsmsSound=m1

View File

@ -1,55 +0,0 @@
import com.alibaba.fastjson.JSONObject;
import com.zcloud.util.HttpRequestUtil;
import com.zcloud.util.Tools;
public class Test {
private static String username = "qinan";
private static String password = "ZBo7pZ6UKDGLXq/xc87WB/J84jk0B7jpujsQZFcGbG4NrNN0CuWSiImfNln0nloVYC0BOp+9bnCq7MEFpzJXy11z2iYnlOA8B7MM5YDi2dpI+bHO0+lfL57eH6IXP7rrSjiKWCBDjNPgYGETkSgXNRVb8L9LnwX6qbHDri4ARTI=";
private static String userName = "n3Q3nVlzQ/8wVC0CObso2H+i8Y3g8q7k0DGZrZY4ofqnAv1wgfFst7AnlTYu7Rw1aJv36cPD/nrWARmNqP+UghX17K5iutwmKLVwC4EZaVmVABQGLjYdCekj2ePHpGjDFyHYaGQrIVJ651WxFZfKtdBexSL7b9sm7FRbpievNmA=";
private static String source = "API";
private static String code = "1";
private static String perLocToken = "4b13428cadd8bafbf9ae7ae2544";
private static String perLocUrl = "http://172.16.130.86/gateway-service";
public static void main(String[] args) throws Exception {
getToken();
}
public static String goToLogin() {
JSONObject request = new JSONObject();
request.put("username", username);
request.put("password", password);
request.put("userName", userName);
request.put("source", source);
request.put("code", code);
String loginResStr = HttpRequestUtil.doPost("http://172.16.130.86/gateway-service" + "/auth/encryptLogin", request.toJSONString());
JSONObject loginResponse = JSONObject.parseObject(loginResStr);
if(Tools.notEmpty(loginResStr) && loginResponse != null
&& loginResponse.get("code") != null && loginResponse.getInteger("code") == 200
&& loginResponse.get("data") != null && loginResponse.getJSONObject("data").getString("token") != null){
return loginResponse.getJSONObject("data").getString("token");
} else { // 登录失败
throw new RuntimeException("人员定位第三方登录失败");
}
}
public static String getToken() throws Exception {
// token 不为空。验证token是否失效
if (Tools.notEmpty(perLocToken)) {
JSONObject request = new JSONObject();
request.put("pageNum", 1);
request.put("pageSize", 10);
String httpResponseStr = HttpRequestUtil.doPost(perLocToken, perLocUrl + "/system/menu/menuTree",request.toJSONString());
JSONObject httpResponse = JSONObject.parseObject(httpResponseStr);
// token 有效
if (Tools.notEmpty(httpResponseStr) && httpResponse != null && httpResponse.get("code") != null && httpResponse.getInteger("code") == 200) {
return perLocToken;
} else { // token 失效 或者报错
perLocToken = goToLogin();
}
} else {
perLocToken = goToLogin();
}
return perLocToken;
}
}