Yansen 2 лет назад
Родитель
Сommit
cde766a631
22 измененных файлов: 507 добавлений и 96 удалений
  1. 1
    1
      db/.back_文明创办/文明创办-backup-2023313112657.pdma.json
  2. 3
    0
      db/upgrade.1.1.sql
  3. 18
    1
      db/文明创办.pdma.json
  4. 1
    1
      pom.xml
  5. 10
    0
      src/main/java/com/example/civilizedcity/common/DateUtils.java
  6. 161
    0
      src/main/java/com/example/civilizedcity/common/ExportIssueUtil.java
  7. 11
    4
      src/main/java/com/example/civilizedcity/controller/SysUserController.java
  8. 2
    2
      src/main/java/com/example/civilizedcity/controller/TaCheckItemController.java
  9. 18
    32
      src/main/java/com/example/civilizedcity/controller/TaIssueController.java
  10. 45
    11
      src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java
  11. 4
    0
      src/main/java/com/example/civilizedcity/entity/SysOrg.java
  12. 4
    0
      src/main/java/com/example/civilizedcity/entity/SysUser.java
  13. 10
    9
      src/main/java/com/example/civilizedcity/entity/TaIssue.java
  14. 11
    3
      src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java
  15. 2
    0
      src/main/java/com/example/civilizedcity/service/SysLoginService.java
  16. 6
    2
      src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java
  17. 8
    0
      src/main/java/com/example/civilizedcity/service/impl/SysLoginServiceImpl.java
  18. 20
    3
      src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java
  19. 121
    0
      src/main/java/com/example/civilizedcity/vo/IssueExport.java
  20. 1
    1
      src/main/resources/application-dev.yml
  21. 1
    1
      src/main/resources/mapper/TaIssueMapper.xml
  22. 49
    25
      src/main/resources/mapper/TaOrgIssueMapper.xml

db/.back_文明创办/文明创办-backup-2023228153135.pdma.json → db/.back_文明创办/文明创办-backup-2023313112657.pdma.json Просмотреть файл

@@ -4,7 +4,7 @@
4 4
   "avatar": "",
5 5
   "version": "4.1.4",
6 6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2023-2-28 11:17:54",
7
+  "updatedTime": "2023-2-28 15:31:35",
8 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {

+ 3
- 0
db/upgrade.1.1.sql Просмотреть файл

@@ -0,0 +1,3 @@
1
+
2
+ALTER TABLE `sys_org`
3
+    ADD COLUMN `is_responsible` int(0) NULL DEFAULT 1 COMMENT '是否责任单位' AFTER `org_p_id`;

+ 18
- 1
db/文明创办.pdma.json Просмотреть файл

@@ -4,7 +4,7 @@
4 4
   "avatar": "",
5 5
   "version": "4.1.4",
6 6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2023-2-28 15:31:35",
7
+  "updatedTime": "2023-3-13 11:26:57",
8 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -667,6 +667,23 @@
667 667
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
668 668
           "id": "B7406CE6-690F-4A9B-8BA4-4EF1F18B5C87"
669 669
         },
