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

View File

@ -591,8 +591,8 @@ public class AppGFHighWorkController extends BaseController {
String status = pd.get("STATUS").toString();
String OTHER_PROTECTIVE_MEASURES = pd2.getString("OTHER_PROTECTIVE_MEASURES");
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") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
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") + ";_;") : ";_;");
// 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") + ";_;") : ";_;"));
// pd2.put("HAZARD_IDENTIFICATION", (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") +

View File

@ -7,7 +7,7 @@ showCount=10
;在线管理IP
onlineIp=127.0.0.1
;在线管理端口
onlinePort=8869
onlinePort=18869
;信息提示音
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;
}
}