无关风月
14 小时以前 25b19e60e004290531f61fdf608d1adb5e531903
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInspectorController.java
@@ -19,6 +19,8 @@
import com.ruoyi.system.service.*;
import com.ruoyi.system.vo.system.InspectorListVO;
import com.ruoyi.system.vo.system.TaskListVO;
import com.ruoyi.web.controller.tool.EmailUtils;
import com.ruoyi.web.controller.tool.MsgUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook;
@@ -135,6 +137,10 @@
                }
                query.setLocationIds(collect);
            }
        }
        if (StringUtils.hasLength(query.getEndTime())){
            String replace = query.getEndTime().replace(" 00:00:00", " 23:59:59");
            query.setEndTime(replace);
        }
        return R.ok(inspectorService.pageList(query));
    }
@@ -254,10 +260,14 @@
    private TNoticeService noticeService;
    @Resource
    private TNoticeSetService noticeSetService;
    @Resource
    private TDictDataService dictDataService;
    @Resource
    private MsgUtils msgUtils;
    @Log(title = "审核任务", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "审核任务")
    @PostMapping(value = "/audit")
    public R<Boolean> audit(@RequestBody TInspectorAuditDTO dto) {
    public R<Boolean> audit(@RequestBody TInspectorAuditDTO dto) throws Exception {
        TTaskAuditDTO tTaskAuditDTO = new TTaskAuditDTO();
        BeanUtils.copyProperties(dto, tTaskAuditDTO);
        TTask task = taskCleanerService.getById(dto.getTaskId());
@@ -269,14 +279,32 @@
        tNotice.setStatus(1);
        tNotice.setDataId(task.getId());
        tNotice.setNoticeSetType(noticeSet.getNoticeType());
        TInspector byId = inspectorService.getById(dto.getId());
        SysUser sysUser = sysUserService.selectUserById(Long.valueOf(task.getPatrolInspector()));
        // 邮箱
        TDictData email = dictDataService.lambdaQuery().eq(TDictData::getDataType,4).one();
        // 授权码
        TDictData code = dictDataService.lambdaQuery().eq(TDictData::getDataType,5).one();
        if (dto.getAuditStatus()==1){
            if (dto.getClearStatus()==2){
            if (byId.getClearStatus()==2){
                tTaskAuditDTO.setHandleType(3);
                dto.setStatus(2);
                // 增加消息
                tNotice.setNoticeType(1);
                tNotice.setNoticeType(8);
                tNotice.setNoticeContent("【"+location.getLocationName()+"】督察任务不合格,请重新上传!");
                noticeService.save(tNotice);
                switch (noticeSet.getNoticeType()) {
                    case 1:
                        msgUtils.sendMsg5(sysUser.getPhonenumber(), location.getLocationName());
                        break;
                    case 2:
                        if (StringUtils.hasLength(email.getDataContent()) && StringUtils.hasLength(code.getDataContent())) {
                            EmailUtils.sendEmail(sysUser.getEmail(), email.getDataContent(), code.getDataContent(), "【"+location.getLocationName()+"】任务督察不合格,请及时整改!");
                        }
                        break;
                    case 3:
                        break;
                }
            }else{
                if (dto.getAuditTime()!=null){
                    dto.setStatus(3);