670
+        {
671
+          "defKey": "is_responsible",
672
+          "defName": "是否责任单位",
673
+          "comment": "",
674
+          "type": "",
675
+          "len": "",
676
+          "scale": "",
677
+          "primaryKey": false,
678
+          "notNull": false,
679
+          "autoIncrement": false,
680
+          "defaultValue": "1",
681
+          "hideInGraph": false,
682
+          "refDict": "",
683
+          "extProps": {},
684
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
685
+          "id": "40B1363B-2AD0-4B89-9ADE-A487DCB59573"
686
+        },
670 687
         {
671 688
           "defKey": "sort_no",
672 689
           "defName": "排序",

+ 1
- 1
pom.xml Просмотреть файл

@@ -10,7 +10,7 @@
10 10
     </parent>
11 11
     <groupId>com.example</groupId>
12 12
     <artifactId>civilizedCity</artifactId>
13
-    <version>0.0.3</version>
13
+    <version>0.0.4</version>
14 14
     <name>civilizedCity</name>
15 15
     <description>civilizedCity</description>
16 16
     <properties>

+ 10
- 0
src/main/java/com/example/civilizedcity/common/DateUtils.java Просмотреть файл

@@ -29,6 +29,11 @@ public class DateUtils {
29 29
         return LocalDateTime.now().format(formatter);
30 30
     }
31 31
 
32
+    public static String tomorrow() {
33
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
34
+        return LocalDateTime.now().plusDays(1).format(formatter);
35
+    }
36
+
32 37
     public static String todayCompact() {
33 38
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
34 39
         return LocalDateTime.now().format(formatter);
@@ -54,6 +59,11 @@ public class DateUtils {
54 59
         return LocalDateTime.parse(day + " 00:00:00", df);
55 60
     }
56 61
 
62
+    public static LocalDateTime day2LocalDateime2(String day) {
63
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
64
+        return LocalDateTime.parse(day + " 23:59:59", df);
65
+    }
66
+
57 67
     public static LocalDateTime dayToLocalDateime(String day) {
58 68
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
59 69
         return LocalDateTime.parse(day, df);

+ 161
- 0
src/main/java/com/example/civilizedcity/common/ExportIssueUtil.java Просмотреть файл

@@ -0,0 +1,161 @@
1
+package com.example.civilizedcity.common;
2
+
3
+import com.example.civilizedcity.entity.SysOrg;
4
+import com.example.civilizedcity.entity.TaAttach;
5
+import com.example.civilizedcity.entity.TaIssue;
6
+import com.example.civilizedcity.entity.TaOrgIssue;
7
+import com.example.civilizedcity.service.SysOrgService;
8
+import com.example.civilizedcity.service.TaAttachService;
9
+import com.example.civilizedcity.service.TaOrgIssueService;
10
+import com.example.civilizedcity.vo.IssueExport;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.stereotype.Component;
13
+
14
+import java.net.MalformedURLException;
15
+import java.net.URL;
16
+import java.time.LocalDateTime;
17
+import java.util.ArrayList;
18
+import java.util.List;
19
+import java.util.Optional;
20
+import java.util.stream.Collectors;
21
+
22
+@Component
23
+public class ExportIssueUtil {
24
+
25
+    @Autowired
26
+    private SysOrgService sysOrgService;
27
+
28
+    @Autowired
29
+    private TaAttachService taAttachService;
30
+
31
+    @Autowired
32
+    private TaOrgIssueService taOrgIssueService;
33
+
34
+    public List<IssueExport> getExportList(List<TaIssue> list) throws MalformedURLException {
35
+        List<IssueExport> exportList = new ArrayList<>();
36
+        if (null != list && list.size() > 0) {
37
+            List<SysOrg> orgList = sysOrgService.list();
38
+
39
+            for (TaIssue taIssue : list) {
40
+                IssueExport issueExport = new IssueExport();
41
+                issueExport.setIssueId(taIssue.getIssueId());
42
+                issueExport.setCreateDate(taIssue.getCreateDate());
43
+                issueExport.setLocName(taIssue.getLocName());
44
+                issueExport.setAddr(taIssue.getAddr());
45
+                issueExport.setContent(taIssue.getContent());
46
+                issueExport.setExpireDate(taIssue.getExpireDate());
47
+                issueExport.setProcessNum(taIssue.getProcessNum());
48
+
49
+                // 转换机构
50
+                if (StringUtils.isNotEmpty(taIssue.getOrgId())) {
51
+                    Optional<SysOrg> sysOrg = orgList.stream().filter(x -> x.getOrgId().equals(taIssue.getOrgId())).findFirst();
52
+                    if (sysOrg.isPresent()) {
53
+                        issueExport.setOrgId(sysOrg.get().getName());
54
+                    } else {
55
+                        issueExport.setOrgId(null);
56
+                    }
57
+                }
58
+
59
+                // 转换流程状态
60
+                String processNode = taIssue.getProcessNode();
61
+                if (processNode.equals(Constants.PROCESS_START)) {
62
+                    issueExport.setProcessNode("待交办");
63
+                } else if (processNode.equals(Constants.PROCESS_END)) {
64
+                    issueExport.setProcessNode("已办结");
65
+                } else if (StringUtils.isNotEmpty(taIssue.getExpireDate()) && LocalDateTime.now().isAfter(DateUtils.day2LocalDateime2(taIssue.getExpireDate()))) {
66
+                    issueExport.setProcessNode("已逾期");
67
+                } else {
68
+                    issueExport.setProcessNode("已交办");
69
+                }
70
+
71
+                // 获取图片列表
72
+                List<TaAttach> attachList = taAttachService.getListBy(Constants.SOURCE_ISSUE, taIssue.getIssueId().toString());
73
+                if (null != attachList && attachList.size() > 0) {
74
+                    List<TaAttach> images = attachList.stream().filter(x -> StringUtils.isEmpty(x.getFileType()) || x.getFileType().equals("image")).collect(Collectors.toList());
75
+
76
+                    int max = 5;
77
+                    for (int i = 0; i < max; i += 1) {
78
+                        TaAttach taAttach = null;
79
+
80
+                        try {
81
+                            taAttach = images.get(i);
82
+                        } catch (Exception e) {
83
+                            //
84
+                        }
85
+
86
+                        if (null != taAttach) {
87
+
88
+                            URL url = new URL(taAttach.getUrl());
89
+                            switch (i) {
90
+                                case 0:
91
+                                    issueExport.setUrl1(url);
92
+                                    break;
93
+                                case 1:
94
+                                    issueExport.setUrl2(url);
95
+                                    break;
96
+                                case 2:
97
+                                    issueExport.setUrl3(url);
98
+                                    break;
99
+                                case 3:
100
+                                    issueExport.setUrl4(url);
101
+                                    break;
102
+                                case 4:
103
+                                    issueExport.setUrl5(url);
104
+                                    break;
105
+                                default:
106
+                                    break;
107
+                            }
108
+                        }
109
+                    }
110
+                }
111
+
112
+                //
113
+                TaOrgIssue taOrgIssue = taOrgIssueService.getByIssueAndOrg(taIssue.getIssueId(), taIssue.getOrgId());
114
+                if (null != taOrgIssue) {
115
+                    List<TaAttach> orgAttachList = taAttachService.getListBy(Constants.SOURCE_ORG_ISSUE, taOrgIssue.getOrgIssueId().toString());
116
+                    if (null != orgAttachList && orgAttachList.size() > 0) {
117
+                        List<TaAttach> images = orgAttachList.stream().filter(x -> StringUtils.isEmpty(x.getFileType()) || x.getFileType().equals("image")).collect(Collectors.toList());
118
+
119
+                        int max = 5;
120
+                        for (int i = 0; i < max; i += 1) {
121
+                            TaAttach taAttach = null;
122
+
123
+                            try {
124
+                                taAttach = images.get(i);
125
+                            } catch (Exception e) {
126
+                                //
127
+                            }
128
+
129
+                            if (null != taAttach) {
130
+                                URL url = new URL(taAttach.getUrl());
131
+                                switch (i) {
132
+                                    case 0:
133
+                                        issueExport.setUrl6(url);
134
+                                        break;
135
+                                    case 1:
136
+                                        issueExport.setUrl7(url);
137
+                                        break;
138
+                                    case 2:
139
+                                        issueExport.setUrl8(url);
140
+                                        break;
141
+                                    case 3:
142
+                                        issueExport.setUrl9(url);
143
+                                        break;
144
+                                    case 4:
145
+                                        issueExport.setUrl10(url);
146
+                                        break;
147
+                                    default:
148
+                                        break;
149
+                                }
150
+                            }
151
+                        }
152
+                    }
153
+                }
154
+
155
+                exportList.add(issueExport);
156
+            }
157
+        }
158
+
159
+        return exportList;
160
+    }
161
+}

+ 11
- 4
src/main/java/com/example/civilizedcity/controller/SysUserController.java Просмотреть файл

@@ -15,9 +15,7 @@ import java.util.Map;
15 15
 import com.example.civilizedcity.common.StringUtils;
16 16
 import com.example.civilizedcity.entity.SysResource;
17 17
 import com.example.civilizedcity.entity.SysRole;
18
-import com.example.civilizedcity.service.SysResourceService;
19
-import com.example.civilizedcity.service.SysRoleService;
20
-import com.example.civilizedcity.service.SysUserDutyService;
18
+import com.example.civilizedcity.service.*;
21 19
 import com.example.civilizedcity.vo.ChangePassword;
22 20
 import io.swagger.annotations.Api;
23 21
 import io.swagger.annotations.ApiOperation;
@@ -25,7 +23,6 @@ import io.swagger.annotations.ApiParam;
25 23
 import org.springframework.beans.factory.annotation.Autowired;
26 24
 import org.springframework.web.bind.annotation.*;
27 25
 import com.example.civilizedcity.entity.SysUser;
28
-import com.example.civilizedcity.service.SysUserService;
29 26
 
30 27
 /**
31 28
  * 用户表;(sys_user)表控制层
@@ -47,6 +44,12 @@ public class SysUserController extends BaseController {
47 44
     @Autowired
48 45
     SysUserDutyService sysUserDutyService;
49 46
 
47
+    @Autowired
48
+    SysLoginService sysLoginService;
49
+
50
+    @Autowired
51
+    SysOrgService sysOrgService;
52
+
50 53
     /**
51 54
      * 通过ID查询单条数据
52 55
      *
@@ -85,6 +88,7 @@ public class SysUserController extends BaseController {
85 88
         sysUser.setRolesList(rolesList);
86 89
         sysUser.setResourcesList(resourcesList);
87 90
         sysUser.setDutyList(dutyList);
91
+        sysUser.setOrg(sysOrgService.getById(sysUser.getOrgId()));
88 92
 
89 93
         return sysUser;
90 94
     }
@@ -284,6 +288,9 @@ public class SysUserController extends BaseController {
284 288
             return ResponseBean.error("暂无权限");
285 289
         }
286 290
 
291
+        // 删除登录信息
292
+        sysLoginService.removeByUser(sysUser.getUserId());
293
+
287 294
         sysUserService.removeLogicById(id);
288 295
         return ResponseBean.success("success");
289 296
     }

+ 2
- 2
src/main/java/com/example/civilizedcity/controller/TaCheckItemController.java Просмотреть файл

@@ -186,7 +186,7 @@ public class TaCheckItemController extends BaseController {
186 186
             }});
187 187
         }
188 188
 
189
-        if (LocalDateTime.now().isAfter(DateUtils.day2LocalDateime(taCheck.getEndDate()))) {
189
+        if (LocalDateTime.now().isAfter(DateUtils.day2LocalDateime2(taCheck.getEndDate()))) {
190 190
             return ResponseBean.success(new HashMap<String, Object>(){{
191 191
                 put("errorCode", 1);    // 正数代表, 只能查看
192 192
                 put("message", "本次测评已结束");
@@ -245,7 +245,7 @@ public class TaCheckItemController extends BaseController {
245 245
             return ResponseBean.error("未找到有效的测评信息");
246 246
         }
247 247
 
248
-        if (LocalDateTime.now().isAfter(DateUtils.day2LocalDateime(taCheck.getEndDate()))) {
248
+        if (LocalDateTime.now().isAfter(DateUtils.day2LocalDateime2(taCheck.getEndDate()))) {
249 249
             return ResponseBean.error("本次测评已结束");
250 250
         }
251 251
 

+ 18
- 32
src/main/java/com/example/civilizedcity/controller/TaIssueController.java Просмотреть файл

@@ -7,13 +7,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
7 7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8 8
 import com.example.civilizedcity.common.*;
9 9
 
10
+import java.net.URL;
10 11
 import java.time.LocalDateTime;
11 12
 import java.util.ArrayList;
12 13
 import java.util.List;
13 14
 import java.util.Optional;
15
+import java.util.stream.Collectors;
14 16
 
15 17
 import com.example.civilizedcity.entity.*;
16 18
 import com.example.civilizedcity.service.*;
19
+import com.example.civilizedcity.vo.IssueExport;
17 20
 import io.swagger.annotations.Api;
18 21
 import io.swagger.annotations.ApiOperation;
19 22
 import io.swagger.annotations.ApiParam;
@@ -37,6 +40,9 @@ public class TaIssueController extends BaseController {
37 40
     @Autowired
38 41
     private TaIssueService taIssueService;
39 42
 
43
+    @Autowired
44
+    private TaOrgIssueService taOrgIssueService;
45
+
40 46
     @Autowired
41 47
     private TaAttachService taAttachService;
42 48
 
@@ -49,6 +55,9 @@ public class TaIssueController extends BaseController {
49 55
     @Autowired
50 56
     private SysOrgService sysOrgService;
51 57
 
58
+    @Autowired
59
+    private ExportIssueUtil exportIssueUtil;
60
+
52 61
     /**
53 62
      * 通过ID查询单条数据
54 63
      *
@@ -76,8 +85,9 @@ public class TaIssueController extends BaseController {
76 85
      * @param orgId
77 86
      * @return
78 87
      */
79
-    private QueryWrapper<TaIssue> buildQuery(SysUser sysUser, String bizStatus, String sourceType, String locId, Boolean mine, String orgId, Boolean all) {
88
+    private QueryWrapper<TaIssue> buildQuery(SysUser sysUser, String issueId, String bizStatus, String sourceType, String locId, Boolean mine, String orgId, Boolean all) {
80 89
         QueryWrapper<TaIssue> queryWrapper = new QueryWrapper<>();
90
+        queryWrapper.eq(StringUtils.isNotEmpty(issueId), "issue_id", issueId);
81 91
 
82 92
         if (Constants.PROCESS_START.equals(bizStatus)) {
83 93
             // 待交办
@@ -126,6 +136,7 @@ public class TaIssueController extends BaseController {
126 136
     @GetMapping("/taIssue")
127 137
     public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
128 138
                              @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
139
+                             @ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
129 140
                              @ApiParam("问题单状态") @RequestParam(value = "bizStatus", required = false) String bizStatus,
130 141
                              @ApiParam("来源") @RequestParam(value = "sourceType", required = false) String sourceType,
131 142
                              @ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
@@ -142,7 +153,7 @@ public class TaIssueController extends BaseController {
142 153
         }
143 154
 
144 155
         IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
145
-        QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, bizStatus, sourceType, locId, mine, orgId, all);
156
+        QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, issueId, bizStatus, sourceType, locId, mine, orgId, all);
146 157
         IPage<TaIssue> result = taIssueService.page(pg, queryWrapper);
147 158
 
148 159
         return ResponseBean.success(result);
@@ -158,7 +169,8 @@ public class TaIssueController extends BaseController {
158 169
      */
159 170
     @ApiOperation("导出")
160 171
     @PostMapping("/taIssue/export")
161
-    public ResponseBean export(@ApiParam("问题单状态") @RequestParam(value = "bizStatus", required = false) String bizStatus,
172
+    public ResponseBean export(@ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
173
+                               @ApiParam("问题单状态") @RequestParam(value = "bizStatus", required = false) String bizStatus,
162 174
                                @ApiParam("来源") @RequestParam(value = "sourceType", required = false) String sourceType,
163 175
                                @ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
164 176
                                @ApiParam("我的") @RequestParam(value = "mine", defaultValue = "false") Boolean mine,
@@ -174,38 +186,12 @@ public class TaIssueController extends BaseController {
174 186
             return ResponseBean.error("暂无权限查询数据");
175 187
         }
176 188
 
177
-        QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, bizStatus, sourceType, locId, mine, orgId, all);
189
+        QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, issueId, bizStatus, sourceType, locId, mine, orgId, all);
178 190
         List<TaIssue> list = taIssueService.list(queryWrapper);
179 191
 
180
-        if (null != list && list.size() > 0) {
181
-            List<SysOrg> orgList = sysOrgService.list();
182
-            for (TaIssue taIssue : list) {
183
-
184
-                // 转换机构
185
-                if (StringUtils.isNotEmpty(taIssue.getOrgId())) {
186
-                    Optional<SysOrg> sysOrg = orgList.stream().filter(x -> x.getOrgId().equals(taIssue.getOrgId())).findFirst();
187
-                    if (sysOrg.isPresent()) {
188
-                        taIssue.setOrgId(sysOrg.get().getName());
189
-                    } else {
190
-                        taIssue.setOrgId(null);
191
-                    }
192
-                }
193
-
194
-                // 转换流程状态
195
-                String processNode = taIssue.getProcessNode();
196
-                if (processNode.equals(Constants.PROCESS_START)) {
197
-                    taIssue.setProcessNode("待交办");
198
-                } else if (processNode.equals(Constants.PROCESS_END)) {
199
-                    taIssue.setProcessNode("已办结");
200
-                } else if (StringUtils.isNotEmpty(taIssue.getExpireDate()) && LocalDateTime.now().isAfter(DateUtils.day2LocalDateime(taIssue.getExpireDate()))) {
201
-                    taIssue.setProcessNode("已逾期");
202
-                } else {
203
-                    taIssue.setProcessNode("已交办");
204
-                }
205
-            }
206
-        }
192
+        List<IssueExport> exportList = exportIssueUtil.getExportList(list);
193
+        ExcelUtils.flush(response, IssueExport.class, exportList, "问题单列表");
207 194
 
208
-        ExcelUtils.flush(response, TaIssue.class, list, "问题单列表");
209 195
         return null;
210 196
     }
211 197
 

+ 45
- 11
src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java Просмотреть файл

@@ -3,25 +3,26 @@ package com.example.civilizedcity.controller;
3 3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-import com.example.civilizedcity.common.BaseController;
7
-import com.example.civilizedcity.common.Constants;
8
-import com.example.civilizedcity.common.ResponseBean;
6
+import com.example.civilizedcity.common.*;
7
+
8
+import java.time.LocalDateTime;
9 9
 import java.util.List;
10
+import java.util.Optional;
10 11
 
11
-import com.example.civilizedcity.common.StringUtils;
12
-import com.example.civilizedcity.entity.SysUser;
13
-import com.example.civilizedcity.entity.TaAttach;
14
-import com.example.civilizedcity.entity.TaIssue;
12
+import com.example.civilizedcity.entity.*;
13
+import com.example.civilizedcity.service.SysOrgService;
15 14
 import com.example.civilizedcity.service.TaAttachService;
15
+import com.example.civilizedcity.vo.IssueExport;
16 16
 import io.swagger.annotations.Api;
17 17
 import io.swagger.annotations.ApiOperation;
18 18
 import io.swagger.annotations.ApiParam;
19 19
 import org.springframework.beans.factory.annotation.Autowired;
20 20
 import org.springframework.web.bind.annotation.*;
21
-import com.example.civilizedcity.entity.TaOrgIssue;
22 21
 import com.example.civilizedcity.service.TaOrgIssueService;
23 22
 
24
- /**
23
+import javax.servlet.http.HttpServletResponse;
24
+
25
+/**
25 26
  * 单位问题单;(ta_org_issue)表控制层
26 27
  * @author : http://njyunzhi.com
27 28
  * @date : 2022-12-28
@@ -36,7 +37,14 @@ public class TaOrgIssueController extends BaseController {
36 37
 
37 38
     @Autowired
38 39
     private TaAttachService taAttachService;
39
-    
40
+
41
+    @Autowired
42
+    private SysOrgService sysOrgService;
43
+
44
+    @Autowired
45
+    private ExportIssueUtil exportIssueUtil;
46
+
47
+
40 48
     /** 
41 49
      * 通过ID查询单条数据 
42 50
      *
@@ -95,15 +103,41 @@ public class TaOrgIssueController extends BaseController {
95 103
     @GetMapping("/taOrgIssue")
96 104
     public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
97 105
                              @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
106
+                             @ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
107
+                             @ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
98 108
                              @ApiParam("数据来源") @RequestParam(value ="sourceType", required = false) String sourceType,
99 109
                              @ApiParam("业务状态") @RequestParam(value ="bizStatus", required = false) String bizStatus) throws Exception {
100 110
         SysUser sysUser = currentUser();
101 111
 
102 112
         IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
103
-        IPage<TaIssue> result = taOrgIssueService.getIssuePageBy(pg, sysUser.getOrgId(), sourceType, bizStatus);
113
+        IPage<TaIssue> result = taOrgIssueService.getIssuePageBy(pg, sysUser.getOrgId(), issueId, sourceType, bizStatus, locId);
104 114
         
105 115
         return ResponseBean.success(result);
106 116
     }
117
+
118
+
119
+     /**
120
+      * 分页查询
121
+      *
122
+      * @param pageNum 当前页码
123
+      * @param pageSize 每页条数
124
+      * @return 查询结果
125
+      */
126
+     @ApiOperation("分页查询")
127
+     @PostMapping("/taOrgIssue/export")
128
+     public ResponseBean export(@ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
129
+                                @ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
130
+                                @ApiParam("数据来源") @RequestParam(value ="sourceType", required = false) String sourceType,
131
+                                @ApiParam("业务状态") @RequestParam(value ="bizStatus", required = false) String bizStatus,
132
+                                HttpServletResponse response) throws Exception {
133
+         SysUser sysUser = currentUser();
134
+
135
+         List<TaIssue> list = taOrgIssueService.getIssueListBy(sysUser.getOrgId(), issueId, sourceType, bizStatus, locId);
136
+         List<IssueExport> exportList = exportIssueUtil.getExportList(list);
137
+
138
+         ExcelUtils.flush(response, IssueExport.class, exportList, "问题单列表");
139
+         return null;
140
+     }
107 141
     
108 142
 //    /**
109 143
 //     * 新增数据

+ 4
- 0
src/main/java/com/example/civilizedcity/entity/SysOrg.java Просмотреть файл

@@ -36,6 +36,10 @@ public class SysOrg implements Serializable,Cloneable{
36 36
     /** 上级单位 */
37 37
     @ApiModelProperty(name = "上级单位",notes = "")
38 38
     private String orgPId ;
39
+
40
+     /** 是否责任单位 */
41
+     @ApiModelProperty(name = "是否责任单位",notes = "")
42
+    private Boolean isResponsible;
39 43
     /** 排序 */
40 44
     @ApiModelProperty(name = "排序",notes = "")
41 45
     private Integer sortNo ;

+ 4
- 0
src/main/java/com/example/civilizedcity/entity/SysUser.java Просмотреть файл

@@ -72,4 +72,8 @@ public class SysUser implements Serializable,Cloneable{
72 72
      @ApiModelProperty(name = "职责列表", notes = "")
73 73
      @TableField(exist = false)
74 74
      List<String> dutyList;
75
+
76
+     @ApiModelProperty(name = "单位信息", notes = "")
77
+     @TableField(exist = false)
78
+     SysOrg org;
75 79
 }

+ 10
- 9
src/main/java/com/example/civilizedcity/entity/TaIssue.java Просмотреть файл

@@ -33,7 +33,8 @@ import lombok.experimental.Accessors;
33 33
 @TableName("ta_issue")
34 34
 public class TaIssue implements Serializable, Cloneable {
35 35
 
36
-    @ExcelIgnore
36
+    @ColumnWidth(24)
37
+    @ExcelProperty(value = "问题单号", index = 0)
37 38
     @ApiModelProperty(name = "问题ID", notes = "")
38 39
     @TableId(value = "issue_id", type = IdType.AUTO)
39 40
     private Integer issueId;
@@ -55,7 +56,7 @@ public class TaIssue implements Serializable, Cloneable {
55 56
     private String locId;
56 57
 
57 58
     @ColumnWidth(30)
58
-    @ExcelProperty(value = "点位", index = 1)
59
+    @ExcelProperty(value = "点位", index = 2)
59 60
     @ApiModelProperty(name = "点位名称", notes = "")
60 61
     private String locName;
61 62
 
@@ -64,17 +65,17 @@ public class TaIssue implements Serializable, Cloneable {
64 65
     private String location;
65 66
 
66 67
     @ColumnWidth(50)
67
-    @ExcelProperty(value = "位置", index = 2)
68
+    @ExcelProperty(value = "位置", index = 3)
68 69
     @ApiModelProperty(name = "具体位置", notes = "")
69 70
     private String addr;
70 71
 
71 72
     @ColumnWidth(80)
72
-    @ExcelProperty(value = "问题详情", index = 3)
73
+    @ExcelProperty(value = "问题详情", index = 4)
73 74
     @ApiModelProperty(name = "问题详情", notes = "")
74 75
     private String content;
75 76
 
76 77
     @ColumnWidth(20)
77
-    @ExcelProperty(value = "流程状态", index = 5)
78
+    @ExcelProperty(value = "流程状态", index = 6)
78 79
     @ApiModelProperty(name = "流程节点", notes = "")
79 80
     private String processNode;
80 81
 
@@ -83,7 +84,7 @@ public class TaIssue implements Serializable, Cloneable {
83 84
     private String processStatus;
84 85
 
85 86
     @ColumnWidth(30)
86
-    @ExcelProperty(value = "截止时间", index = 6)
87
+    @ExcelProperty(value = "截止时间", index = 7)
87 88
     @ApiModelProperty(name = "截止时间", notes = "YYYY-MM-DD")
88 89
     private String expireDate;
89 90
 
@@ -92,14 +93,14 @@ public class TaIssue implements Serializable, Cloneable {
92 93
     private LocalDateTime endDate;
93 94
 
94 95
     @ColumnWidth(30)
95
-    @ExcelProperty(value = "交办次数", index = 7)
96
+    @ExcelProperty(value = "交办次数", index = 8)
96 97
     @ApiModelProperty(name = "交办次数", notes = "")
97 98
     private Integer processNum;
98 99
     /**
99 100
      * 责任单位
100 101
      */
101 102
     @ColumnWidth(40)
102
-    @ExcelProperty(value = "责任单位", index = 4)
103
+    @ExcelProperty(value = "责任单位", index = 5)
103 104
     @ApiModelProperty(name = "责任单位", notes = "")
104 105
     private String orgId;
105 106
 
@@ -140,7 +141,7 @@ public class TaIssue implements Serializable, Cloneable {
140 141
     private String userDuty;
141 142
 
142 143
     @ColumnWidth(30)
143
-    @ExcelProperty(value = "上报日期", index = 0, converter = LocalDateTimeConverter.class)
144
+    @ExcelProperty(value = "上报日期", index = 1, converter = LocalDateTimeConverter.class)
144 145
     @ApiModelProperty(name = "创建时间", notes = "")
145 146
     private LocalDateTime createDate;
146 147
 

+ 11
- 3
src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java Просмотреть файл

@@ -3,11 +3,11 @@ package com.example.civilizedcity.mapper;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.example.civilizedcity.entity.TaIssue;
6
-import org.apache.ibatis.annotations.MapKey;
7 6
 import org.apache.ibatis.annotations.Mapper;
8 7
 import org.apache.ibatis.annotations.Param;
9 8
 import com.example.civilizedcity.entity.TaOrgIssue;
10 9
 
10
+import java.util.List;
11 11
 import java.util.Map;
12 12
 
13 13
 /**
@@ -20,14 +20,22 @@ public interface TaOrgIssueMapper  extends BaseMapper<TaOrgIssue>{
20 20
 
21 21
      IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg,
22 22
                                    @Param("orgId") String orgId,
23
+                                   @Param("issueId") String issueId,
23 24
                                    @Param("sourceType") String sourceType,
24 25
                                    @Param("processNode") String processNode,
25
-                                   @Param("isExpire") Boolean isExpire
26
-     );
26
+                                   @Param("isExpire") Boolean isExpire,
27
+                                   @Param("locId") String locId);
27 28
 
28 29
      TaOrgIssue getByIssueAndOrg(@Param("issueId") Integer issueId, @Param("orgId") String orgId);
29 30
 
30 31
      Map<String, Object> statMaIndex(@Param("orgId") String orgId);
31 32
 
32 33
     int updateProcess(@Param("issueId") Integer issueId,@Param("orgId") String orgId,@Param("processStatus") String processStatus);
34
+
35
+    List<TaIssue> getIssueListBy(@Param("orgId") String orgId,
36
+                                 @Param("issueId") String issueId,
37
+                                 @Param("sourceType") String sourceType,
38
+                                 @Param("processNode") String processNode,
39
+                                 @Param("isExpire") Boolean isExpire,
40
+                                 @Param("locId") String locId);
33 41
 }

+ 2
- 0
src/main/java/com/example/civilizedcity/service/SysLoginService.java Просмотреть файл

@@ -18,4 +18,6 @@ public interface SysLoginService extends IBaseService<SysLogin> {
18 18
      boolean changePassword(SysUser user, WxChangePwd wxChangePwd);
19 19
 
20 20
     Map<String, Object> loginByPerson(TaPerson taPerson);
21
+
22
+    void removeByUser(String userId);
21 23
 }

+ 6
- 2
src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java Просмотреть файл

@@ -6,18 +6,22 @@ import com.example.civilizedcity.entity.TaIssue;
6 6
 import com.example.civilizedcity.entity.TaIssueProcess;
7 7
 import com.example.civilizedcity.entity.TaOrgIssue;
8 8
 
9
- /**
9
+import java.util.List;
10
+
11
+/**
10 12
  * 单位问题单;(ta_org_issue)表服务接口
11 13
  * @author : http://njyunzhi.com
12 14
  * @date : 2022-12-28
13 15
  */
14 16
 public interface TaOrgIssueService extends IBaseService<TaOrgIssue> {
15 17
 
16
-     IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus);
18
+     IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String issueId, String sourceType, String bizStatus, String locId);
17 19
 
18 20
      void createNewIssue(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser sysUser) throws Exception;
19 21
 
20 22
      TaOrgIssue getByIssueAndOrg(Integer issueId, String orgId);
21 23
 
22 24
      void updateData(TaOrgIssue taOrgIssue) throws Exception;
25
+
26
+     List<TaIssue> getIssueListBy(String orgId, String issueId, String sourceType, String bizStatus, String locId);
23 27
  }

+ 8
- 0
src/main/java/com/example/civilizedcity/service/impl/SysLoginServiceImpl.java Просмотреть файл

@@ -1,6 +1,7 @@
1 1
 package com.example.civilizedcity.service.impl;
2 2
 
3 3
 import cn.dev33.satoken.stp.StpUtil;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 5
 import com.example.civilizedcity.common.Constants;
5 6
 import com.example.civilizedcity.common.EncryptUtils;
6 7
 import com.example.civilizedcity.entity.SysUser;
@@ -84,4 +85,11 @@ public class SysLoginServiceImpl extends BaseServiceImpl<SysLoginMapper, SysLogi
84 85
 
85 86
         return res;
86 87
     }
88
+
89
+    @Override
90
+    public void removeByUser(String userId) {
91
+        QueryWrapper<SysLogin> queryWrapper = new QueryWrapper<>();
92
+        queryWrapper.eq("user_id", userId);
93
+        remove(queryWrapper);
94
+    }
87 95
 }

+ 20
- 3
src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java Просмотреть файл

@@ -36,20 +36,20 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
36 36
     TaAttachMapper taAttachMapper;
37 37
 
38 38
     @Override
39
-    public IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus) {
39
+    public IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String issueId, String sourceType, String bizStatus, String locId) {
40 40
 
41 41
         String processNode = null;
42 42
         Boolean isExpire = false;
43 43
 
44 44
         if (!StringUtils.isEmpty(bizStatus)) {
45
-            if ("expire".equals(bizStatus)) {
45
+            if ("expire".equals(bizStatus) || "expired".equals(bizStatus)) {
46 46
                 isExpire = true;
47 47
             } else {
48 48
                 processNode = bizStatus;
49 49
             }
50 50
         }
51 51
 
52
-        return baseMapper.getIssuePageBy(pg, orgId, sourceType, processNode, isExpire);
52
+        return baseMapper.getIssuePageBy(pg, orgId, issueId, sourceType, processNode, isExpire, locId);
53 53
     }
54 54
 
55 55
     @Transactional(rollbackFor = Exception.class)
@@ -127,4 +127,21 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
127 127
         taAttachMapper.deleteNotIn(idList, Constants.SOURCE_ORG_ISSUE, taOrgIssue.getOrgIssueId().toString());
128 128
         taOrgIssue.setAttachList(attachList);
129 129
     }
130
+
131
+    @Override
132
+    public List<TaIssue> getIssueListBy(String orgId, String issueId, String sourceType, String bizStatus, String locId) {
133
+
134
+        String processNode = null;
135
+        Boolean isExpire = false;
136
+
137
+        if (!StringUtils.isEmpty(bizStatus)) {
138
+            if ("expire".equals(bizStatus) || "expired".equals(bizStatus)) {
139
+                isExpire = true;
140
+            } else {
141
+                processNode = bizStatus;
142
+            }
143
+        }
144
+
145
+        return baseMapper.getIssueListBy(orgId, issueId, sourceType, processNode, isExpire, locId);
146
+    }
130 147
 }

+ 121
- 0
src/main/java/com/example/civilizedcity/vo/IssueExport.java Просмотреть файл

@@ -0,0 +1,121 @@
1
+package com.example.civilizedcity.vo;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
5
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
6
+import com.alibaba.excel.annotation.write.style.ContentStyle;
7
+import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
8
+import com.example.civilizedcity.common.excel.LocalDateTimeConverter;
9
+import io.swagger.annotations.ApiModel;
10
+import io.swagger.annotations.ApiModelProperty;
11
+import lombok.Data;
12
+import lombok.EqualsAndHashCode;
13
+import lombok.experimental.Accessors;
14
+
15
+import java.net.URL;
16
+import java.time.LocalDateTime;
17
+
18
+@ContentRowHeight(100)
19
+@ContentStyle(verticalAlignment = VerticalAlignmentEnum.CENTER)
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@ApiModel(value = "导出问题单", description = "")
24
+public class IssueExport {
25
+
26
+    @ColumnWidth(24)
27
+    @ExcelProperty(value = "问题单号", index = 0)
28
+    @ApiModelProperty(name = "问题ID", notes = "")
29
+    private Integer issueId;
30
+
31
+
32
+    @ColumnWidth(30)
33
+    @ExcelProperty(value = "上报日期", index = 1, converter = LocalDateTimeConverter.class)
34
+    @ApiModelProperty(name = "创建时间", notes = "")
35
+    private LocalDateTime createDate;
36
+
37
+    @ColumnWidth(30)
38
+    @ExcelProperty(value = "点位", index = 2)
39
+    @ApiModelProperty(name = "点位名称", notes = "")
40
+    private String locName;
41
+
42
+    @ColumnWidth(50)
43
+    @ExcelProperty(value = "位置", index = 3)
44
+    @ApiModelProperty(name = "具体位置", notes = "")
45
+    private String addr;
46
+
47
+    @ColumnWidth(80)
48
+    @ExcelProperty(value = "问题详情", index = 4)
49
+    @ApiModelProperty(name = "问题详情", notes = "")
50
+    private String content;
51
+
52
+    @ColumnWidth(40)
53
+    @ExcelProperty(value = "责任单位", index = 5)
54
+    @ApiModelProperty(name = "责任单位", notes = "")
55
+    private String orgId;
56
+
57
+    @ColumnWidth(20)
58
+    @ExcelProperty(value = "流程状态", index = 6)
59
+    @ApiModelProperty(name = "流程节点", notes = "")
60
+    private String processNode;
61
+
62
+    @ColumnWidth(30)
63
+    @ExcelProperty(value = "截止时间", index = 7)
64
+    @ApiModelProperty(name = "截止时间", notes = "YYYY-MM-DD")
65
+    private String expireDate;
66
+
67
+    @ColumnWidth(30)
68
+    @ExcelProperty(value = "交办次数", index = 8)
69
+    @ApiModelProperty(name = "交办次数", notes = "")
70
+    private Integer processNum;
71
+
72
+    @ColumnWidth(30)
73
+    @ExcelProperty(value = "问题图片", index = 9)
74
+    @ApiModelProperty(name = "问题图片", notes = "")
75
+    private URL url1;
76
+
77
+    @ColumnWidth(30)
78
+    @ExcelProperty(value = "问题图片", index = 10)
79
+    @ApiModelProperty(name = "问题图片", notes = "")
80
+    private URL url2;
81
+
82
+    @ColumnWidth(30)
83
+    @ExcelProperty(value = "问题图片", index = 11)
84
+    @ApiModelProperty(name = "问题图片", notes = "")
85
+    private URL url3;
86
+
87
+    @ColumnWidth(30)
88
+    @ExcelProperty(value = "问题图片", index = 12)
89
+    @ApiModelProperty(name = "问题图片", notes = "")
90
+    private URL url4;
91
+
92
+    @ColumnWidth(30)
93
+    @ExcelProperty(value = "问题图片", index = 13)
94
+    @ApiModelProperty(name = "问题图片", notes = "")
95
+    private URL url5;
96
+
97
+    @ColumnWidth(30)
98
+    @ExcelProperty(value = "处理结果图片", index = 14)
99
+    @ApiModelProperty(name = "处理结果图片", notes = "")
100
+    private URL url6;
101
+
102
+    @ColumnWidth(30)
103
+    @ExcelProperty(value = "处理结果图片", index = 15)
104
+    @ApiModelProperty(name = "处理结果图片", notes = "")
105
+    private URL url7;
106
+
107
+    @ColumnWidth(30)
108
+    @ExcelProperty(value = "处理结果图片", index = 16)
109
+    @ApiModelProperty(name = "处理结果图片", notes = "")
110
+    private URL url8;
111
+
112
+    @ColumnWidth(30)
113
+    @ExcelProperty(value = "处理结果图片", index = 17)
114
+    @ApiModelProperty(name = "处理结果图片", notes = "")
115
+    private URL url9;
116
+
117
+    @ColumnWidth(30)
118
+    @ExcelProperty(value = "处理结果图片", index = 18)
119
+    @ApiModelProperty(name = "处理结果图片", notes = "")
120
+    private URL url10;
121
+}

+ 1
- 1
src/main/resources/application-dev.yml Просмотреть файл

@@ -10,7 +10,7 @@ spring:
10 10
       # 空闲连接存活最大时间, 默认 600000 - 10分钟
11 11
       idle-timeout: 120000 # 2min
12 12
       # 最大连接池数, 默认 10
13
-      maximum-pool-size: 30
13
+      maximum-pool-size: 10
14 14
       # 连接池最长生命 0 无限期, 1800000 - 30分钟
15 15
       max-lifetime: 180000 # 3min
16 16
       # 连接超时 默认 30000 - 30秒

+ 1
- 1
src/main/resources/mapper/TaIssueMapper.xml Просмотреть файл

@@ -73,7 +73,7 @@
73 73
             UUID_SHORT( ) AS id,
74 74
             IFNULL( SUM( IF ( t.process_node = '03', t.process_num, 0 ) ), 0 ) AS endNum,
75 75
             IFNULL( SUM( IF ( t.process_node LIKE '02%', t.process_num, 0 ) ), 0 ) AS assignedNum,
76
-            IFNULL( SUM( IF ( t.expire_date &lt;= NOW( ) AND t.process_node != '03', t.process_num, 0 ) ), 0 ) AS expireNum
76
+            IFNULL( SUM( IF ( TO_DAYS(t.expire_date) &lt; TO_DAYS(NOW()) AND t.process_node != '03', t.process_num, 0 ) ), 0 ) AS expireNum
77 77
         FROM
78 78
             ta_issue t
79 79
         WHERE

+ 49
- 25
src/main/resources/mapper/TaOrgIssueMapper.xml Просмотреть файл

@@ -10,38 +10,49 @@
10 10
           AND t.issue_id = #{issueId}
11 11
     </update>
12 12
 
13
-    <select id="getIssuePageBy" resultType="com.example.civilizedcity.entity.TaIssue">
13
+    <sql id="getOrgIssueList">
14 14
         SELECT
15
-            *
15
+        *
16 16
         FROM
17
-            ta_issue t
17
+        ta_issue t
18 18
         WHERE
19 19
             EXISTS (
20
-                SELECT
20
+            SELECT
21 21
                 *
22
-                FROM
22
+            FROM
23 23
                 ta_org_issue s
24
-                WHERE
24
+            WHERE
25 25
                 s.issue_id = t.issue_id
26
-                AND s.org_id = #{orgId}
26
+                AND s.org_id = t.org_id
27 27
                 AND s.`status` &gt; -1
28 28
             )
29
-          <if test="sourceType != null and sourceType == 'feedback'">
30
-              AND t.source_type = 'feedback'
31
-          </if>
32
-          <if test="sourceType != null and sourceType != 'feedback'">
33
-              AND t.source_type in ('check', 'inspector')
34
-          </if>
35
-          <if test="processNode != null and processNode != ''">
29
+            AND t.org_id = #{orgId}
30
+        <if test="issueId != null and issueId != ''">
31
+            AND t.issue_id = #{issueId}
32
+        </if>
33
+        <if test="sourceType != null and sourceType == 'feedback'">
34
+            AND t.source_type = 'feedback'
35
+        </if>
36
+        <if test="sourceType != null and sourceType != 'feedback'">
37
+            AND t.source_type in ('check', 'inspector')
38
+        </if>
39
+        <if test="locId != null and locId != ''">
40
+            AND t.loc_id = #{locId}
41
+        </if>
42
+        <if test="processNode != null and processNode != ''">
36 43
             AND t.process_node LIKE CONCAT(#{processNode}, '%')
37
-          </if>
38
-          <if test="isExpire != null and isExpire">
44
+        </if>
45
+        <if test="isExpire != null and isExpire">
39 46
             AND t.process_node != '03'
40
-            AND t.expire_date &lt;= now( )
41
-          </if>
47
+            AND TO_DAYS(t.expire_date) &lt; TO_DAYS(now())
48
+        </if>
42 49
             AND t.`status` &gt; -1
43 50
         ORDER BY
44 51
             t.create_date DESC
52
+    </sql>
53
+
54
+    <select id="getIssuePageBy" resultType="com.example.civilizedcity.entity.TaIssue">
55
+        <include refid="getOrgIssueList"></include>
45 56
     </select>
46 57
     <select id="getByIssueAndOrg" resultType="com.example.civilizedcity.entity.TaOrgIssue">
47 58
         SELECT
@@ -52,16 +63,29 @@
52 63
             t.issue_id = #{issueId}
53 64
           AND t.org_id = #{orgId}
54 65
           AND t.`status` = 1
66
+        ORDER BY t.create_date DESC
67
+        LIMIT 1
55 68
     </select>
56 69
     <select id="statMaIndex" resultType="java.util.Map">
57 70
         select
58
-            SUM( IF ( TO_DAYS( now( ) ) > TO_DAYS( s.expire_date ) AND s.process_node != '03', 1, 0 ) ) AS delay_num,
59
-            SUM( IF (s.process_node = '03', 1, 0 ) ) AS end_num,
60
-            SUM( IF (s.process_node != '03', 1, 0 ) ) AS doing_num
61
-        from ta_org_issue t
62
-                 INNER JOIN ta_issue s on t.issue_id = s.issue_id AND t.org_id = s.org_id
63
-        where t.org_id = #{orgId}
71
+            SUM( IF ( TO_DAYS( now( ) ) > TO_DAYS( t.expire_date ) AND t.process_node != '03', 1, 0 ) ) AS delay_num,
72
+            SUM( IF (t.process_node = '03', 1, 0 ) ) AS end_num,
73
+            SUM( IF (t.process_node != '03', 1, 0 ) ) AS doing_num
74
+        from ta_issue t
75
+        where EXISTS (
76
+                SELECT
77
+                    *
78
+                FROM
79
+                    ta_org_issue s
80
+                WHERE
81
+                    s.issue_id = t.issue_id
82
+                  AND s.org_id = t.org_id
83
+                  AND s.`status` > - 1
84
+            )
85
+            and t.org_id = #{orgId}
64 86
           and t.`status` &gt; -1
65
-          and s.`status` &gt; -1
87
+    </select>
88
+    <select id="getIssueListBy" resultType="com.example.civilizedcity.entity.TaIssue">
89
+        <include refid="getOrgIssueList"></include>
66 90
     </select>
67 91
 </mapper>