查询自查任务主表1个月内是否有记录

查询巡查任务主表2个月内是否有记录
main
dongdingding 8 months ago
parent a4e200c09e
commit 1f9a399dd9

@ -16,8 +16,8 @@ public interface ASafeXcrwMapper extends BaseMapper<ASafeXcrw> {
/**
* 2
*/
@Select("select count(*) from a_safe_xcrw where rksj BETWEEN DATE_SUB( CURDATE(), INTERVAL 2 MONTH ) AND CURDATE()")
Integer xcrwNum();
@Select("select count(*) from a_safe_xcrw where rksj BETWEEN DATE_SUB( CURDATE(), INTERVAL 2 MONTH ) AND CURDATE() and qybh=#{enterPriseId} ")
Integer xcrwNum(String enterPriseId);
}

@ -17,8 +17,8 @@ public interface ASafeZcrwMapper extends BaseMapper<ASafeZcrw> {
* 1
*/
@Select("select count(*) from a_safe_zcrw where rksj BETWEEN DATE_SUB( CURDATE(), INTERVAL 1 MONTH ) AND CURDATE() ")
Integer zcrwNum();
@Select("select count(*) from a_safe_zcrw where rksj BETWEEN DATE_SUB( CURDATE(), INTERVAL 1 MONTH ) AND CURDATE() and qybh =#{enterPriseId} ")
Integer zcrwNum(String enterPriseId);
}

@ -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);

@ -16,7 +16,7 @@ public interface ASafeXcrwService extends IService<ASafeXcrw> {
* 2
*/
Integer xcrwNum();
Integer xcrwNum(String enterPriseId);
}

@ -15,7 +15,7 @@ public interface ASafeZcrwService extends IService<ASafeZcrw> {
* 1
*/
Integer zcrwNum();
Integer zcrwNum(String enterPriseId);
}

@ -19,9 +19,10 @@ public class ASafeXcrwServiceImpl extends ServiceImpl<ASafeXcrwMapper, ASafeXcrw
@Resource
private ASafeXcrwMapper aSafeXcrwMapper;
@Override
public Integer xcrwNum() {
return aSafeXcrwMapper.xcrwNum();
public Integer xcrwNum(String enterPriseId) {
return aSafeXcrwMapper.xcrwNum(enterPriseId);
}
}

@ -21,8 +21,8 @@ public class ASafeZcrwServiceImpl extends ServiceImpl<ASafeZcrwMapper, ASafeZcrw
private ASafeZcrwMapper aSafeZcrwMapper;
@Override
public Integer zcrwNum() {
return aSafeZcrwMapper.zcrwNum();
public Integer zcrwNum(String enterPriseId) {
return aSafeZcrwMapper.zcrwNum(enterPriseId);
}
}

@ -5,3 +5,8 @@ spring:
active: prod
# 日志配置
logging:
level:
com.ruoyi: info
org.springframework: info

Loading…
Cancel
Save