|
|
|
@ -1,12 +1,17 @@
|
|
|
|
|
package com.mudu.controller;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.mudu.base.domain.AjaxResult;
|
|
|
|
|
import com.mudu.entity.*;
|
|
|
|
|
import com.mudu.entity.dto.request.ACheckQuatzRequest;
|
|
|
|
|
import com.mudu.entity.dto.request.ACheckQuatzZichaRequest;
|
|
|
|
|
import com.mudu.entity.dto.response.ACheckXcTpResponse;
|
|
|
|
|
import com.mudu.service.*;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
@ -14,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
@ -72,6 +79,23 @@ public class AcheckTaskController {
|
|
|
|
|
@Resource
|
|
|
|
|
private ASafeXcrwwzService aSafeXcrwwzService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ASafeQyjcxxService aSafeQyjcxxService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ASafeRwzqService aSafeRwzqService;
|
|
|
|
|
|
|
|
|
|
@Value("${improveUrl}")
|
|
|
|
|
private String url;
|
|
|
|
|
|
|
|
|
|
@Value("${api}")
|
|
|
|
|
private String api;
|
|
|
|
|
|
|
|
|
|
@Value("${zcUrl}")
|
|
|
|
|
private String zcUrl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增创建时间为昨天且处于审批通过的工单数据
|
|
|
|
|
*
|
|
|
|
@ -80,129 +104,166 @@ public class AcheckTaskController {
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/insert")
|
|
|
|
|
@ApiOperation(value = "新增创建时间为昨天且处于审批通过的工单数据")
|
|
|
|
|
public AjaxResult selectAll(@RequestBody List<ACheckQuatzRequest> list) {
|
|
|
|
|
public AjaxResult selectAll(@RequestBody List<ACheckQuatzRequest> list) throws ParseException {
|
|
|
|
|
for (ACheckQuatzRequest a : list) {
|
|
|
|
|
String rwzqUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String xcrwuuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
|
|
|
|
|
//获取企业编号
|
|
|
|
|
ASafeQyjcxx aSafeQyjcxx = aSafeQyjcxxService.findOneByqymcOrXybm(a.getName(), a.getEntCode());
|
|
|
|
|
String enterPriseId = aSafeQyjcxx.getXxbh();
|
|
|
|
|
//根据工单获取数据
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("improvingNo", a.getImprovingNo());
|
|
|
|
|
String response = HttpRequest.post(url)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.body(jsonObject.toJSONString())
|
|
|
|
|
.execute()
|
|
|
|
|
.body();
|
|
|
|
|
JSONObject jsonResponse = JSON.parseObject(response);
|
|
|
|
|
// 提取数据
|
|
|
|
|
String data = jsonResponse.getString("data");
|
|
|
|
|
JSONObject json = JSONObject.parseObject(data);
|
|
|
|
|
Object zgqtpListObj = json.get("zgqtpList");
|
|
|
|
|
Object zghtpListObj = json.get("zghtpList");
|
|
|
|
|
String zgqtpListStr = JSONObject.toJSONString(zgqtpListObj);
|
|
|
|
|
String zghtpListStr = JSONObject.toJSONString(zghtpListObj);
|
|
|
|
|
List<ACheckXcTpResponse> zgqTpList = JSON.parseArray(zgqtpListStr, ACheckXcTpResponse.class);
|
|
|
|
|
List<ACheckXcTpResponse> zghtpList = JSON.parseArray(zghtpListStr, ACheckXcTpResponse.class);
|
|
|
|
|
int xxsx = 0;
|
|
|
|
|
/**
|
|
|
|
|
* 附件表a_safe_rwfj
|
|
|
|
|
*/
|
|
|
|
|
for (ACheckXcTpResponse zgq : zgqTpList) {
|
|
|
|
|
/**
|
|
|
|
|
* 新增整改前任务附件
|
|
|
|
|
*/
|
|
|
|
|
saveZgqTp(zgq, xcrwuuid, xxsx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (ACheckXcTpResponse zgh : zghtpList) {
|
|
|
|
|
/**
|
|
|
|
|
* 新增整改后任务附件
|
|
|
|
|
*/
|
|
|
|
|
svaeZghTp(zgh, xcrwuuid, xxsx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*新增任务周期a_safe_rwzq
|
|
|
|
|
*/
|
|
|
|
|
saveRwzq(a, rwzqUuid);
|
|
|
|
|
/**
|
|
|
|
|
* 新增巡查信息表 a_safe_xcrw
|
|
|
|
|
*/
|
|
|
|
|
saveXcrw(list, a, xcrwuuid, enterPriseId, rwzqUuid);
|
|
|
|
|
|
|
|
|
|
for (ACheckQuatzEntity b : a.getList()) {
|
|
|
|
|
String xcrwjcxUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String xcrwjcxzgxxUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String xcrwwzUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String yhzgxxUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String rwfjUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
//获取企业编号
|
|
|
|
|
String enterPriseId = a.getEnterpriseID();
|
|
|
|
|
//获取人员编号
|
|
|
|
|
String rybh = a.getRybh();
|
|
|
|
|
/**
|
|
|
|
|
* 新增巡查信息表 a_safe_xcrw
|
|
|
|
|
* 巡查任务检查项记录 a_safe_xcrwjcx
|
|
|
|
|
*/
|
|
|
|
|
ASafeXcrw aSafeXcrw = new ASafeXcrw();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeXcrw.setXxbh(xcrwuuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeXcrw.setQybh(enterPriseId);
|
|
|
|
|
//任务类型
|
|
|
|
|
aSafeXcrw.setRwlx("WGXC");
|
|
|
|
|
//巡查项
|
|
|
|
|
aSafeXcrw.setXcx(list.size());
|
|
|
|
|
//完成项
|
|
|
|
|
aSafeXcrw.setWcx(list.size());
|
|
|
|
|
//发现隐患数
|
|
|
|
|
aSafeXcrw.setFxyhs(list.size());
|
|
|
|
|
//检查时间
|
|
|
|
|
if (a.getReportDateTime() != null) {
|
|
|
|
|
aSafeXcrw.setJcsj(a.getReportDateTime());
|
|
|
|
|
} else {
|
|
|
|
|
aSafeXcrw.setJcsj(null);
|
|
|
|
|
}
|
|
|
|
|
saveXcrwJcx(b, xcrwjcxUuid, enterPriseId, xcrwuuid, rwzqUuid);
|
|
|
|
|
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeXcrw.setWczt(1);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeXcrw.setRkry(rybh);
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeXcrw.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeXcrw.setGxsj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeXcrw.setGxry(rybh);
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeXcrw.setJlzt(1);
|
|
|
|
|
//新增
|
|
|
|
|
aSafeXcrwService.save(aSafeXcrw);
|
|
|
|
|
/**
|
|
|
|
|
* 巡查任务检查项记录 a_safe_xcrwjcx
|
|
|
|
|
* 巡查任务隐患整改/隐患复查 a_safe_xcrwjcxzgxx
|
|
|
|
|
*/
|
|
|
|
|
ASafeXcrwjcx aSafeXcrwjcx = new ASafeXcrwjcx();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeXcrwjcx.setXxbh(xcrwjcxUuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeXcrwjcx.setQybh(enterPriseId);
|
|
|
|
|
//任务编号对应a_safe_xcrw的信息编号
|
|
|
|
|
aSafeXcrwjcx.setRwbh(xcrwuuid);
|
|
|
|
|
//企业风险点编号 对应a_safe_fxd的信息编号 todo
|
|
|
|
|
if (a.getCheckId() != null) {
|
|
|
|
|
aSafeXcrwjcx.setQyfxdbh(a.getCheckId());
|
|
|
|
|
} else {
|
|
|
|
|
aSafeXcrwjcx.setQyfxdbh("测试");
|
|
|
|
|
saveXcrwJcxZgxx(a, b, xcrwjcxzgxxUuid, xcrwuuid, xcrwjcxUuid, rwzqUuid);
|
|
|
|
|
/**
|
|
|
|
|
* 巡查任务位置 a_safe_xcrwwz
|
|
|
|
|
*/
|
|
|
|
|
saveXcrwwz(b, xcrwwzUuid, xcrwuuid, rwzqUuid);
|
|
|
|
|
/**
|
|
|
|
|
* 巡查风险点位置隐患 a_safe_yhzgxx
|
|
|
|
|
*/
|
|
|
|
|
saveYhzgxx(list, a, b, yhzgxxUuid, xcrwuuid, enterPriseId, rwzqUuid, xcrwwzUuid);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//周期编号 todo
|
|
|
|
|
aSafeXcrwjcx.setZqbh("测试");
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeXcrwjcx.setWczt(1);
|
|
|
|
|
//检查项结果
|
|
|
|
|
aSafeXcrwjcx.setJcxjg(String.valueOf(1));
|
|
|
|
|
//隐患描述
|
|
|
|
|
aSafeXcrwjcx.setYhms(a.getDescription());
|
|
|
|
|
//检查时间
|
|
|
|
|
if (a.getReportDateTime() != null) {
|
|
|
|
|
aSafeXcrwjcx.setJcsj(a.getReportDateTime());
|
|
|
|
|
} else {
|
|
|
|
|
aSafeXcrwjcx.setJcsj(null);
|
|
|
|
|
}
|
|
|
|
|
//整改时间 todo 整改完成时间
|
|
|
|
|
if (a.getReportDateTime() != null) {
|
|
|
|
|
aSafeXcrwjcx.setZgsj(a.getReportDateTime());
|
|
|
|
|
} else {
|
|
|
|
|
aSafeXcrwjcx.setZgsj(null);
|
|
|
|
|
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
//整改描述 todo
|
|
|
|
|
|
|
|
|
|
private void saveYhzgxx(List<ACheckQuatzRequest> list, ACheckQuatzRequest a, ACheckQuatzEntity b, String yhzgxxUuid, String xcrwuuid, String enterPriseId, String rwzqUuid, String xcrwwzUuid) {
|
|
|
|
|
ASafeYhzgxx aSafeYhzgxx = new ASafeYhzgxx();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeYhzgxx.setXxbh(yhzgxxUuid);
|
|
|
|
|
//任务编号
|
|
|
|
|
aSafeYhzgxx.setRwbh(xcrwuuid);
|
|
|
|
|
//位置编号
|
|
|
|
|
aSafeYhzgxx.setWzbh(b.getWzxxbh());
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeYhzgxx.setQybh(enterPriseId);
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeYhzgxx.setZqbh(rwzqUuid);
|
|
|
|
|
//企业风险点编号 对应a_safe_fxd的信息编号
|
|
|
|
|
aSafeYhzgxx.setQyfxdbh(b.getCheckId());
|
|
|
|
|
//隐患来源
|
|
|
|
|
aSafeYhzgxx.setYhly("1");
|
|
|
|
|
//检查时间
|
|
|
|
|
aSafeYhzgxx.setJcsj(a.getReportDateTime());
|
|
|
|
|
//整改期限
|
|
|
|
|
aSafeXcrwjcx.setZgqx(a.getNeedFinalDateTime());
|
|
|
|
|
aSafeYhzgxx.setZgqx(b.getNeedFinalDateTime());
|
|
|
|
|
//不合格检查项a_safe_xcrwjcx中JCXJG=1的数量
|
|
|
|
|
aSafeYhzgxx.setBhgjcx(list.size());
|
|
|
|
|
//是否展示
|
|
|
|
|
aSafeYhzgxx.setSfzs(1);
|
|
|
|
|
//巡查位置编号
|
|
|
|
|
aSafeYhzgxx.setXcwzbh(xcrwwzUuid);
|
|
|
|
|
//复查是否合格
|
|
|
|
|
aSafeYhzgxx.setFcsfhg(1);
|
|
|
|
|
//隐患描述
|
|
|
|
|
aSafeYhzgxx.setYhms(null);
|
|
|
|
|
//整改时间
|
|
|
|
|
aSafeYhzgxx.setZgsj(b.getReportDateTime());
|
|
|
|
|
//整改状态
|
|
|
|
|
aSafeXcrwjcx.setZgzt(1);
|
|
|
|
|
//整改逾期
|
|
|
|
|
Date currentTime = new Date(); // 获取当前时间
|
|
|
|
|
if (a.getNeedFinalDateTime() != null && currentTime.after(a.getNeedFinalDateTime())) {
|
|
|
|
|
// 超过截止时间,
|
|
|
|
|
aSafeXcrwjcx.setZgyq(1);
|
|
|
|
|
} else {
|
|
|
|
|
// 未超过截止时间,
|
|
|
|
|
aSafeXcrwjcx.setZgyq(0);
|
|
|
|
|
}
|
|
|
|
|
//市风险点编号 todo
|
|
|
|
|
//任务类型
|
|
|
|
|
aSafeXcrwjcx.setRwlx(3);
|
|
|
|
|
aSafeYhzgxx.setZgzt(1);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeXcrwjcx.setRkry(rybh);
|
|
|
|
|
aSafeYhzgxx.setRkry(b.getRybh());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeXcrwjcx.setRksj(new Date());
|
|
|
|
|
aSafeYhzgxx.setRksj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeXcrwjcx.setGxry(rybh);
|
|
|
|
|
aSafeYhzgxx.setGxry(b.getRybh());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeXcrwjcx.setGxsj(new Date());
|
|
|
|
|
aSafeYhzgxx.setGxsj(new Date());
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeXcrwjcx.setJlzt(1);
|
|
|
|
|
aSafeXcrwjcxService.save(aSafeXcrwjcx);
|
|
|
|
|
aSafeYhzgxx.setJlzt(1);
|
|
|
|
|
aSafeYhzgxxService.save(aSafeYhzgxx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 巡查任务隐患整改/隐患复查 a_safe_xcrwjcxzgxx
|
|
|
|
|
*/
|
|
|
|
|
private void saveXcrwwz(ACheckQuatzEntity b, String xcrwwzUuid, String xcrwuuid, String rwzqUuid) {
|
|
|
|
|
ASafeXcrwwz aSafeXcrwwz = new ASafeXcrwwz();
|
|
|
|
|
//xxbh
|
|
|
|
|
aSafeXcrwwz.setXxbh(xcrwwzUuid);
|
|
|
|
|
//任务编号
|
|
|
|
|
aSafeXcrwwz.setRwbh(xcrwuuid);
|
|
|
|
|
//位置编号
|
|
|
|
|
aSafeXcrwwz.setWzbh(b.getWzxxbh());
|
|
|
|
|
//位置名称
|
|
|
|
|
aSafeXcrwwz.setWzmc(b.getWzmc());
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeXcrwwz.setZqbh(rwzqUuid);
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeXcrwwz.setWczt(1);
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeXcrwwz.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeXcrwwz.setGxsj(new Date());
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeXcrwwz.setJlzt(1);
|
|
|
|
|
aSafeXcrwwzService.save(aSafeXcrwwz);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveXcrwJcxZgxx(ACheckQuatzRequest a, ACheckQuatzEntity b, String xcrwjcxzgxxUuid, String xcrwuuid, String xcrwjcxUuid, String rwzqUuid) {
|
|
|
|
|
ASafeXcrwjcxzgxx aSafeXcrwjcxzgxx = new ASafeXcrwjcxzgxx();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeXcrwjcxzgxx.setXxbh(xcrwjcxzgxxUuid);
|
|
|
|
|
//任务编号对应a_safe_xcrw的信息编号
|
|
|
|
|
aSafeXcrwjcx.setRwbh(xcrwuuid);
|
|
|
|
|
//描述 content todo
|
|
|
|
|
aSafeXcrwjcxzgxx.setRwbh(xcrwuuid);
|
|
|
|
|
//描述 content
|
|
|
|
|
aSafeXcrwjcxzgxx.setMs(b.getContent());
|
|
|
|
|
//巡查检查项编号 a_safe_xcrwjcx的XXBH
|
|
|
|
|
aSafeXcrwjcxzgxx.setXcjcxbh(xcrwjcxUuid);
|
|
|
|
|
//时间
|
|
|
|
@ -212,196 +273,448 @@ public class AcheckTaskController {
|
|
|
|
|
//是否合格
|
|
|
|
|
aSafeXcrwjcxzgxx.setSfhg(1);
|
|
|
|
|
//到期日期
|
|
|
|
|
aSafeXcrwjcxzgxx.setDqrq(a.getNeedFinalDateTime());
|
|
|
|
|
aSafeXcrwjcxzgxx.setDqrq(b.getNeedFinalDateTime());
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeXcrwjcxzgxx.setZqbh(rwzqUuid);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeXcrwjcxzgxx.setRkry(rybh);
|
|
|
|
|
aSafeXcrwjcxzgxx.setRkry(b.getRybh());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeXcrwjcxzgxx.setRksj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeXcrwjcxzgxx.setGxry(rybh);
|
|
|
|
|
aSafeXcrwjcxzgxx.setGxry(b.getRybh());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeXcrwjcxzgxx.setGxsj(new Date());
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeXcrwjcxzgxx.setJlzt(1);
|
|
|
|
|
aSafeXcrwjcxzgxxService.save(aSafeXcrwjcxzgxx);
|
|
|
|
|
/**
|
|
|
|
|
* 巡查任务位置 a_safe_xcrwwz
|
|
|
|
|
*/
|
|
|
|
|
ASafeXcrwwz aSafeXcrwwz = new ASafeXcrwwz();
|
|
|
|
|
//xxbh
|
|
|
|
|
aSafeXcrwwz.setXxbh(xcrwwzUuid);
|
|
|
|
|
//任务编号
|
|
|
|
|
aSafeXcrwwz.setRwbh(xcrwuuid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveXcrwJcx(ACheckQuatzEntity b, String xcrwjcxUuid, String enterPriseId, String xcrwuuid, String rwzqUuid) {
|
|
|
|
|
ASafeXcrwjcx aSafeXcrwjcx = new ASafeXcrwjcx();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeXcrwjcx.setXxbh(xcrwjcxUuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeXcrwjcx.setQybh(enterPriseId);
|
|
|
|
|
//任务编号对应a_safe_xcrw的信息编号
|
|
|
|
|
aSafeXcrwjcx.setRwbh(xcrwuuid);
|
|
|
|
|
//企业风险点编号 对应a_safe_fxd的信息编号
|
|
|
|
|
aSafeXcrwjcx.setQyfxdbh(b.getCheckId());
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeXcrwjcx.setZqbh(rwzqUuid);
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeXcrwwz.setWczt(1);
|
|
|
|
|
aSafeXcrwjcx.setWczt(1);
|
|
|
|
|
//检查项结果
|
|
|
|
|
aSafeXcrwjcx.setJcxjg(String.valueOf(1));
|
|
|
|
|
//隐患描述
|
|
|
|
|
aSafeXcrwjcx.setYhms(b.getDescription());
|
|
|
|
|
//检查时间
|
|
|
|
|
aSafeXcrwjcx.setJcsj(b.getReportDateTime());
|
|
|
|
|
//整改时间
|
|
|
|
|
aSafeXcrwjcx.setZgsj(b.getFinalDateTime());
|
|
|
|
|
//整改描述
|
|
|
|
|
aSafeXcrwjcx.setZgms(b.getContent());
|
|
|
|
|
//整改期限
|
|
|
|
|
aSafeXcrwjcx.setZgqx(b.getNeedFinalDateTime());
|
|
|
|
|
//整改状态
|
|
|
|
|
aSafeXcrwjcx.setZgzt(1);
|
|
|
|
|
//整改逾期
|
|
|
|
|
aSafeXcrwjcx.setZgyq(0);
|
|
|
|
|
//复查时间
|
|
|
|
|
aSafeXcrwjcx.setFcsj(b.getReviewDateTime());
|
|
|
|
|
//复查是否合格
|
|
|
|
|
aSafeXcrwjcx.setFcsfhg(1);
|
|
|
|
|
//复查期限
|
|
|
|
|
aSafeXcrwjcx.setFcqx(b.getReviewDateTime());
|
|
|
|
|
//复查逾期
|
|
|
|
|
aSafeXcrwjcx.setFcyq(0);
|
|
|
|
|
//复查状态
|
|
|
|
|
aSafeXcrwjcx.setFczt(1);
|
|
|
|
|
//是否重点检查项
|
|
|
|
|
aSafeXcrwjcx.setSfzdjcx(1);
|
|
|
|
|
//是否重点检查项
|
|
|
|
|
aSafeXcrwjcx.setSfzdjcx(1);
|
|
|
|
|
//历史整改逾期
|
|
|
|
|
aSafeXcrwjcx.setLszgyq(0);
|
|
|
|
|
//复查历史逾期
|
|
|
|
|
aSafeXcrwjcx.setFclsyq(0);
|
|
|
|
|
//复查信息
|
|
|
|
|
aSafeXcrwjcx.setFcxx(b.getReviewContent());
|
|
|
|
|
//位置编号
|
|
|
|
|
aSafeXcrwjcx.setWzbh(b.getWzxxbh());
|
|
|
|
|
//任务类型
|
|
|
|
|
aSafeXcrwjcx.setRwlx(3);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeXcrwjcx.setRkry(b.getRybh());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeXcrwwz.setRksj(new Date());
|
|
|
|
|
aSafeXcrwjcx.setRksj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeXcrwjcx.setGxry(b.getRybh());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeXcrwwz.setGxsj(new Date());
|
|
|
|
|
aSafeXcrwjcx.setGxsj(new Date());
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeXcrwwz.setJlzt(1);
|
|
|
|
|
aSafeXcrwwzService.save(aSafeXcrwwz);
|
|
|
|
|
/**
|
|
|
|
|
* 巡查风险点位置隐患 a_safe_yhzgxx
|
|
|
|
|
*/
|
|
|
|
|
ASafeYhzgxx aSafeYhzgxx = new ASafeYhzgxx();
|
|
|
|
|
aSafeXcrwjcx.setJlzt(1);
|
|
|
|
|
aSafeXcrwjcxService.save(aSafeXcrwjcx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveXcrw(List<ACheckQuatzRequest> list, ACheckQuatzRequest a, String xcrwuuid, String enterPriseId, String rwzqUuid) {
|
|
|
|
|
ASafeXcrw aSafeXcrw = new ASafeXcrw();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeYhzgxx.setXxbh(yhzgxxUuid);
|
|
|
|
|
//任务编号
|
|
|
|
|
aSafeYhzgxx.setRwbh(xcrwuuid);
|
|
|
|
|
aSafeXcrw.setXxbh(xcrwuuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeYhzgxx.setQybh(enterPriseId);
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeYhzgxx.setZqbh(null);
|
|
|
|
|
//企业风险点编号 对应a_safe_fxd的信息编号
|
|
|
|
|
if (a.getCheckId() != null) {
|
|
|
|
|
aSafeYhzgxx.setQyfxdbh(a.getCheckId());
|
|
|
|
|
}
|
|
|
|
|
//隐患来源
|
|
|
|
|
aSafeYhzgxx.setYhly("1");
|
|
|
|
|
aSafeXcrw.setQybh(enterPriseId);
|
|
|
|
|
//任务类型
|
|
|
|
|
aSafeXcrw.setRwlx("WGXC");
|
|
|
|
|
//巡查项
|
|
|
|
|
aSafeXcrw.setXcx(list.size());
|
|
|
|
|
//完成项
|
|
|
|
|
aSafeXcrw.setWcx(list.size());
|
|
|
|
|
//发现隐患数
|
|
|
|
|
aSafeXcrw.setFxyhs(list.size());
|
|
|
|
|
//检查时间
|
|
|
|
|
if (a.getReportDateTime() != null) {
|
|
|
|
|
aSafeYhzgxx.setJcsj(a.getReportDateTime());
|
|
|
|
|
aSafeXcrw.setJcsj(a.getReportDateTime());
|
|
|
|
|
} else {
|
|
|
|
|
aSafeYhzgxx.setJcsj(null);
|
|
|
|
|
aSafeXcrw.setJcsj(null);
|
|
|
|
|
}
|
|
|
|
|
//整改期限
|
|
|
|
|
aSafeYhzgxx.setZgqx(a.getNeedFinalDateTime());
|
|
|
|
|
//不合格检查项a_safe_xcrwjcx中JCXJG=1的数量
|
|
|
|
|
aSafeYhzgxx.setBhgjcx(0);
|
|
|
|
|
//整改时间 todo 隐患描述
|
|
|
|
|
//整改状态
|
|
|
|
|
aSafeYhzgxx.setZgzt(1);
|
|
|
|
|
//任务周期
|
|
|
|
|
aSafeXcrw.setZqbh(rwzqUuid);
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeXcrw.setWczt(1);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeYhzgxx.setRkry(rybh);
|
|
|
|
|
aSafeXcrw.setRkry(a.getRybh());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeYhzgxx.setRksj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeYhzgxx.setGxry(rybh);
|
|
|
|
|
aSafeXcrw.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeYhzgxx.setGxsj(new Date());
|
|
|
|
|
aSafeXcrw.setGxsj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeXcrw.setGxry(a.getRybh());
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeYhzgxx.setJlzt(1);
|
|
|
|
|
aSafeYhzgxxService.save(aSafeYhzgxx);
|
|
|
|
|
/**
|
|
|
|
|
* 附件表a_safe_rwfj todo 少字段
|
|
|
|
|
*/
|
|
|
|
|
aSafeXcrw.setJlzt(1);
|
|
|
|
|
//新增
|
|
|
|
|
aSafeXcrwService.save(aSafeXcrw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveRwzq(ACheckQuatzRequest a, String rwzqUuid) {
|
|
|
|
|
ASafeRwzq aSafeRwzq = new ASafeRwzq();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeRwzq.setXxbh(rwzqUuid);
|
|
|
|
|
//周期开始时间
|
|
|
|
|
aSafeRwzq.setZqkssj(a.getReportDateTime());
|
|
|
|
|
//周期结束时间
|
|
|
|
|
aSafeRwzq.setZqjssj(a.getFinalDateTime());
|
|
|
|
|
//任务类型,QYZC,WGXC,AJB,JNRY
|
|
|
|
|
aSafeRwzq.setRwlx("WGXC");
|
|
|
|
|
aSafeRwzq.setGxsj(new Date());
|
|
|
|
|
aSafeRwzq.setRksj(new Date());
|
|
|
|
|
aSafeRwzqService.save(aSafeRwzq);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveZgqTp(ACheckXcTpResponse zgq, String xcrwuuid, int xxsx) throws ParseException {
|
|
|
|
|
String rwfjUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
ASafeRwfj aSafeRwfj = new ASafeRwfj();
|
|
|
|
|
String api = "http://221.229.220.83:8007/api/";
|
|
|
|
|
aSafeRwfj.setXxbh(rwfjUuid);
|
|
|
|
|
//附件名称
|
|
|
|
|
aSafeRwfj.setFjmc(zgq.getFileName());
|
|
|
|
|
//附件后缀
|
|
|
|
|
aSafeRwfj.setFjhz(zgq.getContentType());
|
|
|
|
|
//关联父级编号
|
|
|
|
|
aSafeRwfj.setPid(xcrwuuid);
|
|
|
|
|
//附件地址
|
|
|
|
|
if (a.getRelativePath() != null) {
|
|
|
|
|
aSafeRwfj.setFjdz(api + a.getRelativePath());
|
|
|
|
|
}
|
|
|
|
|
aSafeRwfj.setFjdz(api + zgq.getRelativePath());
|
|
|
|
|
//文件类型
|
|
|
|
|
aSafeRwfj.setWjlx("ZGQTP");
|
|
|
|
|
//关联父级编号 自查巡查任务主表的XXBH
|
|
|
|
|
aSafeRwfj.setPid(xcrwuuid);
|
|
|
|
|
//显示顺序 todo
|
|
|
|
|
int b = 0;
|
|
|
|
|
aSafeRwfj.setXssx(b++);
|
|
|
|
|
//显示顺序
|
|
|
|
|
aSafeRwfj.setXssx(xxsx++);
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeRwfj.setJlzt(1);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeRwfj.setRkry(zgq.getAddUserName());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeRwfj.setRksj(new Date());
|
|
|
|
|
String dateString = zgq.getAddDateTime();
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
Date date = format.parse(dateString);
|
|
|
|
|
aSafeRwfj.setRksj(date);
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeRwfj.setGxsj(new Date());
|
|
|
|
|
aSafeRwfj.setGxsj(date);
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeRwfj.setGxry(zgq.getAddUserName());
|
|
|
|
|
aSafeRwfjService.save(aSafeRwfj);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void svaeZghTp(ACheckXcTpResponse zgh, String xcrwuuid, int xxsx) throws ParseException {
|
|
|
|
|
String rwfjUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
ASafeRwfj aSafeRwfj = new ASafeRwfj();
|
|
|
|
|
|
|
|
|
|
aSafeRwfj.setXxbh(rwfjUuid);
|
|
|
|
|
//附件名称
|
|
|
|
|
aSafeRwfj.setFjmc(zgh.getFileName());
|
|
|
|
|
//附件后缀
|
|
|
|
|
aSafeRwfj.setFjhz(zgh.getContentType());
|
|
|
|
|
//关联父级编号
|
|
|
|
|
aSafeRwfj.setPid(xcrwuuid);
|
|
|
|
|
//附件地址
|
|
|
|
|
aSafeRwfj.setFjdz(api + zgh.getRelativePath());
|
|
|
|
|
//文件类型
|
|
|
|
|
aSafeRwfj.setWjlx("ZGHTP");
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeRwfj.setJlzt(1);
|
|
|
|
|
//显示顺序
|
|
|
|
|
aSafeRwfj.setXssx(xxsx++);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeRwfj.setRkry(zgh.getAddUserName());
|
|
|
|
|
//入库时间
|
|
|
|
|
String dateString = zgh.getAddDateTime();
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
Date date = format.parse(dateString);
|
|
|
|
|
aSafeRwfj.setRksj(date);
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeRwfj.setGxsj(date);
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeRwfj.setGxry(zgh.getAddUserName());
|
|
|
|
|
aSafeRwfjService.save(aSafeRwfj);
|
|
|
|
|
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/ziChainsert")
|
|
|
|
|
@ApiOperation(value = "自查")
|
|
|
|
|
public AjaxResult zicha(@RequestBody List<ACheckQuatzZichaRequest> list) {
|
|
|
|
|
public AjaxResult zicha(@RequestBody List<ACheckQuatzZichaRequest> list) throws ParseException {
|
|
|
|
|
for (ACheckQuatzZichaRequest a : list) {
|
|
|
|
|
String rwzqUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String zcrwUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
/**
|
|
|
|
|
*新增任务周期a_safe_rwzq
|
|
|
|
|
*/
|
|
|
|
|
saveRwzq(a, rwzqUuid);
|
|
|
|
|
/**
|
|
|
|
|
* 自查任务 a_safe_zcrw
|
|
|
|
|
*/
|
|
|
|
|
String zcrwUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
saveZcrw(a, zcrwUuid, rwzqUuid);
|
|
|
|
|
for (ACheckQuatzZichaEntity b : a.getList()) {
|
|
|
|
|
String zcrwjlUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String zcrwwzUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
String zcyhxxUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
ASafeZcrw aSafeZcrw = new ASafeZcrw();
|
|
|
|
|
aSafeZcrw.setXxbh(zcrwUuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeZcrw.setQybh(a.getEnterpriseID());
|
|
|
|
|
//自查项 小的listsize
|
|
|
|
|
aSafeZcrw.setZcx(list.size());
|
|
|
|
|
//完成项
|
|
|
|
|
aSafeZcrw.setWcx(list.size());
|
|
|
|
|
//发现隐患数
|
|
|
|
|
aSafeZcrw.setFxyhs(list.size());
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeZcrw.setWczt(1);
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeZcrw.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeZcrw.setGxsj(new Date());
|
|
|
|
|
aSafeZcrwService.save(aSafeZcrw);
|
|
|
|
|
/**
|
|
|
|
|
* 自查任务检查项记录 a_safe_zcrwjl
|
|
|
|
|
* 附件表a_safe_rwfj
|
|
|
|
|
*/
|
|
|
|
|
ASafeZcrwjl aSafeZcrwjl = new ASafeZcrwjl();
|
|
|
|
|
aSafeZcrwjl.setXxbh(zcrwjlUuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeZcrwjl.setQybh(a.getEnterpriseID());
|
|
|
|
|
//任务编号
|
|
|
|
|
aSafeZcrwjl.setRwbh(zcrwUuid);
|
|
|
|
|
//企业风险点编号
|
|
|
|
|
aSafeZcrwjl.setQyfxdbh(a.getCheckId());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeZcrwjl.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeZcrwjl.setGxsj(new Date());//todo 完成状态
|
|
|
|
|
//是否发现隐患 todo
|
|
|
|
|
//AddDateTime 检查时间
|
|
|
|
|
//检查时间
|
|
|
|
|
// AddUserNamere人员
|
|
|
|
|
//市风险点编号 todo
|
|
|
|
|
//content 隐患描述
|
|
|
|
|
aSafeZcrwjlService.save(aSafeZcrwjl);
|
|
|
|
|
//根据工单获取数据
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("imageRelationID", b.getImgId());
|
|
|
|
|
String response = HttpRequest.post(zcUrl)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.body(jsonObject.toJSONString())
|
|
|
|
|
.execute()
|
|
|
|
|
.body();
|
|
|
|
|
JSONObject jsonResponse = JSON.parseObject(response);
|
|
|
|
|
// 提取数据
|
|
|
|
|
String data = jsonResponse.getString("data");
|
|
|
|
|
JSONObject json = JSONObject.parseObject(data);
|
|
|
|
|
Object zgqtpListObj = json.get("zcList");
|
|
|
|
|
String zgqtpListStr = JSONObject.toJSONString(zgqtpListObj);
|
|
|
|
|
int xxsx = 0;
|
|
|
|
|
List<ACheckXcTpResponse> zgqTpList = JSON.parseArray(zgqtpListStr, ACheckXcTpResponse.class);
|
|
|
|
|
for (ACheckXcTpResponse zc : zgqTpList) {
|
|
|
|
|
/**
|
|
|
|
|
* 自查整改前图片
|
|
|
|
|
*/
|
|
|
|
|
saveZczgqTp(zc, zcrwUuid, xxsx);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
*自查任务位置表a_safe_zcrwwz
|
|
|
|
|
*/
|
|
|
|
|
ASafeZcrwwz aSafeZcrwwz = new ASafeZcrwwz();
|
|
|
|
|
aSafeZcrwwz.setXxbh(zcrwwzUuid);
|
|
|
|
|
aSafeZcrwwz.setQybh(a.getEnterpriseID());
|
|
|
|
|
aSafeZcrwwz.setRwbh(zcrwUuid);
|
|
|
|
|
//市风险点编号 todo
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeZcrwwz.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeZcrwwz.setGxsj(new Date());
|
|
|
|
|
aSafeZcrwwz.setJlzt(1);
|
|
|
|
|
aSafeZcrwwzService.save(aSafeZcrwwz);
|
|
|
|
|
saveZcRwwz(a, b, zcrwwzUuid, zcrwUuid, rwzqUuid);
|
|
|
|
|
/**
|
|
|
|
|
* 自查任务检查项记录 a_safe_zcrwjl
|
|
|
|
|
*/
|
|
|
|
|
saveZcrwjl(b, zcrwjlUuid, zcrwUuid, rwzqUuid, zcrwwzUuid);
|
|
|
|
|
/**
|
|
|
|
|
* 自查任务隐患/整改 szs_a_safe_zcyhxx同巡查信息
|
|
|
|
|
*/
|
|
|
|
|
saveZcyHxx(a, b, zcyhxxUuid, zcrwUuid, zcrwjlUuid, rwzqUuid);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveZcyHxx(ACheckQuatzZichaRequest a, ACheckQuatzZichaEntity b, String zcyhxxUuid, String zcrwUuid, String zcrwjlUuid, String rwzqUuid) {
|
|
|
|
|
SzsASafeZcyhxx szsASafeZcyhxx = new SzsASafeZcyhxx();
|
|
|
|
|
//信息编号
|
|
|
|
|
szsASafeZcyhxx.setXxbh(zcyhxxUuid);
|
|
|
|
|
//任务编号对应a_safe_xcrw的信息编号
|
|
|
|
|
szsASafeZcyhxx.setRwbh(zcrwUuid);
|
|
|
|
|
//描述 content
|
|
|
|
|
szsASafeZcyhxx.setMs(b.getContent());
|
|
|
|
|
//巡查检查项编号 a_safe_xcrwjcx的XXBH
|
|
|
|
|
szsASafeZcyhxx.setXcjcxbh(zcrwjlUuid);
|
|
|
|
|
//时间
|
|
|
|
|
szsASafeZcyhxx.setSj(a.getReportDateTime());
|
|
|
|
|
//类型
|
|
|
|
|
szsASafeZcyhxx.setSjlx("ZG");
|
|
|
|
|
//时间 todo时间必填
|
|
|
|
|
szsASafeZcyhxx.setSj(new Date());
|
|
|
|
|
szsASafeZcyhxx.setSjlx("FC");
|
|
|
|
|
//是否合格
|
|
|
|
|
szsASafeZcyhxx.setSfhg(1);
|
|
|
|
|
|
|
|
|
|
//周期编号
|
|
|
|
|
szsASafeZcyhxx.setZqbh(rwzqUuid);
|
|
|
|
|
//入库人员
|
|
|
|
|
szsASafeZcyhxx.setRkry(b.getAddUserID());
|
|
|
|
|
//入库时间
|
|
|
|
|
szsASafeZcyhxx.setRksj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
szsASafeZcyhxx.setGxry(b.getAddUserID());
|
|
|
|
|
//更新时间
|
|
|
|
|
szsASafeZcyhxx.setGxsj(new Date());
|
|
|
|
|
//记录状态
|
|
|
|
|
szsASafeZcyhxx.setJlzt(1);
|
|
|
|
|
szsASafeZcyhxxService.save(szsASafeZcyhxx);
|
|
|
|
|
}
|
|
|
|
|
return success();
|
|
|
|
|
|
|
|
|
|
private void saveZcrwjl(ACheckQuatzZichaEntity b, String zcrwjlUuid, String zcrwUuid, String rwzqUuid, String zcrwwzUuid) {
|
|
|
|
|
ASafeZcrwjl aSafeZcrwjl = new ASafeZcrwjl();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeZcrwjl.setXxbh(zcrwjlUuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeZcrwjl.setQybh(b.getEnterpriseID());
|
|
|
|
|
//任务编号
|
|
|
|
|
aSafeZcrwjl.setRwbh(zcrwUuid);
|
|
|
|
|
//企业风险点编号
|
|
|
|
|
aSafeZcrwjl.setQyfxdbh(b.getFxdbh());
|
|
|
|
|
//企业风险点位置编号
|
|
|
|
|
aSafeZcrwjl.setQyfxdwzbh(b.getFxbh());
|
|
|
|
|
//是否发现隐患
|
|
|
|
|
aSafeZcrwjl.setSffxyh(0);
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeZcrwjl.setWczt(1);
|
|
|
|
|
//检查时间
|
|
|
|
|
aSafeZcrwjl.setJcsj(b.getAddDateTime());
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeZcrwjl.setZqbh(rwzqUuid);
|
|
|
|
|
//位置编号
|
|
|
|
|
aSafeZcrwjl.setWzbh(b.getWzbh());
|
|
|
|
|
//自查任务位置编号
|
|
|
|
|
aSafeZcrwjl.setZcrwwzbh(zcrwwzUuid);
|
|
|
|
|
//设备数量
|
|
|
|
|
aSafeZcrwjl.setSbsl(b.getSbsl());
|
|
|
|
|
//检查状态
|
|
|
|
|
aSafeZcrwjl.setJczt(1);
|
|
|
|
|
//是否检查
|
|
|
|
|
aSafeZcrwjl.setSfjc(1);
|
|
|
|
|
//是否采取有限管控措施
|
|
|
|
|
aSafeZcrwjl.setSfcqyxgkcs(1);
|
|
|
|
|
//隐患描述
|
|
|
|
|
aSafeZcrwjl.setYhms(b.getContent());
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeZcrwjl.setRkry(b.getAddUserID());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeZcrwjl.setRksj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeZcrwjl.setGxry(b.getAddUserID());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeZcrwjl.setGxsj(new Date());
|
|
|
|
|
// 完成状态
|
|
|
|
|
aSafeZcrwjl.setWczt(1);
|
|
|
|
|
aSafeZcrwjlService.save(aSafeZcrwjl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveZcRwwz(ACheckQuatzZichaRequest a, ACheckQuatzZichaEntity b, String zcrwwzUuid, String zcrwUuid, String rwzqUuid) {
|
|
|
|
|
ASafeZcrwwz aSafeZcrwwz = new ASafeZcrwwz();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeZcrwwz.setXxbh(zcrwwzUuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeZcrwwz.setQybh(a.getEnterpriseID());
|
|
|
|
|
//任务编号
|
|
|
|
|
aSafeZcrwwz.setRwbh(zcrwUuid);
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeZcrwwz.setZqbh(rwzqUuid);
|
|
|
|
|
//市风险点编号
|
|
|
|
|
aSafeZcrwwz.setSfxdbh(b.getSfxdbh());
|
|
|
|
|
//位置编号
|
|
|
|
|
aSafeZcrwwz.setWzbh(b.getWzbh());
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeZcrwwz.setRkry(b.getAddUserID());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeZcrwwz.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeZcrwwz.setGxsj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeZcrwwz.setGxry(b.getAddUserID());
|
|
|
|
|
aSafeZcrwwz.setJlzt(1);
|
|
|
|
|
aSafeZcrwwzService.save(aSafeZcrwwz);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveZczgqTp(ACheckXcTpResponse zc, String zcrwUuid, int xxsx) throws ParseException {
|
|
|
|
|
String rwfjUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
|
ASafeRwfj aSafeRwfj = new ASafeRwfj();
|
|
|
|
|
aSafeRwfj.setXxbh(rwfjUuid);
|
|
|
|
|
//附件名称
|
|
|
|
|
aSafeRwfj.setFjmc(zc.getFileName());
|
|
|
|
|
//附件后缀
|
|
|
|
|
aSafeRwfj.setFjhz(zc.getContentType());
|
|
|
|
|
//关联父级编号
|
|
|
|
|
aSafeRwfj.setPid(zcrwUuid);
|
|
|
|
|
//附件地址
|
|
|
|
|
aSafeRwfj.setFjdz(api + zc.getRelativePath());
|
|
|
|
|
//文件类型
|
|
|
|
|
aSafeRwfj.setWjlx("ZGQTP");
|
|
|
|
|
//记录状态
|
|
|
|
|
aSafeRwfj.setJlzt(1);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeRwfj.setRkry(zc.getAddUserName());
|
|
|
|
|
//入库时间
|
|
|
|
|
String dateString = zc.getAddDateTime();
|
|
|
|
|
SimpleDateFormat zcformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
Date zcdate = zcformat.parse(dateString);
|
|
|
|
|
aSafeRwfj.setRksj(zcdate);
|
|
|
|
|
//显示顺序
|
|
|
|
|
aSafeRwfj.setXssx(xxsx++);
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeRwfj.setGxsj(zcdate);
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeRwfj.setGxry(zc.getAddUserName());
|
|
|
|
|
aSafeRwfjService.save(aSafeRwfj);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveZcrw(ACheckQuatzZichaRequest a, String zcrwUuid, String rwzqUuid) {
|
|
|
|
|
ASafeZcrw aSafeZcrw = new ASafeZcrw();
|
|
|
|
|
aSafeZcrw.setXxbh(zcrwUuid);
|
|
|
|
|
//企业编号
|
|
|
|
|
aSafeZcrw.setQybh(a.getEnterpriseID());
|
|
|
|
|
//自查项
|
|
|
|
|
aSafeZcrw.setZcx(a.getList().size());
|
|
|
|
|
//完成项
|
|
|
|
|
aSafeZcrw.setWcx(a.getList().size());
|
|
|
|
|
//周期编号
|
|
|
|
|
aSafeZcrw.setZqbh(rwzqUuid);
|
|
|
|
|
//发现隐患数
|
|
|
|
|
aSafeZcrw.setFxyhs(a.getList().size());
|
|
|
|
|
//完成状态
|
|
|
|
|
aSafeZcrw.setWczt(1);
|
|
|
|
|
//入库人员
|
|
|
|
|
aSafeZcrw.setRkry(a.getAddUserID());
|
|
|
|
|
//入库时间
|
|
|
|
|
aSafeZcrw.setRksj(new Date());
|
|
|
|
|
//更新时间
|
|
|
|
|
aSafeZcrw.setGxsj(new Date());
|
|
|
|
|
//更新人员
|
|
|
|
|
aSafeZcrw.setGxry(a.getAddUserID());
|
|
|
|
|
aSafeZcrwService.save(aSafeZcrw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveRwzq(ACheckQuatzZichaRequest a, String rwzqUuid) {
|
|
|
|
|
ASafeRwzq aSafeRwzq = new ASafeRwzq();
|
|
|
|
|
//信息编号
|
|
|
|
|
aSafeRwzq.setXxbh(rwzqUuid);
|
|
|
|
|
//周期开始时间
|
|
|
|
|
aSafeRwzq.setZqkssj(a.getReportDateTime());
|
|
|
|
|
//周期结束时间
|
|
|
|
|
aSafeRwzq.setZqjssj(a.getEndDateTime());
|
|
|
|
|
//任务类型,QYZC,WGXC,AJB,JNRY
|
|
|
|
|
aSafeRwzq.setRwlx("QYZC");
|
|
|
|
|
aSafeRwzq.setGxsj(new Date());
|
|
|
|
|
aSafeRwzq.setRksj(new Date());
|
|
|
|
|
aSafeRwzqService.save(aSafeRwzq);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|