|
|
@ -37,12 +37,12 @@ import java.util.UUID;
|
|
|
|
* @author dong
|
|
|
|
* @author dong
|
|
|
|
* @since 2024/3/12 16:37
|
|
|
|
* @since 2024/3/12 16:37
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
//@RestController
|
|
|
|
@RestController
|
|
|
|
//@RequestMapping("pharmaceuticals/aCheck")
|
|
|
|
@RequestMapping("pharmaceuticals/aCheck")
|
|
|
|
//@Api(tags = "新增")
|
|
|
|
@Api(tags = "新增")
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
//@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Configuration
|
|
|
|
//@Configuration
|
|
|
|
@EnableScheduling
|
|
|
|
//@EnableScheduling
|
|
|
|
public class AcheckTaskQuartz {
|
|
|
|
public class AcheckTaskQuartz {
|
|
|
|
Logger logger = LoggerFactory.getLogger(AcheckTaskQuartz.class);
|
|
|
|
Logger logger = LoggerFactory.getLogger(AcheckTaskQuartz.class);
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -158,7 +158,9 @@ public class AcheckTaskQuartz {
|
|
|
|
String responseList = HttpRequest.post(imUrl)
|
|
|
|
String responseList = HttpRequest.post(imUrl)
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
|
|
|
|
.header("Authorization", token)
|
|
|
|
.header("Authorization", token)
|
|
|
|
|
|
|
|
// .timeout(60*1000*2)
|
|
|
|
.execute().body();
|
|
|
|
.execute().body();
|
|
|
|
|
|
|
|
logger.info(responseList);
|
|
|
|
JSONObject jsonResponseList = JSON.parseObject(responseList);
|
|
|
|
JSONObject jsonResponseList = JSON.parseObject(responseList);
|
|
|
|
logger.info(responseList);
|
|
|
|
logger.info(responseList);
|
|
|
|
String dataList = jsonResponseList.getString("data");
|
|
|
|
String dataList = jsonResponseList.getString("data");
|
|
|
@ -183,12 +185,7 @@ public class AcheckTaskQuartz {
|
|
|
|
enterPriseId = aSafeQyjcxx.getXxbh();
|
|
|
|
enterPriseId = aSafeQyjcxx.getXxbh();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// todo 查询巡查任务主表2月是否有记录就不推
|
|
|
|
|
|
|
|
Integer xcrwNum = aSafeXcrwService.xcrwNum(enterPriseId);
|
|
|
|
|
|
|
|
if (xcrwNum > 0) {
|
|
|
|
|
|
|
|
logger.info("查任务主表2月是否有记录就不推");
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// todo 来自新表查询 根据企业xxbh 以及周期编号
|
|
|
|
// todo 来自新表查询 根据企业xxbh 以及周期编号
|
|
|
|
JSONObject xcjsonObject = new JSONObject();
|
|
|
|
JSONObject xcjsonObject = new JSONObject();
|
|
|
|
xcjsonObject.put("qybh", aSafeQyjcxx.getXxbh());
|
|
|
|
xcjsonObject.put("qybh", aSafeQyjcxx.getXxbh());
|
|
|
@ -678,12 +675,7 @@ public class AcheckTaskQuartz {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (ACheckQuatzZichaRequest a : list) {
|
|
|
|
for (ACheckQuatzZichaRequest a : list) {
|
|
|
|
// todo 查询自查任务主表本月是否有记录 有就不推
|
|
|
|
|
|
|
|
Integer zcrwNum = aSafeZcrwService.zcrwNum(a.getEnterpriseID());
|
|
|
|
|
|
|
|
if (zcrwNum > 0) {
|
|
|
|
|
|
|
|
logger.info("查询自查任务主表本月是否有记录 有就不推");
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (a.getEnterpriseID() == null) {
|
|
|
|
if (a.getEnterpriseID() == null) {
|
|
|
|
logger.info("getEnterpriseID为空");
|
|
|
|
logger.info("getEnterpriseID为空");
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -698,7 +690,7 @@ public class AcheckTaskQuartz {
|
|
|
|
.body(zcjsonObject.toJSONString())
|
|
|
|
.body(zcjsonObject.toJSONString())
|
|
|
|
.execute().body();
|
|
|
|
.execute().body();
|
|
|
|
JSONObject zcjsonResponse = JSON.parseObject(zcresponse);
|
|
|
|
JSONObject zcjsonResponse = JSON.parseObject(zcresponse);
|
|
|
|
logger.info(JSONUtil.toJsonStr(zcjsonResponse));
|
|
|
|
|
|
|
|
if (zcjsonResponse.getString("msg") == null) {
|
|
|
|
if (zcjsonResponse.getString("msg") == null) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -711,7 +703,12 @@ public class AcheckTaskQuartz {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 自查任务 a_safe_zcrw
|
|
|
|
* 自查任务 a_safe_zcrw
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
try {
|
|
|
|
saveZcrw(a, zcrwUuid, rwzqUuid);
|
|
|
|
saveZcrw(a, zcrwUuid, rwzqUuid);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
logger.error("============" + a.getEnterpriseID() + "==============" + "============" + rwzqUuidResponse.getXxbh() + "==============");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (ACheckQuatzZichaEntity b : a.getList()) {
|
|
|
|
for (ACheckQuatzZichaEntity b : a.getList()) {
|
|
|
|
String zcrwjlUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
String zcrwjlUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
String zcrwwzUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|
String zcrwwzUuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
|
|
|