|
|
|
@ -11,11 +11,16 @@ 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 io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
@ -28,12 +33,12 @@ import java.util.UUID;
|
|
|
|
|
* @author dong
|
|
|
|
|
* @since 2024/3/12 16:37
|
|
|
|
|
*/
|
|
|
|
|
//@RestController
|
|
|
|
|
//@RequestMapping("pharmaceuticals/aCheck")
|
|
|
|
|
//@Api(tags = "新增")
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Configuration
|
|
|
|
|
@EnableScheduling
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("pharmaceuticals/aCheck")
|
|
|
|
|
@Api(tags = "新增")
|
|
|
|
|
//@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
//@Configuration
|
|
|
|
|
//@EnableScheduling
|
|
|
|
|
public class AcheckTaskQuartz {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -121,16 +126,12 @@ public class AcheckTaskQuartz {
|
|
|
|
|
*
|
|
|
|
|
* @Param qymc 企业名称
|
|
|
|
|
*/
|
|
|
|
|
@Scheduled(cron = "0 0 4 * * ? ")
|
|
|
|
|
// @Scheduled(cron = "0 0 4 * * ? ")
|
|
|
|
|
// @Scheduled(cron = "0 0/5 * * * ?")
|
|
|
|
|
// @PostMapping("/insert")
|
|
|
|
|
// @ApiOperation(value = "新增创建时间为昨天且处于审批通过的工单数据")
|
|
|
|
|
@PostMapping("/insert")
|
|
|
|
|
@ApiOperation(value = "新增创建时间为昨天且处于审批通过的工单数据")
|
|
|
|
|
public void selectAll() throws ParseException {
|
|
|
|
|
// todo 查询巡查任务主表2月是否有记录就不推
|
|
|
|
|
Integer xcrwNum = aSafeXcrwService.xcrwNum();
|
|
|
|
|
if (xcrwNum > 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//巡查任务周期id
|
|
|
|
|
RwzqUuidResponse rwzqUuidResponse = aSafeRwzqService.getXcUuid();
|
|
|
|
|
String rwzqUuid = rwzqUuidResponse.getXxbh();
|
|
|
|
@ -148,6 +149,11 @@ public class AcheckTaskQuartz {
|
|
|
|
|
//获取企业编号
|
|
|
|
|
ASafeQyjcxx aSafeQyjcxx = aSafeQyjcxxService.findOneByqymcOrXybm(a.getName(), a.getEntCode());
|
|
|
|
|
String enterPriseId = aSafeQyjcxx.getXxbh();
|
|
|
|
|
// todo 查询巡查任务主表2月是否有记录就不推
|
|
|
|
|
Integer xcrwNum = aSafeXcrwService.xcrwNum(enterPriseId);
|
|
|
|
|
if (xcrwNum > 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// todo 来自新表查询 根据企业xxbh 以及周期编号
|
|
|
|
|
JSONObject xcjsonObject = new JSONObject();
|
|
|
|
|
xcjsonObject.put("qybh", aSafeQyjcxx.getXxbh());
|
|
|
|
@ -589,17 +595,13 @@ public class AcheckTaskQuartz {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 4 * * ? ")
|
|
|
|
|
// @Scheduled(cron = "0 0 4 * * ? ")
|
|
|
|
|
// @Scheduled(cron = "0 0/5 * * * ?")
|
|
|
|
|
//@Scheduled(cron = "0 58 18 * * ?")
|
|
|
|
|
// @PostMapping("/zicha")
|
|
|
|
|
// @ApiOperation(value = "自查")
|
|
|
|
|
@PostMapping("/zicha")
|
|
|
|
|
@ApiOperation(value = "自查")
|
|
|
|
|
public void zicha() throws ParseException {
|
|
|
|
|
// todo 查询自查任务主表本月是否有记录 有就不推
|
|
|
|
|
Integer zcrwNum = aSafeZcrwService.zcrwNum();
|
|
|
|
|
if (zcrwNum > 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//自己查任务周期id
|
|
|
|
|
RwzqUuidResponse rwzqUuidResponse = aSafeRwzqService.getZcUuid();
|
|
|
|
|
String rwzqUuid = rwzqUuidResponse.getXxbh();
|
|
|
|
@ -614,6 +616,11 @@ public class AcheckTaskQuartz {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (ACheckQuatzZichaRequest a : list) {
|
|
|
|
|
// todo 查询自查任务主表本月是否有记录 有就不推
|
|
|
|
|
Integer zcrwNum = aSafeZcrwService.zcrwNum(a.getEnterpriseID());
|
|
|
|
|
if (zcrwNum > 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
JSONObject zcjsonObject = new JSONObject();
|
|
|
|
|
zcjsonObject.put("qybh", a.getEnterpriseID());
|
|
|
|
|
zcjsonObject.put("zqbh", rwzqUuid);
|
|
|
|
|