From 53d014edd19f57125c355abe71ec5b478500e610 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 05 八月 2025 09:57:40 +0800
Subject: [PATCH] 保洁巡检所有代码

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java |  398 ++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 267 insertions(+), 131 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java
index 1619bb2..2cc7455 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java
@@ -51,8 +51,6 @@
     private TTaskCleanService taskCleanService;
 
 
-
-
     @Resource
     private TLocationTypeService locationTypeService;
     @Resource
@@ -72,17 +70,22 @@
 
     @Resource
     private TAppealService appealService;
+    @Resource
+    private TInspectorService inspectorService;
+    @Resource
+    private TInspectorDetailService inspectorDetailService;
+
     @ApiOperation(value = "申诉记录分页列表")
     @PostMapping(value = "/pageList")
     public R<PageInfo<AppealListVO>> pageList(@RequestBody InsepectorListQuery query) {
         List<SysUser> sysUsers = sysUserService.selectAllList();
         List<TLocation> locationList = locationService.list();
-        if (StringUtils.hasLength(query.getDeptName())){
+        if (StringUtils.hasLength(query.getDeptName())) {
             List<TProjectDept> list = projectDeptService.lambdaQuery().like(TProjectDept::getProjectName, query.getDeptName()).list();
             List<String> listIds = projectDeptService.lambdaQuery().like(TProjectDept::getProjectName, query.getDeptName()).list()
                     .stream().map(TProjectDept::getId).collect(Collectors.toList());
             for (TProjectDept tProjectDept : list) {
-                if (tProjectDept.getParentId().equals("0")){
+                if (tProjectDept.getParentId().equals("0")) {
                     List<String> collect = projectDeptService.lambdaQuery().eq(TProjectDept::getParentId, tProjectDept.getId()).list()
                             .stream().map(TProjectDept::getId).collect(Collectors.toList());
                     listIds.addAll(collect);
@@ -91,69 +94,69 @@
             List<String> deptIds = deptService.lambdaQuery().like(TDept::getDeptName, query.getDeptName()).list()
                     .stream().map(TDept::getId).collect(Collectors.toList());
             listIds.addAll(deptIds);
-            if (listIds.isEmpty()){
+            if (listIds.isEmpty()) {
                 listIds.add("0");
             }
-            if (listIds.contains("0")){
+            if (listIds.contains("0")) {
                 query.setPatrolInspectorIds(Collections.singletonList(0L));
-            }else{
-                query.setPatrolInspectorIds(sysUsers.stream().filter(e->listIds.contains(e.getDeptId())).map(SysUser::getUserId)
+            } else {
+                query.setPatrolInspectorIds(sysUsers.stream().filter(e -> listIds.contains(e.getDeptId())).map(SysUser::getUserId)
                         .collect(Collectors.toList()));
             }
-            if (StringUtils.hasLength(query.getPhonenumber())){
+            if (StringUtils.hasLength(query.getPhonenumber())) {
                 List<Long> patrolInspectorIds = sysUsers.stream().filter(sysUser ->
                         sysUser.getPhonenumber().contains(query.getPhonenumber())
                                 && listIds.contains(sysUser.getDeptId())
                 ).map(SysUser::getUserId).collect(Collectors.toList());
-                if (patrolInspectorIds.isEmpty()){
+                if (patrolInspectorIds.isEmpty()) {
                     return R.ok(new PageInfo<>());
                 }
                 query.setPatrolInspectorIds(patrolInspectorIds);
             }
         }
-        if (StringUtils.hasLength(query.getPhonenumber())){
+        if (StringUtils.hasLength(query.getPhonenumber())) {
             List<Long> patrolInspectorIds = sysUsers.stream().filter(sysUser ->
                     sysUser.getPhonenumber().contains(query.getPhonenumber())
             ).map(SysUser::getUserId).collect(Collectors.toList());
-            if (!CollectionUtils.isEmpty(query.getPatrolInspectorIds())){
+            if (!CollectionUtils.isEmpty(query.getPatrolInspectorIds())) {
                 // 取交集
                 patrolInspectorIds = patrolInspectorIds.stream().filter(query.getPatrolInspectorIds()::contains).collect(Collectors.toList());
             }
             query.setPatrolInspectorIds(patrolInspectorIds);
-            if (patrolInspectorIds.isEmpty()){
+            if (patrolInspectorIds.isEmpty()) {
                 return R.ok(new PageInfo<>());
             }
         }
-        if (query.getClearStatus()!=null){
+        if (query.getClearStatus() != null) {
             List<String> collect = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getClearStatus, query.getClearStatus())
-                    .eq(TTaskDetail::getHandleType,1)
+                    .eq(TTaskDetail::getHandleType, 1)
                     .groupBy(TTaskDetail::getTaskId)
                     .orderByDesc(BaseModel::getCreateTime)
                     .list().stream().map(TTaskDetail::getTaskId).collect(Collectors.toList());
 
             query.setTaskIds(collect);
-            if (collect.isEmpty()){
+            if (collect.isEmpty()) {
                 return R.ok(new PageInfo<>());
             }
         }
-        if (query.getLocationType()!=null){
+        if (query.getLocationType() != null) {
             List<String> collect = locationList.stream().filter(e -> e.getLocationType().equals(query.getLocationType())).map(TLocation::getId)
                     .collect(Collectors.toList());
-            if (collect.isEmpty()){
+            if (collect.isEmpty()) {
                 return R.ok(new PageInfo<>());
             }
             query.setLocationIds(collect);
         }
-        if (StringUtils.hasLength(query.getLocationName())){
+        if (StringUtils.hasLength(query.getLocationName())) {
             List<String> collect = locationList.stream().filter(e -> e.getLocationName().contains(query.getLocationName())).map(TLocation::getId)
                     .collect(Collectors.toList());
-            if (collect.isEmpty()){
+            if (collect.isEmpty()) {
                 query.setLocationIds(collect);
                 return R.ok(new PageInfo<>());
-            }else{
-                if (query.getLocationIds()!=null){
+            } else {
+                if (query.getLocationIds() != null) {
                     collect = collect.stream().filter(query.getLocationIds()::contains).collect(Collectors.toList());
-                    if (collect.isEmpty()){
+                    if (collect.isEmpty()) {
                         return R.ok(new PageInfo<>());
                     }
                 }
@@ -162,6 +165,7 @@
         }
         return R.ok(appealService.pageList(query));
     }
+
     @Log(title = "批量删除申诉记录", businessType = BusinessType.DELETE)
     @ApiOperation(value = "批量删除申诉记录")
     @DeleteMapping(value = "/deleteByIds")
@@ -170,6 +174,7 @@
         appealService.removeBatchByIds(Arrays.asList(split));
         return R.ok();
     }
+
     @Log(title = "删除申诉记录", businessType = BusinessType.DELETE)
     @ApiOperation(value = "删除申诉记录")
     @DeleteMapping(value = "/deleteById")
@@ -177,30 +182,54 @@
         appealService.removeById(id);
         return R.ok();
     }
+
     @ApiOperation(value = "详情申诉记录")
     @GetMapping(value = "/detail")
     public R<AppealDetailVO> detail(@RequestParam String id) {
         AppealDetailVO appealDetailVO = new AppealDetailVO();
         TAppeal appeal = appealService.getById(id);
-        BeanUtils.copyProperties(appeal,appealDetailVO);
-        TTask byId = taskCleanService.getById(appeal.getTaskId());
-        TLocation byId1 = locationService.getById(byId.getLocationId());
-        TLocationType byId2 = locationTypeService.getById(byId1.getLocationType());
-        appealDetailVO.setLocationAddress(byId1.getLocationAddress());
-        appealDetailVO.setLocationIcon(byId2.getLocationIcon());
-        appealDetailVO.setLocationName(byId1.getLocationName());
-        appealDetailVO.setLocationTypeName(byId2.getLocationName());
-        appealDetailVO.setTaskId(byId.getId());
-        if (appeal.getAuditPerson()!=null){
-            SysUser sysUser = sysUserService.selectUserById(Long.valueOf(appeal.getAuditPerson()));
-            if (sysUser!=null){
-                appealDetailVO.setAuditPersonName(sysUser.getUserName());
+        BeanUtils.copyProperties(appeal, appealDetailVO);
+        if (appeal.getInspectorId() != null) {
+            TInspector inspector = inspectorService.getById(appeal.getInspectorId());
+            TLocation location = locationService.getById(inspector.getLocationId());
+            TLocationType byId2 = locationTypeService.getById(location.getLocationType());
+            appealDetailVO.setLocationAddress(location.getLocationAddress());
+            appealDetailVO.setLocationIcon(byId2.getLocationIcon());
+            appealDetailVO.setLocationName(location.getLocationName());
+            appealDetailVO.setLocationTypeName(byId2.getLocationName());
+            appealDetailVO.setTaskId(inspector.getId());
+            if (appeal.getAuditPerson() != null) {
+                SysUser sysUser = sysUserService.selectUserById(Long.valueOf(appeal.getAuditPerson()));
+                if (sysUser != null) {
+                    appealDetailVO.setAuditPersonName(sysUser.getUserName());
+                }
             }
+            appealDetailVO.setTaskName(location.getLocationName());
+            return R.ok(appealDetailVO);
+
+        } else {
+            TTask byId = taskCleanService.getById(appeal.getTaskId());
+            TLocation byId1 = locationService.getById(byId.getLocationId());
+            TLocationType byId2 = locationTypeService.getById(byId1.getLocationType());
+            appealDetailVO.setLocationAddress(byId1.getLocationAddress());
+            appealDetailVO.setLocationIcon(byId2.getLocationIcon());
+            appealDetailVO.setLocationName(byId1.getLocationName());
+            appealDetailVO.setLocationTypeName(byId2.getLocationName());
+            appealDetailVO.setTaskId(byId.getId());
+            if (appeal.getAuditPerson() != null) {
+                SysUser sysUser = sysUserService.selectUserById(Long.valueOf(appeal.getAuditPerson()));
+                if (sysUser != null) {
+                    appealDetailVO.setAuditPersonName(sysUser.getUserName());
+                }
+            }
+            appealDetailVO.setTaskName(byId1.getLocationName());
+            appealDetailVO.setTaskCode(byId.getTaskCode());
+            return R.ok(appealDetailVO);
+
         }
-        appealDetailVO.setTaskName(byId.getTaskName());
-        appealDetailVO.setTaskCode(byId.getTaskCode());
-        return R.ok(appealDetailVO);
+
     }
+
     @Resource
     private TNoticeService noticeService;
     @Resource
@@ -211,114 +240,221 @@
     private TNoticeSetService noticeSetService;
     @Resource
     private TDictDataService dictDataService;
+
     @Log(title = "审核申诉记录", businessType = BusinessType.UPDATE)
     @ApiOperation(value = "审核申诉记录")
     @PostMapping(value = "/audit")
     public R<Boolean> audit(@RequestBody @Valid TAppealAuditDTO dto) throws Exception {
         List<SysUser> sysUsers = sysUserService.selectAllList();
         TAppeal appeal = appealService.getById(dto.getId());
-        SysUser sysUser = sysUsers.stream().filter(e -> e.getUserId().equals(Long.valueOf(appeal.getAppealPerson())))
-                .findFirst().orElse(null);
-        dto.setStatus(dto.getStatus());
-        dto.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
-        dto.setAuditTime(LocalDateTime.now());
-        TTask task = taskCleanService.getById(appeal.getTaskId());
-        TLocation location = locationService.getById(task.getLocationId());
-        TNotice tNotice = new TNotice();
-        tNotice.setUserId(appeal.getAppealPerson());
-        tNotice.setStatus(1);
-        tNotice.setDataId(dto.getId());
-        dto.setAuditTime(LocalDateTime.now());
-        TTaskDetail taskDetail = new TTaskDetail();
-        taskDetail.setTaskId(appeal.getTaskId());
-        Long count = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, appeal.getTaskId())
-                .eq(TTaskDetail::getHandleType, 1).count();
-        TNoticeSet noticeSet = noticeSetService.lambdaQuery().eq(TNoticeSet::getType, 2).last("limit 1")
-                .one();
-        // 邮箱
-        TDictData email = dictDataService.lambdaQuery().eq(TDictData::getDataType,4).one();
-        // 授权码
-        TDictData code = dictDataService.lambdaQuery().eq(TDictData::getDataType,5).one();
-        if (dto.getStatus()==2){
-            taskDetail.setClearStatus(1);
-            taskDetail.setAuditTime(LocalDateTime.now());
-            taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
-            taskDetail.setAuditStatus(1);
-            taskDetail.setAuditRemark(dto.getAuditRemark());
-            taskDetail.setHandleType(5);
-            taskDetail.setAppealId(dto.getId());
-            // 通过
-            TTask byId = taskCleanService.getById(dto.getTaskId());
-            if (count>1){
-                byId.setStatus(5);
-            }else{
-                byId.setStatus(6);
+        if (appeal.getInspectorId() != null) {
+            SysUser sysUser1 = sysUsers.stream().filter(e -> e.getUserId().equals(Long.valueOf(appeal.getAppealPerson())))
+                    .findFirst().orElse(null);
+            dto.setStatus(dto.getStatus());
+            dto.setAuditPerson(tokenService.getLoginUser().getUserId() + "");
+            dto.setAuditTime(LocalDateTime.now());
+            TInspector inspector = inspectorService.getById(appeal.getInspectorId());
+            TLocation location1 = locationService.getById(inspector.getLocationId());
+            TNotice tNotice1 = new TNotice();
+            tNotice1.setUserId(appeal.getAppealPerson());
+            tNotice1.setStatus(1);
+            tNotice1.setDataId(dto.getId());
+            dto.setAuditTime(LocalDateTime.now());
+            TInspectorDetail inspectorDetail = new TInspectorDetail();
+            inspectorDetail.setInspectorId(appeal.getInspectorId());
+            Long count1 = inspectorDetailService.lambdaQuery().eq(TInspectorDetail::getInspectorId, appeal.getInspectorId())
+                    .eq(TInspectorDetail::getHandleType, 1).count();
+            TNoticeSet noticeSet1 = noticeSetService.lambdaQuery().eq(TNoticeSet::getType, 2).last("limit 1")
+                    .one();
+            // 邮箱
+            TDictData email1 = dictDataService.lambdaQuery().eq(TDictData::getDataType, 4).one();
+            // 授权码
+            TDictData code1 = dictDataService.lambdaQuery().eq(TDictData::getDataType, 5).one();
+            if (dto.getStatus() == 2) {
+                inspectorDetail.setClearStatus(1);
+                inspectorDetail.setAuditTime(LocalDateTime.now());
+                inspectorDetail.setAuditPerson(tokenService.getLoginUser().getUserId() + "");
+                inspectorDetail.setAuditStatus(1);
+                inspectorDetail.setAuditRemark(dto.getAuditRemark());
+                inspectorDetail.setHandleType(5);
+                inspectorDetail.setAppealId(dto.getId());
+                // 通过
+                TInspector byId = inspectorService.getById(dto.getInspectorId());
+                if (count1 > 1) {
+                    byId.setStatus(5);
+                } else {
+                    byId.setStatus(6);
+                }
+                inspectorService.updateById(byId);
+                tNotice1.setNoticeType(5);
+                tNotice1.setNoticeContent("【" + location1.getLocationName() + "】任务申诉通过");
+                if (sysUser1 != null) {
+                    switch (noticeSet1.getNoticeType()) {
+                        case 1:
+                            msgUtils.sendMsg3(sysUser1.getPhonenumber(), location1.getLocationName(), "通过");
+                            break;
+                        case 2:
+                            if (StringUtils.hasLength(email1.getDataContent()) && StringUtils.hasLength(code1.getDataContent())
+                            &&StringUtils.hasLength(sysUser1.getEmail())
+                            ) {
+                                EmailUtils.sendEmail(sysUser1.getEmail(), email1.getDataContent(), code1.getDataContent(), "【" + location1.getLocationName() + "】任务申诉通过");
+                            }
+                            break;
+                        case 3:
+                            if (StringUtils.hasLength(sysUser1.getOpenId())) {
+                                Date date = new Date();
 
-            }
+                                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                                String format = simpleDateFormat.format(date);
+                                templateMessageSendUtil.wxTemplateAppealResultRequest(sysUser1.getOpenId(),
+                                        location1.getLocationName(), "通过", format, dto.getAuditRemark());
+                            }
+                            break;
+                    }
+                }
+            } else {
+                inspectorDetail.setClearStatus(2);
+                inspectorDetail.setAuditTime(LocalDateTime.now());
+                inspectorDetail.setAuditPerson(tokenService.getLoginUser().getUserId() + "");
+                inspectorDetail.setAuditStatus(2);
+                inspectorDetail.setAuditRemark(dto.getAuditRemark());
+                inspectorDetail.setHandleType(6);
+                inspectorDetail.setAppealId(dto.getId());
+                tNotice1.setNoticeType(4);
+                tNotice1.setNoticeContent("【" + location1.getLocationName() + "】任务申诉驳回");
+                if (sysUser1 != null) {
+                    switch (noticeSet1.getNoticeType()) {
+                        case 1:
+                            msgUtils.sendMsg3(sysUser1.getPhonenumber(), location1.getLocationName(), "通过");
+                            break;
+                        case 2:
+                            if (StringUtils.hasLength(email1.getDataContent()) && StringUtils.hasLength(code1.getDataContent())
 
-            taskCleanService.updateById(byId);
-            tNotice.setNoticeType(5);
-            tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉通过");
-            if (sysUser!=null){
-                switch (noticeSet.getNoticeType()) {
-                    case 1:
-                        msgUtils.sendMsg3(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:
-                        if (StringUtils.hasLength(sysUser.getOpenId())){
-                            Date date = new Date();
+                                    &&StringUtils.hasLength(sysUser1.getEmail())) {
+                                EmailUtils.sendEmail(sysUser1.getEmail(), email1.getDataContent(), code1.getDataContent(), "【" + location1.getLocationName() + "】任务申诉驳回");
+                            }
+                            break;
+                        case 3:
+                            if (StringUtils.hasLength(sysUser1.getOpenId())) {
+                                Date date = new Date();
 
-                            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-                            String format = simpleDateFormat.format(date);
-                            templateMessageSendUtil.wxTemplateAppealResultRequest(sysUser.getOpenId(),
-                                    location.getLocationName(),"通过",format,dto.getAuditRemark());
-                        }
-                        break;
+                                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                                String format = simpleDateFormat.format(date);
+                                templateMessageSendUtil.wxTemplateAppealResultRequest(sysUser1.getOpenId(),
+                                        location1.getLocationName(), "驳回", format, dto.getAuditRemark());
+                            }
+                            break;
+                    }
                 }
             }
-        }else{
-            taskDetail.setClearStatus(2);
-            taskDetail.setAuditTime(LocalDateTime.now());
-            taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
-            taskDetail.setAuditStatus(2);
-            taskDetail.setAuditRemark(dto.getAuditRemark());
-            taskDetail.setHandleType(6);
-            taskDetail.setAppealId(dto.getId());
-            tNotice.setNoticeType(4);
-            tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉驳回");
-            if (sysUser!=null){
-                switch (noticeSet.getNoticeType()) {
-                    case 1:
-                        msgUtils.sendMsg3(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:
-                        if (StringUtils.hasLength(sysUser.getOpenId())){
-                            Date date = new Date();
+        } else {
+            SysUser sysUser = sysUsers.stream().filter(e -> e.getUserId().equals(Long.valueOf(appeal.getAppealPerson())))
+                    .findFirst().orElse(null);
+            dto.setStatus(dto.getStatus());
+            dto.setAuditPerson(tokenService.getLoginUser().getUserId() + "");
+            dto.setAuditTime(LocalDateTime.now());
+            TTask task = taskCleanService.getById(appeal.getTaskId());
+            TLocation location = locationService.getById(task.getLocationId());
+            TNotice tNotice = new TNotice();
+            tNotice.setUserId(appeal.getAppealPerson());
+            tNotice.setStatus(1);
+            tNotice.setDataId(dto.getId());
+            dto.setAuditTime(LocalDateTime.now());
+            TTaskDetail taskDetail = new TTaskDetail();
+            taskDetail.setTaskId(appeal.getTaskId());
+            Long count = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, appeal.getTaskId())
+                    .eq(TTaskDetail::getHandleType, 1).count();
+            TNoticeSet noticeSet = noticeSetService.lambdaQuery().eq(TNoticeSet::getType, 2).last("limit 1")
+                    .one();
+            // 邮箱
+            TDictData email = dictDataService.lambdaQuery().eq(TDictData::getDataType, 4).one();
+            // 授权码
+            TDictData code = dictDataService.lambdaQuery().eq(TDictData::getDataType, 5).one();
+            if (dto.getStatus() == 2) {
+                taskDetail.setClearStatus(1);
+                taskDetail.setAuditTime(LocalDateTime.now());
+                taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId() + "");
+                taskDetail.setAuditStatus(1);
+                taskDetail.setAuditRemark(dto.getAuditRemark());
+                taskDetail.setHandleType(5);
+                taskDetail.setAppealId(dto.getId());
+                // 通过
+                TTask byId = taskCleanService.getById(dto.getTaskId());
+                if (count > 1) {
+                    byId.setStatus(5);
+                } else {
+                    byId.setStatus(6);
 
-                            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-                            String format = simpleDateFormat.format(date);
-                            templateMessageSendUtil.wxTemplateAppealResultRequest(sysUser.getOpenId(),
-                                    location.getLocationName(),"驳回",format,dto.getAuditRemark());
-                        }
-                        break;
+                }
+
+                taskCleanService.updateById(byId);
+                tNotice.setNoticeType(5);
+                tNotice.setNoticeContent("【" + location.getLocationName() + "】任务申诉通过");
+                if (sysUser != null) {
+                    switch (noticeSet.getNoticeType()) {
+                        case 1:
+                            msgUtils.sendMsg3(sysUser.getPhonenumber(), location.getLocationName(), "通过");
+                            break;
+                        case 2:
+                            if (StringUtils.hasLength(email.getDataContent()) && StringUtils.hasLength(code.getDataContent())
+
+                                    &&StringUtils.hasLength(sysUser.getEmail())) {
+                                EmailUtils.sendEmail(sysUser.getEmail(), email.getDataContent(), code.getDataContent(), "【" + location.getLocationName() + "】任务申诉通过");
+                            }
+                            break;
+                        case 3:
+                            if (StringUtils.hasLength(sysUser.getOpenId())) {
+                                Date date = new Date();
+
+                                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                                String format = simpleDateFormat.format(date);
+                                templateMessageSendUtil.wxTemplateAppealResultRequest(sysUser.getOpenId(),
+                                        location.getLocationName(), "通过", format, dto.getAuditRemark());
+                            }
+                            break;
+                    }
+                }
+            } else {
+                taskDetail.setClearStatus(2);
+                taskDetail.setAuditTime(LocalDateTime.now());
+                taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId() + "");
+                taskDetail.setAuditStatus(2);
+                taskDetail.setAuditRemark(dto.getAuditRemark());
+                taskDetail.setHandleType(6);
+                taskDetail.setAppealId(dto.getId());
+                tNotice.setNoticeType(4);
+                tNotice.setNoticeContent("【" + location.getLocationName() + "】任务申诉驳回");
+                if (sysUser != null) {
+                    switch (noticeSet.getNoticeType()) {
+                        case 1:
+                            msgUtils.sendMsg3(sysUser.getPhonenumber(), location.getLocationName(), "通过");
+                            break;
+                        case 2:
+                            if (StringUtils.hasLength(email.getDataContent()) && StringUtils.hasLength(code.getDataContent())
+                                    &&StringUtils.hasLength(sysUser.getEmail())) {
+                                EmailUtils.sendEmail(sysUser.getEmail(), email.getDataContent(), code.getDataContent(), "【" + location.getLocationName() + "】任务申诉驳回");
+                            }
+                            break;
+                        case 3:
+                            if (StringUtils.hasLength(sysUser.getOpenId())) {
+                                Date date = new Date();
+
+                                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                                String format = simpleDateFormat.format(date);
+                                templateMessageSendUtil.wxTemplateAppealResultRequest(sysUser.getOpenId(),
+                                        location.getLocationName(), "驳回", format, dto.getAuditRemark());
+                            }
+                            break;
+                    }
                 }
             }
+            noticeService.save(tNotice);
+            dto.setAuditPerson(tokenService.getLoginUser().getUserId() + "");
+            appealService.updateById(dto);
+            tTaskDetailService.save(taskDetail);
         }
-        noticeService.save(tNotice);
-        dto.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
-        appealService.updateById(dto);
-        tTaskDetailService.save(taskDetail);
         return R.ok();
+
     }
 }
 

--
Gitblit v1.7.1