动火作业
This commit is contained in:
parent
d7a2658a61
commit
096799cd3e
@ -1,13 +1,20 @@
|
|||||||
package com.zhgd.xmgl.modules.xz.special.controller;
|
package com.zhgd.xmgl.modules.xz.special.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.XzBlindPlatePlugSafe;
|
import com.zhgd.xmgl.modules.xz.special.entity.XzBlindPlatePlugSafe;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.XzGasAnalyze;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.XzSpecialOperationFireSafety;
|
||||||
import com.zhgd.xmgl.modules.xz.special.service.IXzBlindPlatePlugSafeService;
|
import com.zhgd.xmgl.modules.xz.special.service.IXzBlindPlatePlugSafeService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
@ -89,6 +96,110 @@ public class XzBlindPlatePlugSafeController {
|
|||||||
@PostMapping(value = "/save")
|
@PostMapping(value = "/save")
|
||||||
public Result<XzBlindPlatePlugSafe> save(@RequestBody JSONObject paramMap) {
|
public Result<XzBlindPlatePlugSafe> save(@RequestBody JSONObject paramMap) {
|
||||||
log.info("盲板抽堵信息同步" + paramMap);
|
log.info("盲板抽堵信息同步" + paramMap);
|
||||||
|
JSONArray hotWorkExecutionBeginTime = paramMap.getJSONArray("hotWorkExecutionBeginTime");
|
||||||
|
if (hotWorkExecutionBeginTime != null) {
|
||||||
|
String begin = hotWorkExecutionBeginTime.getString(0);
|
||||||
|
String end = hotWorkExecutionBeginTime.getString(0);
|
||||||
|
paramMap.put("hotWorkExecutionBeginTime", DateUtil.parse(begin + ":00", DatePattern.NORM_DATETIME_FORMAT));
|
||||||
|
paramMap.put("hotWorkExecutionEndTime", DateUtil.parse(end + ":00", DatePattern.NORM_DATETIME_FORMAT));
|
||||||
|
}
|
||||||
|
JSONArray operatingUnit = paramMap.getJSONArray("operatingUnit");
|
||||||
|
if (operatingUnit != null) {
|
||||||
|
paramMap.put("operatingUnit", operatingUnit.get(0));
|
||||||
|
}
|
||||||
|
JSONArray blindPlatePic = paramMap.getJSONArray("blindPlatePic");
|
||||||
|
if (blindPlatePic != null) {
|
||||||
|
paramMap.put("blindPlatePic", JSON.toJSONString(blindPlatePic));
|
||||||
|
}
|
||||||
|
JSONArray jobApplicationUnit = paramMap.getJSONArray("jobApplicationUnit");
|
||||||
|
if (jobApplicationUnit != null) {
|
||||||
|
paramMap.put("jobApplicationUnit", jobApplicationUnit.get(0));
|
||||||
|
}
|
||||||
|
String [] param = {"gasAnalyzeTime", "representativeGas", "analyzeResult", "analyzer"};
|
||||||
|
JSONArray detail = paramMap.getJSONArray("xzGasAnalyzeList");
|
||||||
|
List<XzGasAnalyze> list = new ArrayList<>();
|
||||||
|
if (detail != null) {
|
||||||
|
for (int i = 0; i < detail.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = detail.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
detailObj.put("projectSn", paramMap.getString("projectSn"));
|
||||||
|
list.add(JSONObject.parseObject(JSON.toJSONString(detailObj), XzGasAnalyze.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String [] param1 = {"name", "flag"};
|
||||||
|
JSONArray safeMeasures = paramMap.getJSONArray("safeMeasure");
|
||||||
|
JSONArray safeMeasure = new JSONArray();
|
||||||
|
if (safeMeasures != null) {
|
||||||
|
for (int i = 0; i < safeMeasures.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = safeMeasures.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param1[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
safeMeasure.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("safeMeasure", JSON.toJSONString(safeMeasure));
|
||||||
|
String [] param2 = {"content", "person"};
|
||||||
|
JSONArray otherSafeMeasures = paramMap.getJSONArray("otherSafeMeasure");
|
||||||
|
JSONArray otherSafeMeasure = new JSONArray();
|
||||||
|
if (otherSafeMeasures != null) {
|
||||||
|
for (int i = 0; i < otherSafeMeasures.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = otherSafeMeasures.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param2[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
otherSafeMeasure.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("otherSafeMeasure", JSON.toJSONString(otherSafeMeasure));
|
||||||
|
|
||||||
|
String [] param3 = {"medium", "temperature", "pressure"};
|
||||||
|
JSONArray blindPlateParameters = paramMap.getJSONArray("blindPlateParameter");
|
||||||
|
JSONArray blindPlateParameter = new JSONArray();
|
||||||
|
if (blindPlateParameters != null) {
|
||||||
|
for (int i = 0; i < blindPlateParameters.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = blindPlateParameters.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param3[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
blindPlateParameter.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("blindPlateParameter", JSON.toJSONString(blindPlateParameter));
|
||||||
|
|
||||||
|
String [] param4 = {"materialQuality", "specifications", "number"};
|
||||||
|
JSONArray pipelineParameters = paramMap.getJSONArray("pipelineParameter");
|
||||||
|
JSONArray pipelineParameter = new JSONArray();
|
||||||
|
if (pipelineParameters != null) {
|
||||||
|
for (int i = 0; i < pipelineParameters.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = pipelineParameters.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param4[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
pipelineParameter.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("pipelineParameter", JSON.toJSONString(pipelineParameter));
|
||||||
|
XzBlindPlatePlugSafe xzBlindPlatePlugSafe = JSONObject.parseObject(JSON.toJSONString(paramMap), XzBlindPlatePlugSafe.class);
|
||||||
|
xzBlindPlatePlugSafeService.add(xzBlindPlatePlugSafe);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,20 @@
|
|||||||
package com.zhgd.xmgl.modules.xz.special.controller;
|
package com.zhgd.xmgl.modules.xz.special.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.XzGasAnalyze;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.XzHighJobSafe;
|
import com.zhgd.xmgl.modules.xz.special.entity.XzHighJobSafe;
|
||||||
|
import com.zhgd.xmgl.modules.xz.special.entity.XzSpecialOperationFireSafety;
|
||||||
import com.zhgd.xmgl.modules.xz.special.service.IXzHighJobSafeService;
|
import com.zhgd.xmgl.modules.xz.special.service.IXzHighJobSafeService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
@ -78,6 +86,85 @@ public class XzHighJobSafeController {
|
|||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param paramMap
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "添加星纵-高处作业安全票信息", notes = "添加星纵-高处作业安全票信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/save")
|
||||||
|
public Result<XzHighJobSafe> save(@RequestBody @Validate JSONObject paramMap) {
|
||||||
|
log.info("高处作业安全票信息同步" + paramMap);
|
||||||
|
JSONArray hotWorkExecutionBeginTime = paramMap.getJSONArray("workExecutionBeginTime");
|
||||||
|
if (hotWorkExecutionBeginTime != null) {
|
||||||
|
String begin = hotWorkExecutionBeginTime.getString(0);
|
||||||
|
String end = hotWorkExecutionBeginTime.getString(0);
|
||||||
|
paramMap.put("workExecutionBeginTime", DateUtil.parse(begin + ":00", DatePattern.NORM_DATETIME_FORMAT));
|
||||||
|
paramMap.put("workExecutionEndTime", DateUtil.parse(end + ":00", DatePattern.NORM_DATETIME_FORMAT));
|
||||||
|
}
|
||||||
|
JSONArray operatingUnit = paramMap.getJSONArray("operatingUnit");
|
||||||
|
if (operatingUnit != null) {
|
||||||
|
paramMap.put("operatingUnit", operatingUnit.get(0));
|
||||||
|
}
|
||||||
|
JSONArray jobApplicationUnit = paramMap.getJSONArray("jobApplicationUnit");
|
||||||
|
if (jobApplicationUnit != null) {
|
||||||
|
paramMap.put("jobApplicationUnit", jobApplicationUnit.get(0));
|
||||||
|
}
|
||||||
|
String [] param = {"gasAnalyzeTime", "representativeGas", "analyzeResult", "analyzer"};
|
||||||
|
JSONArray detail = paramMap.getJSONArray("xzGasAnalyzeList");
|
||||||
|
List<XzGasAnalyze> list = new ArrayList<>();
|
||||||
|
if (detail != null) {
|
||||||
|
for (int i = 0; i < detail.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = detail.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
detailObj.put("projectSn", paramMap.getString("projectSn"));
|
||||||
|
list.add(JSONObject.parseObject(JSON.toJSONString(detailObj), XzGasAnalyze.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String [] param1 = {"name", "flag"};
|
||||||
|
JSONArray safeMeasures = paramMap.getJSONArray("safeMeasure");
|
||||||
|
JSONArray safeMeasure = new JSONArray();
|
||||||
|
if (safeMeasures != null) {
|
||||||
|
for (int i = 0; i < safeMeasures.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = safeMeasures.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param1[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
safeMeasure.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("safeMeasure", JSON.toJSONString(safeMeasure));
|
||||||
|
String [] param2 = {"content", "person"};
|
||||||
|
JSONArray otherSafeMeasures = paramMap.getJSONArray("otherSafeMeasure");
|
||||||
|
JSONArray otherSafeMeasure = new JSONArray();
|
||||||
|
if (otherSafeMeasures != null) {
|
||||||
|
for (int i = 0; i < otherSafeMeasures.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = otherSafeMeasures.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param2[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
otherSafeMeasure.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("otherSafeMeasure", JSON.toJSONString(otherSafeMeasure));
|
||||||
|
XzHighJobSafe xzHighJobSafe = JSONObject.parseObject(JSON.toJSONString(paramMap), XzHighJobSafe.class);
|
||||||
|
xzHighJobSafeService.add(xzHighJobSafe);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
|
|||||||
@ -371,6 +371,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.antMatchers("/xmgl/xzLimitSpaceSafe/save").permitAll()
|
.antMatchers("/xmgl/xzLimitSpaceSafe/save").permitAll()
|
||||||
.antMatchers("/xmgl/workerCertificate/queryByType").permitAll()
|
.antMatchers("/xmgl/workerCertificate/queryByType").permitAll()
|
||||||
.antMatchers("/xmgl/xzBlindPlatePlugSafe/save").permitAll()
|
.antMatchers("/xmgl/xzBlindPlatePlugSafe/save").permitAll()
|
||||||
|
.antMatchers("/xmgl/xzHighJobSafe/save").permitAll()
|
||||||
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
||||||
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
||||||
.and()
|
.and()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user