动火作业
This commit is contained in:
parent
c7ca09076b
commit
e6152b7321
@ -611,7 +611,7 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
|
||||
.eq(AiAnalyseHardWareAlarmRecord::getProjectSn, projectSn)
|
||||
.between(AiAnalyseHardWareAlarmRecord::getCreateTime, DateUtil.beginOfMonth(date), DateUtil.endOfMonth(date)));
|
||||
if (num1 != 0) {
|
||||
Date time = DateUtil.offsetHour(date, -1);
|
||||
Date time = DateUtil.offsetMonth(date, -1);
|
||||
int num2 = this.count(Wrappers.<AiAnalyseHardWareAlarmRecord>lambdaQuery()
|
||||
.eq(AiAnalyseHardWareAlarmRecord::getProjectSn, projectSn)
|
||||
.between(AiAnalyseHardWareAlarmRecord::getCreateTime, DateUtil.beginOfMonth(time), DateUtil.endOfMonth(time)));
|
||||
|
||||
@ -730,7 +730,11 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
BigDecimal bigDecimal1 = new BigDecimal(num2);
|
||||
BigDecimal result1 = new BigDecimal(0);
|
||||
if (num2 != 0) {
|
||||
result1 = bigDecimal1.divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(0.99)).setScale(2, RoundingMode.HALF_UP);
|
||||
result1 = bigDecimal1.divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);
|
||||
if (result1.compareTo(new BigDecimal(1)) > 0) {
|
||||
result1 = new BigDecimal(1);
|
||||
}
|
||||
result1 = result1.multiply(new BigDecimal(0.99)).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
Set<String> stringSet = list.stream().map(x -> x.getDangerItemContent()).collect(Collectors.toSet());
|
||||
BigDecimal result2 = new BigDecimal(0);
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
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.XzLimitSpaceSafe;
|
||||
import com.zhgd.xmgl.modules.xz.special.service.IXzLimitSpaceSafeService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -78,6 +83,108 @@ public class XzLimitSpaceSafeController {
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加星纵-受限空间安全作业票信息", notes = "添加星纵-受限空间安全作业票信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/save")
|
||||
public Result<XzLimitSpaceSafe> save(@RequestBody @Validate JSONObject paramMap) {
|
||||
log.info("受限空间安全作业票信息同步" + paramMap);
|
||||
JSONArray hotWorkExecutionBeginTime = paramMap.getJSONArray("hotWorkExecutionBeginTime");
|
||||
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 otherRelatedSpecialTask = paramMap.getJSONArray("otherRelatedSpecialTask");
|
||||
// if (otherRelatedSpecialTask != null) {
|
||||
// paramMap.put("otherRelatedSpecialTask", otherRelatedSpecialTask.get(0));
|
||||
// }
|
||||
JSONArray safetyInformant = paramMap.getJSONArray("safetyInformant");
|
||||
if (safetyInformant != null) {
|
||||
paramMap.put("safetyInformant", safetyInformant.get(0));
|
||||
}
|
||||
JSONArray assignmentPersonInCharge = paramMap.getJSONArray("assignmentPersonInCharge");
|
||||
if (assignmentPersonInCharge != null) {
|
||||
paramMap.put("assignmentPersonInCharge", assignmentPersonInCharge.get(0));
|
||||
}
|
||||
JSONArray jobApplicationUnit = paramMap.getJSONArray("jobApplicationUnit");
|
||||
if (jobApplicationUnit != null) {
|
||||
paramMap.put("jobApplicationUnit", jobApplicationUnit.get(0));
|
||||
}
|
||||
JSONArray jobPerson = paramMap.getJSONArray("jobPerson");
|
||||
if (jobPerson != null) {
|
||||
paramMap.put("jobPerson", jobPerson.get(0));
|
||||
}
|
||||
JSONArray guardian = paramMap.getJSONArray("guardian");
|
||||
if (guardian != null) {
|
||||
paramMap.put("guardian", guardian.get(0));
|
||||
}
|
||||
JSONArray acceptTheInformant = paramMap.getJSONArray("acceptTheInformant");
|
||||
if (acceptTheInformant != null) {
|
||||
paramMap.put("acceptTheInformant", acceptTheInformant.get(0));
|
||||
}
|
||||
String [] param = {"name", "standard"};
|
||||
JSONArray toxicAndHarmfulGasInformations = paramMap.getJSONArray("toxicAndHarmfulGasInformation");
|
||||
JSONArray toxicAndHarmfulGasInformation = new JSONArray();
|
||||
if (toxicAndHarmfulGasInformations != null) {
|
||||
for (int i = 0; i < toxicAndHarmfulGasInformations.size(); i++) {
|
||||
JSONObject detailObj = new JSONObject();
|
||||
JSONObject j = toxicAndHarmfulGasInformations.getJSONObject(i);
|
||||
int k = 0;
|
||||
for (String s : j.keySet()) {
|
||||
detailObj.put(param[k], j.get(s));
|
||||
k++;
|
||||
}
|
||||
toxicAndHarmfulGasInformation.add(detailObj);
|
||||
}
|
||||
}
|
||||
paramMap.put("toxicAndHarmfulGasInformation", JSON.toJSONString(toxicAndHarmfulGasInformation));
|
||||
|
||||
JSONArray combustibleGasInformations = paramMap.getJSONArray("combustibleGasInformation");
|
||||
JSONArray combustibleGasInformation = new JSONArray();
|
||||
if (combustibleGasInformations != null) {
|
||||
for (int i = 0; i < combustibleGasInformations.size(); i++) {
|
||||
JSONObject detailObj = new JSONObject();
|
||||
JSONObject j = combustibleGasInformations.getJSONObject(i);
|
||||
int k = 0;
|
||||
for (String s : j.keySet()) {
|
||||
detailObj.put(param[k], j.get(s));
|
||||
k++;
|
||||
}
|
||||
combustibleGasInformation.add(detailObj);
|
||||
}
|
||||
}
|
||||
paramMap.put("combustibleGasInformation", JSON.toJSONString(combustibleGasInformation));
|
||||
|
||||
String [] param1 = {"name1", "name2", "name3", "name4", "name5", "time", "local", "person"};
|
||||
JSONArray gasAnalysisDatas = paramMap.getJSONArray("gasAnalysisData");
|
||||
JSONArray gasAnalysisData = new JSONArray();
|
||||
if (gasAnalysisDatas != null) {
|
||||
for (int i = 0; i < gasAnalysisDatas.size(); i++) {
|
||||
JSONObject detailObj = new JSONObject();
|
||||
JSONObject j = gasAnalysisDatas.getJSONObject(i);
|
||||
int k = 0;
|
||||
for (String s : j.keySet()) {
|
||||
detailObj.put(param1[k], j.get(s));
|
||||
k++;
|
||||
}
|
||||
gasAnalysisData.add(detailObj);
|
||||
}
|
||||
}
|
||||
paramMap.put("gasAnalysisData", JSON.toJSONString(gasAnalysisData));
|
||||
xzLimitSpaceSafeService.add(JSONObject.parseObject(JSON.toJSONString(paramMap), XzLimitSpaceSafe.class));
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
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.entity.XzMaterialDetail;
|
||||
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.IXzSpecialOperationFireSafetyService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -7,11 +14,13 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
@ -78,6 +87,95 @@ public class XzSpecialOperationFireSafetyController {
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加星纵-特种作业-动火安全信息", notes = "添加星纵-特种作业-动火安全信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/save")
|
||||
public Result<XzSpecialOperationFireSafety> save(@RequestBody @Validate JSONObject 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 otherRelatedSpecialTask = paramMap.getJSONArray("otherRelatedSpecialTask");
|
||||
if (otherRelatedSpecialTask != null) {
|
||||
paramMap.put("otherRelatedSpecialTask", otherRelatedSpecialTask.get(0));
|
||||
}
|
||||
JSONArray safetyInformant = paramMap.getJSONArray("safetyInformant");
|
||||
if (safetyInformant != null) {
|
||||
paramMap.put("safetyInformant", safetyInformant.get(0));
|
||||
}
|
||||
JSONArray assignmentPersonInCharge = paramMap.getJSONArray("assignmentPersonInCharge");
|
||||
if (assignmentPersonInCharge != null) {
|
||||
paramMap.put("assignmentPersonInCharge", assignmentPersonInCharge.get(0));
|
||||
}
|
||||
JSONArray jobApplicationUnit = paramMap.getJSONArray("jobApplicationUnit");
|
||||
if (jobApplicationUnit != null) {
|
||||
paramMap.put("jobApplicationUnit", jobApplicationUnit.get(0));
|
||||
}
|
||||
JSONArray fireman = paramMap.getJSONArray("fireman");
|
||||
if (fireman != null) {
|
||||
paramMap.put("fireman", fireman.get(0));
|
||||
}
|
||||
JSONArray guardian = paramMap.getJSONArray("guardian");
|
||||
if (guardian != null) {
|
||||
paramMap.put("guardian", guardian.get(0));
|
||||
}
|
||||
JSONArray acceptTheInformant = paramMap.getJSONArray("acceptTheInformant");
|
||||
if (acceptTheInformant != null) {
|
||||
paramMap.put("acceptTheInformant", acceptTheInformant.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));
|
||||
XzSpecialOperationFireSafety xzSpecialOperationFireSafety = JSONObject.parseObject(JSON.toJSONString(paramMap), XzSpecialOperationFireSafety.class);
|
||||
xzSpecialOperationFireSafety.setXzGasAnalyzeList(list);
|
||||
xzSpecialOperationFireSafetyService.add(xzSpecialOperationFireSafety);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
|
||||
@ -14,6 +14,7 @@ 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.mapper.XzGasAnalyzeMapper;
|
||||
import com.zhgd.xmgl.modules.xz.special.mapper.XzSpecialOperationFireSafetyMapper;
|
||||
import com.zhgd.xmgl.modules.xz.special.service.IXzGasAnalyzeService;
|
||||
import com.zhgd.xmgl.modules.xz.special.service.IXzSpecialOperationFireSafetyService;
|
||||
import com.zhgd.xmgl.util.MapBuilder;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
@ -38,7 +39,7 @@ public class XzSpecialOperationFireSafetyServiceImpl extends ServiceImpl<XzSpeci
|
||||
@Autowired
|
||||
private XzSpecialOperationFireSafetyMapper xzSpecialOperationFireSafetyMapper;
|
||||
@Autowired
|
||||
private XzGasAnalyzeMapper xzGasAnalyzeMapper;
|
||||
private IXzGasAnalyzeService xzGasAnalyzeService;
|
||||
|
||||
@Override
|
||||
public IPage<XzSpecialOperationFireSafety> queryPageList(HashMap<String, Object> paramMap) {
|
||||
@ -74,6 +75,11 @@ public class XzSpecialOperationFireSafetyServiceImpl extends ServiceImpl<XzSpeci
|
||||
public void add(XzSpecialOperationFireSafety xzSpecialOperationFireSafety) {
|
||||
xzSpecialOperationFireSafety.setId(null);
|
||||
baseMapper.insert(xzSpecialOperationFireSafety);
|
||||
List<XzGasAnalyze> xzGasAnalyzeList = xzSpecialOperationFireSafety.getXzGasAnalyzeList();
|
||||
for (XzGasAnalyze xzGasAnalyze : xzGasAnalyzeList) {
|
||||
xzGasAnalyze.setXzSpecialOperationFireSafetyId(xzSpecialOperationFireSafety.getId());
|
||||
}
|
||||
xzGasAnalyzeService.saveBatch(xzGasAnalyzeList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -100,7 +106,7 @@ public class XzSpecialOperationFireSafetyServiceImpl extends ServiceImpl<XzSpeci
|
||||
if (safety == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
List<XzGasAnalyze> xzGasAnalyzes = xzGasAnalyzeMapper.selectList(new LambdaQueryWrapper<XzGasAnalyze>()
|
||||
List<XzGasAnalyze> xzGasAnalyzes = xzGasAnalyzeService.list(new LambdaQueryWrapper<XzGasAnalyze>()
|
||||
.eq(XzGasAnalyze::getXzSpecialOperationFireSafetyId, id));
|
||||
safety.setXzGasAnalyzeList(xzGasAnalyzes);
|
||||
return safety;
|
||||
|
||||
@ -367,6 +367,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.antMatchers("/xmgl/xzElectrical/**").permitAll()
|
||||
.antMatchers("/xmgl/xzVisitorManageRecord/save").permitAll()
|
||||
.antMatchers("/xmgl/xzWorkerInfoAuditRecord/viewWorkerInfoDetail").permitAll()
|
||||
.antMatchers("/xmgl/xzSpecialOperationFireSafety/save").permitAll()
|
||||
.antMatchers("/xmgl/xzLimitSpaceSafe/save").permitAll()
|
||||
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
||||
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
||||
.and()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user