1231
This commit is contained in:
parent
0fe701f57c
commit
a737f0b6a9
@ -116,10 +116,10 @@ public class XzSpecialOperationFireSafetyController {
|
|||||||
// if (safetyInformant != null) {
|
// if (safetyInformant != null) {
|
||||||
// paramMap.put("safetyInformant", safetyInformant.get(0));
|
// paramMap.put("safetyInformant", safetyInformant.get(0));
|
||||||
// }
|
// }
|
||||||
// JSONArray assignmentPersonInCharge = paramMap.getJSONArray("assignmentPersonInCharge");
|
JSONArray assignmentPersonInCharge = paramMap.getJSONArray("assignmentPersonInCharge");
|
||||||
// if (assignmentPersonInCharge != null) {
|
if (assignmentPersonInCharge != null) {
|
||||||
// paramMap.put("assignmentPersonInCharge", assignmentPersonInCharge.get(0));
|
paramMap.put("assignmentPersonInCharge", assignmentPersonInCharge.get(0));
|
||||||
// }
|
}
|
||||||
JSONArray jobApplicationUnit = paramMap.getJSONArray("jobApplicationUnit");
|
JSONArray jobApplicationUnit = paramMap.getJSONArray("jobApplicationUnit");
|
||||||
if (jobApplicationUnit != null) {
|
if (jobApplicationUnit != null) {
|
||||||
paramMap.put("jobApplicationUnit", jobApplicationUnit.get(0));
|
paramMap.put("jobApplicationUnit", jobApplicationUnit.get(0));
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
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.XzSpecialOperationFireSafety;
|
||||||
import com.zhgd.xmgl.modules.xz.special.entity.XzTemporaryElectricitySafe;
|
import com.zhgd.xmgl.modules.xz.special.entity.XzTemporaryElectricitySafe;
|
||||||
import com.zhgd.xmgl.modules.xz.special.service.IXzTemporaryElectricitySafeService;
|
import com.zhgd.xmgl.modules.xz.special.service.IXzTemporaryElectricitySafeService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -7,6 +14,7 @@ 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,94 @@ public class XzTemporaryElectricitySafeController {
|
|||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param paramMap
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "添加星纵-临时用电安全作业票信息", notes = "添加星纵-临时用电安全作业票信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/save")
|
||||||
|
public Result<XzTemporaryElectricitySafe> save(@RequestBody @Validate JSONObject paramMap) {
|
||||||
|
log.info("临时用电安全作业票信息同步" + paramMap);
|
||||||
|
JSONArray workExecutionBeginTime = paramMap.getJSONArray("workExecutionBeginTime");
|
||||||
|
if (workExecutionBeginTime != null) {
|
||||||
|
String begin = workExecutionBeginTime.getString(0);
|
||||||
|
String end = workExecutionBeginTime.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 jobApplicationUnit = paramMap.getJSONArray("jobApplicationUnit");
|
||||||
|
if (jobApplicationUnit != null) {
|
||||||
|
paramMap.put("jobApplicationUnit", jobApplicationUnit.get(0));
|
||||||
|
}
|
||||||
|
String [] param = {"combustibleGasAnalysis", "analysePlace", "analysePerson"};
|
||||||
|
JSONArray analyseInfo = paramMap.getJSONArray("analysePlace");
|
||||||
|
if (analyseInfo != null) {
|
||||||
|
for (int i = 0; i < analyseInfo.size(); i++) {
|
||||||
|
JSONObject j = analyseInfo.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
paramMap.put(param[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String [] param1 = {"result", "time"};
|
||||||
|
JSONArray analyse = JSONArray.parseArray(JSON.toJSONString(paramMap.get("combustibleGasAnalysis")));
|
||||||
|
JSONArray combustibleGasAnalysis = new JSONArray();
|
||||||
|
if (analyse != null) {
|
||||||
|
for (int i = 0; i < analyse.size(); i++) {
|
||||||
|
JSONObject detailObj = new JSONObject();
|
||||||
|
JSONObject j = analyse.getJSONObject(i);
|
||||||
|
int k = 0;
|
||||||
|
for (String s : j.keySet()) {
|
||||||
|
detailObj.put(param1[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
combustibleGasAnalysis.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("combustibleGasAnalysis", JSON.toJSONString(combustibleGasAnalysis));
|
||||||
|
|
||||||
|
String [] param2 = {"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(param2[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
safeMeasure.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("safeMeasure", JSON.toJSONString(safeMeasure));
|
||||||
|
String [] param3 = {"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(param3[k], j.get(s));
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
otherSafeMeasure.add(detailObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramMap.put("otherSafeMeasure", JSON.toJSONString(otherSafeMeasure));
|
||||||
|
XzTemporaryElectricitySafe xzTemporaryElectricitySafe = JSONObject.parseObject(JSON.toJSONString(paramMap), XzTemporaryElectricitySafe.class);
|
||||||
|
xzTemporaryElectricitySafeService.add(xzTemporaryElectricitySafe);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user