Ver código fonte

Merge branch 'develop' of http://git.ycjcjy.com/fuxingfan/smartCommunity into develop

傅行帆 6 anos atrás
pai
commit
0f1f57e3fd

+ 66
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/exception/ExceptionHandleAdice.java Ver arquivo

@@ -0,0 +1,66 @@
1
+package com.community.huiju.exception;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import lombok.extern.slf4j.Slf4j;
6
+import org.springframework.validation.ObjectError;
7
+import org.springframework.web.bind.MethodArgumentNotValidException;
8
+import org.springframework.web.bind.annotation.ControllerAdvice;
9
+import org.springframework.web.bind.annotation.ExceptionHandler;
10
+import org.springframework.web.bind.annotation.ResponseBody;
11
+
12
+import java.util.List;
13
+
14
+/**
15
+ * 统一异常出口
16
+ * @author weiximei
17
+ */
18
+@ControllerAdvice
19
+@ResponseBody
20
+@Slf4j
21
+public class ExceptionHandleAdice {
22
+
23
+
24
+    @ExceptionHandler(Exception.class)
25
+    public ResponseBean handleException(Exception e){
26
+        log.error(e.getMessage(),e);
27
+        ResponseBean response = new ResponseBean();
28
+        response.addError(Constant.REQUEST_ERROR,"系统异常,请稍后重试!");
29
+        return response;
30
+    }
31
+
32
+    @ExceptionHandler(RuntimeException.class)
33
+    public ResponseBean handleException(RuntimeException e){
34
+        log.error(e.getMessage(),e);
35
+        ResponseBean response = new ResponseBean();
36
+        response.addError(e.getMessage());
37
+        return response;
38
+    }
39
+
40
+
41
+    @ExceptionHandler(WisdomException.class)
42
+    public ResponseBean handleException(WisdomException e) {
43
+        log.error(e.getMessage(),e);
44
+        ResponseBean response = new ResponseBean();
45
+        response.addError(e.getMessage());
46
+        return response;
47
+    }
48
+
49
+
50
+    @ExceptionHandler(MethodArgumentNotValidException.class)
51
+    public ResponseBean handlelllewgalParamException(MethodArgumentNotValidException e){
52
+        ResponseBean response = new ResponseBean();
53
+
54
+        List<ObjectError> errors  =e.getBindingResult().getAllErrors();
55
+        String message = "参数不合法";
56
+        if (errors.size() >0) {
57
+            message = errors.get(0).getDefaultMessage();
58
+        }
59
+
60
+        response.addError(message);
61
+
62
+        return response;
63
+    }
64
+
65
+
66
+}

+ 17
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/exception/WisdomException.java Ver arquivo

@@ -0,0 +1,17 @@
1
+package com.community.huiju.exception;
2
+
3
+
4
+/**
5
+ * @author weiximei
6
+ */
7
+public class WisdomException extends RuntimeException {
8
+
9
+
10
+    public WisdomException(String msg, Throwable t) {
11
+        super(msg, t);
12
+    }
13
+
14
+    public WisdomException(String msg) {
15
+        super(msg);
16
+    }
17
+}

+ 4
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Ver arquivo

@@ -140,9 +140,10 @@ public class TicketServiceImpl implements ITicketService {
140 140
                     "房屋质量":"2".equals(repairType)?
141 141
                     "户内设施":null;
142 142
             tpTicketVO.setRepairName(repairName);
143
-            tpTicketVO.setStatus(recordList.get(0).getStatus());
144
-            tpTicketVO.setTicketStatusName(recordList.get(0).getTicketStatusName());
145
-            tpTicketVO.setTicketRecordDate(recordList.get(0).getCreateDate());
143
+            tpTicketVO.setStatus(recordList.get(recordList.size()-1).getStatus());
144
+            tpTicketVO.setTicketStatusName(recordList.get(recordList.size()-1).getTicketStatusName());
145
+            tpTicketVO.setTicketRecordDate(recordList.get(recordList.size()-1).getCreateDate());
146
+            tpTicketVO.setTicketStatusContent(recordList.get(recordList.size()-1).getContent());
146 147
             if (null != comment) {
147 148
                 tpTicketVO.setCommentContent(comment.getContent());
148 149
                 tpTicketVO.setCommentCreateDate(comment.getCreateDate());

+ 3
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TpTicketVO.java Ver arquivo

@@ -58,6 +58,9 @@ public class TpTicketVO {
58 58
     /** 流程状态名称 **/
59 59
     private String ticketStatusName;
60 60
 
61
+    /** 流程状态内容 **/
62
+    private String ticketStatusContent;
63
+
61 64
     /** 流程状态时间 **/
62 65
     private Date ticketRecordDate;
63 66
 

+ 1
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml Ver arquivo

@@ -122,6 +122,7 @@
122 122
         t.status,
123 123
         t.ticket_id AS ticketId,
124 124
         t.community_id AS communityId,
125
+        t.content AS content,
125 126
         d.NAME AS ticketStatusName
126 127
     FROM
127 128
         tp_ticket_record t

+ 1
- 1
VUECODE/smart-operate-manage/src/views/banner/addBanner/index.vue Ver arquivo

@@ -22,7 +22,7 @@
22 22
       <el-form-item :label-width="formLabelWidth" label="banner图">
23 23
         <el-upload
24 24
           class="avatar-uploader"
25
-          action="http://localhost:8085/operate-api/uploadimage"
25
+          action="http://101.132.102.231:8085/operate-api/uploadimage"
26 26
           name="uploadFiles"
27 27
           :show-file-list="false"
28 28
           :on-success="handleAvatarSuccess">

+ 1
- 1
VUECODE/smart-operate-manage/src/views/banner/ediBanner/index.vue Ver arquivo

@@ -22,7 +22,7 @@
22 22
       <el-form-item :label-width="formLabelWidth" label="banner图">
23 23
         <el-upload
24 24
           class="avatar-uploader"
25
-          action="http://localhost:8085/operate-api/uploadimage"
25
+          action="http://101.132.102.231:8085/operate-api/uploadimage"
26 26
           name="uploadFiles"
27 27
           :show-file-list="false"
28 28
           :on-success="handleAvatarSuccess">