|
|
|
@ -5,12 +5,41 @@ import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.mudu.entity.*;
|
|
|
|
|
import com.mudu.entity.ACheckQuatzEntity;
|
|
|
|
|
import com.mudu.entity.ACheckQuatzZichaEntity;
|
|
|
|
|
import com.mudu.entity.ASafeQyjcxx;
|
|
|
|
|
import com.mudu.entity.ASafeRwfj;
|
|
|
|
|
import com.mudu.entity.ASafeRwzq;
|
|
|
|
|
import com.mudu.entity.ASafeTfg;
|
|
|
|
|
import com.mudu.entity.ASafeTfgsh;
|
|
|
|
|
import com.mudu.entity.ASafeXcrw;
|
|
|
|
|
import com.mudu.entity.ASafeXcrwjcx;
|
|
|
|
|
import com.mudu.entity.ASafeXcrwjcxzgxx;
|
|
|
|
|
import com.mudu.entity.ASafeXcrwwz;
|
|
|
|
|
import com.mudu.entity.ASafeYhzgxx;
|
|
|
|
|
import com.mudu.entity.ASafeZcrw;
|
|
|
|
|
import com.mudu.entity.ASafeZcrwjl;
|
|
|
|
|
import com.mudu.entity.ASafeZcrwwz;
|
|
|
|
|
import com.mudu.entity.SzsASafeZcyhxx;
|
|
|
|
|
import com.mudu.entity.dto.request.ACheckQuatzRequest;
|
|
|
|
|
import com.mudu.entity.dto.request.ACheckQuatzZichaRequest;
|
|
|
|
|
import com.mudu.entity.dto.response.ACheckXcTpResponse;
|
|
|
|
|
import com.mudu.entity.dto.response.RwzqUuidResponse;
|
|
|
|
|
import com.mudu.service.*;
|
|
|
|
|
import com.mudu.service.ASafeQyjcxxService;
|
|
|
|
|
import com.mudu.service.ASafeRwfjService;
|
|
|
|
|
import com.mudu.service.ASafeRwzqService;
|
|
|
|
|
import com.mudu.service.ASafeTfgService;
|
|
|
|
|
import com.mudu.service.ASafeTfgshService;
|
|
|
|
|
import com.mudu.service.ASafeXcrwService;
|
|
|
|
|
import com.mudu.service.ASafeXcrwjcxService;
|
|
|
|
|
import com.mudu.service.ASafeXcrwjcxzgxxService;
|
|
|
|
|
import com.mudu.service.ASafeXcrwwzService;
|
|
|
|
|
import com.mudu.service.ASafeYhzgxxService;
|
|
|
|
|
import com.mudu.service.ASafeZcrwService;
|
|
|
|
|
import com.mudu.service.ASafeZcrwjlService;
|
|
|
|
|
import com.mudu.service.ASafeZcrwwzService;
|
|
|
|
|
import com.mudu.service.SzsASafeZcyhxxService;
|
|
|
|
|
import com.mudu.service.impl.LoginService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
@ -88,9 +117,13 @@ public class AcheckTaskQuartz {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ASafeTfgshService aSafeTfgshService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ASafeRwzqService aSafeRwzqService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private LoginService loginService;
|
|
|
|
|
|
|
|
|
|
@Value("${improveUrl}")
|
|
|
|
|
private String url;
|
|
|
|
|
|
|
|
|
@ -115,17 +148,28 @@ public class AcheckTaskQuartz {
|
|
|
|
|
@Value("${tfgUrl}")
|
|
|
|
|
private String tfgUrl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 木渎二期token
|
|
|
|
|
*/
|
|
|
|
|
private String token;
|
|
|
|
|
|
|
|
|
|
private void getToken() {
|
|
|
|
|
token = "Bearer " + loginService.getToken();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增创建时间为昨天且处于审批通过的工单数据
|
|
|
|
|
*
|
|
|
|
|
* @Param qymc 企业名称
|
|
|
|
|
*/
|
|
|
|
|
@Scheduled(cron = "0 0 4 * * ? ")
|
|
|
|
|
// @Scheduled(cron = "0 0 4 * * ? ")
|
|
|
|
|
// @Scheduled(cron = "0 0/5 * * * ?")
|
|
|
|
|
// @PostMapping("/insert")
|
|
|
|
|
// @ApiOperation(value = "新增创建时间为昨天且处于审批通过的工单数据")
|
|
|
|
|
public void selectAll() throws ParseException {
|
|
|
|
|
// 获取token
|
|
|
|
|
getToken();
|
|
|
|
|
// todo 查询巡查任务主表2月是否有记录就不推
|
|
|
|
|
Integer xcrwNum = aSafeXcrwService.xcrwNum();
|
|
|
|
|
if (xcrwNum > 0) {
|
|
|
|
@ -134,7 +178,10 @@ public class AcheckTaskQuartz {
|
|
|
|
|
//巡查任务周期id
|
|
|
|
|
RwzqUuidResponse rwzqUuidResponse = aSafeRwzqService.getXcUuid();
|
|
|
|
|
String rwzqUuid = rwzqUuidResponse.getXxbh();
|
|
|
|
|
String responseList = HttpRequest.post(imUrl).contentType("application/x-www-form-urlencoded;charset=UTF-8").execute().body();
|
|
|
|
|
String responseList = HttpRequest.post(imUrl)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
.execute().body();
|
|
|
|
|
JSONObject jsonResponseList = JSON.parseObject(responseList);
|
|
|
|
|
String dataList = jsonResponseList.getString("data");
|
|
|
|
|
if (StrUtil.isEmpty(dataList)) {
|
|
|
|
@ -152,7 +199,11 @@ public class AcheckTaskQuartz {
|
|
|
|
|
JSONObject xcjsonObject = new JSONObject();
|
|
|
|
|
xcjsonObject.put("qybh", aSafeQyjcxx.getXxbh());
|
|
|
|
|
xcjsonObject.put("zqbh", rwzqUuid);
|
|
|
|
|
String xcresponse = HttpRequest.post(xczqUrl).contentType("application/x-www-form-urlencoded;charset=UTF-8").body(xcjsonObject.toJSONString()).execute().body();
|
|
|
|
|
String xcresponse = HttpRequest.post(xczqUrl)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
.body(xcjsonObject.toJSONString())
|
|
|
|
|
.execute().body();
|
|
|
|
|
JSONObject xcjsonResponse = JSON.parseObject(xcresponse);
|
|
|
|
|
if (xcjsonResponse.getString("msg") == null) {
|
|
|
|
|
continue;
|
|
|
|
@ -162,7 +213,11 @@ public class AcheckTaskQuartz {
|
|
|
|
|
//根据工单获取数据
|
|
|
|
|
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();
|
|
|
|
|
String response = HttpRequest.post(url)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
.body(jsonObject.toJSONString())
|
|
|
|
|
.execute().body();
|
|
|
|
|
JSONObject jsonResponse = JSON.parseObject(response);
|
|
|
|
|
// 提取数据
|
|
|
|
|
String data = jsonResponse.getString("data");
|
|
|
|
@ -603,7 +658,10 @@ public class AcheckTaskQuartz {
|
|
|
|
|
//自己查任务周期id
|
|
|
|
|
RwzqUuidResponse rwzqUuidResponse = aSafeRwzqService.getZcUuid();
|
|
|
|
|
String rwzqUuid = rwzqUuidResponse.getXxbh();
|
|
|
|
|
String responseList = HttpRequest.post(zcXxUrl).contentType("application/x-www-form-urlencoded;charset=UTF-8").execute().body();
|
|
|
|
|
String responseList = HttpRequest.post(zcXxUrl)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
.execute().body();
|
|
|
|
|
JSONObject jsonResponseList = JSON.parseObject(responseList);
|
|
|
|
|
String dataList = jsonResponseList.getString("data");
|
|
|
|
|
if (StrUtil.isEmpty(dataList)) {
|
|
|
|
@ -617,7 +675,11 @@ public class AcheckTaskQuartz {
|
|
|
|
|
JSONObject zcjsonObject = new JSONObject();
|
|
|
|
|
zcjsonObject.put("qybh", a.getEnterpriseID());
|
|
|
|
|
zcjsonObject.put("zqbh", rwzqUuid);
|
|
|
|
|
String zcresponse = HttpRequest.post(zczqUrl).contentType("application/x-www-form-urlencoded;charset=UTF-8").body(zcjsonObject.toJSONString()).execute().body();
|
|
|
|
|
String zcresponse = HttpRequest.post(zczqUrl)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
.body(zcjsonObject.toJSONString())
|
|
|
|
|
.execute().body();
|
|
|
|
|
JSONObject zcjsonResponse = JSON.parseObject(zcresponse);
|
|
|
|
|
if (zcjsonResponse.getString("msg") == null) {
|
|
|
|
|
continue;
|
|
|
|
@ -643,7 +705,11 @@ public class AcheckTaskQuartz {
|
|
|
|
|
//根据工单获取数据
|
|
|
|
|
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();
|
|
|
|
|
String response = HttpRequest.post(zcUrl)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
.body(jsonObject.toJSONString())
|
|
|
|
|
.execute().body();
|
|
|
|
|
JSONObject jsonResponse = JSON.parseObject(response);
|
|
|
|
|
// 提取数据
|
|
|
|
|
String data = jsonResponse.getString("data");
|
|
|
|
@ -974,7 +1040,10 @@ public class AcheckTaskQuartz {
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String currentTimeString = dateFormat.format(currentDate);
|
|
|
|
|
//停复工表推送
|
|
|
|
|
String responseList = HttpRequest.get(tfgUrl).header("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8").execute().body();
|
|
|
|
|
String responseList = HttpRequest.get(tfgUrl)
|
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
.execute().body();
|
|
|
|
|
JSONObject jsonResponseList = JSON.parseObject(responseList);
|
|
|
|
|
String dataList = jsonResponseList.getString("rows");
|
|
|
|
|
if (StrUtil.isEmpty(dataList)) {
|
|
|
|
|