From beb0889edd56a86ea763c415fb01deaaa1aad0fa Mon Sep 17 00:00:00 2001
From: dongdingding <207595406@qq.com>
Date: Thu, 21 Mar 2024 16:52:40 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BE=9B=E6=A3=80=E6=9F=A5=E7=82=B9?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E6=BA=90=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=95=B0=E6=8D=AE=E4=B8=8A?=
=?UTF-8?q?=E6=8A=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 5 +
.../controller/ASafeQyjcxxController.java | 12 +
.../mudu/controller/AcheckTaskController.java | 899 ++++++++++++------
.../com/mudu/entity/ACheckQuatzEntity.java | 84 +-
.../mudu/entity/ACheckQuatzZichaEntity.java | 119 +++
src/main/java/com/mudu/entity/ASafeRwfj.java | 1 -
.../dto/request/ACheckQuatzRequest.java | 68 +-
.../dto/request/ACheckQuatzZichaRequest.java | 48 +-
.../dto/response/ACheckQuatzXcTpResponse.java | 45 +
.../entity/dto/response/ACheckResponse.java | 27 +
.../dto/response/ACheckXcTpResponse.java | 49 +
src/main/resources/application-dev.yml | 45 +
src/main/resources/application-prod.yml | 45 +
src/main/resources/application.yml | 29 +-
.../resources/mapper/mudu/ACheckMapper.xml | 14 +-
15 files changed, 1094 insertions(+), 396 deletions(-)
create mode 100644 src/main/java/com/mudu/entity/ACheckQuatzZichaEntity.java
create mode 100644 src/main/java/com/mudu/entity/dto/response/ACheckQuatzXcTpResponse.java
create mode 100644 src/main/java/com/mudu/entity/dto/response/ACheckXcTpResponse.java
create mode 100644 src/main/resources/application-dev.yml
create mode 100644 src/main/resources/application-prod.yml
diff --git a/pom.xml b/pom.xml
index 684e418..2e08d05 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,6 +53,11 @@
hutool-all
5.8.16
+
+ com.alibaba.fastjson2
+ fastjson2
+ 2.0.41
+
diff --git a/src/main/java/com/mudu/controller/ASafeQyjcxxController.java b/src/main/java/com/mudu/controller/ASafeQyjcxxController.java
index c99647d..0c0e81f 100644
--- a/src/main/java/com/mudu/controller/ASafeQyjcxxController.java
+++ b/src/main/java/com/mudu/controller/ASafeQyjcxxController.java
@@ -113,5 +113,17 @@ public class ASafeQyjcxxController extends BaseController {
aSafeQyjcxxService.dataSynchronous();
return success();
}
+
+
+ /**
+ * 获取企业xxbh
+ *
+ * @return 响应类
+ */
+ @GetMapping("/getQyXxbh")
+ @ApiOperation(value = "获取企业xxbh")
+ public AjaxResult getQyXxbh(@RequestParam("qymc") String qymc, @RequestParam("xybm") String xybm) {
+ return success(aSafeQyjcxxService.findOneByqymcOrXybm(qymc,xybm));
+ }
}
diff --git a/src/main/java/com/mudu/controller/AcheckTaskController.java b/src/main/java/com/mudu/controller/AcheckTaskController.java
index edb5c6f..fc0c3b5 100644
--- a/src/main/java/com/mudu/controller/AcheckTaskController.java
+++ b/src/main/java/com/mudu/controller/AcheckTaskController.java
@@ -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,328 +104,617 @@ public class AcheckTaskController {
*/
@PostMapping("/insert")
@ApiOperation(value = "新增创建时间为昨天且处于审批通过的工单数据")
- public AjaxResult selectAll(@RequestBody List list) {
+ public AjaxResult selectAll(@RequestBody List list) throws ParseException {
for (ACheckQuatzRequest a : list) {
+ String rwzqUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
String xcrwuuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
- 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();
+ 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 zgqTpList = JSON.parseArray(zgqtpListStr, ACheckXcTpResponse.class);
+ List zghtpList = JSON.parseArray(zghtpListStr, ACheckXcTpResponse.class);
+ int xxsx = 0;
/**
- * 新增巡查信息表 a_safe_xcrw
+ * 附件表a_safe_rwfj
*/
- 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);
+ for (ACheckXcTpResponse zgq : zgqTpList) {
+ /**
+ * 新增整改前任务附件
+ */
+ saveZgqTp(zgq, xcrwuuid, xxsx);
}
- //完成状态
- 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
- */
- 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("测试");
- }
- //周期编号 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);
+ for (ACheckXcTpResponse zgh : zghtpList) {
+ /**
+ * 新增整改后任务附件
+ */
+ svaeZghTp(zgh, xcrwuuid, xxsx);
}
- //整改时间 todo 整改完成时间
- if (a.getReportDateTime() != null) {
- aSafeXcrwjcx.setZgsj(a.getReportDateTime());
- } else {
- aSafeXcrwjcx.setZgsj(null);
- }
- //整改描述 todo
- //整改期限
- aSafeXcrwjcx.setZgqx(a.getNeedFinalDateTime());
- //整改状态
- 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);
- //入库人员
- aSafeXcrwjcx.setRkry(rybh);
- //入库时间
- aSafeXcrwjcx.setRksj(new Date());
- //更新人员
- aSafeXcrwjcx.setGxry(rybh);
- //更新时间
- aSafeXcrwjcx.setGxsj(new Date());
- //记录状态
- aSafeXcrwjcx.setJlzt(1);
- aSafeXcrwjcxService.save(aSafeXcrwjcx);
/**
- * 巡查任务隐患整改/隐患复查 a_safe_xcrwjcxzgxx
- */
- ASafeXcrwjcxzgxx aSafeXcrwjcxzgxx = new ASafeXcrwjcxzgxx();
- //信息编号
- aSafeXcrwjcxzgxx.setXxbh(xcrwjcxzgxxUuid);
- //任务编号对应a_safe_xcrw的信息编号
- aSafeXcrwjcx.setRwbh(xcrwuuid);
- //描述 content todo
- //巡查检查项编号 a_safe_xcrwjcx的XXBH
- aSafeXcrwjcxzgxx.setXcjcxbh(xcrwjcxUuid);
- //时间
- aSafeXcrwjcxzgxx.setSj(a.getFinalDateTime());
- //类型
- aSafeXcrwjcxzgxx.setSjlx("ZG");
- //是否合格
- aSafeXcrwjcxzgxx.setSfhg(1);
- //到期日期
- aSafeXcrwjcxzgxx.setDqrq(a.getNeedFinalDateTime());
- //入库人员
- aSafeXcrwjcxzgxx.setRkry(rybh);
- //入库时间
- aSafeXcrwjcxzgxx.setRksj(new Date());
- //更新人员
- aSafeXcrwjcxzgxx.setGxry(rybh);
- //更新时间
- aSafeXcrwjcxzgxx.setGxsj(new Date());
- //记录状态
- aSafeXcrwjcxzgxx.setJlzt(1);
- aSafeXcrwjcxzgxxService.save(aSafeXcrwjcxzgxx);
- /**
- * 巡查任务位置 a_safe_xcrwwz
+ *新增任务周期a_safe_rwzq
*/
- ASafeXcrwwz aSafeXcrwwz = new ASafeXcrwwz();
- //xxbh
- aSafeXcrwwz.setXxbh(xcrwwzUuid);
- //任务编号
- aSafeXcrwwz.setRwbh(xcrwuuid);
- //完成状态
- aSafeXcrwwz.setWczt(1);
- //入库时间
- aSafeXcrwwz.setRksj(new Date());
- //更新时间
- aSafeXcrwwz.setGxsj(new Date());
- //记录状态
- aSafeXcrwwz.setJlzt(1);
- aSafeXcrwwzService.save(aSafeXcrwwz);
+ saveRwzq(a, rwzqUuid);
/**
- * 巡查风险点位置隐患 a_safe_yhzgxx
- */
- ASafeYhzgxx aSafeYhzgxx = new ASafeYhzgxx();
- //信息编号
- aSafeYhzgxx.setXxbh(yhzgxxUuid);
- //任务编号
- aSafeYhzgxx.setRwbh(xcrwuuid);
- //企业编号
- aSafeYhzgxx.setQybh(enterPriseId);
- //周期编号
- aSafeYhzgxx.setZqbh(null);
- //企业风险点编号 对应a_safe_fxd的信息编号
- if (a.getCheckId() != null) {
- aSafeYhzgxx.setQyfxdbh(a.getCheckId());
- }
- //隐患来源
- aSafeYhzgxx.setYhly("1");
- //检查时间
- if (a.getReportDateTime() != null) {
- aSafeYhzgxx.setJcsj(a.getReportDateTime());
- } else {
- aSafeYhzgxx.setJcsj(null);
- }
- //整改期限
- aSafeYhzgxx.setZgqx(a.getNeedFinalDateTime());
- //不合格检查项a_safe_xcrwjcx中JCXJG=1的数量
- aSafeYhzgxx.setBhgjcx(0);
- //整改时间 todo 隐患描述
- //整改状态
- aSafeYhzgxx.setZgzt(1);
- //入库人员
- aSafeYhzgxx.setRkry(rybh);
- //入库时间
- aSafeYhzgxx.setRksj(new Date());
- //更新人员
- aSafeYhzgxx.setGxry(rybh);
- //更新时间
- aSafeYhzgxx.setGxsj(new Date());
- //记录状态
- aSafeYhzgxx.setJlzt(1);
- aSafeYhzgxxService.save(aSafeYhzgxx);
- /**
- * 附件表a_safe_rwfj todo 少字段
+ * 新增巡查信息表 a_safe_xcrw
*/
- ASafeRwfj aSafeRwfj = new ASafeRwfj();
- String api = "http://221.229.220.83:8007/api/";
- aSafeRwfj.setXxbh(rwfjUuid);
- //附件地址
- if (a.getRelativePath() != null) {
- aSafeRwfj.setFjdz(api + a.getRelativePath());
+ 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();
+ /**
+ * 巡查任务检查项记录 a_safe_xcrwjcx
+ */
+ saveXcrwJcx(b, xcrwjcxUuid, enterPriseId, xcrwuuid, rwzqUuid);
+
+ /**
+ * 巡查任务隐患整改/隐患复查 a_safe_xcrwjcxzgxx
+ */
+ 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);
+
}
- //文件类型
- aSafeRwfj.setWjlx("ZGQTP");
- //关联父级编号 自查巡查任务主表的XXBH
- aSafeRwfj.setPid(xcrwuuid);
- //显示顺序 todo
- int b = 0;
- aSafeRwfj.setXssx(b++);
- //记录状态
- aSafeRwfj.setJlzt(1);
- //入库时间
- aSafeRwfj.setRksj(new Date());
- //更新时间
- aSafeRwfj.setGxsj(new Date());
- aSafeRwfjService.save(aSafeRwfj);
+ }
+
+ return success();
+ }
+
+ private void saveYhzgxx(List 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());
+ //整改期限
+ 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());
+ //整改状态
+ aSafeYhzgxx.setZgzt(1);
+ //入库人员
+ aSafeYhzgxx.setRkry(b.getRybh());
+ //入库时间
+ aSafeYhzgxx.setRksj(new Date());
+ //更新人员
+ aSafeYhzgxx.setGxry(b.getRybh());
+ //更新时间
+ aSafeYhzgxx.setGxsj(new Date());
+ //记录状态
+ aSafeYhzgxx.setJlzt(1);
+ aSafeYhzgxxService.save(aSafeYhzgxx);
+ }
+
+ 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的信息编号
+ aSafeXcrwjcxzgxx.setRwbh(xcrwuuid);
+ //描述 content
+ aSafeXcrwjcxzgxx.setMs(b.getContent());
+ //巡查检查项编号 a_safe_xcrwjcx的XXBH
+ aSafeXcrwjcxzgxx.setXcjcxbh(xcrwjcxUuid);
+ //时间
+ aSafeXcrwjcxzgxx.setSj(a.getFinalDateTime());
+ //类型
+ aSafeXcrwjcxzgxx.setSjlx("ZG");
+ //是否合格
+ aSafeXcrwjcxzgxx.setSfhg(1);
+ //到期日期
+ aSafeXcrwjcxzgxx.setDqrq(b.getNeedFinalDateTime());
+ //周期编号
+ aSafeXcrwjcxzgxx.setZqbh(rwzqUuid);
+ //入库人员
+ aSafeXcrwjcxzgxx.setRkry(b.getRybh());
+ //入库时间
+ aSafeXcrwjcxzgxx.setRksj(new Date());
+ //更新人员
+ aSafeXcrwjcxzgxx.setGxry(b.getRybh());
+ //更新时间
+ aSafeXcrwjcxzgxx.setGxsj(new Date());
+ //记录状态
+ aSafeXcrwjcxzgxx.setJlzt(1);
+ aSafeXcrwjcxzgxxService.save(aSafeXcrwjcxzgxx);
+ }
+
+ 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);
+ //完成状态
+ 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());
+ //入库时间
+ aSafeXcrwjcx.setRksj(new Date());
+ //更新人员
+ aSafeXcrwjcx.setGxry(b.getRybh());
+ //更新时间
+ aSafeXcrwjcx.setGxsj(new Date());
+ //记录状态
+ aSafeXcrwjcx.setJlzt(1);
+ aSafeXcrwjcxService.save(aSafeXcrwjcx);
+ }
+ private void saveXcrw(List list, ACheckQuatzRequest a, String xcrwuuid, String enterPriseId, String rwzqUuid) {
+ 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);
}
+ //任务周期
+ aSafeXcrw.setZqbh(rwzqUuid);
+ //完成状态
+ aSafeXcrw.setWczt(1);
+ //入库人员
+ aSafeXcrw.setRkry(a.getRybh());
+ //入库时间
+ aSafeXcrw.setRksj(new Date());
+ //更新时间
+ aSafeXcrw.setGxsj(new Date());
+ //更新人员
+ aSafeXcrw.setGxry(a.getRybh());
+ //记录状态
+ 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();
+ aSafeRwfj.setXxbh(rwfjUuid);
+ //附件名称
+ aSafeRwfj.setFjmc(zgq.getFileName());
+ //附件后缀
+ aSafeRwfj.setFjhz(zgq.getContentType());
+ //关联父级编号
+ aSafeRwfj.setPid(xcrwuuid);
+ //附件地址
+ aSafeRwfj.setFjdz(api + zgq.getRelativePath());
+ //文件类型
+ aSafeRwfj.setWjlx("ZGQTP");
+ //显示顺序
+ aSafeRwfj.setXssx(xxsx++);
+ //记录状态
+ aSafeRwfj.setJlzt(1);
+ //入库人员
+ aSafeRwfj.setRkry(zgq.getAddUserName());
+ //入库时间
+ String dateString = zgq.getAddDateTime();
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date date = format.parse(dateString);
+ aSafeRwfj.setRksj(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 list) {
+ public AjaxResult zicha(@RequestBody List list) throws ParseException {
for (ACheckQuatzZichaRequest a : list) {
- /**
- * 自查任务 a_safe_zcrw
- */
+ String rwzqUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
String zcrwUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
- 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_rwzq
*/
- 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);
+ saveRwzq(a, rwzqUuid);
/**
- *自查任务位置表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);
- /**
- * 自查任务隐患/整改 szs_a_safe_zcyhxx同巡查信息
+ * 自查任务 a_safe_zcrw
*/
- SzsASafeZcyhxx szsASafeZcyhxx = new SzsASafeZcyhxx();
- //信息编号
- szsASafeZcyhxx.setXxbh(zcyhxxUuid);
- //任务编号对应a_safe_xcrw的信息编号
- szsASafeZcyhxx.setRwbh(zcrwUuid);
- //巡查检查项编号 a_safe_xcrwjcx的XXBH
- szsASafeZcyhxx.setXcjcxbh(zcrwjlUuid);
- //类型
- szsASafeZcyhxx.setSjlx("ZG");
- //时间 todo时间必填
- szsASafeZcyhxx.setSj(new Date());
- //是否合格
- szsASafeZcyhxx.setSfhg(1);
- //入库时间
- szsASafeZcyhxx.setRksj(new Date());
- //更新时间
- szsASafeZcyhxx.setGxsj(new Date());
- //记录状态
- szsASafeZcyhxx.setJlzt(1);
- szsASafeZcyhxxService.save(szsASafeZcyhxx);
+ 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();
+ /**
+ * 附件表a_safe_rwfj
+ */
+ //根据工单获取数据
+ 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 zgqTpList = JSON.parseArray(zgqtpListStr, ACheckXcTpResponse.class);
+ for (ACheckXcTpResponse zc : zgqTpList) {
+ /**
+ * 自查整改前图片
+ */
+ saveZczgqTp(zc, zcrwUuid, xxsx);
+ }
+ /**
+ *自查任务位置表a_safe_zcrwwz
+ */
+ 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("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);
+ }
+
+ 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);
+ }
+
+
}
diff --git a/src/main/java/com/mudu/entity/ACheckQuatzEntity.java b/src/main/java/com/mudu/entity/ACheckQuatzEntity.java
index db9c149..d740a93 100644
--- a/src/main/java/com/mudu/entity/ACheckQuatzEntity.java
+++ b/src/main/java/com/mudu/entity/ACheckQuatzEntity.java
@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
-import java.time.LocalDateTime;
+import java.util.Date;
/**
@@ -16,19 +16,28 @@ import java.time.LocalDateTime;
@Data
@ApiModel("定时任务实体类")
public class ACheckQuatzEntity {
-
/**
* 工单id
*/
- @ApiModelProperty(value = "归属地")
- private String locationName;
-
+ @ApiModelProperty(value = "工单id")
+ private String improvingNo;
/**
- * 企业名称
+ * 企业编号
*/
@ApiModelProperty(value = "企业名称")
- private String enterpriseName;
+ private String name;
+ /**
+ * 企业信用代码
+ */
+ @ApiModelProperty(value = "企业信用代码")
+ private String entCode;
+
+ /**
+ * 人员编号
+ */
+ @ApiModelProperty(value = "人员编号")
+ private String rybh;
/**
* 整改是否完成(-2专家拒绝,-1是需要专家复查未完成,0未成,1全部完成)
@@ -42,29 +51,70 @@ public class ACheckQuatzEntity {
@ApiModelProperty("上报时间(如果巡查一起提交,获取巡查的巡查日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime ReportDateTime;
+ private Date reportDateTime;
/**
- * 上报人
+ * 隐患内容
*/
- @ApiModelProperty(value = "上报人")
- private String ReportPersonName;
+ @ApiModelProperty(value = "隐患内容")
+ private String description;
+
/**
- * 隐患内容
+ * 风险点id
*/
- @ApiModelProperty(value = "隐患内容")
- private String Description;
+ @ApiModelProperty(value = "风险点id")
+ private String checkId;
+
+ /**
+ * 整改完成日期
+ */
+ @ApiModelProperty("整改完成日期")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date FinalDateTime;
+ /**
+ * 整改要求完成日期
+ */
+ @ApiModelProperty("整改要求完成日期")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date NeedFinalDateTime;
/**
- * 现场图片
+ * 复查日期
*/
- @ApiModelProperty(value = "现场图片")
- private String RelativePath;
+ @ApiModelProperty("复查日期")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date reviewDateTime;
+ /**
+ * 整改描述
+ */
+ @ApiModelProperty(value = "整改描述")
+ private String content;
+
+ /**
+ * 复查情况
+ */
+ @ApiModelProperty(value = "复查情况")
+ private String reviewContent;
+
+
+ /**
+ * 位置编号
+ */
+ @ApiModelProperty(value = "位置编号")
+ private String wzxxbh;
+ /**
+ * 位置名称
+ */
+ @ApiModelProperty(value = "位置名称")
+ private String wzmc;
}
diff --git a/src/main/java/com/mudu/entity/ACheckQuatzZichaEntity.java b/src/main/java/com/mudu/entity/ACheckQuatzZichaEntity.java
new file mode 100644
index 0000000..b51a323
--- /dev/null
+++ b/src/main/java/com/mudu/entity/ACheckQuatzZichaEntity.java
@@ -0,0 +1,119 @@
+package com.mudu.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @author dong
+ * @since 2024/3/14 13:21
+ */
+@Data
+@ApiModel("定时任务自查实体类")
+public class ACheckQuatzZichaEntity {
+
+ /**
+ * 企业id
+ */
+ @ApiModelProperty(value = "企业id")
+ private String enterpriseID;
+
+
+ /**
+ * 工单id
+ */
+ @ApiModelProperty(value = "工单id")
+ private String taskId;
+
+
+ /**
+ * 风险点id
+ */
+ @ApiModelProperty(value = "风险点id")
+ private String checkId;
+
+ /**
+ * 风险点id
+ */
+ @ApiModelProperty(value = "人员id")
+ private String addUserID;
+
+
+ /**
+ * 风险点位置编号
+ */
+ @ApiModelProperty(value = "企业风险点位置编号")
+ private String fxbh;
+
+ /**
+ * 市风险点位置编号
+ */
+ @ApiModelProperty(value = "市风险点位置编号")
+ private String sfxdbh;
+
+
+ /**
+ * 企业风险位置编号
+ */
+ @ApiModelProperty(value = "企业风险位置编号")
+ private String wzbh;
+
+
+ /**
+ * 设备数量
+ */
+ @ApiModelProperty(value = "设备数量")
+ private Integer sbsl;
+
+
+ /**
+ * 风险点编号
+ */
+ @ApiModelProperty(value = "风险点编号")
+ private String fxdbh;
+
+ /**
+ * 内容
+ */
+ @ApiModelProperty(value = "内容")
+ private String content;
+
+
+ /**
+ * 图片id
+ */
+ @ApiModelProperty(value = "图片id")
+ private String imgId;
+
+ /**
+ * 创建时间
+ */
+ @ApiModelProperty("上报时间")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date reportDateTime;
+
+
+ /**
+ * 检查时间
+ */
+ @ApiModelProperty("检查时间")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date addDateTime;
+
+
+
+ /**
+ * 检查时间
+ */
+ @ApiModelProperty("结束时间")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date endDateTime;
+
+}
diff --git a/src/main/java/com/mudu/entity/ASafeRwfj.java b/src/main/java/com/mudu/entity/ASafeRwfj.java
index 1232396..8103be0 100644
--- a/src/main/java/com/mudu/entity/ASafeRwfj.java
+++ b/src/main/java/com/mudu/entity/ASafeRwfj.java
@@ -5,7 +5,6 @@ import java.util.Date;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
diff --git a/src/main/java/com/mudu/entity/dto/request/ACheckQuatzRequest.java b/src/main/java/com/mudu/entity/dto/request/ACheckQuatzRequest.java
index b7e1ab2..bf6946d 100644
--- a/src/main/java/com/mudu/entity/dto/request/ACheckQuatzRequest.java
+++ b/src/main/java/com/mudu/entity/dto/request/ACheckQuatzRequest.java
@@ -1,37 +1,31 @@
package com.mudu.entity.dto.request;
import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.mudu.entity.ACheckQuatzEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
-
+import java.util.List;
/**
* @author dong
- * @since 2024/3/12 14:18
+ * @since 2024/3/18 14:23
*/
@Data
-@ApiModel("定时任务请求类")
+@ApiModel("定时任务巡查请求类")
public class ACheckQuatzRequest {
-
-
/**
- * 归属地
+ * 工单id
*/
- @ApiModelProperty(value = "归属地")
- private String locationName;
+ @ApiModelProperty(value = "工单id")
+ private String improvingNo;
- /**
- * 企业编号
- */
- @ApiModelProperty(value = "企业编号")
- private String enterpriseID;
-
/**
* 人员编号
*/
@@ -39,10 +33,16 @@ public class ACheckQuatzRequest {
private String rybh;
/**
- * 整改是否完成(-2专家拒绝,-1是需要专家复查未完成,0未成,1全部完成)
+ * 企业编号
+ */
+ @ApiModelProperty(value = "企业名称")
+ private String name;
+
+ /**
+ * 企业信用代码
*/
- @ApiModelProperty(value = "整改是否完成(-2专家拒绝,-1是需要专家复查未完成,0未成,1全部完成)")
- private String isFinal;
+ @ApiModelProperty(value = "企业信用代码")
+ private String entCode;
/**
* 创建时间
@@ -52,42 +52,16 @@ public class ACheckQuatzRequest {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date reportDateTime;
-
-
- /**
- * 隐患内容
- */
- @ApiModelProperty(value = "隐患内容")
- private String description;
-
-
- /**
- * 现场图片
- */
- @ApiModelProperty(value = "现场图片")
- private String relativePath;
-
- /**
- * 风险点id
- */
- @ApiModelProperty(value = "风险点id")
- private String checkId;
-
-
/**
* 整改完成日期
*/
@ApiModelProperty("整改完成日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Date FinalDateTime;
-
+ private Date finalDateTime;
/**
- * 整改要求完成日期
+ * 定时任务请求类
*/
- @ApiModelProperty("整改要求完成日期")
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Date NeedFinalDateTime;
-
+ @ApiModelProperty(value = "定时任务巡查请求类")
+ List list;
}
diff --git a/src/main/java/com/mudu/entity/dto/request/ACheckQuatzZichaRequest.java b/src/main/java/com/mudu/entity/dto/request/ACheckQuatzZichaRequest.java
index 0ae8570..409ef4b 100644
--- a/src/main/java/com/mudu/entity/dto/request/ACheckQuatzZichaRequest.java
+++ b/src/main/java/com/mudu/entity/dto/request/ACheckQuatzZichaRequest.java
@@ -1,23 +1,24 @@
package com.mudu.entity.dto.request;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.mudu.entity.ACheckQuatzZichaEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
/**
* @author dong
- * @since 2024/3/14 13:21
+ * @since 2024/3/20 14:06
*/
@Data
-@ApiModel("定时任务自查实体类")
+@ApiModel("定时任务自查请求类")
public class ACheckQuatzZichaRequest {
- /**
- * 企业id
- */
- @ApiModelProperty(value = "企业id")
- private String EnterpriseID;
-
/**
* 工单id
@@ -26,9 +27,36 @@ public class ACheckQuatzZichaRequest {
private String taskId;
+ /**
+ * 企业id
+ */
+ @ApiModelProperty(value = "企业id")
+ private String enterpriseID;
+
/**
* 风险点id
*/
- @ApiModelProperty(value = "风险点id")
- private String checkId;
+ @ApiModelProperty(value = "人员id")
+ private String addUserID;
+
+ /**
+ * 创建时间
+ */
+ @ApiModelProperty("上报时间")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date reportDateTime;
+ /**
+ * 检查时间
+ */
+ @ApiModelProperty("结束时间")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date endDateTime;
+
+ /**
+ * 定时任务自查实体类
+ */
+ @ApiModelProperty(value = "定时任务自查实体类")
+ List list;
}
diff --git a/src/main/java/com/mudu/entity/dto/response/ACheckQuatzXcTpResponse.java b/src/main/java/com/mudu/entity/dto/response/ACheckQuatzXcTpResponse.java
new file mode 100644
index 0000000..7855b34
--- /dev/null
+++ b/src/main/java/com/mudu/entity/dto/response/ACheckQuatzXcTpResponse.java
@@ -0,0 +1,45 @@
+package com.mudu.entity.dto.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author dong
+ * @since 2024/3/20 16:53
+ */
+@Data
+@ApiModel("巡查图片响应类")
+public class ACheckQuatzXcTpResponse {
+
+
+ /**
+ * 整改前照片
+ */
+ @ApiModelProperty(value = "整改前照片编号")
+ private String zgqzp;
+
+
+ /**
+ * 整改后照片
+ */
+ @ApiModelProperty(value = "整改后照片编号")
+ private String zghzp;
+
+ /**
+ * 整改前照片
+ */
+ @ApiModelProperty(value = "整改前照片集合")
+ List zgqzpList;
+
+
+ /**
+ * 整改后照片集合
+ */
+ @ApiModelProperty(value = "整改后照片集合")
+ List zghzpList;
+
+
+}
diff --git a/src/main/java/com/mudu/entity/dto/response/ACheckResponse.java b/src/main/java/com/mudu/entity/dto/response/ACheckResponse.java
index 7c2c452..287c32a 100644
--- a/src/main/java/com/mudu/entity/dto/response/ACheckResponse.java
+++ b/src/main/java/com/mudu/entity/dto/response/ACheckResponse.java
@@ -24,4 +24,31 @@ public class ACheckResponse {
@ApiModelProperty(value = "信息编号")
private String xxbh;
+
+ /**
+ * 风险等级VALUE
+ */
+ @ApiModelProperty(value = "风险等级VALUE")
+ private String fxValue;
+
+
+ /**
+ * 附件信息编号
+ */
+ @ApiModelProperty(value = "附件信息编号")
+ private String fjXxbh;
+
+
+ /**
+ * 附件地址
+ */
+ @ApiModelProperty(value = "附件地址")
+ private String fjdz;
+
+
+ /**
+ * 位置名称
+ */
+ @ApiModelProperty(value = "位置名称")
+ private String wzmc;
}
diff --git a/src/main/java/com/mudu/entity/dto/response/ACheckXcTpResponse.java b/src/main/java/com/mudu/entity/dto/response/ACheckXcTpResponse.java
new file mode 100644
index 0000000..deee2aa
--- /dev/null
+++ b/src/main/java/com/mudu/entity/dto/response/ACheckXcTpResponse.java
@@ -0,0 +1,49 @@
+package com.mudu.entity.dto.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author dong
+ * @since 2024/3/20 18:09
+ */
+@Data
+@ApiModel(value = "图片响应类")
+public class ACheckXcTpResponse {
+
+
+ /**
+ * 文件名称
+ */
+ @ApiModelProperty(value = "文件名称")
+ private String fileName;
+
+ /**
+ * 文件类型
+ */
+ @ApiModelProperty(value = "文件类型")
+ private String contentType;
+
+
+ /**
+ * 文件地址
+ */
+ @ApiModelProperty(value = "文件地址")
+ private String relativePath;
+
+
+ /**
+ * 添加人
+ */
+ @ApiModelProperty(value = "添加人")
+ private String addUserName;
+
+
+
+ /**
+ * 添加时间
+ */
+ @ApiModelProperty(value = "添加时间")
+ private String addDateTime;
+}
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..0cb40ba
--- /dev/null
+++ b/src/main/resources/application-dev.yml
@@ -0,0 +1,45 @@
+
+# DataSource Config
+spring:
+ datasource:
+ url: jdbc:mysql://localhost:3306/mudu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ username: root
+ password: adminadmin
+ #公司本地
+# url: jdbc:mysql://localhost:3307/mudu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+# username: root
+# password: Admin123@
+ driverClassName: com.mysql.cj.jdbc.Driver
+
+
+
+# 日志配置
+logging:
+ level:
+ com.mudu: debug
+ org.springframework: warn
+
+# MyBatis配置
+mybatis-plus:
+ # 指定实体类所在包的路径,MyBatis-Plus 会自动扫描该路径下的实体类
+ typeAliasesPackage: com.mudu.entity
+ # 指定 Mapper 接口所在包的路径,MyBatis-Plus 会自动扫描该路径下的 Mapper 接口
+ mapperLocations: classpath*:mapper/mudu/*Mapper.xml
+
+knife4j:
+ enable: true
+ openapi:
+ group:
+ test1:
+ group-name: 木渎
+
+url: http://localhost:9028
+
+#工单url
+improveUrl: http://localhost:9028/mudu/quatz/xctp
+#自查url
+zcUrl: http://localhost:9028/mudu/quatz/zctp
+#图片路径
+api: http://221.229.220.83:8007/api/
+
+
diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..0cb40ba
--- /dev/null
+++ b/src/main/resources/application-prod.yml
@@ -0,0 +1,45 @@
+
+# DataSource Config
+spring:
+ datasource:
+ url: jdbc:mysql://localhost:3306/mudu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ username: root
+ password: adminadmin
+ #公司本地
+# url: jdbc:mysql://localhost:3307/mudu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+# username: root
+# password: Admin123@
+ driverClassName: com.mysql.cj.jdbc.Driver
+
+
+
+# 日志配置
+logging:
+ level:
+ com.mudu: debug
+ org.springframework: warn
+
+# MyBatis配置
+mybatis-plus:
+ # 指定实体类所在包的路径,MyBatis-Plus 会自动扫描该路径下的实体类
+ typeAliasesPackage: com.mudu.entity
+ # 指定 Mapper 接口所在包的路径,MyBatis-Plus 会自动扫描该路径下的 Mapper 接口
+ mapperLocations: classpath*:mapper/mudu/*Mapper.xml
+
+knife4j:
+ enable: true
+ openapi:
+ group:
+ test1:
+ group-name: 木渎
+
+url: http://localhost:9028
+
+#工单url
+improveUrl: http://localhost:9028/mudu/quatz/xctp
+#自查url
+zcUrl: http://localhost:9028/mudu/quatz/zctp
+#图片路径
+api: http://221.229.220.83:8007/api/
+
+
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index a139503..7013f18 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,32 +1,7 @@
server:
port: 9998
-
-# DataSource Config
spring:
- datasource:
- url: jdbc:mysql://localhost:3306/db_jiangning_umale?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
- username: root
- password: adminadmin
- driverClassName: com.mysql.cj.jdbc.Driver
-
-# 日志配置
-logging:
- level:
- com.mudu: debug
- org.springframework: warn
-
-# MyBatis配置
-mybatis-plus:
- # 指定实体类所在包的路径,MyBatis-Plus 会自动扫描该路径下的实体类
- typeAliasesPackage: com.mudu.entity
- # 指定 Mapper 接口所在包的路径,MyBatis-Plus 会自动扫描该路径下的 Mapper 接口
- mapperLocations: classpath*:mapper/mudu/*Mapper.xml
+ profiles:
+ active: prod
-knife4j:
- enable: true
- openapi:
- group:
- test1:
- group-name: 木渎
-url: http://localhost:9028
\ No newline at end of file
diff --git a/src/main/resources/mapper/mudu/ACheckMapper.xml b/src/main/resources/mapper/mudu/ACheckMapper.xml
index e6e60cd..f23e64c 100644
--- a/src/main/resources/mapper/mudu/ACheckMapper.xml
+++ b/src/main/resources/mapper/mudu/ACheckMapper.xml
@@ -6,7 +6,19 @@