Browse Source

Merge branch 'develop'

傅行帆 6 years ago
parent
commit
5a93bc6fed
100 changed files with 4841 additions and 384 deletions
  1. 448
    243
      CODE/smart-community-word/.idea/workspace.xml
  2. 8
    0
      CODE/smart-community/app-api/pom.xml
  3. 1
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKConstant.java
  4. 236
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/welcome/OkHttpRequestUtils.java
  5. 26
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/welcome/WelcomeProperties.java
  6. 109
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AliPayController.java
  7. 14
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java
  8. 58
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  9. 26
    6
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  10. 2
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java
  11. 1
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxPayController.java
  12. 19
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/SysReportReasonMapper.java
  13. 8
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysUserRoleMapper.java
  14. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorLicenseMapper.java
  15. 7
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToCommunitiesMapper.java
  16. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java
  17. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java
  18. 10
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketMapper.java
  19. 9
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordCommentMapper.java
  20. 45
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionLikeMapper.java
  21. 30
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionReplyMapper.java
  22. 28
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionReportMapper.java
  23. 33
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/SysReportReason.java
  24. 11
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUser.java
  25. 13
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillInvoice.java
  26. 15
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java
  27. 39
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransaction.java
  28. 75
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionLike.java
  29. 121
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionReply.java
  30. 53
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionReport.java
  31. 16
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/AliPayServiceI.java
  32. 3
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/FaceServiceI.java
  33. 15
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  34. 1
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java
  35. 11
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java
  36. 28
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java
  37. 8
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java
  38. 120
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/AliPayServiceImpl.java
  39. 20
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java
  40. 4
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java
  41. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java
  42. 185
    8
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  43. 84
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  44. 4
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java
  45. 93
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java
  46. 75
    18
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java
  47. 3
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java
  48. 11
    1
      CODE/smart-community/app-api/src/main/resources/application.yml
  49. 71
    0
      CODE/smart-community/app-api/src/main/resources/mapper/SysReportReasonMapper.xml
  50. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TaSysMenuMapper.xml
  51. 7
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaSysUserRoleMapper.xml
  52. 16
    4
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml
  53. 7
    0
      CODE/smart-community/app-api/src/main/resources/mapper/ToCommunitiesMapper.xml
  54. 20
    6
      CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml
  55. 6
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TpCarouselSettingMapper.xml
  56. 85
    5
      CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml
  57. 15
    3
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml
  58. 12
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordCommentMapper.xml
  59. 140
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionLikeMapper.xml
  60. 150
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml
  61. 100
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReportMapper.xml
  62. 27
    1
      CODE/smart-community/community-common/src/main/java/com/community/commom/utils/AccountValidatorUtil.java
  63. 27
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/utils/DateUtils.java
  64. 20
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/TaSysMenuMapper.java
  65. 72
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TaSysMenu.java
  66. 30
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TaSysMenuImg.java
  67. 38
    2
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java
  68. 3
    1
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java
  69. 48
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/TaSysMenuMapper.xml
  70. 200
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/AnnouncementTelController.java
  71. 2
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillController.java
  72. 28
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillInvoiceController.java
  73. 135
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/CarouselSettingController.java
  74. 73
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/MessageController.java
  75. 4
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/SysMenuController.java
  76. 95
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TaSysMenuController.java
  77. 27
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/AnnouncementTelMapper.java
  78. 67
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/MessageMapper.java
  79. 27
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaSysMenuMapper.java
  80. 16
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java
  81. 77
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/AnnouncementTel.java
  82. 10
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/BillInvoice.java
  83. 132
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/Message.java
  84. 72
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TaSysMenu.java
  85. 47
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpCarouselSetting.java
  86. 27
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IAnnouncementTelService.java
  87. 1
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillService.java
  88. 16
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ICarouselSettingService.java
  89. 40
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IMessageService.java
  90. 25
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITaSysMenuService.java
  91. 52
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/AnnouncementTelServiceImpl.java
  92. 46
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java
  93. 163
    41
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java
  94. 107
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java
  95. 36
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TaSysMenuServiceImpl.java
  96. 101
    3
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java
  97. 56
    9
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpAnnouncementServiceImpl.java
  98. 20
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpCarouselSettingServiceImpl.java
  99. 67
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpTicketServiceImpl.java
  100. 0
    0
      CODE/smart-community/property-api/src/main/resources/mapper/AnnouncementTelMapper.xml

+ 448
- 243
CODE/smart-community-word/.idea/workspace.xml
File diff suppressed because it is too large
View File


+ 8
- 0
CODE/smart-community/app-api/pom.xml View File

@@ -114,6 +114,14 @@
114 114
 			<scope>provided</scope>
115 115
 		</dependency>
116 116
 
117
+		<!-- https://mvnrepository.com/artifact/com.alipay.sdk/alipay-sdk-java -->
118
+		<dependency>
119
+			<groupId>com.alipay.sdk</groupId>
120
+			<artifactId>alipay-sdk-java</artifactId>
121
+			<version>3.3.49.ALL</version>
122
+		</dependency>
123
+
124
+
117 125
 		<!-- log4j -->
118 126
 
119 127
 		<!--<dependency>-->

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKConstant.java View File

@@ -35,6 +35,7 @@ public class HKConstant {
35 35
     //  public static final String OPENAPI_IP_PORT_HTTPS = "http://192.168.0.122";
36 36
     //public static final String OPENAPI_IP_PORT_HTTP = "http://huiju.ngrok.xiaomiqiu.cn";
37 37
     public static final String OPENAPI_IP_PORT_HTTP = "http://huifang.vipgz1.idcfengye.com";
38
+    // public static final String OPENAPI_IP_PORT_HTTP = "192.168.10.200";
38 39
 
39 40
     /**
40 41
      * <p>操作用户UUID,即用户UUID,首次使用操作用户UUID可以通过接口 [获取默认用户UUID]来获取</p>

+ 236
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/welcome/OkHttpRequestUtils.java View File

@@ -0,0 +1,236 @@
1
+package com.community.huiju.common.welcome;
2
+
3
+import com.beust.jcommander.internal.Maps;
4
+import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream;
5
+import okhttp3.*;
6
+
7
+import java.io.*;
8
+import java.util.Iterator;
9
+import java.util.Map;
10
+
11
+/**
12
+ * 封装请求
13
+ * @author weiximei
14
+ */
15
+public class OkHttpRequestUtils {
16
+
17
+    // 定义请求客户端
18
+    private static OkHttpClient client = new OkHttpClient();
19
+
20
+    /**
21
+     * get 请求
22
+     * @param url 请求URL
23
+     * @return
24
+     * @throws Exception
25
+     */
26
+    public static String doGet(String url) throws Exception {
27
+       return doGet(url, Maps.newHashMap());
28
+    }
29
+
30
+
31
+    /**
32
+     * get 请求
33
+     * @param url 请求URL
34
+     * @param query 携带参数参数
35
+     * @return
36
+     * @throws Exception
37
+     */
38
+    public static String doGet(String url, Map<String, Object> query) throws Exception {
39
+
40
+        return doGet(url, Maps.newHashMap(), query);
41
+    }
42
+
43
+    /**
44
+     * get 请求
45
+     * @param url url
46
+     * @param header 请求头参数
47
+     * @param query 参数
48
+     * @return
49
+     */
50
+    public static String doGet(String url, Map<String, Object> header, Map<String, Object> query) throws Exception {
51
+
52
+        // 创建一个请求 Builder
53
+        Request.Builder builder = new Request.Builder();
54
+        // 创建一个 request
55
+        Request request = builder.url(url).build();
56
+
57
+        // 创建一个 HttpUrl.Builder
58
+        HttpUrl.Builder urlBuilder = request.url().newBuilder();
59
+        // 创建一个 Headers.Builder
60
+        Headers.Builder headerBuilder = request.headers().newBuilder();
61
+
62
+        // 装载请求头参数
63
+        Iterator<Map.Entry<String, Object>> headerIterator = header.entrySet().iterator();
64
+        headerIterator.forEachRemaining(e -> {
65
+            headerBuilder.add(e.getKey(), (String) e.getValue());
66
+        });
67
+
68
+        // 装载请求的参数
69
+        Iterator<Map.Entry<String, Object>> queryIterator = query.entrySet().iterator();
70
+        queryIterator.forEachRemaining(e -> {
71
+            urlBuilder.addQueryParameter(e.getKey(), (String) e.getValue());
72
+        });
73
+
74
+        // 设置自定义的 builder
75
+        builder.url(urlBuilder.build()).headers(headerBuilder.build());
76
+
77
+        try (Response execute = client.newCall(builder.build()).execute()) {
78
+            return execute.body().string();
79
+        }
80
+    }
81
+
82
+    /**
83
+     * post 请求, 请求参数 并且 携带文件上传
84
+     * @param url
85
+     * @param header
86
+     * @param parameter
87
+     * @param file
88
+     * @return
89
+     * @throws Exception
90
+     */
91
+    public static String doPost(String url, Map<String, Object> header, Map<String, Object> parameter, File file) throws Exception {
92
+
93
+        // 创建一个请求 Builder
94
+        Request.Builder builder = new Request.Builder();
95
+        // 创建一个 request
96
+        Request request = builder.url(url).build();
97
+
98
+        // 创建一个 Headers.Builder
99
+        Headers.Builder headerBuilder = request.headers().newBuilder();
100
+
101
+        // 装载请求头参数
102
+        Iterator<Map.Entry<String, Object>> headerIterator = header.entrySet().iterator();
103
+        headerIterator.forEachRemaining(e -> {
104
+            headerBuilder.add(e.getKey(), (String) e.getValue());
105
+        });
106
+
107
+        MultipartBody.Builder requestBuilder = new MultipartBody.Builder();
108
+
109
+        // 状态请求参数
110
+        Iterator<Map.Entry<String, Object>> queryIterator = parameter.entrySet().iterator();
111
+        queryIterator.forEachRemaining(e -> {
112
+            requestBuilder.addFormDataPart(e.getKey(), (String) e.getValue());
113
+        });
114
+
115
+        if (null != file) {
116
+            // application/octet-stream
117
+            requestBuilder.addFormDataPart("uploadFiles", file.getName(), RequestBody.create(MediaType.parse("application/octet-stream"), file));
118
+        }
119
+
120
+        // 设置自定义的 builder
121
+        builder.headers(headerBuilder.build()).post(requestBuilder.build());
122
+
123
+        // 然后再 build 一下
124
+        try (Response execute = client.newCall(builder.build()).execute()) {
125
+            return execute.body().string();
126
+        }
127
+    }
128
+
129
+    /**
130
+     * post 请求, 请求参数 并且 携带文件上传二进制流
131
+     * @param url
132
+     * @param header
133
+     * @param parameter
134
+     * @param fileName 文件名
135
+     * @param fileByte 文件的二进制流
136
+     * @return
137
+     * @throws Exception
138
+     */
139
+    public static String doPost(String url, Map<String, Object> header, Map<String, Object> parameter, String fileName, byte [] fileByte) throws Exception {
140
+// 创建一个请求 Builder
141
+        Request.Builder builder = new Request.Builder();
142
+        // 创建一个 request
143
+        Request request = builder.url(url).build();
144
+
145
+        // 创建一个 Headers.Builder
146
+        Headers.Builder headerBuilder = request.headers().newBuilder();
147
+
148
+        // 装载请求头参数
149
+        Iterator<Map.Entry<String, Object>> headerIterator = header.entrySet().iterator();
150
+        headerIterator.forEachRemaining(e -> {
151
+            headerBuilder.add(e.getKey(), (String) e.getValue());
152
+        });
153
+
154
+        MultipartBody.Builder requestBuilder = new MultipartBody.Builder();
155
+
156
+        // 状态请求参数
157
+        Iterator<Map.Entry<String, Object>> queryIterator = parameter.entrySet().iterator();
158
+        queryIterator.forEachRemaining(e -> {
159
+            requestBuilder.addFormDataPart(e.getKey(), (String) e.getValue());
160
+        });
161
+
162
+        if (fileByte.length > 0) {
163
+            // application/octet-stream
164
+            requestBuilder.addFormDataPart("uploadFiles", fileName, RequestBody.create(MediaType.parse("application/octet-stream"), fileByte));
165
+        }
166
+
167
+        // 设置自定义的 builder
168
+        builder.headers(headerBuilder.build()).post(requestBuilder.build());
169
+
170
+        try (Response execute = client.newCall(builder.build()).execute()) {
171
+            return execute.body().string();
172
+        }
173
+    }
174
+
175
+
176
+    /**
177
+     * post 请求  携带文件上传
178
+     * @param url
179
+     * @param file
180
+     * @return
181
+     * @throws Exception
182
+     */
183
+    public static String doPost(String url, File file) throws Exception {
184
+        return doPost(url, Maps.newHashMap(), Maps.newHashMap(), file);
185
+    }
186
+
187
+    /**
188
+     * post 请求
189
+     * @param url
190
+     * @param header 请求头
191
+     * @param parameter 参数
192
+     * @return
193
+     * @throws Exception
194
+     */
195
+    public static String doPost(String url, Map<String, Object> header, Map<String, Object> parameter) throws Exception {
196
+        return doPost(url, header, parameter, null);
197
+    }
198
+
199
+    /**
200
+     * post 请求
201
+     * @param url
202
+     * @param parameter 参数
203
+     * @return
204
+     * @throws Exception
205
+     */
206
+    public static String doPost(String url, Map<String, Object> parameter) throws Exception {
207
+        return doPost(url, Maps.newHashMap(), parameter, null);
208
+    }
209
+
210
+    public static void main(String[] args) throws Exception {
211
+
212
+        byte [] fileByte = null;
213
+
214
+        File file = new File("C:\\Users\\szc\\Pictures\\file-read-4182.jpg");
215
+        FileInputStream fileInputStream = new FileInputStream(file);
216
+
217
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
218
+        byte[] b = new byte[1024];
219
+        int n;
220
+        while ((n = fileInputStream.read(b)) != -1)
221
+        {
222
+            bos.write(b, 0, n);
223
+        }
224
+        fileInputStream.close();
225
+        bos.close();
226
+        fileByte = bos.toByteArray();
227
+
228
+
229
+        Map<String, Object> queryMap = Maps.newHashMap();
230
+        queryMap.put("pageNum","2");
231
+        queryMap.put("pageSize","50");
232
+        System.out.println(OkHttpRequestUtils.doPost("http://localhost:8080/uploadImage" , Maps.newHashMap(), Maps.newHashMap(),file.getName(), fileByte));
233
+
234
+    }
235
+
236
+}

+ 26
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/welcome/WelcomeProperties.java View File

@@ -0,0 +1,26 @@
1
+package com.community.huiju.common.welcome;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * 迎宾系统配置
11
+ * @author weiximei
12
+ */
13
+@ConfigurationProperties(prefix = "welcome")
14
+@Component
15
+@Data
16
+@AllArgsConstructor
17
+@NoArgsConstructor
18
+public class WelcomeProperties {
19
+
20
+    /** 小区 **/
21
+    private Integer communityId;
22
+
23
+    /** 请求url **/
24
+    private String url;
25
+
26
+}

+ 109
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AliPayController.java View File

@@ -0,0 +1,109 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.alipay.api.AlipayApiException;
4
+import com.alipay.api.internal.util.AlipaySignature;
5
+import com.community.commom.constant.Constant;
6
+import com.community.commom.mode.ResponseBean;
7
+import com.community.commom.session.UserElement;
8
+import com.community.huiju.common.wxpay.WXPayConstants;
9
+import com.community.huiju.common.wxpay.WXPayUtil;
10
+import com.community.huiju.service.AliPayServiceI;
11
+import com.community.huiju.service.WxPayServiceI;
12
+import com.google.common.collect.Maps;
13
+import io.swagger.annotations.Api;
14
+import io.swagger.annotations.ApiImplicitParam;
15
+import io.swagger.annotations.ApiImplicitParams;
16
+import io.swagger.annotations.ApiOperation;
17
+import org.slf4j.Logger;
18
+import org.slf4j.LoggerFactory;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.beans.factory.annotation.Value;
21
+import org.springframework.cloud.context.config.annotation.RefreshScope;
22
+import org.springframework.web.bind.annotation.PathVariable;
23
+import org.springframework.web.bind.annotation.RequestMapping;
24
+import org.springframework.web.bind.annotation.RequestMethod;
25
+import org.springframework.web.bind.annotation.RestController;
26
+
27
+import javax.servlet.http.HttpServletRequest;
28
+import javax.servlet.http.HttpServletResponse;
29
+import javax.servlet.http.HttpSession;
30
+import java.io.ByteArrayOutputStream;
31
+import java.io.InputStream;
32
+import java.util.HashMap;
33
+import java.util.Iterator;
34
+import java.util.Map;
35
+
36
+import static com.alipay.api.AlipayConstants.CHARSET_UTF8;
37
+
38
+/**
39
+ * @author FXF
40
+ * @date 2019-03-12
41
+ */
42
+@RestController
43
+@RefreshScope
44
+@RequestMapping("/")
45
+@Api(value = "支付宝支付 API", description = "支付宝支付 API")
46
+public class AliPayController {
47
+	
48
+	private Logger log = LoggerFactory.getLogger(AliPayController.class);
49
+	
50
+	@Autowired
51
+	private AliPayServiceI aliPayService;
52
+	
53
+	@Autowired
54
+	private WxPayServiceI wxPayService;
55
+	
56
+	@Value("${alipay.ALIPAY_PUBLIC_KEY}")
57
+	private String ALIPAY_PUBLIC_KEY;
58
+	
59
+	@ApiOperation(value = "统一下单", notes = "统一下单")
60
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "billInvoiceId", value = "账单Id"),
61
+			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token") })
62
+	@RequestMapping(value = "/aliPayOrder/{billInvoiceId}",method = RequestMethod.GET)
63
+	public ResponseBean wxUnifiedOrder(@PathVariable("billInvoiceId") Integer billInvoiceId, HttpSession session){
64
+		ResponseBean responseBean = new ResponseBean();
65
+		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
66
+		String resp = "";
67
+		try {
68
+			resp = aliPayService.AliPayOrder(billInvoiceId,userElement);
69
+		} catch (Exception e) {
70
+			e.printStackTrace();
71
+			responseBean.addError(e.getMessage());
72
+			return responseBean;
73
+		}
74
+		responseBean.addSuccess(resp);
75
+		return responseBean;
76
+	}
77
+	
78
+	@ApiOperation(value = "支付宝手机订单支付完成后回调", notes = "支付宝手机订单支付完成后回调")
79
+	@RequestMapping(value = "/aliPayNotify",method = RequestMethod.POST)
80
+	public void aliPayNotify(HttpServletRequest request, HttpServletResponse response){
81
+		System.out.println("alipay result  start =======");
82
+		Map<String,String> params = new HashMap<String,String>();
83
+		Map requestParams = request.getParameterMap();
84
+		for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext();) {
85
+			String name = (String) iter.next();
86
+			String[] values = (String[]) requestParams.get(name);
87
+			String valueStr = "";
88
+			for (int i = 0; i < values.length; i++) {
89
+				valueStr = (i == values.length - 1) ? valueStr + values[i]
90
+						: valueStr + values[i] + ",";
91
+			}
92
+			//乱码解决,这段代码在出现乱码时使用。
93
+			//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
94
+			params.put(name, valueStr);
95
+		}
96
+		//切记alipaypublickey是支付宝的公钥,请去open.alipay.com对应应用下查看。
97
+		try {
98
+			boolean flag = AlipaySignature.rsaCheckV1(params, ALIPAY_PUBLIC_KEY, CHARSET_UTF8,"RSA2");
99
+			if (flag){
100
+				params.put("pay_type","2");
101
+				wxPayService.wxNotify(params);
102
+			}
103
+		} catch (AlipayApiException e) {
104
+			e.printStackTrace();
105
+		} catch (Exception e) {
106
+			e.printStackTrace();
107
+		}
108
+	}
109
+}

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java View File

@@ -111,4 +111,18 @@ public class MessageController extends BaseController {
111 111
 		messageService.updateMessageReadStatus(communityId, userId);
112 112
 		return responseBean;
113 113
 	}
114
+
115
+
116
+	@ApiOperation(value = "根据消息id进行已读", notes = "根据消息id进行已读")
117
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "messageId", value = "消息id"),
118
+			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")})
119
+	@RequestMapping(value = "/messageIdreadStatus/{messageId}",method = RequestMethod.PUT)
120
+	public ResponseBean updateMessageByIdReadStatus(HttpSession session, @PathVariable("messageId") Integer messageId) {
121
+		ResponseBean responseBean = new ResponseBean();
122
+		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
123
+		responseBean = messageService.updateMessageByIdReadStatus(userElement, messageId);
124
+		return responseBean;
125
+	}
126
+
127
+
114 128
 }

+ 58
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java View File

@@ -266,6 +266,35 @@ public class SocialController extends BaseController {
266 266
         return responseBean;
267 267
     }
268 268
 
269
+
270
+    @ApiOperation(value = "查询二手租赁回复", notes = "查询二手租赁回复")
271
+    @ApiImplicitParams({
272
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "transactionId", value = "活动帖子id"),
273
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
274
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageNum", value = "第几页"),
275
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageSize", value = "一页多少行"),
276
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "order", value = "asc 正序(默认), desc倒序")
277
+    })
278
+    @RequestMapping(value = "/getTransactionReply", method = RequestMethod.GET)
279
+    public ResponseBean findUsedDetailsReply(@RequestParam("transactionId") Integer transactionId,
280
+                                             @RequestParam(value = "order", defaultValue = "asc") String order,
281
+                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
282
+                                             @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
283
+                                             HttpSession session) {
284
+        ResponseBean responseBean = new ResponseBean();
285
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
286
+
287
+        if (!check(userElement.getCommunityId())) {
288
+            responseBean.addError("小区不存在");
289
+            return responseBean;
290
+        }
291
+
292
+        responseBean = socialServiceI.findUsedDetailsReply(transactionId, userElement, order, pageNum, pageSize);
293
+        return responseBean;
294
+    }
295
+
296
+
297
+
269 298
     @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
270 299
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
271 300
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),
@@ -367,7 +396,7 @@ public class SocialController extends BaseController {
367 396
     public ResponseBean deleteTransaction(HttpSession session, @PathVariable("id") String id) {
368 397
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
369 398
         Integer userId = userElement.getId();
370
-        ResponseBean response = socialServiceI.deleteransaction(Integer.valueOf(id),userId);
399
+        ResponseBean response = socialServiceI.deleteransaction(Integer.valueOf(id),userElement);
371 400
         return response;
372 401
     }
373 402
 
@@ -401,4 +430,32 @@ public class SocialController extends BaseController {
401 430
         responseBean.addSuccess(reportList);
402 431
         return responseBean;
403 432
     }
433
+
434
+    @ApiOperation(value = "二手帖子对话", notes = "二手帖子对话")
435
+    @ApiImplicitParams({
436
+            @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
437
+                    "transactionId:当前帖子ID,replyContent:回复内容,replyTaUserId:被回复的用户ID"),
438
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
439
+    })
440
+    @RequestMapping(value = "/addTransactionReply", method = RequestMethod.POST)
441
+    public ResponseBean addTransactionReply(HttpSession session, @RequestBody String paramets) {
442
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
443
+        ResponseBean response = socialServiceI.addTransactionReply(paramets,userElement);
444
+        return response;
445
+    }
446
+
447
+    @ApiOperation(value = "添加点赞", notes = "添加点赞")
448
+    @ApiImplicitParams({
449
+            @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
450
+                    "transactionId:当前帖子ID,likeStatus:1是喜欢 2是不喜欢"),
451
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
452
+    })
453
+    @RequestMapping(value = "/addTransactionLike", method = RequestMethod.POST)
454
+    public ResponseBean addTransactionLike(HttpSession session, @RequestBody String paramets) {
455
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
456
+        ResponseBean response = socialServiceI.addTransactionLike(paramets,userElement);
457
+        return response;
458
+    }
459
+
460
+
404 461
 }

+ 26
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java View File

@@ -19,6 +19,7 @@ import org.springframework.beans.BeanUtils;
19 19
 import org.springframework.beans.factory.annotation.Autowired;
20 20
 import org.springframework.cloud.context.config.annotation.RefreshScope;
21 21
 import org.springframework.web.bind.annotation.*;
22
+import org.springframework.web.multipart.MultipartFile;
22 23
 
23 24
 import javax.servlet.http.HttpSession;
24 25
 import javax.xml.crypto.dsig.keyinfo.PGPData;
@@ -90,9 +91,9 @@ public class UserController extends BaseController {
90 91
         responseBean.addSuccess(taUserList);
91 92
         return responseBean;
92 93
     }
93
-    @ApiOperation(value = "修改用户名和性别", notes = "修改用户名和性别")
94
+    @ApiOperation(value = "修改用户名和性别和身份证", notes = "修改用户名和性别和身份证")
94 95
     @ApiImplicitParams({
95
-            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName用户民和gender性别"),
96
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName用户民和gender性别和idCard身份证"),
96 97
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
97 98
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 app"),
98 99
     })
@@ -137,7 +138,8 @@ public class UserController extends BaseController {
137 138
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName(租客或者家属 姓名) " +
138 139
                     "phone(租客或者家属 手机号) " +
139 140
                     "gender(租客或者家属 性别 1男 2女) " +
140
-                    "type(2租客 3家属)"),
141
+                    "type(2租客 3家属)" +
142
+                    "idCard(身份证号)"),
141 143
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 app"),
142 144
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
143 145
     })
@@ -151,7 +153,7 @@ public class UserController extends BaseController {
151 153
         response = iTaUserService.addTenantsOrDependents(jsonObject.getString("userName"),
152 154
                 jsonObject.getString("phone"),jsonObject.getString("gender"),
153 155
                 userElement.getId(),
154
-                jsonObject.getInteger("type"));
156
+                jsonObject.getInteger("type"), jsonObject.getString("idCard"));
155 157
 
156 158
         return response;
157 159
 
@@ -163,7 +165,8 @@ public class UserController extends BaseController {
163 165
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "id(租客或者家属 ID) userName(租客或者家属 姓名) " +
164 166
                     "phone(租客或者家属 手机号) " +
165 167
                     "gender(租客或者家属 性别 1男 2女) " +
166
-                    "type(2租客 3家属)"),
168
+                    "type(2租客 3家属)" +
169
+                    "idCard(身份证号)"),
167 170
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 app"),
168 171
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
169 172
     })
@@ -178,7 +181,8 @@ public class UserController extends BaseController {
178 181
                 jsonObject.getString("phone"),jsonObject.getString("gender"),
179 182
                 userElement.getId(),
180 183
                 jsonObject.getInteger("type"),
181
-                jsonObject.getInteger("id"));
184
+                jsonObject.getInteger("id"),
185
+                jsonObject.getString("idCard"));
182 186
 
183 187
         return response;
184 188
 
@@ -247,4 +251,20 @@ public class UserController extends BaseController {
247 251
         userVO.setToken(session.getId());
248 252
         return responseBean;
249 253
     }
254
+
255
+    @ApiOperation(value = "迎宾系统添加人员", notes = "迎宾系统添加人员")
256
+    @ApiImplicitParams({
257
+            @ApiImplicitParam(paramType = "form", dataTypeClass = String.class, value = "userName人员名称"),
258
+            @ApiImplicitParam(paramType = "form", dataTypeClass = MultipartFile.class, name = "file", value = "图片"),
259
+            @ApiImplicitParam(paramType = "path", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
260
+    })
261
+    @RequestMapping(value = "/user/welcome/add", method = RequestMethod.POST)
262
+    public ResponseBean welcomeAddUser(@RequestParam("userName") String userName, @RequestParam("file") MultipartFile file, HttpSession session) {
263
+        ResponseBean responseBean = new ResponseBean();
264
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
265
+        TaUser user = new TaUser();
266
+        user.setUserName(userName);
267
+        responseBean = iTaUserService.welcomeFace(userElement, file, user);
268
+        return responseBean;
269
+    }
250 270
 }

+ 2
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java View File

@@ -38,7 +38,7 @@ public class VistorController extends BaseController {
38 38
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
39 39
             @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
40 40
             @ApiImplicitParam(paramType = "body", dataType = "String", name = "parameter", value = "carLicense:车牌(数组),drivingStatus:0 是不开车 1是开车," +
41
-                    "visitorName:访问人姓名,visitorNum:访问人数,visitorTel:访问人电话,visitorStartTime:访问人开始时间,visitorEndTime:访问人结束时间")})
41
+                    "visitorName:访问人姓名,visitorNum:访问人数,visitorTel:访问人电话,visitorStartTime:访问人开始时间,visitorEndTime:访问人结束时间,payEntity:支付方式(owmer是由我承担  visitor是访客承担)")})
42 42
     public ResponseBean findVistorDetail(@PathVariable("communityId")Integer communityId, @RequestBody String parameter, HttpSession session) {
43 43
         ResponseBean responseBean = new ResponseBean();
44 44
 
@@ -68,8 +68,7 @@ public class VistorController extends BaseController {
68 68
 
69 69
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
70 70
         Integer userId = userElement.getId();
71
-        List<TaVisitor> taVisitors = vistorServiceI.invateHis(communityId, userId);
72
-        responseBean.addSuccess(taVisitors);
71
+        responseBean = vistorServiceI.invateHis(communityId, userId);
73 72
         return  responseBean;
74 73
     }
75 74
 }

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxPayController.java View File

@@ -95,6 +95,7 @@ public class WxPayController {
95 95
 			Map<String, String> resultMap = WXPayUtil.xmlToMap(result);
96 96
 			if (WXPayConstants.SUCCESS.equalsIgnoreCase(resultMap.get("result_code"))) {
97 97
 				//处理业务逻辑 修改订单状态等
98
+				resultMap.put("pay_type","0");
98 99
 				String state = wxPayService.wxNotify(resultMap);
99 100
 				if (state.equals("success")){
100 101
 					log.info("微信支付成功。。");

+ 19
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/SysReportReasonMapper.java View File

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.SysReportReason;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface SysReportReasonMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(SysReportReason record);
11
+
12
+    int insertSelective(SysReportReason record);
13
+
14
+    SysReportReason selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(SysReportReason record);
17
+
18
+    int updateByPrimaryKey(SysReportReason record);
19
+}

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysUserRoleMapper.java View File

@@ -3,6 +3,7 @@ package com.community.huiju.dao;
3 3
 
4 4
 import com.community.huiju.model.TaSysUserRole;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 import java.util.Map;
8 9
 
@@ -30,4 +31,11 @@ public interface TaSysUserRoleMapper {
30 31
      * @return
31 32
      */
32 33
     TaSysUserRole selectByCommunityIdAndUserId(Map<String,Object> map);
34
+
35
+    /**
36
+     *查询角色
37
+     * @param userId
38
+     * @return
39
+     */
40
+    TaSysUserRole selectRole(@Param("communityId") Integer communityId,@Param("userId") Integer userId);
33 41
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorLicenseMapper.java View File

@@ -19,7 +19,7 @@ public interface TaVisitorLicenseMapper {
19 19
 
20 20
     int updateByPrimaryKey(TaVisitorLicense record);
21 21
 
22
-    void insertTaVistorLicense(TaVisitorLicense taVisitorLicense);
22
+    // void insertTaVistorLicense(TaVisitorLicense taVisitorLicense);
23 23
 
24 24
     List<String> findTaVistorLicenseById(Integer id);
25 25
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToCommunitiesMapper.java View File

@@ -22,4 +22,11 @@ public interface ToCommunitiesMapper {
22 22
     int updateByPrimaryKey(ToCommunities record);
23 23
     
24 24
     List<ToCommunities> selectByCommunityName(@Param(value="communityName") String communityName);
25
+
26
+    /**
27
+     * 查询超级管理员
28
+     * @param communityId
29
+     * @return
30
+     */
31
+    Integer selectAndmin(@Param("communityId") Integer communityId);
25 32
 }

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java View File

@@ -2,6 +2,7 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpCarouselSetting;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 @Mapper
7 8
 public interface TpCarouselSettingMapper {
@@ -17,7 +18,7 @@ public interface TpCarouselSettingMapper {
17 18
 
18 19
     int updateByPrimaryKey(TpCarouselSetting record);
19 20
 
20
-     Integer getcarouselNum(String lease);
21
+     Integer getcarouselNum(@Param("lease") String lease, @Param("communityId") Integer communityId);
21 22
 
22 23
     Integer selectCarouselNum(String carouselType);
23 24
 

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java View File

@@ -36,4 +36,28 @@ public interface TpMessageMapper {
36 36
      * @return
37 37
      */
38 38
     TpMessage selectTicketMessage(TpMessage tpMessage);
39
+
40
+    /**
41
+     * 维护物业端消息推送
42
+     */
43
+    void updateTickMessage(@Param("message") TpMessage message);
44
+
45
+    /**
46
+     * 查询工单id是否为空
47
+     */
48
+    Integer selectTicket(@Param(value = "communityId") Integer ticketId);
49
+
50
+    /**
51
+     * 根据条件查询消息
52
+     * @param map
53
+     * @return
54
+     */
55
+    TpMessage selectConditionsTpMessage(Map<String, Object> map);
56
+
57
+    /**
58
+     * 根据条件查询 消息代办
59
+     * @param map
60
+     * @return
61
+     */
62
+    TpMessage selectBillinvoiceMessage(@Param("map") Map<String, Object> map);
39 63
 }

+ 10
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketMapper.java View File

@@ -37,4 +37,14 @@ public interface TpTicketMapper {
37 37
 	TpTicket selectByTicketId(@Param("communityId") String communityId,@Param("ticketId") Integer ticketId);
38 38
 
39 39
     void updateTpUserId(@Param("ticketId") Integer ticketId);
40
+
41
+    /**
42
+     * 查看当前工单分配人
43
+     * @param ticketId
44
+     * @param communityId
45
+     * @return
46
+     */
47
+    TpTicket getTicketTpUserId(@Param("ticketId") Integer ticketId, @Param("communityId") Integer communityId);
48
+
49
+    Integer selectRecordStatus(@Param("communityId") Integer communityId, @Param("ticketId")Integer ticketId);
40 50
 }

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordCommentMapper.java View File

@@ -3,6 +3,7 @@ package com.community.huiju.dao;
3 3
 import com.community.huiju.model.TpTicketRecord;
4 4
 import com.community.huiju.model.TpTicketRecordComment;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 import java.util.List;
8 9
 import java.util.Map;
@@ -38,4 +39,12 @@ public interface TpTicketRecordCommentMapper {
38 39
      * @return
39 40
      */
40 41
 	List<TpTicketRecordComment> selectByTicketRecordId(TpTicketRecord tpTicketRecord);
42
+
43
+    /**
44
+     * 查询当前最后回复物业人员1.5需求指定要求
45
+     * @param communityId
46
+     * @param ticketId
47
+     * @return
48
+     */
49
+    TpTicketRecordComment getUuID(@Param("communityId") Integer communityId, @Param("ticketId") Integer ticketId);
41 50
 }

+ 45
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionLikeMapper.java View File

@@ -0,0 +1,45 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpTransactionLike;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+@Mapper
7
+public interface TpTransactionLikeMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(TpTransactionLike record);
11
+
12
+    int insertSelective(TpTransactionLike record);
13
+
14
+    TpTransactionLike selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(TpTransactionLike record);
17
+
18
+    int updateByPrimaryKey(TpTransactionLike record);
19
+
20
+    /**
21
+     * 点赞
22
+     * @param invitationId
23
+     * @param communityId
24
+     * @return
25
+     */
26
+    Integer likeCount(@Param("invitationId") Integer invitationId, @Param("communityId") Integer communityId);
27
+
28
+    /**
29
+     * 踩
30
+     * @param invitationId
31
+     * @param communityId
32
+     * @return
33
+     */
34
+    Integer nolikeCount(@Param("invitationId") Integer invitationId, @Param("communityId") Integer communityId);
35
+
36
+    /**
37
+     * 查询当前人是否存在数据
38
+     * @param invitationId
39
+     * @param communityId
40
+     * @param userId
41
+     * @return
42
+     */
43
+    TpTransactionLike getinvitationId(@Param("invitationId") Integer invitationId, @Param("communityId") Integer communityId, @Param("userId") Integer userId);
44
+
45
+}

+ 30
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionReplyMapper.java View File

@@ -0,0 +1,30 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpTransactionReply;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+
9
+@Mapper
10
+public interface TpTransactionReplyMapper {
11
+    int deleteByPrimaryKey(Integer id);
12
+
13
+    int insert(TpTransactionReply record);
14
+
15
+    int insertSelective(TpTransactionReply record);
16
+
17
+    TpTransactionReply selectByPrimaryKey(Integer id);
18
+
19
+    int updateByPrimaryKeySelective(TpTransactionReply record);
20
+
21
+    int updateByPrimaryKey(TpTransactionReply record);
22
+
23
+    /**
24
+     * 根据 小区id 和 帖子id
25
+     * @param communityId
26
+     * @param transactionId
27
+     * @return
28
+     */
29
+    List<TpTransactionReply> getCommunityIdAndTransactionId(@Param("communityId") Integer communityId, @Param("transactionId") Integer transactionId);
30
+}

+ 28
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionReportMapper.java View File

@@ -0,0 +1,28 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpTransactionReport;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+@Mapper
8
+public interface TpTransactionReportMapper {
9
+    int deleteByPrimaryKey(Integer id);
10
+
11
+    int insert(TpTransactionReport record);
12
+
13
+    int insertSelective(TpTransactionReport record);
14
+
15
+    TpTransactionReport selectByPrimaryKey(Integer id);
16
+
17
+    int updateByPrimaryKeySelective(TpTransactionReport record);
18
+
19
+    int updateByPrimaryKey(TpTransactionReport record);
20
+
21
+    /**
22
+     * 根据小区 和 帖子id
23
+     * @param communityId
24
+     * @param transactionId
25
+     * @return
26
+     */
27
+    TpTransactionReport selectByCommunityIdAndTransactionId(@Param("userId") Integer userId, @Param("communityId") Integer communityId, @Param("transactionId") Integer transactionId);
28
+}

+ 33
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/SysReportReason.java View File

@@ -0,0 +1,33 @@
1
+package com.community.huiju.model;
2
+
3
+public class SysReportReason {
4
+    private Integer id;
5
+
6
+    private String reason;
7
+
8
+    private Integer sort;
9
+
10
+    public Integer getId() {
11
+        return id;
12
+    }
13
+
14
+    public void setId(Integer id) {
15
+        this.id = id;
16
+    }
17
+
18
+    public String getReason() {
19
+        return reason;
20
+    }
21
+
22
+    public void setReason(String reason) {
23
+        this.reason = reason == null ? null : reason.trim();
24
+    }
25
+
26
+    public Integer getSort() {
27
+        return sort;
28
+    }
29
+
30
+    public void setSort(Integer sort) {
31
+        this.sort = sort;
32
+    }
33
+}

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUser.java View File

@@ -39,6 +39,9 @@ public class TaUser {
39 39
 
40 40
     private Date updateDate;
41 41
 
42
+    // 身份证
43
+    private String idCard;
44
+
42 45
     // 海康UserId
43 46
     private Integer hkUserId;
44 47
 
@@ -248,4 +251,12 @@ public class TaUser {
248 251
     public void setHkPersonNo(Long hkPersonNo) {
249 252
         this.hkPersonNo = hkPersonNo;
250 253
     }
254
+
255
+    public String getIdCard() {
256
+        return idCard;
257
+    }
258
+
259
+    public void setIdCard(String idCard) {
260
+        this.idCard = idCard;
261
+    }
251 262
 }

+ 13
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillInvoice.java View File

@@ -37,6 +37,11 @@ public class TpBillInvoice {
37 37
     
38 38
     private String billName;
39 39
 
40
+    /**
41
+     * 缴费方式  0:微信支付  1:线下缴费
42
+     */
43
+    private String payType;
44
+
40 45
     public Integer getId() {
41 46
         return id;
42 47
     }
@@ -172,4 +177,12 @@ public class TpBillInvoice {
172 177
     public void setBillName(String billName) {
173 178
         this.billName = billName;
174 179
     }
180
+
181
+    public String getPayType() {
182
+        return payType;
183
+    }
184
+
185
+    public void setPayType(String payType) {
186
+        this.payType = payType;
187
+    }
175 188
 }

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java View File

@@ -75,10 +75,25 @@ public class TpMessage {
75 75
     
76 76
     private String messageIconTitle;
77 77
 
78
+    /**
79
+     * 举报ID
80
+     * @return
81
+     */
82
+     private  Integer transactionId;
83
+
84
+    public Integer getTransactionId() {
85
+        return transactionId;
86
+    }
87
+
88
+    public void setTransactionId(Integer transactionId) {
89
+        this.transactionId = transactionId;
90
+    }
91
+
78 92
     public Integer getId() {
79 93
         return id;
80 94
     }
81 95
 
96
+
82 97
     public void setId(Integer id) {
83 98
         this.id = id;
84 99
     }

+ 39
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransaction.java View File

@@ -44,6 +44,21 @@ public class TpTransaction {
44 44
 
45 45
     private  String roleName;
46 46
 
47
+    /**
48
+     * 顶赞的次数
49
+     */
50
+    private Integer likeCount;
51
+    /**
52
+     * 踩的人数
53
+     */
54
+    private Integer noLikeCount;
55
+
56
+    /**
57
+     * 是否已点赞或者踩
58
+     */
59
+    private String bel;
60
+
61
+
47 62
     public String getRoleName() {
48 63
         return roleName;
49 64
     }
@@ -184,4 +199,28 @@ public class TpTransaction {
184 199
     public void setCreateUserName(String createUserName) {
185 200
         this.createUserName = createUserName;
186 201
     }
202
+
203
+    public Integer getLikeCount() {
204
+        return likeCount;
205
+    }
206
+
207
+    public void setLikeCount(Integer likeCount) {
208
+        this.likeCount = likeCount;
209
+    }
210
+
211
+    public Integer getNoLikeCount() {
212
+        return noLikeCount;
213
+    }
214
+
215
+    public void setNoLikeCount(Integer noLikeCount) {
216
+        this.noLikeCount = noLikeCount;
217
+    }
218
+
219
+    public String getBel() {
220
+        return bel;
221
+    }
222
+
223
+    public void setBel(String bel) {
224
+        this.bel = bel;
225
+    }
187 226
 }

+ 75
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionLike.java View File

@@ -0,0 +1,75 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpTransactionLike {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer taUserId;
11
+
12
+    private Integer transactionId;
13
+
14
+    private String likeStatus;
15
+
16
+    private Date createDate;
17
+
18
+    private Date updateDate;
19
+
20
+    public Integer getId() {
21
+        return id;
22
+    }
23
+
24
+    public void setId(Integer id) {
25
+        this.id = id;
26
+    }
27
+
28
+    public Integer getCommunityId() {
29
+        return communityId;
30
+    }
31
+
32
+    public void setCommunityId(Integer communityId) {
33
+        this.communityId = communityId;
34
+    }
35
+
36
+    public Integer getTaUserId() {
37
+        return taUserId;
38
+    }
39
+
40
+    public void setTaUserId(Integer taUserId) {
41
+        this.taUserId = taUserId;
42
+    }
43
+
44
+    public Integer getTransactionId() {
45
+        return transactionId;
46
+    }
47
+
48
+    public void setTransactionId(Integer transactionId) {
49
+        this.transactionId = transactionId;
50
+    }
51
+
52
+    public String getLikeStatus() {
53
+        return likeStatus;
54
+    }
55
+
56
+    public void setLikeStatus(String likeStatus) {
57
+        this.likeStatus = likeStatus == null ? null : likeStatus.trim();
58
+    }
59
+
60
+    public Date getCreateDate() {
61
+        return createDate;
62
+    }
63
+
64
+    public void setCreateDate(Date createDate) {
65
+        this.createDate = createDate;
66
+    }
67
+
68
+    public Date getUpdateDate() {
69
+        return updateDate;
70
+    }
71
+
72
+    public void setUpdateDate(Date updateDate) {
73
+        this.updateDate = updateDate;
74
+    }
75
+}

+ 121
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionReply.java View File

@@ -0,0 +1,121 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpTransactionReply {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer transactionId;
11
+
12
+    private Integer taUserId;
13
+
14
+    private String taUserName;
15
+
16
+    private String replyContent;
17
+
18
+    private Integer replyTaUserId;
19
+
20
+    private String replyTaUserName;
21
+
22
+    private Date createDate;
23
+
24
+    /**
25
+     * 住户端 的角色
26
+     */
27
+    private String taRoleName;
28
+
29
+    /**
30
+     * 被回复人 的角色
31
+     */
32
+    private String replyRoleName;
33
+
34
+    public Integer getId() {
35
+        return id;
36
+    }
37
+
38
+    public void setId(Integer id) {
39
+        this.id = id;
40
+    }
41
+
42
+    public Integer getCommunityId() {
43
+        return communityId;
44
+    }
45
+
46
+    public void setCommunityId(Integer communityId) {
47
+        this.communityId = communityId;
48
+    }
49
+
50
+    public Integer getTransactionId() {
51
+        return transactionId;
52
+    }
53
+
54
+    public void setTransactionId(Integer transactionId) {
55
+        this.transactionId = transactionId;
56
+    }
57
+
58
+    public Integer getTaUserId() {
59
+        return taUserId;
60
+    }
61
+
62
+    public void setTaUserId(Integer taUserId) {
63
+        this.taUserId = taUserId;
64
+    }
65
+
66
+    public String getTaUserName() {
67
+        return taUserName;
68
+    }
69
+
70
+    public void setTaUserName(String taUserName) {
71
+        this.taUserName = taUserName == null ? null : taUserName.trim();
72
+    }
73
+
74
+    public String getReplyContent() {
75
+        return replyContent;
76
+    }
77
+
78
+    public void setReplyContent(String replyContent) {
79
+        this.replyContent = replyContent == null ? null : replyContent.trim();
80
+    }
81
+
82
+    public Integer getReplyTaUserId() {
83
+        return replyTaUserId;
84
+    }
85
+
86
+    public void setReplyTaUserId(Integer replyTaUserId) {
87
+        this.replyTaUserId = replyTaUserId;
88
+    }
89
+
90
+    public String getReplyTaUserName() {
91
+        return replyTaUserName;
92
+    }
93
+
94
+    public void setReplyTaUserName(String replyTaUserName) {
95
+        this.replyTaUserName = replyTaUserName == null ? null : replyTaUserName.trim();
96
+    }
97
+
98
+    public Date getCreateDate() {
99
+        return createDate;
100
+    }
101
+
102
+    public void setCreateDate(Date createDate) {
103
+        this.createDate = createDate;
104
+    }
105
+
106
+    public String getTaRoleName() {
107
+        return taRoleName;
108
+    }
109
+
110
+    public void setTaRoleName(String taRoleName) {
111
+        this.taRoleName = taRoleName;
112
+    }
113
+
114
+    public String getReplyRoleName() {
115
+        return replyRoleName;
116
+    }
117
+
118
+    public void setReplyRoleName(String replyRoleName) {
119
+        this.replyRoleName = replyRoleName;
120
+    }
121
+}

+ 53
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionReport.java View File

@@ -0,0 +1,53 @@
1
+package com.community.huiju.model;
2
+
3
+public class TpTransactionReport {
4
+    private Integer id;
5
+
6
+    private Integer communityId;
7
+
8
+    private Integer transactionId;
9
+
10
+    private String reportReasonId;
11
+
12
+    private Integer reporterId;
13
+
14
+    public Integer getId() {
15
+        return id;
16
+    }
17
+
18
+    public void setId(Integer id) {
19
+        this.id = id;
20
+    }
21
+
22
+    public Integer getCommunityId() {
23
+        return communityId;
24
+    }
25
+
26
+    public void setCommunityId(Integer communityId) {
27
+        this.communityId = communityId;
28
+    }
29
+
30
+    public Integer getTransactionId() {
31
+        return transactionId;
32
+    }
33
+
34
+    public void setTransactionId(Integer transactionId) {
35
+        this.transactionId = transactionId;
36
+    }
37
+
38
+    public String getReportReasonId() {
39
+        return reportReasonId;
40
+    }
41
+
42
+    public void setReportReasonId(String reportReasonId) {
43
+        this.reportReasonId = reportReasonId == null ? null : reportReasonId.trim();
44
+    }
45
+
46
+    public Integer getReporterId() {
47
+        return reporterId;
48
+    }
49
+
50
+    public void setReporterId(Integer reporterId) {
51
+        this.reporterId = reporterId;
52
+    }
53
+}

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/AliPayServiceI.java View File

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.session.UserElement;
4
+
5
+import java.util.Map;
6
+
7
+public interface AliPayServiceI {
8
+	/**
9
+	 * 微信支付统一下单
10
+	 * @return
11
+	 * @param billInvoiceId
12
+	 * @param userElement
13
+	 */
14
+	String AliPayOrder(Integer billInvoiceId, UserElement userElement) throws Exception;
15
+	
16
+}

+ 3
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/FaceServiceI.java View File

@@ -2,6 +2,8 @@ package com.community.huiju.service;
2 2
 
3 3
 
4 4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.model.TaUser;
5 7
 import org.springframework.web.multipart.MultipartFile;
6 8
 
7 9
 public interface FaceServiceI {
@@ -29,4 +31,5 @@ public interface FaceServiceI {
29 31
      * @return
30 32
      */
31 33
     ResponseBean getTaFaceByUserId(Integer userId,Integer otherUserId);
34
+
32 35
 }

+ 15
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java View File

@@ -1,7 +1,9 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4 5
 import com.community.huiju.model.TaUser;
6
+import org.springframework.web.multipart.MultipartFile;
5 7
 
6 8
 import java.util.List;
7 9
 
@@ -72,9 +74,10 @@ public interface ITaUserService {
72 74
      * @param gender
73 75
      * @param currentUserId 当前用户(业主)
74 76
      * @param type 2租客 3家属
77
+     * @param idCard 身份证号
75 78
      * @return
76 79
      */
77
-    ResponseBean addTenantsOrDependents(String userName, String phone, String gender,Integer currentUserId,Integer type);
80
+    ResponseBean addTenantsOrDependents(String userName, String phone, String gender,Integer currentUserId,Integer type, String idCard);
78 81
 
79 82
     /**
80 83
      * 修改租客或者家属
@@ -84,9 +87,10 @@ public interface ITaUserService {
84 87
      * @param currentUserId 当前用户(业主)
85 88
      * @param type 2租客 3家属
86 89
      * @param userId 用户ID
90
+     * @param idCard 身份证号
87 91
      * @return
88 92
      */
89
-    ResponseBean updateTenantsOrDependents(String userName, String phone, String gender,Integer currentUserId,Integer type,Integer userId);
93
+    ResponseBean updateTenantsOrDependents(String userName, String phone, String gender,Integer currentUserId,Integer type,Integer userId, String idCard);
90 94
 
91 95
     /**
92 96
      * 修改用户头像
@@ -111,4 +115,13 @@ public interface ITaUserService {
111 115
      */
112 116
     ResponseBean temporaryLogin(Integer communityId);
113 117
 
118
+    /**
119
+     * 迎宾专用 接口
120
+     * @param userElement
121
+     * @param uploadFile
122
+     * @param user
123
+     * @return
124
+     */
125
+    ResponseBean welcomeFace(UserElement userElement, MultipartFile uploadFile, TaUser user);
126
+
114 127
 }

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java View File

@@ -54,6 +54,7 @@ public interface ITicketService {
54 54
 	 * @param tpTicketRecordComment
55 55
 	 * @return
56 56
 	 */
57
+	@Deprecated
57 58
 	Integer updateTicketsReply(TpTicketRecordComment tpTicketRecordComment, Integer userId);
58 59
 
59 60
 	/**

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java View File

@@ -1,5 +1,8 @@
1 1
 package com.community.huiju.service;
2 2
 
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
5
+
3 6
 import java.util.Map;
4 7
 
5 8
 public interface MessageServiceI {
@@ -24,4 +27,12 @@ public interface MessageServiceI {
24 27
 	 * 全部已读
25 28
 	 */
26 29
 	void updateMessageReadStatus(Integer communityId, Integer userId);
30
+
31
+	/**
32
+	 * 根据消息的id, 进行已读操作
33
+	 * @param userElement
34
+	 * @param messageId
35
+	 * @return
36
+	 */
37
+	ResponseBean updateMessageByIdReadStatus(UserElement userElement, Integer messageId);
27 38
 }

+ 28
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java View File

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4 5
 import com.community.huiju.model.*;
5 6
 
6 7
 import java.io.IOException;
@@ -151,7 +152,7 @@ public interface SocialServiceI {
151 152
  	 * @param id
152 153
 	 * @return
153 154
 	 */
154
-	ResponseBean deleteransaction(Integer id,Integer userid);
155
+	ResponseBean deleteransaction(Integer id, UserElement userElement);
155 156
 	
156 157
 	/**
157 158
 	 * 获取举报原因列表
@@ -167,4 +168,30 @@ public interface SocialServiceI {
167 168
 	 * @return
168 169
 	 */
169 170
 	ResponseBean reportTransaction(Integer userId,Integer communityId, String paramets);
171
+
172
+	/**
173
+	 * 查询 二手交易帖子的回复
174
+	 * @param transactionId 帖子id
175
+	 * @param userElement 用户信息体
176
+	 * @param order asc 正序  desc 倒序
177
+	 * @param pageNum
178
+	 * @param pageSize
179
+	 * @return
180
+	 */
181
+	ResponseBean findUsedDetailsReply(Integer transactionId, UserElement userElement, String order, Integer pageNum, Integer pageSize);
182
+	/**
183
+	 * 二帖子回复
184
+	 *@param paramets
185
+	 *@param userElement
186
+	 *@return
187
+	 */
188
+    ResponseBean addTransactionReply(String paramets, UserElement userElement);
189
+
190
+	/**
191
+	 * 添加点赞
192
+	 * @param paramets
193
+	 * @param userElement
194
+	 * @return
195
+	 */
196
+	ResponseBean addTransactionLike(String paramets, UserElement userElement);
170 197
 }

+ 8
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java View File

@@ -20,5 +20,12 @@ public interface TaVistorServiceI {
20 20
      * @return
21 21
      */
22 22
     ResponseBean insertTaVistor(TaVisitor taVisitor, Integer communityId, Integer userId);
23
-    List<TaVisitor> invateHis(Integer communityId, Integer userId);
23
+
24
+    /**
25
+     * 访客邀请记录
26
+     * @param communityId
27
+     * @param userId
28
+     * @return
29
+     */
30
+    ResponseBean invateHis(Integer communityId, Integer userId);
24 31
 }

+ 120
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/AliPayServiceImpl.java View File

@@ -0,0 +1,120 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alipay.api.AlipayApiException;
4
+import com.alipay.api.AlipayClient;
5
+import com.alipay.api.DefaultAlipayClient;
6
+import com.alipay.api.domain.AlipayTradeAppPayModel;
7
+import com.alipay.api.request.AlipayTradeAppPayRequest;
8
+import com.alipay.api.response.AlipayTradeAppPayResponse;
9
+import com.community.commom.session.UserElement;
10
+import com.community.huiju.common.wxpay.HfWxConfig;
11
+import com.community.huiju.common.wxpay.WXPay;
12
+import com.community.huiju.common.wxpay.WXPayConstants;
13
+import com.community.huiju.common.wxpay.WXPayUtil;
14
+import com.community.huiju.dao.TaSysRoleMapper;
15
+import com.community.huiju.dao.TaUserMapper;
16
+import com.community.huiju.dao.TpBillInvoiceMapper;
17
+import com.community.huiju.dao.TpBillMapper;
18
+import com.community.huiju.dao.TpBillStatementMapper;
19
+import com.community.huiju.model.TaSysRole;
20
+import com.community.huiju.model.TaUser;
21
+import com.community.huiju.model.TpBillInvoice;
22
+import com.community.huiju.service.AliPayServiceI;
23
+import org.slf4j.Logger;
24
+import org.slf4j.LoggerFactory;
25
+import org.springframework.beans.factory.annotation.Autowired;
26
+import org.springframework.beans.factory.annotation.Value;
27
+import org.springframework.stereotype.Service;
28
+import org.springframework.transaction.annotation.Transactional;
29
+
30
+import java.math.BigDecimal;
31
+
32
+import static com.alipay.api.AlipayConstants.CHARSET_UTF8;
33
+
34
+/**
35
+ * @author FXF
36
+ * @date 2018-10-25
37
+ */
38
+@Service("aliPayService")
39
+@Transactional(rollbackFor = Exception.class)
40
+public class AliPayServiceImpl implements AliPayServiceI {
41
+	private Logger log = LoggerFactory.getLogger(AliPayServiceImpl.class);
42
+	
43
+	@Autowired
44
+	private TpBillInvoiceMapper tpBillInvoiceMapper;
45
+	
46
+	@Autowired
47
+	private TpBillStatementMapper tpBillStatementMapper;
48
+
49
+	@Autowired
50
+	private TpBillMapper tpBillMapper;
51
+
52
+	@Autowired
53
+	private TaUserMapper taUserMapper;
54
+
55
+	@Autowired
56
+	private TaSysRoleMapper taSysRoleMapper;
57
+	
58
+	@Value("${alipay.APP_PRIVATE_KEY}")
59
+	private String APP_PRIVATE_KEY;
60
+	
61
+	@Value("${alipay.APP_ID}")
62
+	private String ALI_APP_ID;
63
+	
64
+	@Value("${alipay.ALIPAY_PUBLIC_KEY}")
65
+	private String ALIPAY_PUBLIC_KEY;
66
+	
67
+	/**
68
+	 * 支付宝统一下单
69
+	 *
70
+	 * @return
71
+	 * @param billInvoiceId
72
+	 * @param userElement
73
+	 */
74
+	@Override
75
+	@Transactional(rollbackFor = Exception.class)
76
+	public String AliPayOrder(Integer billInvoiceId, UserElement userElement) throws Exception {
77
+		Integer userId = userElement.getId();
78
+
79
+		// 如果是家属/租客, 应该用业主的用户id
80
+		TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
81
+		TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
82
+		if (null != taSysRole && taSysRole.getId().intValue() != 1) {
83
+			TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
84
+			userId = ownerUser.getId();
85
+		}
86
+
87
+		//获取支付金额
88
+		TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userId,userElement.getCommunityId());
89
+		if (null == tpBillInvoice){
90
+			throw new Exception("订单不存在");
91
+		}else if (!tpBillInvoice.getBillStatus().equals("3")){
92
+			throw new Exception("不是正在支付的订单");
93
+		}
94
+		
95
+		//下单
96
+		AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", ALI_APP_ID, APP_PRIVATE_KEY, "json", CHARSET_UTF8, ALIPAY_PUBLIC_KEY, "RSA2");
97
+		//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
98
+		AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
99
+		//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
100
+		AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
101
+		model.setBody(tpBillInvoice.getBillName());
102
+		model.setSubject(tpBillInvoice.getBillName());
103
+		model.setOutTradeNo(tpBillInvoice.getOutTradeNo());
104
+		model.setTimeoutExpress("30m");
105
+		model.setTotalAmount(BigDecimal.valueOf(Long.valueOf(tpBillInvoice.getPayPrice())).divide(new BigDecimal(100)).toString());
106
+		model.setProductCode("QUICK_MSECURITY_PAY");
107
+		request.setBizModel(model);
108
+		request.setNotifyUrl("http://106.14.20.193:8086/app-api/aliPayNotify");
109
+		try {
110
+			//这里和普通的接口调用不同,使用的是sdkExecute
111
+			AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
112
+			//就是orderString 可以直接给客户端请求,无需再做处理。
113
+			System.out.println(response.getBody());
114
+			return response.getBody();
115
+		} catch (AlipayApiException e) {
116
+			e.printStackTrace();
117
+		}
118
+		return null;
119
+	}
120
+}

+ 20
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java View File

@@ -1,6 +1,10 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.community.huiju.dao.TaSysRoleMapper;
4
+import com.community.huiju.dao.TaUserMapper;
3 5
 import com.community.huiju.dao.TpBillInvoiceMapper;
6
+import com.community.huiju.model.TaSysRole;
7
+import com.community.huiju.model.TaUser;
4 8
 import com.community.huiju.service.BillServiceI;
5 9
 import com.github.pagehelper.Page;
6 10
 import com.github.pagehelper.PageHelper;
@@ -20,6 +24,12 @@ public class BillServiceImpl implements BillServiceI {
20 24
 	
21 25
 	@Autowired
22 26
 	private TpBillInvoiceMapper tpBillInvoiceMapper;
27
+
28
+	@Autowired
29
+	private TaUserMapper taUserMapper;
30
+
31
+	@Autowired
32
+	private TaSysRoleMapper taSysRoleMapper;
23 33
 	
24 34
 	/**
25 35
 	 * 根据payType分页获取缴费或未缴费的数据
@@ -33,6 +43,16 @@ public class BillServiceImpl implements BillServiceI {
33 43
 	public Map<String, Object> getBillsList(Integer communityId, Integer payType, Integer userId ,Integer pageNum, Integer pageSize) {
34 44
 		//使用分页插件
35 45
 		Page<Map<String,Object>> page = PageHelper.startPage(pageNum, pageSize);
46
+
47
+		TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
48
+
49
+		TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
50
+		// 如果不是业主
51
+		if (null != taSysRole && taSysRole.getId().intValue() != 1) {
52
+			TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
53
+			userId = ownerUser.getId();
54
+		}
55
+
36 56
 		List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(communityId, userId, payType);
37 57
 		billsList.forEach(e-> {
38 58
 			String payPrice = String.valueOf(e.get("payPrice"));

+ 4
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java View File

@@ -3,6 +3,7 @@ import com.alibaba.fastjson.JSONObject;
3 3
 import com.community.commom.ailiyun.AESDecode;
4 4
 import com.community.commom.constant.Constant;
5 5
 import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
6 7
 import com.community.huiju.common.hk.HKOpenApi;
7 8
 import com.community.huiju.dao.TaFaceMapper;
8 9
 import com.community.huiju.dao.TaSysRoleMapper;
@@ -44,6 +45,7 @@ public class FaceServicelimpl implements FaceServiceI {
44 45
     @Transactional(rollbackFor = Exception.class)
45 46
     public ResponseBean addFace(Integer userid, MultipartFile uploadFile,Integer otherUserId) {
46 47
         ResponseBean responseBean= new ResponseBean();
48
+
47 49
          String faceImg =img(uploadFile);
48 50
         /**当otherUserId不为空时判断它是否是业主下的租客或者家属*/
49 51
         if (null!= otherUserId) {
@@ -65,7 +67,7 @@ public class FaceServicelimpl implements FaceServiceI {
65 67
             taFace.setUpdateDate(new Date());
66 68
 
67 69
         /*验证身份*/
68
-        responseBean=addVerify( activeUser,  uploadFile, otherUserId, faceImg, taFace) ;
70
+        responseBean=addVerify( activeUser,  uploadFile, faceImg, taFace) ;
69 71
         return responseBean;
70 72
     }
71 73
 
@@ -218,7 +220,7 @@ public class FaceServicelimpl implements FaceServiceI {
218 220
     /**
219 221
      *各种身份校验
220 222
      */
221
-    public ResponseBean addVerify(Integer userid, MultipartFile uploadFile,Integer otherUserId,String faceImg,TaFace taFace) {
223
+    public ResponseBean addVerify(Integer userid, MultipartFile uploadFile,String faceImg,TaFace taFace) {
222 224
         ResponseBean response = new ResponseBean();
223 225
         TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userid);
224 226
         TaUser taUser = taUserMapper.selectByPrimaryKey(userid);
@@ -265,8 +267,6 @@ public class FaceServicelimpl implements FaceServiceI {
265 267
         response.addError("您的信息已存在");
266 268
         return response;
267 269
     }
268
-
269
-
270 270
 }
271 271
 
272 272
 

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java View File

@@ -1,6 +1,8 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
4 6
 import com.community.huiju.dao.TpBillInvoiceMapper;
5 7
 import com.community.huiju.dao.TpBillMapper;
6 8
 import com.community.huiju.dao.TpMessageMapper;
@@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
13 15
 import org.springframework.stereotype.Service;
14 16
 import org.springframework.util.StringUtils;
15 17
 
18
+import java.util.Date;
16 19
 import java.util.HashMap;
17 20
 import java.util.List;
18 21
 import java.util.Map;
@@ -112,4 +115,25 @@ public class MessageServiceImpl implements MessageServiceI {
112 115
 	public void updateMessageReadStatus(Integer communityId, Integer userId) {
113 116
 		tpMessageMapper.updateReadStatus(communityId, userId);
114 117
 	}
118
+
119
+	@Override
120
+	public ResponseBean updateMessageByIdReadStatus(UserElement userElement, Integer messageId) {
121
+		ResponseBean responseBean = new ResponseBean();
122
+
123
+		TpMessage tpMessage = tpMessageMapper.selectByPrimaryKey(messageId);
124
+		if (null == tpMessage) {
125
+			responseBean.addError("消息不存在!");
126
+			return responseBean;
127
+		}
128
+		tpMessage.setReadStatus("1");
129
+		tpMessage.setUpdateDate(new Date());
130
+		tpMessage.setUpdateUser(userElement.getId());
131
+		int row = tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
132
+		if (row > 0) {
133
+			responseBean.addSuccess("操作成功!");
134
+			return responseBean;
135
+		}
136
+		responseBean.addError("操作失败!");
137
+		return responseBean;
138
+	}
115 139
 }

+ 185
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java View File

@@ -3,6 +3,7 @@ package com.community.huiju.service.impl;
3 3
 import com.alibaba.fastjson.JSONObject;
4 4
 import com.community.commom.constant.Constant;
5 5
 import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
6 7
 import com.community.huiju.dao.*;
7 8
 import com.community.huiju.model.*;
8 9
 import com.community.huiju.service.ImageServiceI;
@@ -12,12 +13,15 @@ import com.github.pagehelper.PageHelper;
12 13
 import com.google.common.collect.Maps;
13 14
 import com.sun.org.apache.bcel.internal.generic.NEW;
14 15
 import io.swagger.models.auth.In;
16
+import org.apache.ibatis.annotations.Param;
15 17
 import org.springframework.beans.BeanUtils;
16 18
 import org.springframework.beans.factory.annotation.Autowired;
17 19
 import org.springframework.stereotype.Service;
18 20
 import org.springframework.transaction.annotation.Transactional;
19 21
 
22
+import javax.swing.plaf.TabbedPaneUI;
20 23
 import java.io.IOException;
24
+import java.time.LocalDateTime;
21 25
 import java.util.*;
22 26
 import java.util.stream.Collectors;
23 27
 
@@ -69,6 +73,23 @@ public class SocialServiceImpl implements SocialServiceI {
69 73
     @Autowired
70 74
     private TpUserMapper tpUserMapper;
71 75
 
76
+    @Autowired
77
+    private TpMessageMapper tpMessageMapper;
78
+
79
+    @Autowired
80
+    private SysReportReasonMapper sysReportReasonMapper;
81
+
82
+    @Autowired
83
+    private TpTransactionReportMapper tpTransactionReportMapper;
84
+
85
+    @Autowired
86
+    private ToCommunitiesMapper  toCommunitiesMapper;
87
+
88
+    @Autowired
89
+    private TpTransactionReplyMapper tpTransactionReplyMapper;
90
+
91
+    @Autowired
92
+    private  TpTransactionLikeMapper tpTransactionLikeMapper;
72 93
 
73 94
     @Override
74 95
     @Transactional
@@ -119,8 +140,11 @@ public class SocialServiceImpl implements SocialServiceI {
119 140
      */
120 141
     @Override
121 142
     public List<TpAnnouncement> getAnnouncement(Integer communityId) {
122
-        Integer Num=tpCarouselSettingMapper.getcarouselNum(Constant.ANNOUNCEMENT);
123
-        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId,Num);
143
+        Integer num=tpCarouselSettingMapper.getcarouselNum(Constant.ANNOUNCEMENT, communityId);
144
+        if (null == num) {
145
+            num = 0;
146
+        }
147
+        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId,num);
124 148
         return listAnnouncement;
125 149
     }
126 150
 
@@ -165,6 +189,11 @@ public class SocialServiceImpl implements SocialServiceI {
165 189
         }
166 190
 
167 191
         TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId,communityId);
192
+        TpUser tpUser = tpUserMapper.selectByPrimaryKey(tpActivity.getCreateUser());
193
+        if (null != tpUser) {
194
+            tpActivity.setUserName(tpUser.getUserName());
195
+        }
196
+
168 197
         //返回报名状态
169 198
         Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
170 199
         String signStatus = signNum != 0 ? Constant.STATUS_SIGNED : Constant.STATUS_UNSIGN;
@@ -442,14 +471,35 @@ public class SocialServiceImpl implements SocialServiceI {
442 471
     }
443 472
 
444 473
     @Override
445
-    public ResponseBean deleteransaction(Integer id,Integer userId) {
474
+    public ResponseBean deleteransaction(Integer id, UserElement userElement) {
446 475
         ResponseBean responseBean= new ResponseBean();
447 476
         TpTransaction tpTransaction=tpTransactionMapper.getById(Integer.valueOf(id));
448
-        if(null!= tpTransaction && userId.equals(tpTransaction.getTaUserId())) {
477
+        if(null!= tpTransaction && userElement.getId().equals(tpTransaction.getTaUserId())) {
449 478
             tpTransaction.setStatus("0");
450 479
             tpTransaction.setUpdateDate(new Date());
451 480
             tpTransactionMapper.updateByPrimaryKeySelective(tpTransaction);
452 481
             responseBean.addSuccess("删除成功");
482
+
483
+
484
+
485
+            // 把消息变为无效
486
+            Map<String, Object> map = new HashMap<>();
487
+            map.put("communityId", userElement.getCommunityId());
488
+            map.put("messageType", "9");
489
+            map.put("adviceType", "4");
490
+            map.put("uuidType", "2");
491
+            map.put("source", "1");
492
+            map.put("status", "1");
493
+            map.put("modelType", "1");
494
+            map.put("transactionId", tpTransaction.getId());
495
+            TpMessage tpMessage = tpMessageMapper.selectConditionsTpMessage(map);
496
+            if (null != tpMessage) {
497
+                tpMessage.setStatus("0");
498
+                tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
499
+            }
500
+
501
+
502
+
453 503
         }else {
454 504
             responseBean.addSuccess("当前ID不存在");
455 505
         }
@@ -485,6 +535,12 @@ public class SocialServiceImpl implements SocialServiceI {
485 535
             responseBean.addError("举报的交易不存在");
486 536
             return responseBean;
487 537
         }
538
+        // 举报原因
539
+        TpTransactionReport tpTransactionReport = tpTransactionReportMapper.selectByCommunityIdAndTransactionId(userId, communityId, tpTransaction.getId());
540
+        if (null != tpTransactionReport) {
541
+            responseBean.addError("您已举报了该帖子!");
542
+            return responseBean;
543
+        }
488 544
         //插入举报表
489 545
         tpTransactionMapper.saveReportReason(userId,communityId,transactionId,reportReasonId);
490 546
         //更新交易表的举报状态为被举报
@@ -493,14 +549,84 @@ public class SocialServiceImpl implements SocialServiceI {
493 549
         record.setIsReported("1");
494 550
         Integer size = tpTransactionMapper.updateByPrimaryKeySelective(record);
495 551
         if (size > 0){
552
+
553
+            // 举报人
554
+            TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
555
+            // 发帖人
556
+            TaUser createUser = taUserMapper.selectByPrimaryKey(tpTransaction.getCreateUser());
557
+
558
+            // 举报原因
559
+            //TpTransactionReport tpTransactionReport = tpTransactionReportMapper.selectByCommunityIdAndTransactionId(communityId, tpTransaction.getId());
560
+            SysReportReason sysReportReason = sysReportReasonMapper.selectByPrimaryKey(Integer.valueOf(reportReasonId));
561
+
562
+
563
+            // 插入消息表
564
+            TpMessage message = new TpMessage();
565
+            message.setCommunityId(communityId);
566
+            message.setMessageType("9");
567
+            message.setAdviceType("4");
568
+            message.setModelType("1");
569
+            //超级管理员
570
+            Integer userID= toCommunitiesMapper.selectAndmin(communityId);
571
+            message.setUuid(userID);
572
+            message.setModelType("1");
573
+            message.setUuidType("2");
574
+            message.setSource("1");
575
+            message.setMessageContent("{" + taUser.getUserName() + "}举报了{" + createUser.getUserName() + "}发布的帖子:{" + tpTransaction.getTransactionTitle() +  "},举报原因:{" + sysReportReason.getReason() + "},点击责令发布人修改或直接作废帖子");
576
+            message.setStatus("1");
577
+            message.setReadStatus("0");
578
+            message.setTransactionId(transactionId);
579
+            message.setCreateDate(new Date());
580
+            message.setCreateUser(userId);
581
+            tpMessageMapper.insertSelective(message);
582
+
583
+
584
+
496 585
             responseBean.addSuccess(size);
497 586
             return responseBean;
498 587
         }
499 588
         responseBean.addError("举报出错");
500 589
         return responseBean;
501 590
     }
502
-    
503
-    
591
+
592
+    @Override
593
+    public ResponseBean addTransactionReply(String paramets, UserElement userElement) {
594
+        ResponseBean response= new ResponseBean();
595
+        TpTransactionReply tpTransactionReply= JSONObject.parseObject(paramets,TpTransactionReply.class);
596
+        tpTransactionReply.setCommunityId(userElement.getCommunityId());
597
+        tpTransactionReply.setTaUserId(userElement.getId());
598
+        tpTransactionReply.setTaUserName(userElement.getUserName());
599
+        //获取被回复的姓名
600
+        if("".equals(tpTransactionReply.getReplyTaUserId())) {
601
+            tpTransactionReply.setReplyTaUserId(null);
602
+        }
603
+        if(null!=tpTransactionReply.getReplyTaUserId()&!"".equals(tpTransactionReply.getReplyTaUserId())) {
604
+            tpTransactionReply.setReplyTaUserName(taUserMapper.selectByPrimaryKey(tpTransactionReply.getReplyTaUserId()).getUserName());
605
+        }
606
+        tpTransactionReply.setCreateDate(new Date());
607
+        tpTransactionReplyMapper.insert(tpTransactionReply);
608
+        response.addSuccess("成功");
609
+        return response;
610
+    }
611
+
612
+    @Override
613
+    public ResponseBean addTransactionLike(String paramets, UserElement userElement) {
614
+      ResponseBean response = new ResponseBean();
615
+        TpTransactionLike tpTransactionLike= JSONObject.parseObject(paramets,TpTransactionLike.class);
616
+        tpTransactionLike.setCommunityId(userElement.getCommunityId());
617
+        tpTransactionLike.setTaUserId(userElement.getId());
618
+        tpTransactionLike.setCreateDate(new Date());
619
+        TpTransactionLike isUser= tpTransactionLikeMapper.getinvitationId(tpTransactionLike.getTransactionId(),userElement.getCommunityId(),userElement.getId());
620
+        if (null!=isUser) {
621
+            response.addError("您已点赞或踩");
622
+            return response;
623
+        }
624
+        tpTransactionLikeMapper.insert(tpTransactionLike);
625
+        response.addSuccess("成功");
626
+        return response;
627
+    }
628
+
629
+
504 630
     @Override
505 631
     public void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId, Integer userId) {
506 632
         //修改工单内容和评分
@@ -518,12 +644,34 @@ public class SocialServiceImpl implements SocialServiceI {
518 644
         record.setCreateUser(userId);
519 645
         record.setCreateDate(new Date());
520 646
         tpTicketRecordMapper.insertSelective(record);
647
+
648
+        //1.5版本推送消息message
649
+        TpMessage message = new TpMessage();
650
+        message.setCommunityId(communityId);
651
+        message.setTicketId(tpTicket.getId());
652
+        TpTicket tic= tpTicketMapper.selectByTicketId(String.valueOf(communityId),Integer.valueOf(ticketId));
653
+        message.setMessageType(tic.getType());
654
+        message.setAdviceType("4");
655
+        message.setModelType("1");
656
+        Integer createUser=tpTicketMapper.selectRecordStatus(communityId,tpTicket.getId());
657
+        message.setUuid(createUser);
658
+        message.setUuidType("2");
659
+        message.setSource("2");
660
+        message.setMessageContent("工单“"+tic.getTicketTitle() +"”已经验收并评价,点击查看评分");
661
+        message.setStatus("1");
662
+        message.setReadStatus("0");
663
+        message.setCreateUser(userId);
664
+        message.setCreateDate(new Date());
665
+        tpMessageMapper.insert(message);
521 666
     }
522 667
 
523 668
     @Override
524 669
     public List<TpActivity> getActivity(Integer communityId) {
525
-        Integer Num=tpCarouselSettingMapper.getcarouselNum(Constant.ACTIVITY);
526
-        List<TpActivity> listActivity=tpActivityMapper.getActivity(communityId,Num);
670
+        Integer num = tpCarouselSettingMapper.getcarouselNum(Constant.ACTIVITY, communityId);
671
+        if (null == num) {
672
+            num = 0;
673
+        }
674
+        List<TpActivity> listActivity=tpActivityMapper.getActivity(communityId,num);
527 675
         return listActivity;
528 676
     }
529 677
     
@@ -614,6 +762,24 @@ public class SocialServiceImpl implements SocialServiceI {
614 762
         List<String> imgList = tdImagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
615 763
         tpTransaction.setImgList(imgList);
616 764
 
765
+        /**
766
+         * 查询点赞和踩的次数
767
+         */
768
+
769
+
770
+        //统计点赞人数的次数
771
+        Integer likeCount= tpTransactionLikeMapper.likeCount(activityId, communityId);
772
+        //不喜欢的人数
773
+        Integer noLikeCount= tpTransactionLikeMapper.nolikeCount(activityId, communityId);
774
+        tpTransaction.setLikeCount(likeCount == null ? 0 : likeCount);
775
+        tpTransaction.setNoLikeCount(noLikeCount == null ? 0 : noLikeCount);
776
+
777
+        // 查询是 点赞 还是 踩
778
+        TpTransactionLike isUser= tpTransactionLikeMapper.getinvitationId(activityId,communityId, userId);
779
+        if (null!=isUser){
780
+            tpTransaction.setBel(isUser.getLikeStatus());
781
+        }
782
+
617 783
         return tpTransaction;
618 784
 
619 785
     }
@@ -650,4 +816,15 @@ public class SocialServiceImpl implements SocialServiceI {
650 816
 
651 817
         return responseBean;
652 818
     }
819
+
820
+    @Override
821
+    public ResponseBean findUsedDetailsReply(Integer transactionId, UserElement userElement, String order, Integer pageNum, Integer pageSize) {
822
+        ResponseBean responseBean = new ResponseBean();
823
+
824
+        PageHelper.startPage(pageNum, pageSize, "create_date " + order);
825
+        List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId);
826
+
827
+        responseBean.addSuccess(replies);
828
+        return responseBean;
829
+    }
653 830
 }

+ 84
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
4 4
 import com.alibaba.fastjson.JSONObject;
5 5
 import com.community.commom.constant.Constant;
6 6
 import com.community.commom.mode.ResponseBean;
7
+import com.community.commom.session.UserElement;
7 8
 import com.community.commom.utils.AccountValidatorUtil;
8 9
 import com.community.commom.utils.BeanTools;
9 10
 import com.community.commom.utils.MD5Utils;
@@ -11,9 +12,12 @@ import com.community.commom.uuid.IdGen;
11 12
 import com.community.huiju.common.code.cache.AppkeyCache;
12 13
 import com.community.huiju.common.hk.HKConstant;
13 14
 import com.community.huiju.common.hk.HKOpenApi;
15
+import com.community.huiju.common.welcome.OkHttpRequestUtils;
16
+import com.community.huiju.common.welcome.WelcomeProperties;
14 17
 import com.community.huiju.dao.*;
15 18
 import com.community.huiju.model.*;
16 19
 import com.community.huiju.service.ITaUserService;
20
+import com.community.huiju.service.ImageServiceI;
17 21
 import com.community.huiju.vo.TaUserVO;
18 22
 import com.google.common.collect.Lists;
19 23
 import com.google.common.collect.Maps;
@@ -26,7 +30,9 @@ import org.springframework.beans.BeanUtils;
26 30
 import org.springframework.beans.factory.annotation.Autowired;
27 31
 import org.springframework.stereotype.Service;
28 32
 import org.springframework.transaction.annotation.Transactional;
33
+import org.springframework.web.multipart.MultipartFile;
29 34
 
35
+import java.io.IOException;
30 36
 import java.text.ParseException;
31 37
 import java.text.SimpleDateFormat;
32 38
 import java.time.LocalDate;
@@ -47,6 +53,9 @@ public class TaUserServiceImpl implements ITaUserService {
47 53
 
48 54
     private IdGen idGen = IdGen.get();
49 55
 
56
+    @Autowired
57
+    private WelcomeProperties welcomeProperties;
58
+
50 59
     @Autowired
51 60
     private TaUserMapper taUserMapper;
52 61
 
@@ -71,6 +80,9 @@ public class TaUserServiceImpl implements ITaUserService {
71 80
     @Autowired
72 81
     private TpBillInvoiceMapper tpBillInvoiceMapper;
73 82
 
83
+    @Autowired
84
+    private ImageServiceI imageService;
85
+
74 86
     @Transactional(rollbackFor = Exception.class)
75 87
     @Override
76 88
     @Deprecated
@@ -488,7 +500,7 @@ public class TaUserServiceImpl implements ITaUserService {
488 500
 
489 501
     @Transactional(rollbackFor = Exception.class)
490 502
     @Override
491
-    public ResponseBean addTenantsOrDependents(String userName, String phone, String gender, Integer currentUserId, Integer type) {
503
+    public ResponseBean addTenantsOrDependents(String userName, String phone, String gender, Integer currentUserId, Integer type, String idCard) {
492 504
         ResponseBean response = new ResponseBean();
493 505
 
494 506
         TaUser taUser = taUserMapper.selectByPrimaryKey(currentUserId);
@@ -513,6 +525,11 @@ public class TaUserServiceImpl implements ITaUserService {
513 525
             return response;
514 526
         }
515 527
 
528
+        if (StringUtils.isEmpty(idCard)) {
529
+            response.addError("对不起! 身份证不允许为空!");
530
+            return response;
531
+        }
532
+
516 533
         Map<String,Object> parUserLogin = Maps.newHashMap();
517 534
         parUserLogin.put("loginName",phone);
518 535
         TaUser parUser = taUserMapper.selectByLoginName(parUserLogin);
@@ -536,6 +553,7 @@ public class TaUserServiceImpl implements ITaUserService {
536 553
         user.setAcceptAgreementStatus("1");
537 554
         user.setFaceStatus("0");
538 555
         user.setRemark("这是业主添加的!");
556
+        user.setIdCard(idCard);
539 557
         if (StringUtils.isEmpty(userName)) {
540 558
             user.setUserName(user.getLoginName());
541 559
         }
@@ -575,7 +593,7 @@ public class TaUserServiceImpl implements ITaUserService {
575 593
 
576 594
     @Override
577 595
     @Transactional(rollbackFor = Exception.class)
578
-    public ResponseBean updateTenantsOrDependents(String userName, String phone, String gender, Integer currentUserId, Integer type,Integer userId) {
596
+    public ResponseBean updateTenantsOrDependents(String userName, String phone, String gender, Integer currentUserId, Integer type,Integer userId, String idCard) {
579 597
         ResponseBean response = new ResponseBean();
580 598
 
581 599
         TaUser taUser = taUserMapper.selectByPrimaryKey(currentUserId);
@@ -590,13 +608,18 @@ public class TaUserServiceImpl implements ITaUserService {
590 608
         // 当前用户的身份
591 609
         TaSysRole role = taSysRoleMapper.findRoleByUserId(taUser.getId());
592 610
         if (!"OWNER".equals(role.getRoleName())) {
593
-            response.addError("对不起,您不是业主,不能添加家属或租客!");
611
+            response.addError("对不起,您不是业主,不能修改家属或租客!");
594 612
             return response;
595 613
         }
596 614
 
597 615
         int tempType = type;
598 616
         if (tempType != 2 && type != 3) {
599
-            response.addError("对不起! 您只能添加家属或者租客!");
617
+            response.addError("对不起! 您只能修改家属或者租客!");
618
+            return response;
619
+        }
620
+
621
+        if (StringUtils.isEmpty(idCard)) {
622
+            response.addError("对不起! 身份证不允许为空!");
600 623
             return response;
601 624
         }
602 625
 
@@ -607,6 +630,7 @@ public class TaUserServiceImpl implements ITaUserService {
607 630
         user.setUpdateDate(new Date());
608 631
         user.setUpdateUser(currentUserId);
609 632
         user.setParentId(currentUserId);
633
+        user.setIdCard(idCard);
610 634
         if (StringUtils.isEmpty(userName)) {
611 635
             user.setUserName(user.getLoginName());
612 636
         }
@@ -967,4 +991,60 @@ public class TaUserServiceImpl implements ITaUserService {
967 991
 
968 992
         return responseBean;
969 993
     }
994
+
995
+    @Override
996
+    @Transactional(rollbackFor = Exception.class)
997
+    public ResponseBean welcomeFace(UserElement userElement, MultipartFile uploadFile, TaUser user) {
998
+        ResponseBean responseBean = new ResponseBean();
999
+
1000
+        user.setCommunityId(userElement.getCommunityId());
1001
+        user.setParentId(userElement.getId());
1002
+        user.setCreateDate(new Date());
1003
+        user.setCreateUser(userElement.getId());
1004
+        user.setCommunityId(userElement.getCommunityId());
1005
+        user.setVerifyStatus("1");
1006
+        user.setAcceptAgreementStatus("1");
1007
+        user.setStatus("1");
1008
+
1009
+        int rows = taUserMapper.insertSelective(user);
1010
+        if (rows <= 0) {
1011
+            responseBean.addError("操作失败!");
1012
+            return responseBean;
1013
+        }
1014
+
1015
+        // 角色  2 表示租客
1016
+        addOrUpdateUserRole(2,responseBean,user,true);
1017
+
1018
+        // 开始推送 迎宾系统
1019
+
1020
+        Map<String, Object> parameterMap = Maps.newHashMap();
1021
+        parameterMap.put("userId", user.getId());
1022
+        parameterMap.put("username", user.getUserName());
1023
+        try {
1024
+            OkHttpRequestUtils.doPost(welcomeProperties.getUrl(), Maps.newHashMap(), parameterMap, uploadFile.getOriginalFilename(), uploadFile.getBytes());
1025
+        } catch (Exception e) {
1026
+            e.printStackTrace();
1027
+            log.error("推送 迎宾系统失败!", e);
1028
+        }
1029
+
1030
+        // 开始存储人脸的图片到本地库
1031
+        TaFace taFace = new TaFace();
1032
+        taFace.setCommunityId(user.getCommunityId());
1033
+        taFace.setCreateDate(new Date());
1034
+        taFace.setCreateUser(user.getId());
1035
+        taFace.setTaUserId(user.getId());
1036
+        taFace.setUpdateDate(new Date());
1037
+        taFace.setUpdateUser(user.getId());
1038
+        try {
1039
+            taFace.setFaceImg(imageService.getImageUrl(uploadFile));
1040
+        } catch (IOException e) {
1041
+            e.printStackTrace();
1042
+            log.error("迎宾系统 人脸图片上传阿里云失败!", e);
1043
+        }
1044
+
1045
+        taFaceMapper.insertSelective(taFace);
1046
+
1047
+        responseBean.addSuccess("操作成功!");
1048
+        return responseBean;
1049
+    }
970 1050
 }

+ 4
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java View File

@@ -82,7 +82,8 @@ public class TaVistorServiceImpl implements TaVistorServiceI {
82 82
     }
83 83
 
84 84
     @Override
85
-    public List<TaVisitor> invateHis(Integer communityId, Integer userId) {
85
+    public ResponseBean invateHis(Integer communityId, Integer userId) {
86
+        ResponseBean responseBean = new ResponseBean();
86 87
         List<TaVisitor> taVisitors = taVisitorMapper.findAllVistors(communityId, userId);
87 88
 
88 89
         for (TaVisitor taVisitor : taVisitors){
@@ -91,7 +92,8 @@ public class TaVistorServiceImpl implements TaVistorServiceI {
91 92
                 taVisitor.setCarLicense(taVisitorLicenses);
92 93
             }
93 94
         }
94
-        return taVisitors;
95
+        responseBean.addSuccess(taVisitors);
96
+        return responseBean;
95 97
     }
96 98
 
97 99
     /**

+ 93
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java View File

@@ -52,6 +52,12 @@ public class TicketServiceImpl implements ITicketService {
52 52
     @Autowired
53 53
     private TpannouncementTelMapper tpannouncementTelMapper;
54 54
 
55
+    @Autowired
56
+    private TaSysUserRoleMapper taSysUserRoleMapper;
57
+
58
+    @Autowired
59
+    private  ToCommunitiesMapper toCommunitiesMapper;
60
+
55 61
     @Override
56 62
     public ResponseBean getList(TpTicket tpTicket, Integer pageNum, Integer pageSize) {
57 63
 
@@ -238,6 +244,7 @@ public class TicketServiceImpl implements ITicketService {
238 244
             // 把该工单的消息变为 已读
239 245
             TpMessage tpMessage = new TpMessage();
240 246
             tpMessage.setTicketId(ticket.getId());
247
+            tpMessage.setSource("1");
241 248
             tpMessage.setModelType("1");
242 249
             tpMessage.setMessageType(ticket.getType());
243 250
 
@@ -298,7 +305,32 @@ public class TicketServiceImpl implements ITicketService {
298 305
 
299 306
 
300 307
         // 把工单信息添加到消息表
301
-        insertTicketMessage(tpTicket, userId);
308
+//        insertTicketMessage(tpTicket, userId);
309
+        //1.5版本维护消息推送
310
+        TpMessage message = new TpMessage();
311
+        message.setCommunityId(user.getCommunityId());
312
+        message.setTicketId(tpTicket.getId());
313
+        message.setModelType("1");
314
+        message.setMessageType(tpTicket.getType());
315
+        message.setAdviceType("4");
316
+        message.setUuidType("2");
317
+        message.setSource("1");
318
+        //当前插入为超级管理员
319
+         Integer uuserID= toCommunitiesMapper.selectAndmin(user.getCommunityId());
320
+         message.setUuid(uuserID);
321
+         TaSysUserRole taSysUserRole= taSysUserRoleMapper.selectRole(user.getCommunityId(), userId);
322
+         String userName = null;
323
+         if (null != taSysUserRole) {
324
+             if(1 == taSysUserRole.getRoleId().intValue()){userName="业主"; }
325
+             if(2 == taSysUserRole.getRoleId().intValue()){userName="家属" ;}
326
+             if(3 == taSysUserRole.getRoleId().intValue()){userName="租客" ;}
327
+             message.setMessageContent(userName+user.getUserName()+"发起了一个工单“"+tpTicket.getTicketTitle()+"”,点击受理分配给合适的人处理");
328
+             message.setStatus("1");
329
+             message.setReadStatus("0");
330
+             message.setCreateUser(userId);
331
+             message.setCreateDate(new Date());
332
+             tpMessageMapper.insert(message);
333
+         }
302 334
 
303 335
         response.addSuccess(tpTicketReco);
304 336
         return response;
@@ -380,11 +412,21 @@ public class TicketServiceImpl implements ITicketService {
380 412
         ticket.setTicketContent(tpTicket.getTicketContent());
381 413
 
382 414
         tpTicketMapper.updateByPrimaryKeySelective(ticket);
415
+        // 维护1.5版本消息
416
+        Integer messageTicket= tpMessageMapper.selectTicket(ticketId);
417
+        if (!"".equals(messageTicket)) {
418
+            TpMessage tpMessage = new TpMessage();
419
+            tpMessage.setTicketId(ticketId);
420
+            tpMessage.setMessageContent("工单“" + tpTicket.getTicketTitle() + "”已被分配给您,点击查看并处理");
421
+            tpMessage.setUpdateDate(new Date());
422
+            tpMessage.setUpdateUser(userId);
423
+            tpMessageMapper.updateTickMessage(tpMessage);
424
+        }
383 425
         responseBean.addSuccess("操作成功!");
384 426
         return responseBean;
385 427
     }
386 428
 
387
-    @Transactional
429
+    @Transactional(rollbackFor = Exception.class)
388 430
     @Override
389 431
     public ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId, Integer userId) {
390 432
         ResponseBean responseBean = new ResponseBean();
@@ -405,6 +447,31 @@ public class TicketServiceImpl implements ITicketService {
405 447
             tpTicketRecord.setCreateUser(userId);
406 448
             tpTicketRecord.setCreateDate(new Date());
407 449
             tpTicketRecordMapper.insertSelective(tpTicketRecord);
450
+            //1.5版本需求推送消息
451
+            TpMessage tpMessage= new TpMessage();
452
+                      tpMessage.setTicketId(ticketId);
453
+                      tpMessage.setStatus("0");
454
+                      tpMessage.setUpdateUser(userId);
455
+                      tpMessage.setUpdateDate(new Date());
456
+                      tpMessageMapper.updateTickMessage(tpMessage);
457
+
458
+            //1.5版本推送消息message
459
+            TpMessage message = new TpMessage();
460
+            message.setCommunityId(communityId);
461
+            message.setModelType("1");
462
+            TpTicket tic= tpTicketMapper.selectByTicketId(String.valueOf(communityId),Integer.valueOf(ticketId));
463
+            message.setMessageType(tic.getType());
464
+            message.setAdviceType("4");
465
+            message.setUuid(userId);
466
+            message.setUuidType("2");
467
+            message.setSource("2");
468
+            message.setModelType("1");
469
+            message.setMessageContent("工单“"+tic.getTicketTitle() +"”被住户终止了,点击查看详情");
470
+            message.setStatus("1");
471
+            message.setReadStatus("0");
472
+            message.setCreateUser(userId);
473
+            message.setCreateDate(new Date());
474
+            tpMessageMapper.insert(message);
408 475
             return responseBean;
409 476
         } catch (Exception e) {
410 477
             e.printStackTrace();
@@ -487,6 +554,30 @@ public class TicketServiceImpl implements ITicketService {
487 554
                 tdImagesMapper.insert(tdImages);
488 555
             }
489 556
         }
557
+        //1.5版本推送消息message
558
+        //工单消息回复最最后一个物业人员
559
+
560
+        TpMessage message = new TpMessage();
561
+        message.setTicketId(ticketId);
562
+        message.setCommunityId(communityId);
563
+        message.setModelType("1");
564
+        message.setMessageType(tpTicket.getType());
565
+        message.setAdviceType("4");
566
+        //查询当前工单水处理
567
+        TpTicket ticket= tpTicketMapper.getTicketTpUserId(ticketId,communityId);
568
+        //考虑到工单没有分配,物业人员没有追问,只能塞本小区超级管理员ID
569
+        TpTicketRecordComment recordComment= tpTicketRecordCommentMapper.getUuID(communityId,ticketId);
570
+        Integer uuserID= toCommunitiesMapper.selectAndmin(communityId);
571
+        
572
+        message.setUuid(recordComment==null?uuserID:recordComment.getUuid());
573
+        message.setUuidType("2");
574
+        message.setSource("2");
575
+        message.setMessageContent("工单“"+ tpTicket.getTicketTitle()+"”发起人发来消息:"+content+",点击查看并处理");
576
+        message.setStatus("1");
577
+        message.setReadStatus("0");
578
+        message.setCreateUser(id);
579
+        message.setCreateDate(new Date());
580
+        tpMessageMapper.insert(message);
490 581
         response.addSuccess("成功");
491 582
         return response;
492 583
     }

+ 75
- 18
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java View File

@@ -5,15 +5,10 @@ import com.community.huiju.common.wxpay.HfWxConfig;
5 5
 import com.community.huiju.common.wxpay.WXPay;
6 6
 import com.community.huiju.common.wxpay.WXPayConstants;
7 7
 import com.community.huiju.common.wxpay.WXPayUtil;
8
-import com.community.huiju.dao.TaUserMapper;
9
-import com.community.huiju.dao.TpBillInvoiceMapper;
10
-import com.community.huiju.dao.TpBillMapper;
11
-import com.community.huiju.dao.TpBillStatementMapper;
12
-import com.community.huiju.model.TaUser;
13
-import com.community.huiju.model.TpBill;
14
-import com.community.huiju.model.TpBillInvoice;
15
-import com.community.huiju.model.TpBillStatement;
8
+import com.community.huiju.dao.*;
9
+import com.community.huiju.model.*;
16 10
 import com.community.huiju.service.WxPayServiceI;
11
+import com.google.common.collect.Maps;
17 12
 import org.slf4j.Logger;
18 13
 import org.slf4j.LoggerFactory;
19 14
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +41,11 @@ public class WxPayServiceImpl implements WxPayServiceI {
46 41
 	@Autowired
47 42
 	private TaUserMapper taUserMapper;
48 43
 
44
+	@Autowired
45
+	private TaSysRoleMapper taSysRoleMapper;
46
+
47
+	@Autowired
48
+	private TpMessageMapper tpMessageMapper;
49 49
 
50 50
 	/**
51 51
 	 * 微信支付统一下单
@@ -59,9 +59,19 @@ public class WxPayServiceImpl implements WxPayServiceI {
59 59
 	public Map<String, String> wxUnifiedOrder(Integer billInvoiceId, UserElement userElement) throws Exception {
60 60
 		HfWxConfig config = new HfWxConfig();
61 61
 		WXPay wxpay = new WXPay(config);
62
+
63
+		Integer userId = userElement.getId();
64
+
65
+		// 如果是家属/租客, 应该用业主的用户id
66
+		TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
67
+		TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
68
+		if (null != taSysRole && taSysRole.getId().intValue() != 1) {
69
+			TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
70
+			userId = ownerUser.getId();
71
+		}
62 72
 		
63 73
 		//获取支付金额
64
-		TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userElement.getId(),userElement.getCommunityId());
74
+		TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userId,userElement.getCommunityId());
65 75
 		if (null == tpBillInvoice){
66 76
 			throw new Exception("订单不存在");
67 77
 		}else if (!tpBillInvoice.getBillStatus().equals("3")){
@@ -120,16 +130,16 @@ public class WxPayServiceImpl implements WxPayServiceI {
120 130
 			return "订单状态出错";
121 131
 		}
122 132
 
123
-		// 根据 app 用户id, 查询用户
124
-		TaUser taUser = taUserMapper.selectByPrimaryKey(tpBillInvoice.getTaUserId());
133
+
134
+		// 缴费人在准备支付状态下更新, 这里是微信的回调所有没有 token
125 135
 
126 136
 		// 更新为正在支付状态
127
-		// 更改收费单的缴费人, 缴费时间, 修改人, 修改时间
137
+		// 更改收费单的 缴费时间, 修改人, 修改时间
128 138
 		tpBillInvoice.setBillStatus("1");
129
-		tpBillInvoice.setPayName(taUser.getUserName());
130 139
 		tpBillInvoice.setPayDate(new Date());
131 140
 		tpBillInvoice.setUpdateDate(new Date());
132
-		// tpBillInvoice.setUpdateUser(taUser.getId());
141
+		// 缴费方式  0:微信支付  1:线下缴费 2.支付宝支付
142
+		tpBillInvoice.setPayType(resultMap.get("pay_type"));
133 143
 		tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoice);
134 144
 
135 145
 		//插入流水账单表
@@ -140,7 +150,7 @@ public class WxPayServiceImpl implements WxPayServiceI {
140 150
 		tpBillStatement.setPayPrice(tpBillInvoice.getPayPrice());
141 151
 		tpBillStatement.setPayName(tpBillInvoice.getPayName());
142 152
 		tpBillStatement.setPayRemark(tpBillInvoice.getBillName());
143
-		tpBillStatement.setPayType("0");
153
+		tpBillStatement.setPayType(resultMap.get("pay_type"));
144 154
 		tpBillStatement.setCreateTime(new Date());
145 155
 		tpBillStatementMapper.insert(tpBillStatement);
146 156
 
@@ -159,6 +169,16 @@ public class WxPayServiceImpl implements WxPayServiceI {
159 169
 		}
160 170
 		tpBillMapper.updateByPrimaryKeySelective(tpBill);
161 171
 
172
+
173
+		// 把相对应的APP端, 代办消息设置为无效
174
+		Map<String, Object> map = Maps.newHashMap();
175
+		map.put("communityId", tpBillInvoice.getCommunityId());
176
+		map.put("billInvoiceId", tpBillInvoice.getId());
177
+		map.put("userId", tpBillInvoice.getTaUserId());
178
+		TpMessage tpMessage = tpMessageMapper.selectBillinvoiceMessage(map);
179
+		tpMessage.setStatus("0");
180
+		tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
181
+
162 182
 		return "success";
163 183
 	}
164 184
 	
@@ -180,15 +200,27 @@ public class WxPayServiceImpl implements WxPayServiceI {
180 200
 	@Override
181 201
 	@Transactional(rollbackFor = Exception.class)
182 202
 	public void wxStartPay(Integer billInvoiceId, UserElement userElement) throws Exception {
203
+
204
+		Integer userId = userElement.getId();
205
+
206
+		// 如果是家属/租客, 应该用业主的用户id
207
+		TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
208
+		TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
209
+		if (null != taSysRole && taSysRole.getId().intValue() != 1) {
210
+			TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
211
+			userId = ownerUser.getId();
212
+		}
213
+
183 214
 		//获取支付金额
184
-		TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userElement.getId(),userElement.getCommunityId());
215
+		TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userId,userElement.getCommunityId());
185 216
 		if (null == tpBillInvoice){
186 217
 			throw new Exception("订单不存在");
187 218
 		}else if (!tpBillInvoice.getBillStatus().equals("0")){
188 219
 			throw new Exception("正在支付的订单");
189 220
 		}
221
+
190 222
 		//更新为正在支付状态
191
-		updateBillInvoiceBillStatus(billInvoiceId,"3");
223
+		updateBillInvoiceBillStatus(billInvoiceId, taUser.getUserName(),"3");
192 224
 	}
193 225
 	
194 226
 	/**
@@ -200,8 +232,19 @@ public class WxPayServiceImpl implements WxPayServiceI {
200 232
 	@Override
201 233
 	@Transactional(rollbackFor = Exception.class)
202 234
 	public void wxCancelPay(Integer billInvoiceId, UserElement userElement) throws Exception {
235
+
236
+		Integer userId = userElement.getId();
237
+
238
+		// 如果是家属/租客, 应该用业主的用户id
239
+		TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
240
+		TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
241
+		if (null != taSysRole && taSysRole.getId().intValue() != 1) {
242
+			TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
243
+			userId = ownerUser.getId();
244
+		}
245
+
203 246
 		//获取支付金额
204
-		TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userElement.getId(),userElement.getCommunityId());
247
+		TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userId,userElement.getCommunityId());
205 248
 		if (null == tpBillInvoice){
206 249
 			throw new Exception("订单不存在");
207 250
 		}else if (!tpBillInvoice.getBillStatus().equals("3")){
@@ -222,4 +265,18 @@ public class WxPayServiceImpl implements WxPayServiceI {
222 265
 		tpBillInvoiceUpdate.setId(billInvoiceId);
223 266
 		tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
224 267
 	}
268
+
269
+	/**
270
+	 * 更新支付状态
271
+	 * @param billInvoiceId
272
+	 * @param userName 缴费人
273
+	 * @param billStatus
274
+	 */
275
+	private void updateBillInvoiceBillStatus(Integer billInvoiceId, String userName, String billStatus) {
276
+		TpBillInvoice tpBillInvoiceUpdate = new TpBillInvoice();
277
+		tpBillInvoiceUpdate.setBillStatus(billStatus);
278
+		tpBillInvoiceUpdate.setId(billInvoiceId);
279
+		tpBillInvoiceUpdate.setPayName(userName);
280
+		tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
281
+	}
225 282
 }

+ 3
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java View File

@@ -67,4 +67,7 @@ public class TaUserVO {
67 67
     /**业主ID**/
68 68
     private Integer proprietorID;
69 69
 
70
+    /** 身份证 **/
71
+    private String idCard;
72
+
70 73
 }

+ 11
- 1
CODE/smart-community/app-api/src/main/resources/application.yml View File

@@ -18,4 +18,14 @@ pagehelper:
18 18
 # 打印sql
19 19
 logging:
20 20
   level:
21
-    com.community.huiju.dao: debug
21
+    com.community.huiju.dao: debug
22
+alipay:
23
+  APP_ID: 2019021463230548
24
+  APP_PRIVATE_KEY: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCkrvqeBeJNNeKByYSBq8U+V0STFBh70IGaHi2oPa3TiF6u2WAJ7YlH2h1S4Zj2Ezojckfl0m8y/nqpPay6gSMBOpR38A+94gNiH7BVfyecuuQ9z+2BJdOxN5RkEBBkUqeW4oUbrgY4mRLPRrUKvAu/4Brd0eojkkEW0hJUxqgKj+C4H5tR+6DRowHcO23Q/98+4qlSRjhygLVK4m+u8+zb26RxF4v0ogooF+EAZQLOqz3N4uaZs2ajgnecG0drtei7mxbpyqHMr0idP4U4Lx63yXViRNWpHQ7u7byOBQNV9MFHWPHKt+aNOqZ61LCXpJt777usQPzQJggZj6TpRtT3AgMBAAECggEAHM36Sf+PeJ/PMZJU2fV4d5H+DZe7PJTYxmM26zF2oQQ+Q2kEElh45Zdx/5g0D/6G8cJAbyNijdHTFJ0UBD8oJ0Peyie0KStKGjSevCWUgSZzW5ht22QJZfrpuqLQqyuF4q9WRuQmdGnZz2V3rxv7FiGVsWzQ/k3LkrlFuYxRwh7lpJvHC/ed5o1NI4t+w0lBNp3qonJJ8QYsAGWoJR8iP/XrupErrTivRHkyzEos1DsDdPb5TPV21D+YO7FlqTb6/nqqJH6IOjxMI/PlWGRS3l12TeHqv8W2PWIrZvcTGBqMOiHKGt9Y2ZAIelKBGv+lr2G4yaSnWSXec+6V4x3sWQKBgQDv9r26pbBoEtwGd55zAXTr+0A4jwfgUtVm0Z2b/WG857k+iR5hdLX6PHinbgD7sFpRAhoWGNLPa88ZjPDD0JyFwVMEN176k6zEyrBSbbyoCYJeYbWikebdKdiKNE/WFqZGS3Olm3pdHxwD2Q92H61XHLveWRHmYGAlTi66txPh6wKBgQCvsFr8CUt4Y8RU0RGvBLG7JRpRIaVKF34r6YsHZhpAluQ1WAqJEezmYMTfLi81UNYUZHaw7SyG1O+WiEMpWH0Y+qV/z6OUn+37lll7RsIpy9EGLY4L51emCClBmcUIGp80sA2rfF4U8dc23lwIHpLSUWoKOlcQO4gqzLICTLwKJQKBgGjlCvrUAtD7rYKGN5U+RcYCBoiyvVap3u8bIjJWCKty/97+QXGIeyPv2y4VQAjFhjVzHcQbBcv17InWukheoI03fPqS2cnfU96SW5EstxMdVQe83pE6BhkXebiwNVX4gKapxNvXox2hw7VK5R9VqYgy30zK0rBJ4L1t969W6DIRAoGALGSzmNwAZftPsN7jSQY2osNNUxLdYUtuZkotB0GVgJygLZqBjwEoi04IcRyKcT5r2dtI4owLpEZKBA+KaPgjJByxlQoym2uOBvSGx8+pYEZQGu+H5Rof26RUSG9Cijmv4PBbg+l5HHG/n+2v851GHD7WPJ9hQIjKb4YptMsO+MECgYEAyD8rx2Vk2smh5chVkkiw1QMSoV91B+dJ8+B/G0Moxy9Hzp/s4O8mG4B2ByCkcRgkbMTJmNndk5MTd0gjX4C4C3FKf2vbdqFuCKAPzJ0rTs/rLcjz2/g8I7BMvVd/sEh77iewsVLvSLhF2ZRxD9Mc2qfffU4hq8F4WIyLVgvizFU=
25
+  ALIPAY_PUBLIC_KEY: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnJtkEz+TiJR/KbLDeP0rKQTSrQO7g8sGU0G0RYIN3KF6CiWd+eaT/ioM0BpR1Jx+IuAdpo3DFBqhLA6ABSHXFZPRikcxNlsyz2JgkwzfsRY+DxcPnYYNZFK7pUbku8L/AIxZiFQcbunwz36acazaZpun0zgrQlcBZqBCTCIgkT2fMQbPTm/MrmUKjDTE0VP+1mFyjYUVZWpJEYE5AJ3+x7jAPmuEdSMwKONUtOOTByDrkmXJ60RGE8zCmO/oUmOGxnTQRYfNjvBZ0lbVdP/bAw6qHVFBElzPHjNerbMK/geLuiLs3vkDY9tw7A4GQYMnjKuoetuMUhxZ6nRTH6NCeQIDAQAB
26
+
27
+# 迎宾系统
28
+welcome:
29
+  communityId: 83
30
+  url: http://xxxxxxxx
31
+

+ 71
- 0
CODE/smart-community/app-api/src/main/resources/mapper/SysReportReasonMapper.xml View File

@@ -0,0 +1,71 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.SysReportReasonMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.SysReportReason" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="reason" property="reason" jdbcType="VARCHAR" />
7
+    <result column="sort" property="sort" jdbcType="INTEGER" />
8
+  </resultMap>
9
+  <sql id="Base_Column_List" >
10
+    id, reason, sort
11
+  </sql>
12
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
13
+    select 
14
+    <include refid="Base_Column_List" />
15
+    from sys_report_reason
16
+    where id = #{id,jdbcType=INTEGER}
17
+  </select>
18
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
19
+    delete from sys_report_reason
20
+    where id = #{id,jdbcType=INTEGER}
21
+  </delete>
22
+  <insert id="insert" parameterType="com.community.huiju.model.SysReportReason" >
23
+    insert into sys_report_reason (id, reason, sort
24
+      )
25
+    values (#{id,jdbcType=INTEGER}, #{reason,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}
26
+      )
27
+  </insert>
28
+  <insert id="insertSelective" parameterType="com.community.huiju.model.SysReportReason" >
29
+    insert into sys_report_reason
30
+    <trim prefix="(" suffix=")" suffixOverrides="," >
31
+      <if test="id != null" >
32
+        id,
33
+      </if>
34
+      <if test="reason != null" >
35
+        reason,
36
+      </if>
37
+      <if test="sort != null" >
38
+        sort,
39
+      </if>
40
+    </trim>
41
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
42
+      <if test="id != null" >
43
+        #{id,jdbcType=INTEGER},
44
+      </if>
45
+      <if test="reason != null" >
46
+        #{reason,jdbcType=VARCHAR},
47
+      </if>
48
+      <if test="sort != null" >
49
+        #{sort,jdbcType=INTEGER},
50
+      </if>
51
+    </trim>
52
+  </insert>
53
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.SysReportReason" >
54
+    update sys_report_reason
55
+    <set >
56
+      <if test="reason != null" >
57
+        reason = #{reason,jdbcType=VARCHAR},
58
+      </if>
59
+      <if test="sort != null" >
60
+        sort = #{sort,jdbcType=INTEGER},
61
+      </if>
62
+    </set>
63
+    where id = #{id,jdbcType=INTEGER}
64
+  </update>
65
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.SysReportReason" >
66
+    update sys_report_reason
67
+    set reason = #{reason,jdbcType=VARCHAR},
68
+      sort = #{sort,jdbcType=INTEGER}
69
+    where id = #{id,jdbcType=INTEGER}
70
+  </update>
71
+</mapper>

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TaSysMenuMapper.xml View File

@@ -131,6 +131,6 @@
131 131
     select
132 132
     <include refid="Base_Column_List" />
133 133
     from ta_sys_menu
134
-    where community_id = #{communityId,jdbcType=INTEGER}
134
+    where community_id = #{communityId,jdbcType=INTEGER} and status = 0
135 135
   </select>
136 136
 </mapper>

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaSysUserRoleMapper.xml View File

@@ -93,4 +93,11 @@
93 93
     from ta_sys_user_role
94 94
     where community_id = #{communityId,jdbcType=INTEGER} and user_id = #{userId,jdbcType=INTEGER}
95 95
   </select>
96
+
97
+  <select id="selectRole" resultMap="BaseResultMap">
98
+    select
99
+    <include refid="Base_Column_List" />
100
+    from ta_sys_user_role
101
+    where community_id = #{communityId,jdbcType=INTEGER} and user_id = #{userId,jdbcType=INTEGER}
102
+  </select>
96 103
 </mapper>

+ 16
- 4
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml View File

@@ -24,11 +24,12 @@
24 24
     <result column="hk_user_id" property="hkUserId" jdbcType="INTEGER" />
25 25
     <result column="hk_card_no" property="hkCardNo" jdbcType="VARCHAR" />
26 26
     <result column="face_status" property="faceStatus" jdbcType="CHAR" />
27
+    <result column="id_card" property="idCard" jdbcType="INTEGER"/>
27 28
   </resultMap>
28 29
   <sql id="Base_Column_List" >
29 30
     id, community_id, building_owner_info_id, head_portrait, user_name, login_name, login_password,
30 31
     email, gender, status, remark, parent_id, accept_agreement_status, verify_status,
31
-    create_user, create_date, update_user, update_date, hk_person_no, hk_user_id, hk_card_no, face_status
32
+    create_user, create_date, update_user, update_date, hk_person_no, hk_user_id, hk_card_no, face_status, id_card
32 33
   </sql>
33 34
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
34 35
     select
@@ -47,7 +48,7 @@
47 48
       status, remark, parent_id,
48 49
       accept_agreement_status, verify_status, create_user,
49 50
       create_date, update_user, update_date, hk_person_no,
50
-      hk_user_id, hk_card_no, face_status
51
+      hk_user_id, hk_card_no, face_status, id_card
51 52
       )
52 53
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{buildingOwnerInfoId,jdbcType=INTEGER},
53 54
       #{headPortrait,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
@@ -55,7 +56,8 @@
55 56
       #{status,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
56 57
       #{acceptAgreementStatus,jdbcType=CHAR}, #{verifyStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER},
57 58
       #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
58
-      #{hkPersonNo,jdbcType=BIGINT}, #{hkUserId,jdbcType=INTEGER}, #{hkCardNo,jdbcType=VARCHAR}, #{faceStatus,jdbcType=CHAR}
59
+      #{hkPersonNo,jdbcType=BIGINT}, #{hkUserId,jdbcType=INTEGER}, #{hkCardNo,jdbcType=VARCHAR}, #{faceStatus,jdbcType=CHAR},
60
+      #{idCard,jdbcType=VARCHAR}
59 61
       )
60 62
   </insert>
61 63
   <insert id="insertSelective" parameterType="com.community.huiju.model.TaUser" useGeneratedKeys="true" keyProperty="id" >
@@ -127,6 +129,9 @@
127 129
       <if test="faceStatus != null" >
128 130
         face_status,
129 131
       </if>
132
+      <if test="idCard != null">
133
+        id_card,
134
+      </if>
130 135
     </trim>
131 136
     <trim prefix="values (" suffix=")" suffixOverrides="," >
132 137
       <if test="id != null" >
@@ -195,6 +200,9 @@
195 200
       <if test="faceStatus != null" >
196 201
         #{faceStatus,jdbcType=CHAR},
197 202
       </if>
203
+      <if test="idCard != null">
204
+        #{idCard,jdbcType=VARCHAR},
205
+      </if>
198 206
     </trim>
199 207
   </insert>
200 208
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaUser" >
@@ -263,6 +271,9 @@
263 271
       <if test="faceStatus != null" >
264 272
         face_status = #{faceStatus,jdbcType=CHAR},
265 273
       </if>
274
+      <if test="idCard != null">
275
+        id_card = #{idCard,jdbcType=VARCHAR},
276
+      </if>
266 277
     </set>
267 278
     where id = #{id,jdbcType=INTEGER}
268 279
   </update>
@@ -288,7 +299,8 @@
288 299
       hk_person_no = #{hkPersonNo,jdbcType=BIGINT},
289 300
       hk_user_id = #{hkUserId,jdbcType=INTEGER},
290 301
       hk_card_no = #{hkCardNo,jdbcType=VARCHAR},
291
-      face_status = #{faceStatus,jdbcType=CHAR}
302
+      face_status = #{faceStatus,jdbcType=CHAR},
303
+      id_card = #{idCard,jdbcType=VARCHAR}
292 304
     where id = #{id,jdbcType=INTEGER}
293 305
   </update>
294 306
 

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/ToCommunitiesMapper.xml View File

@@ -136,4 +136,11 @@
136 136
       and community_name like concat('%',#{communityName,jdbcType=VARCHAR},'%')
137 137
     </if>
138 138
   </select>
139
+
140
+  <select id="selectAndmin" resultType="int">
141
+    SELECT u.id  FROM  tp_user u
142
+    LEFT JOIN to_communities co ON u.login_name = co.login_name
143
+    WHERE co.id = #{communityId,jdbcType=VARCHAR}
144
+    AND u.community_id=#{communityId,jdbcType=VARCHAR}
145
+  </select>
139 146
 </mapper>

+ 20
- 6
CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml View File

@@ -17,11 +17,12 @@
17 17
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
18 18
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
19 19
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
20
+    <result column="pay_type" property="payType" jdbcType="CHAR" />
20 21
   </resultMap>
21 22
   <sql id="Base_Column_List" >
22 23
     id, community_id, bill_id, building_owner_info_id, ta_user_id, bill_invoice_explain, 
23 24
     pay_price, bill_statement_id, bill_status, pay_name, pay_date, create_user, create_date, 
24
-    update_user, update_date
25
+    update_user, update_date, pay_type
25 26
   </sql>
26 27
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
27 28
     select 
@@ -38,13 +39,14 @@
38 39
       building_owner_info_id, ta_user_id, bill_invoice_explain, 
39 40
       pay_price, bill_statement_id, bill_status, 
40 41
       pay_name, pay_date, create_user, 
41
-      create_date, update_user, update_date
42
+      create_date, update_user, update_date, pay_type
42 43
       )
43 44
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{billId,jdbcType=INTEGER}, 
44 45
       #{buildingOwnerInfoId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER}, #{billInvoiceExplain,jdbcType=VARCHAR}, 
45 46
       #{payPrice,jdbcType=INTEGER}, #{billStatementId,jdbcType=INTEGER}, #{billStatus,jdbcType=CHAR}, 
46 47
       #{payName,jdbcType=VARCHAR}, #{payDate,jdbcType=TIMESTAMP}, #{createUser,jdbcType=INTEGER}, 
47
-      #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP}
48
+      #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
49
+      #{payType,jdbcType=CHAR}
48 50
       )
49 51
   </insert>
50 52
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpBillInvoice" >
@@ -95,6 +97,9 @@
95 97
       <if test="updateDate != null" >
96 98
         update_date,
97 99
       </if>
100
+      <if test="payType != null">
101
+          pay_type,
102
+      </if>
98 103
     </trim>
99 104
     <trim prefix="values (" suffix=")" suffixOverrides="," >
100 105
       <if test="id != null" >
@@ -142,6 +147,9 @@
142 147
       <if test="updateDate != null" >
143 148
         #{updateDate,jdbcType=TIMESTAMP},
144 149
       </if>
150
+      <if test="payType != null">
151
+        #{payType,jdbcType=CHAR},
152
+      </if>
145 153
     </trim>
146 154
   </insert>
147 155
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpBillInvoice" >
@@ -189,6 +197,9 @@
189 197
       <if test="updateDate != null" >
190 198
         update_date = #{updateDate,jdbcType=TIMESTAMP},
191 199
       </if>
200
+      <if test="payType != null">
201
+        pay_type = #{payType,jdbcType=CHAR},
202
+      </if>
192 203
     </set>
193 204
     where id = #{id,jdbcType=INTEGER}
194 205
   </update>
@@ -207,7 +218,8 @@
207 218
       create_user = #{createUser,jdbcType=INTEGER},
208 219
       create_date = #{createDate,jdbcType=TIMESTAMP},
209 220
       update_user = #{updateUser,jdbcType=INTEGER},
210
-      update_date = #{updateDate,jdbcType=TIMESTAMP}
221
+      update_date = #{updateDate,jdbcType=TIMESTAMP},
222
+      pay_type = #{payType,jdbcType=CHAR}
211 223
     where id = #{id,jdbcType=INTEGER}
212 224
   </update>
213 225
 
@@ -221,7 +233,8 @@
221 233
           b.bill_name AS billName,
222 234
           b.bill_explain AS billExplain,
223 235
           b.end_date AS endDate,
224
-          b.create_date AS createDate
236
+          b.create_date AS createDate,
237
+          i.out_trade_no AS outTradeNo
225 238
       FROM
226 239
           tp_bill_invoice i
227 240
           LEFT JOIN tp_bill b ON b.id = i.bill_id
@@ -252,7 +265,8 @@
252 265
         s.pay_name AS payName,
253 266
         s.pay_remark AS payRemark,
254 267
         s.pay_type AS payType,
255
-        s.create_time AS createTime
268
+        s.create_time AS createTime,
269
+        i.out_trade_no AS outTradeNo
256 270
     FROM
257 271
         tp_bill_invoice i
258 272
         LEFT JOIN tp_bill b ON b.id = i.bill_id

+ 6
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpCarouselSettingMapper.xml View File

@@ -85,8 +85,12 @@
85 85
       carousel_num = #{carouselNum,jdbcType=INTEGER}
86 86
     where id = #{id,jdbcType=INTEGER}
87 87
   </update>
88
-  <select id="getcarouselNum"  parameterType="java.lang.String" resultType="java.lang.Integer">
89
-    select carousel_num from tp_carousel_setting where  carousel_type=#{lease,jdbcType=VARCHAR}
88
+  <select id="getcarouselNum"  resultType="java.lang.Integer">
89
+    select carousel_num
90
+    from
91
+    tp_carousel_setting
92
+    where  carousel_type=#{lease,jdbcType=VARCHAR}
93
+    and community_id = #{communityId,jdbcType=INTEGER}
90 94
   </select>
91 95
 
92 96
 

+ 85
- 5
CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml View File

@@ -124,7 +124,10 @@
124 124
         activity_id,
125 125
       </if>
126 126
       <if test="announcementId != null" >
127
-        announcement_id,
127
+      announcement_id,
128
+    </if>
129
+      <if test="transactionId != null" >
130
+        transaction_id
128 131
       </if>
129 132
     </trim>
130 133
     <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -183,13 +186,16 @@
183 186
         #{updateDate,jdbcType=TIMESTAMP},
184 187
       </if>
185 188
       <if test="billId != null" >
186
-        bill_id,
189
+        #{billId,jdbcType=TIMESTAMP},
187 190
       </if>
188 191
       <if test="activityId != null" >
189
-        activity_id,
192
+        #{activityId,jdbcType=TIMESTAMP},
190 193
       </if>
191 194
       <if test="announcementId != null" >
192
-        announcement_id,
195
+        #{announcementId,jdbcType=TIMESTAMP},
196
+      </if>
197
+      <if test="transactionId != null" >
198
+        #{transactionId,jdbcType=TIMESTAMP},
193 199
       </if>
194 200
     </trim>
195 201
   </insert>
@@ -287,7 +293,7 @@
287 293
   <select id="getMessageTotal" resultType="map">
288 294
     SELECT
289 295
         count( CASE WHEN model_type = 1 AND read_status = 0 THEN 1 ELSE NULL END ) AS messageTotal,
290
-        count( CASE WHEN model_type = 2 THEN 1 ELSE NULL END ) AS toDoTotal
296
+        count( CASE WHEN model_type = 2 AND status = 1 THEN 1 ELSE NULL END ) AS toDoTotal
291 297
     FROM
292 298
         tp_message
293 299
     WHERE
@@ -340,6 +346,7 @@
340 346
         AND t.uuid = #{userId,jdbcType=INTEGER}
341 347
         AND t.STATUS = 1
342 348
         AND t.advice_type = 1
349
+        AND t.uuid_type = 1
343 350
         AND t.model_type = #{modelType,jdbcType=INTEGER}
344 351
     ORDER BY
345 352
     t.create_date DESC
@@ -365,6 +372,79 @@
365 372
     message_type=#{messageType}
366 373
     and ticket_id=#{ticketId}
367 374
     and model_type=#{modelType}
375
+    and source=#{source}
376
+  </select>
377
+  <update id="updateTickMessage" parameterType="com.community.huiju.model.TpMessage" >
378
+    update tp_message
379
+    set
380
+    <trim suffixOverrides=",">
381
+      <if test="message.messageContent!= null" >
382
+        message_content = #{message.messageContent,jdbcType=VARCHAR},
383
+      </if>
384
+      <if test="message.updateUser != null" >
385
+        update_user = #{message.updateUser,jdbcType=INTEGER},
386
+      </if>
387
+      <if test="message.updateDate != null" >
388
+        update_date = #{message.updateDate,jdbcType=TIMESTAMP},
389
+      </if>
390
+      <if test="message.status != null" >
391
+        status = #{message.status,jdbcType=CHAR}
392
+      </if>
393
+    </trim>
394
+    where ticket_id = #{message.ticketId,jdbcType=INTEGER}
395
+  </update>
396
+  <select id="selectTicket" resultType="int">
397
+    select
398
+    ticket_id
399
+    from
400
+    tp_message
401
+    when ticket_id=#{ticketId}
402
+  </select>
403
+  <select id="selectConditionsTpMessage" resultMap="BaseResultMap" parameterType="map">
404
+    SELECT
405
+        *
406
+    FROM
407
+        tp_message
408
+    WHERE
409
+    <trim prefixOverrides="and | or">
410
+      <if test="map.communityId != null">
411
+        and community_id = #{map.communityId}
412
+      </if>
413
+      <if test="map.messageType != null">
414
+        and message_type = #{map.messageType}
415
+      </if>
416
+      <if test="map.adviceType != null">
417
+        and advice_type = #{map.adviceType}
418
+      </if>
419
+      <if test="map.uuidType != null">
420
+        and uuid_type = #{map.uuidType}
421
+      </if>
422
+      <if test="map.source != null">
423
+        and source = #{map.source}
424
+      </if>
425
+      <if test="map.status != null">
426
+        and status = #{map.status}
427
+      </if>
428
+      <if test="map.transactionId != null">
429
+        and transaction_id = #{map.transactionId}
430
+      </if>
431
+      <if test="map.modelType != null">
432
+        and model_type = #{map.modelType}
433
+      </if>
434
+    </trim>
368 435
   </select>
369 436
 
437
+  <select id="selectBillinvoiceMessage" resultMap="BaseResultMap" parameterType="map">
438
+    select
439
+    <include refid="Base_Column_List" />
440
+    from tp_message
441
+    where
442
+    community_id = #{map.communityId}
443
+    and bill_id = #{map.billInvoiceId}
444
+    and uuid_type = 1
445
+    and uuid = #{map.userId}
446
+    and message_type = 7
447
+    and advice_type = 1
448
+    and source = 2
449
+  </select>
370 450
 </mapper>

+ 15
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml View File

@@ -247,13 +247,25 @@
247 247
     WHERE
248 248
         t.id = #{ticketId,jdbcType=INTEGER}
249 249
         AND t.community_id = #{communityId,jdbcType=INTEGER}
250
-  </select>
250
+</select>
251 251
   <update id="updateTpUserId" parameterType="int" >
252 252
     update tp_ticket
253 253
     set
254 254
       tp_user_id =null
255 255
     where id = #{ticketId,jdbcType=INTEGER}
256 256
   </update>
257
-
258
-
257
+  <select id="getTicketTpUserId" resultMap="BaseResultMap" >
258
+    select
259
+    <include refid="Base_Column_List" />
260
+    from tp_ticket
261
+    where id = #{ticketId,jdbcType=INTEGER} and community_id= #{communityId,jdbcType=INTEGER}
262
+  </select>
263
+  <select id="selectRecordStatus" resultType="int">
264
+    select
265
+    create_user
266
+    from tp_ticket_record
267
+    where ticket_id = #{ticketId,jdbcType=INTEGER}
268
+     and community_id= #{communityId,jdbcType=INTEGER}
269
+     and status = 4
270
+  </select>
259 271
 </mapper>

+ 12
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordCommentMapper.xml View File

@@ -168,4 +168,16 @@
168 168
         AND ticket_id = #{ticketId,jdbcType=INTEGER}
169 169
         AND ticket_record_id = #{id,jdbcType=INTEGER}
170 170
   </select>
171
+  <select id="getUuID" resultType="com.community.huiju.model.TpTicketRecordComment">
172
+    SELECT
173
+	*
174
+    FROM
175
+        tp_ticket_record_comment
176
+    WHERE user_type=0
177
+    and ticket_id= #{ticketId,jdbcType=INTEGER}
178
+    and  community_id = #{communityId,jdbcType=INTEGER}
179
+    ORDER BY
180
+	create_date DESC
181
+    LIMIT 1
182
+  </select>
171 183
 </mapper>

+ 140
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionLikeMapper.xml View File

@@ -0,0 +1,140 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpTransactionLikeMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransactionLike" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
8
+    <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
9
+    <result column="like_status" property="likeStatus" jdbcType="VARCHAR" />
10
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
12
+  </resultMap>
13
+  <sql id="Base_Column_List" >
14
+    id, community_id, ta_user_id, transaction_id, like_status, create_date, update_date
15
+  </sql>
16
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
17
+    select 
18
+    <include refid="Base_Column_List" />
19
+    from tp_transaction_like
20
+    where id = #{id,jdbcType=INTEGER}
21
+  </select>
22
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
23
+    delete from tp_transaction_like
24
+    where id = #{id,jdbcType=INTEGER}
25
+  </delete>
26
+  <insert id="insert" parameterType="com.community.huiju.model.TpTransactionLike" >
27
+    insert into tp_transaction_like (id, community_id, ta_user_id, 
28
+      transaction_id, like_status, create_date, 
29
+      update_date)
30
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER}, 
31
+      #{transactionId,jdbcType=INTEGER}, #{likeStatus,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
32
+      #{updateDate,jdbcType=TIMESTAMP})
33
+  </insert>
34
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTransactionLike" >
35
+    insert into tp_transaction_like
36
+    <trim prefix="(" suffix=")" suffixOverrides="," >
37
+      <if test="id != null" >
38
+        id,
39
+      </if>
40
+      <if test="communityId != null" >
41
+        community_id,
42
+      </if>
43
+      <if test="taUserId != null" >
44
+        ta_user_id,
45
+      </if>
46
+      <if test="transactionId != null" >
47
+        transaction_id,
48
+      </if>
49
+      <if test="likeStatus != null" >
50
+        like_status,
51
+      </if>
52
+      <if test="createDate != null" >
53
+        create_date,
54
+      </if>
55
+      <if test="updateDate != null" >
56
+        update_date,
57
+      </if>
58
+    </trim>
59
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
60
+      <if test="id != null" >
61
+        #{id,jdbcType=INTEGER},
62
+      </if>
63
+      <if test="communityId != null" >
64
+        #{communityId,jdbcType=INTEGER},
65
+      </if>
66
+      <if test="taUserId != null" >
67
+        #{taUserId,jdbcType=INTEGER},
68
+      </if>
69
+      <if test="transactionId != null" >
70
+        #{transactionId,jdbcType=INTEGER},
71
+      </if>
72
+      <if test="likeStatus != null" >
73
+        #{likeStatus,jdbcType=VARCHAR},
74
+      </if>
75
+      <if test="createDate != null" >
76
+        #{createDate,jdbcType=TIMESTAMP},
77
+      </if>
78
+      <if test="updateDate != null" >
79
+        #{updateDate,jdbcType=TIMESTAMP},
80
+      </if>
81
+    </trim>
82
+  </insert>
83
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTransactionLike" >
84
+    update tp_transaction_like
85
+    <set >
86
+      <if test="communityId != null" >
87
+        community_id = #{communityId,jdbcType=INTEGER},
88
+      </if>
89
+      <if test="taUserId != null" >
90
+        ta_user_id = #{taUserId,jdbcType=INTEGER},
91
+      </if>
92
+      <if test="transactionId != null" >
93
+        transaction_id = #{transactionId,jdbcType=INTEGER},
94
+      </if>
95
+      <if test="likeStatus != null" >
96
+        like_status = #{likeStatus,jdbcType=VARCHAR},
97
+      </if>
98
+      <if test="createDate != null" >
99
+        create_date = #{createDate,jdbcType=TIMESTAMP},
100
+      </if>
101
+      <if test="updateDate != null" >
102
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
103
+      </if>
104
+    </set>
105
+    where id = #{id,jdbcType=INTEGER}
106
+  </update>
107
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransactionLike" >
108
+    update tp_transaction_like
109
+    set community_id = #{communityId,jdbcType=INTEGER},
110
+      ta_user_id = #{taUserId,jdbcType=INTEGER},
111
+      transaction_id = #{transactionId,jdbcType=INTEGER},
112
+      like_status = #{likeStatus,jdbcType=VARCHAR},
113
+      create_date = #{createDate,jdbcType=TIMESTAMP},
114
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </update>
117
+  <select id="likeCount" resultType="int">
118
+    SELECT COUNT(transaction_id) FROM
119
+    tp_transaction_like
120
+    WHERE like_status = 1
121
+    and   community_id = #{communityId,jdbcType=INTEGER}
122
+    and   transaction_id = #{invitationId,jdbcType=INTEGER}
123
+  </select>
124
+
125
+  <select id="nolikeCount"  resultType="int">
126
+    SELECT COUNT(transaction_id) FROM
127
+    tp_transaction_like
128
+    WHERE like_status = 2
129
+    and   community_id = #{communityId,jdbcType=INTEGER}
130
+    and   transaction_id = #{invitationId,jdbcType=INTEGER}
131
+  </select>
132
+
133
+  <select id="getinvitationId" resultMap="BaseResultMap">
134
+    SELECT * FROM
135
+    tp_transaction_like
136
+    WHERE community_id = #{communityId,jdbcType=INTEGER}
137
+    and   ta_user_id = #{userId,jdbcType=INTEGER}
138
+    and   transaction_id = #{invitationId,jdbcType=INTEGER}
139
+  </select>
140
+</mapper>

+ 150
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml View File

@@ -0,0 +1,150 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpTransactionReplyMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransactionReply" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
8
+    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
9
+    <result column="ta_user_name" property="taUserName" jdbcType="VARCHAR" />
10
+    <result column="reply_content" property="replyContent" jdbcType="VARCHAR" />
11
+    <result column="reply_ta_user_id" property="replyTaUserId" jdbcType="INTEGER" />
12
+    <result column="reply_ta_user_name" property="replyTaUserName" jdbcType="VARCHAR" />
13
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
14
+  </resultMap>
15
+  <sql id="Base_Column_List" >
16
+    id, community_id, transaction_id, ta_user_id, ta_user_name, reply_content, reply_ta_user_id, 
17
+    reply_ta_user_name, create_date
18
+  </sql>
19
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
20
+    select 
21
+    <include refid="Base_Column_List" />
22
+    from tp_transaction_reply
23
+    where id = #{id,jdbcType=INTEGER}
24
+  </select>
25
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
26
+    delete from tp_transaction_reply
27
+    where id = #{id,jdbcType=INTEGER}
28
+  </delete>
29
+  <insert id="insert" parameterType="com.community.huiju.model.TpTransactionReply" >
30
+    insert into tp_transaction_reply (id, community_id, transaction_id, 
31
+      ta_user_id, ta_user_name, reply_content, 
32
+      reply_ta_user_id, reply_ta_user_name, create_date
33
+      )
34
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER}, 
35
+      #{taUserId,jdbcType=INTEGER}, #{taUserName,jdbcType=VARCHAR}, #{replyContent,jdbcType=VARCHAR}, 
36
+      #{replyTaUserId,jdbcType=INTEGER}, #{replyTaUserName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}
37
+      )
38
+  </insert>
39
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTransactionReply" >
40
+    insert into tp_transaction_reply
41
+    <trim prefix="(" suffix=")" suffixOverrides="," >
42
+      <if test="id != null" >
43
+        id,
44
+      </if>
45
+      <if test="communityId != null" >
46
+        community_id,
47
+      </if>
48
+      <if test="transactionId != null" >
49
+        transaction_id,
50
+      </if>
51
+      <if test="taUserId != null" >
52
+        ta_user_id,
53
+      </if>
54
+      <if test="taUserName != null" >
55
+        ta_user_name,
56
+      </if>
57
+      <if test="replyContent != null" >
58
+        reply_content,
59
+      </if>
60
+      <if test="replyTaUserId != null" >
61
+        reply_ta_user_id,
62
+      </if>
63
+      <if test="replyTaUserName != null" >
64
+        reply_ta_user_name,
65
+      </if>
66
+      <if test="createDate != null" >
67
+        create_date,
68
+      </if>
69
+    </trim>
70
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
71
+      <if test="id != null" >
72
+        #{id,jdbcType=INTEGER},
73
+      </if>
74
+      <if test="communityId != null" >
75
+        #{communityId,jdbcType=INTEGER},
76
+      </if>
77
+      <if test="transactionId != null" >
78
+        #{transactionId,jdbcType=INTEGER},
79
+      </if>
80
+      <if test="taUserId != null" >
81
+        #{taUserId,jdbcType=INTEGER},
82
+      </if>
83
+      <if test="taUserName != null" >
84
+        #{taUserName,jdbcType=VARCHAR},
85
+      </if>
86
+      <if test="replyContent != null" >
87
+        #{replyContent,jdbcType=VARCHAR},
88
+      </if>
89
+      <if test="replyTaUserId != null" >
90
+        #{replyTaUserId,jdbcType=INTEGER},
91
+      </if>
92
+      <if test="replyTaUserName != null" >
93
+        #{replyTaUserName,jdbcType=VARCHAR},
94
+      </if>
95
+      <if test="createDate != null" >
96
+        #{createDate,jdbcType=TIMESTAMP},
97
+      </if>
98
+    </trim>
99
+  </insert>
100
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTransactionReply" >
101
+    update tp_transaction_reply
102
+    <set >
103
+      <if test="communityId != null" >
104
+        community_id = #{communityId,jdbcType=INTEGER},
105
+      </if>
106
+      <if test="transactionId != null" >
107
+        transaction_id = #{transactionId,jdbcType=INTEGER},
108
+      </if>
109
+      <if test="taUserId != null" >
110
+        ta_user_id = #{taUserId,jdbcType=INTEGER},
111
+      </if>
112
+      <if test="taUserName != null" >
113
+        ta_user_name = #{taUserName,jdbcType=VARCHAR},
114
+      </if>
115
+      <if test="replyContent != null" >
116
+        reply_content = #{replyContent,jdbcType=VARCHAR},
117
+      </if>
118
+      <if test="replyTaUserId != null" >
119
+        reply_ta_user_id = #{replyTaUserId,jdbcType=INTEGER},
120
+      </if>
121
+      <if test="replyTaUserName != null" >
122
+        reply_ta_user_name = #{replyTaUserName,jdbcType=VARCHAR},
123
+      </if>
124
+      <if test="createDate != null" >
125
+        create_date = #{createDate,jdbcType=TIMESTAMP},
126
+      </if>
127
+    </set>
128
+    where id = #{id,jdbcType=INTEGER}
129
+  </update>
130
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransactionReply" >
131
+    update tp_transaction_reply
132
+    set community_id = #{communityId,jdbcType=INTEGER},
133
+      transaction_id = #{transactionId,jdbcType=INTEGER},
134
+      ta_user_id = #{taUserId,jdbcType=INTEGER},
135
+      ta_user_name = #{taUserName,jdbcType=VARCHAR},
136
+      reply_content = #{replyContent,jdbcType=VARCHAR},
137
+      reply_ta_user_id = #{replyTaUserId,jdbcType=INTEGER},
138
+      reply_ta_user_name = #{replyTaUserName,jdbcType=VARCHAR},
139
+      create_date = #{createDate,jdbcType=TIMESTAMP}
140
+    where id = #{id,jdbcType=INTEGER}
141
+  </update>
142
+  <select id="getCommunityIdAndTransactionId" resultMap="BaseResultMap">
143
+    select
144
+      tr.*,
145
+      (select tsr.role_name from ta_sys_user_role tsur LEFT JOIN ta_sys_role tsr on tsur.role_id = tsr.id where tsur.user_id = tr.ta_user_id) as taRoleName,
146
+      (select tsr.role_name from ta_sys_user_role tsur LEFT JOIN ta_sys_role tsr on tsur.role_id = tsr.id where tsur.user_id = tr.reply_ta_user_id) as replyRoleName
147
+    from tp_transaction_reply tr
148
+    where tr.community_id = #{communityId,jdbcType=INTEGER} and tr.transaction_id = #{transactionId,jdbcType=INTEGER}
149
+  </select>
150
+</mapper>

+ 100
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReportMapper.xml View File

@@ -0,0 +1,100 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpTransactionReportMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransactionReport" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
8
+    <result column="report_reason_id" property="reportReasonId" jdbcType="VARCHAR" />
9
+    <result column="reporter_id" property="reporterId" jdbcType="INTEGER" />
10
+  </resultMap>
11
+  <sql id="Base_Column_List" >
12
+    id, community_id, transaction_id, report_reason_id, reporter_id
13
+  </sql>
14
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
15
+    select 
16
+    <include refid="Base_Column_List" />
17
+    from tp_transaction_report
18
+    where id = #{id,jdbcType=INTEGER}
19
+  </select>
20
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
21
+    delete from tp_transaction_report
22
+    where id = #{id,jdbcType=INTEGER}
23
+  </delete>
24
+  <insert id="insert" parameterType="com.community.huiju.model.TpTransactionReport" >
25
+    insert into tp_transaction_report (id, community_id, transaction_id, 
26
+      report_reason_id, reporter_id)
27
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER}, 
28
+      #{reportReasonId,jdbcType=VARCHAR}, #{reporterId,jdbcType=INTEGER})
29
+  </insert>
30
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTransactionReport" >
31
+    insert into tp_transaction_report
32
+    <trim prefix="(" suffix=")" suffixOverrides="," >
33
+      <if test="id != null" >
34
+        id,
35
+      </if>
36
+      <if test="communityId != null" >
37
+        community_id,
38
+      </if>
39
+      <if test="transactionId != null" >
40
+        transaction_id,
41
+      </if>
42
+      <if test="reportReasonId != null" >
43
+        report_reason_id,
44
+      </if>
45
+      <if test="reporterId != null" >
46
+        reporter_id,
47
+      </if>
48
+    </trim>
49
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
50
+      <if test="id != null" >
51
+        #{id,jdbcType=INTEGER},
52
+      </if>
53
+      <if test="communityId != null" >
54
+        #{communityId,jdbcType=INTEGER},
55
+      </if>
56
+      <if test="transactionId != null" >
57
+        #{transactionId,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="reportReasonId != null" >
60
+        #{reportReasonId,jdbcType=VARCHAR},
61
+      </if>
62
+      <if test="reporterId != null" >
63
+        #{reporterId,jdbcType=INTEGER},
64
+      </if>
65
+    </trim>
66
+  </insert>
67
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTransactionReport" >
68
+    update tp_transaction_report
69
+    <set >
70
+      <if test="communityId != null" >
71
+        community_id = #{communityId,jdbcType=INTEGER},
72
+      </if>
73
+      <if test="transactionId != null" >
74
+        transaction_id = #{transactionId,jdbcType=INTEGER},
75
+      </if>
76
+      <if test="reportReasonId != null" >
77
+        report_reason_id = #{reportReasonId,jdbcType=VARCHAR},
78
+      </if>
79
+      <if test="reporterId != null" >
80
+        reporter_id = #{reporterId,jdbcType=INTEGER},
81
+      </if>
82
+    </set>
83
+    where id = #{id,jdbcType=INTEGER}
84
+  </update>
85
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransactionReport" >
86
+    update tp_transaction_report
87
+    set community_id = #{communityId,jdbcType=INTEGER},
88
+      transaction_id = #{transactionId,jdbcType=INTEGER},
89
+      report_reason_id = #{reportReasonId,jdbcType=VARCHAR},
90
+      reporter_id = #{reporterId,jdbcType=INTEGER}
91
+    where id = #{id,jdbcType=INTEGER}
92
+  </update>
93
+
94
+  <select id="selectByCommunityIdAndTransactionId" resultMap="BaseResultMap" >
95
+    select
96
+     <include refid="Base_Column_List"/>
97
+     from tp_transaction_report
98
+     where reporter_id = #{userId, jdbcType=INTEGER} and community_id = #{communityId,jdbcType=INTEGER} and transaction_id = #{transactionId,jdbcType=INTEGER}
99
+  </select>
100
+</mapper>

+ 27
- 1
CODE/smart-community/community-common/src/main/java/com/community/commom/utils/AccountValidatorUtil.java View File

@@ -31,8 +31,34 @@ public class AccountValidatorUtil {
31 31
         }
32 32
 
33 33
 
34
+    /**
35
+     * 校验座机号
36
+     * @param phone
37
+     * @return
38
+     */
39
+    public static boolean isLandline(String phone) {
40
+        String regex = "/^(\\d{3}-)(\\d{8})$|^(\\d{4}-)(\\d{7})$|^(\\d{4}-)(\\d{8})$/";
41
+            Pattern p = Pattern.compile(regex);
42
+            Matcher m = p.matcher(phone);
43
+            boolean isMatch = m.matches();
44
+            if (!isMatch) {
45
+                //MToast.showToast("请填入正确的手机号");
46
+            }
47
+            return isMatch;
48
+    }
49
+
50
+    /**
51
+     * 校验是否全为数字
52
+     * @param str
53
+     * @return
54
+     */
55
+    public static boolean isNumber(String str) {
56
+        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
57
+        return pattern.matcher(str).matches();
58
+    }
59
+
34 60
     public static void main(String[] args) {
35
-        System.out.println(isPhone("15871301059"));
61
+        System.out.println(isNumber("1"));
36 62
     }
37 63
 
38 64
 }

+ 27
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/utils/DateUtils.java View File

@@ -274,4 +274,31 @@ public class DateUtils {
274 274
         }
275 275
         return presentNum;
276 276
     }
277
+
278
+
279
+    /**
280
+     * 计算两个日期之间的天数
281
+     * @param startDate
282
+     * @param endDate
283
+     * @return
284
+     */
285
+    public static Long getDaysBetween(Date startDate, Date endDate) {
286
+        Calendar fromCalendar = Calendar.getInstance();
287
+        fromCalendar.setTime(startDate);
288
+        fromCalendar.set(Calendar.HOUR_OF_DAY, 0);
289
+        fromCalendar.set(Calendar.MINUTE, 0);
290
+        fromCalendar.set(Calendar.SECOND, 0);
291
+        fromCalendar.set(Calendar.MILLISECOND, 0);
292
+
293
+        Calendar toCalendar = Calendar.getInstance();
294
+        toCalendar.setTime(endDate);
295
+        toCalendar.set(Calendar.HOUR_OF_DAY, 0);
296
+        toCalendar.set(Calendar.MINUTE, 0);
297
+        toCalendar.set(Calendar.SECOND, 0);
298
+        toCalendar.set(Calendar.MILLISECOND, 0);
299
+
300
+        return (toCalendar.getTime().getTime() - fromCalendar.getTime().getTime()) / (1000 * 60 * 60 * 24);
301
+    }
302
+
303
+
277 304
 }

+ 20
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/TaSysMenuMapper.java View File

@@ -0,0 +1,20 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TaSysMenu;
4
+import com.community.huiju.model.TaSysMenuImg;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+@Mapper
11
+public interface TaSysMenuMapper {
12
+	
13
+	List<TaSysMenu> getTaSysMenuListByCommunityId();
14
+	
15
+	int insertTaSysMenu(TaSysMenu taSysMenu);
16
+	
17
+	List<TaSysMenuImg> selectTaSysMenuImgById(@Param("taMenuId") Integer taMenuId);
18
+	
19
+	int batchInsertImg(List<TaSysMenuImg> imgList);
20
+}

+ 72
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TaSysMenu.java View File

@@ -0,0 +1,72 @@
1
+package com.community.huiju.model;
2
+
3
+import lombok.Data;
4
+import lombok.EqualsAndHashCode;
5
+import lombok.experimental.Accessors;
6
+
7
+import java.io.Serializable;
8
+
9
+/**
10
+ * <p>
11
+ * APP端菜单页面
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-03-06
16
+ */
17
+@Data
18
+@EqualsAndHashCode(callSuper = false)
19
+@Accessors(chain = true)
20
+public class TaSysMenu implements Serializable {
21
+
22
+    private static final long serialVersionUID = 1L;
23
+
24
+    private Integer id;
25
+    
26
+    /**
27
+     * 小区id
28
+     */
29
+    private Integer communityId;
30
+
31
+    /**
32
+     * 菜单名称
33
+     */
34
+    private String menuName;
35
+
36
+    /**
37
+     * 菜单链接
38
+     */
39
+    private String menuUrl;
40
+
41
+    /**
42
+     * 父级菜单ID
43
+     */
44
+    private Integer parentId;
45
+
46
+    /**
47
+     * 排序
48
+     */
49
+    private Integer sort;
50
+
51
+    /**
52
+     * 菜单类型 0 H5  1原生开发
53
+     */
54
+    private String menuType;
55
+
56
+    /**
57
+     * 状态 0正常 1 是停用 9 删除
58
+     */
59
+    private String status;
60
+
61
+    /**
62
+     * face 代表人脸录入  monitor 代表是 公区监控
63
+     */
64
+    private String remark;
65
+
66
+    /**
67
+     * 说明
68
+     */
69
+    private String explain;
70
+
71
+
72
+}

+ 30
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TaSysMenuImg.java View File

@@ -0,0 +1,30 @@
1
+package com.community.huiju.model;
2
+
3
+import lombok.Data;
4
+import lombok.EqualsAndHashCode;
5
+import lombok.experimental.Accessors;
6
+
7
+import java.io.Serializable;
8
+
9
+/**
10
+ * <p>
11
+ * APP端菜单页面
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-03-06
16
+ */
17
+@Data
18
+@EqualsAndHashCode(callSuper = false)
19
+@Accessors(chain = true)
20
+public class TaSysMenuImg implements Serializable {
21
+
22
+    private static final long serialVersionUID = 1L;
23
+
24
+    private Integer id;
25
+    
26
+    private Integer taMenuId;
27
+    
28
+    private String menuIconImg;
29
+    
30
+}

+ 38
- 2
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java View File

@@ -1,9 +1,12 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4
+import com.community.huiju.dao.TaSysMenuMapper;
4 5
 import com.community.huiju.dao.ToCommunitiesMapper;
5 6
 import com.community.huiju.dao.TpUserCommunityMapper;
6 7
 import com.community.huiju.dao.TpUserMapper;
8
+import com.community.huiju.model.TaSysMenu;
9
+import com.community.huiju.model.TaSysMenuImg;
7 10
 import com.community.huiju.model.ToCommunities;
8 11
 import com.community.huiju.model.TpSysMenu;
9 12
 import com.community.huiju.model.TpSysRole;
@@ -28,7 +31,7 @@ import java.util.Map;
28 31
  * @date 2018-10-31
29 32
  */
30 33
 @Service("communityService")
31
-@Transactional
34
+@Transactional(rollbackFor = Exception.class)
32 35
 public class CommunityServiceImpl implements CommunityServiceI {
33 36
 	
34 37
 	@Autowired
@@ -40,6 +43,9 @@ public class CommunityServiceImpl implements CommunityServiceI {
40 43
 	@Autowired
41 44
 	private TpUserCommunityMapper tpUserCommunityMapper;
42 45
 	
46
+	@Autowired
47
+	private TaSysMenuMapper taSysMenuMapper;
48
+	
43 49
 	/**
44 50
 	 * 分页获取小区列表
45 51
 	 * @param toCommunities
@@ -79,9 +85,39 @@ public class CommunityServiceImpl implements CommunityServiceI {
79 85
 		tpUserMapper.insertSelective(tpUser);
80 86
 		//维护此用户的角色
81 87
 		addUserAndRole(tpUser.getId(), toCommunities.getId());
88
+		//维护这个小区的APP端的图标
89
+		addAppMenu(toCommunities.getId());
82 90
 		return size;
83 91
 	}
84
-
92
+	
93
+	/**
94
+	 * 维护这个小区的APP端的菜单和图标
95
+	 * @param communityId
96
+	 */
97
+	private void addAppMenu(Integer communityId) {
98
+		List<TaSysMenu>  list = taSysMenuMapper.getTaSysMenuListByCommunityId();
99
+		list.stream().forEach(e -> {
100
+			//插入APP菜单
101
+			TaSysMenu taSysMenu = new TaSysMenu();
102
+			taSysMenu.setCommunityId(communityId);
103
+			taSysMenu.setExplain(e.getExplain());
104
+			taSysMenu.setMenuName(e.getMenuName());
105
+			taSysMenu.setMenuType(e.getMenuType());
106
+			taSysMenu.setMenuUrl(e.getMenuUrl());
107
+			taSysMenu.setRemark(e.getRemark());
108
+			taSysMenu.setSort(e.getSort());
109
+			taSysMenu.setStatus("0");
110
+			taSysMenuMapper.insertTaSysMenu(taSysMenu);
111
+			//插入图标
112
+			List<TaSysMenuImg> imgList =  taSysMenuMapper.selectTaSysMenuImgById(e.getId());
113
+			imgList.stream().forEach(img -> {
114
+				img.setTaMenuId(taSysMenu.getId());
115
+			});
116
+			taSysMenuMapper.batchInsertImg(imgList);
117
+		});
118
+		
119
+	}
120
+	
85 121
 	/**
86 122
 	 * 维护住户端用户与社区关系表
87 123
 	 * @param tpUserId

+ 3
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java View File

@@ -15,7 +15,9 @@ import com.community.huiju.vo.ToBannerVO;
15 15
 import com.github.pagehelper.Page;
16 16
 import com.github.pagehelper.PageHelper;
17 17
 import com.google.common.collect.Maps;
18
+import org.apache.commons.httpclient.HttpState;
18 19
 import org.apache.commons.lang.StringUtils;
20
+import org.apache.http.HttpStatus;
19 21
 import org.springframework.beans.BeanUtils;
20 22
 import org.springframework.beans.factory.annotation.Autowired;
21 23
 import org.springframework.stereotype.Service;
@@ -190,7 +192,7 @@ public class ToBannerServiceImpl implements IToBannerService {
190 192
 
191 193
     @Override
192 194
     public ResponseBean getBanner(ToBanner banner,Integer pageNum, Integer pageSize) {
193
-
195
+        
194 196
         ResponseBean response = new ResponseBean();
195 197
 
196 198
         Page<ToBanner> page = PageHelper.startPage(pageNum,pageSize);

+ 48
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/TaSysMenuMapper.xml View File

@@ -0,0 +1,48 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.community.huiju.dao.TaSysMenuMapper">
4
+
5
+    <select id="getTaSysMenuListByCommunityId" resultType="com.community.huiju.model.TaSysMenu">
6
+        SELECT
7
+            t.id,
8
+            t.community_id AS communityId,
9
+            t.menu_url AS menuUrl,
10
+            t.menu_name AS menuName,
11
+            t.parent_id AS paremtId,
12
+            t.sort,
13
+            t.menu_type AS menuType,
14
+            t.`status`,
15
+            t.remark,
16
+            t.`explain`
17
+        FROM
18
+            ta_sys_menu t
19
+        WHERE
20
+            community_id = '-1'
21
+    </select>
22
+
23
+    <insert id="insertTaSysMenu" parameterType="com.community.huiju.model.TaSysMenu" useGeneratedKeys="true" keyProperty="id">
24
+        insert into ta_sys_menu (community_id, menu_url, menu_name, sort, menu_type,  `status`, remark, `explain`)
25
+    values (#{communityId,jdbcType=INTEGER}, #{menuUrl,jdbcType=VARCHAR},
26
+      #{menuName,jdbcType=VARCHAR}, #{sort,jdbcType=VARCHAR}, #{menuType,jdbcType=VARCHAR},
27
+      #{status,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{explain,jdbcType=VARCHAR})
28
+    </insert>
29
+
30
+    <select id="selectTaSysMenuImgById" resultType="com.community.huiju.model.TaSysMenuImg">
31
+        SELECT
32
+            id,
33
+            ta_menu_id as taMenuId,
34
+            menu_icon_img as menuIconImg
35
+        FROM
36
+            ta_sys_menu_img
37
+        WHERE
38
+            ta_menu_id = #{taMenuId,jdbcType=INTEGER}
39
+    </select>
40
+
41
+    <insert id="batchInsertImg" parameterType="list" >
42
+        insert into ta_sys_menu_img (ta_menu_id, menu_icon_img)
43
+        values
44
+        <foreach collection="list" item="item" index="index" separator="," >
45
+            (#{item.taMenuId,jdbcType=VARCHAR}, #{item.menuIconImg,jdbcType=VARCHAR})
46
+        </foreach>
47
+    </insert>
48
+</mapper>

+ 200
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/AnnouncementTelController.java View File

@@ -0,0 +1,200 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
7
+import com.community.commom.utils.AccountValidatorUtil;
8
+import com.community.huiju.common.base.BaseController;
9
+import com.community.huiju.model.AnnouncementTel;
10
+import com.community.huiju.model.Bill;
11
+import com.community.huiju.service.IAnnouncementTelService;
12
+import io.swagger.annotations.Api;
13
+import io.swagger.annotations.ApiImplicitParam;
14
+import io.swagger.annotations.ApiImplicitParams;
15
+import io.swagger.annotations.ApiOperation;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.cloud.context.config.annotation.RefreshScope;
18
+import org.springframework.validation.annotation.Validated;
19
+import org.springframework.web.bind.annotation.PathVariable;
20
+import org.springframework.web.bind.annotation.RequestBody;
21
+import org.springframework.web.bind.annotation.RequestMapping;
22
+import org.springframework.web.bind.annotation.RequestMethod;
23
+import org.springframework.web.bind.annotation.RequestParam;
24
+import org.springframework.web.bind.annotation.RestController;
25
+
26
+import javax.servlet.http.HttpServletRequest;
27
+import javax.servlet.http.HttpSession;
28
+import javax.validation.Valid;
29
+import java.time.LocalDateTime;
30
+import java.util.List;
31
+
32
+/**
33
+ * <p>
34
+ * 物业号码表 前端控制器
35
+ * </p>
36
+ *
37
+ * @author jobob
38
+ * @since 2019-03-05
39
+ */
40
+@RestController
41
+@RequestMapping("/")
42
+@RefreshScope
43
+@Api(value = "物业端号码 API", description = "物业端号码 API")
44
+public class AnnouncementTelController extends BaseController {
45
+	
46
+	@Autowired
47
+	private IAnnouncementTelService announcementTelService;
48
+	
49
+	@ApiOperation(value = "根据搜索条件获取物业端号码", notes = "根据搜索条件获取物业端号码")
50
+	@ApiImplicitParams({
51
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "name", value = "名称(模糊查询)"),
52
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "tel", value = "号码(模糊查询)"),
53
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "remark", value = "备注(模糊查询)"),
54
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
55
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度"),
56
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
57
+	})
58
+	@RequestMapping(value = "/tels",method = RequestMethod.GET)
59
+	public ResponseBean getList(@RequestParam(value = "name", required = false) String name,
60
+	                            @RequestParam(value = "tel", required = false) String tel,
61
+	                            @RequestParam(value = "remark", required = false) String remark,
62
+	                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
63
+	                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize, HttpSession session){
64
+		ResponseBean responseBean = new ResponseBean();
65
+		UserElement userElement = getUserElement(session);
66
+		AnnouncementTel announcementTel = new AnnouncementTel();
67
+		announcementTel.setCommunityId(userElement.getCommunityId());
68
+		announcementTel.setName(name);
69
+		announcementTel.setTel(tel);
70
+		announcementTel.setRemark(remark);
71
+		responseBean = announcementTelService.getTelList(announcementTel,pageNum,pageSize);
72
+		return responseBean;
73
+	}
74
+	
75
+	@ApiOperation(value = "添加物业端号码", notes = "添加物业端号码")
76
+	@ApiImplicitParams({
77
+			@ApiImplicitParam(dataTypeClass = String.class, paramType = "AnnouncementTel", name = "announcementTel", value = "电话号码实体类"),
78
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
79
+	})
80
+	@RequestMapping(value = "/tel/add",method = RequestMethod.POST)
81
+	public ResponseBean addTel(@Valid @RequestBody AnnouncementTel announcementTel, HttpSession session){
82
+		ResponseBean responseBean = new ResponseBean();
83
+		boolean isPhone = true;
84
+		boolean isLandline = true;
85
+//		if (!AccountValidatorUtil.isLandline(announcementTel.getTel())){
86
+//			isLandline = false;
87
+//		}
88
+//		if (!AccountValidatorUtil.isPhone(announcementTel.getTel())){
89
+//			isPhone = false;
90
+//		}
91
+//		if (isPhone == false && isLandline == false) {
92
+//			responseBean.addError("输入的号码不正确!");
93
+//			return responseBean;
94
+//		}
95
+		if (!AccountValidatorUtil.isNumber(announcementTel.getTel())) {
96
+			responseBean.addError("输入的号码不正确!");
97
+			return responseBean;
98
+		}
99
+		UserElement userElement = getUserElement(session);
100
+		QueryWrapper<AnnouncementTel> announcementTelQueryWrapper = new QueryWrapper<>();
101
+		announcementTelQueryWrapper.eq("tel", announcementTel.getTel());
102
+		announcementTelQueryWrapper.eq("community_id", userElement.getCommunityId());
103
+		AnnouncementTel telServiceOne = announcementTelService.getOne(announcementTelQueryWrapper);
104
+		if (null != telServiceOne) {
105
+			responseBean.addError("此号码已存在");
106
+			return responseBean;
107
+		}
108
+		LocalDateTime time = LocalDateTime.now();
109
+		announcementTel.setCommunityId(userElement.getCommunityId());
110
+		announcementTel.setCreateUser(userElement.getId());
111
+		announcementTel.setUpdateUser(userElement.getId());
112
+		announcementTel.setCreateDate(time);
113
+		announcementTel.setUpdateDate(time);
114
+		boolean state = announcementTelService.save(announcementTel);
115
+		if (state){
116
+			responseBean.addSuccess("添加物业端号码成功");
117
+			return responseBean;
118
+		}
119
+		responseBean.addError("添加物业端号码失败");
120
+		return responseBean;
121
+	}
122
+	
123
+	@ApiOperation(value = "根据ID修改物业端号码", notes = "根据ID修改物业端号码")
124
+	@ApiImplicitParams({
125
+			@ApiImplicitParam(paramType = "body", dataType = "AnnouncementTel", name = "announcementTel", value = "电话号码实体类"),
126
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
127
+	})
128
+	@RequestMapping(value = "/tel/update", method = RequestMethod.PUT)
129
+	public ResponseBean updateTel(@Valid @RequestBody AnnouncementTel announcementTel, HttpSession session) {
130
+		ResponseBean responseBean = new ResponseBean();
131
+		boolean isPhone = true;
132
+		boolean isLandline = true;
133
+//		if (!AccountValidatorUtil.isLandline(announcementTel.getTel())){
134
+//			isLandline = false;
135
+//		}
136
+//		if (!AccountValidatorUtil.isPhone(announcementTel.getTel())){
137
+//			isPhone = false;
138
+//		}
139
+//		if (isPhone == false && isLandline == false) {
140
+//			responseBean.addError("输入的号码不正确!");
141
+//			return responseBean;
142
+//		}
143
+		if (!AccountValidatorUtil.isNumber(announcementTel.getTel())) {
144
+			responseBean.addError("输入的号码不正确!");
145
+			return responseBean;
146
+		}
147
+		UserElement userElement = getUserElement(session);
148
+		QueryWrapper<AnnouncementTel> announcementTelQueryWrapper = new QueryWrapper<>();
149
+		announcementTelQueryWrapper.eq("tel", announcementTel.getTel());
150
+		announcementTelQueryWrapper.eq("community_id", userElement.getCommunityId());
151
+		AnnouncementTel telServiceOne = announcementTelService.getOne(announcementTelQueryWrapper);
152
+		if (null != telServiceOne && announcementTel.getTel().equals(telServiceOne.getTel()) && announcementTel.getId().equals(telServiceOne.getId())) {
153
+			responseBean.addSuccess("修改物业端号码成功");
154
+			return responseBean;
155
+		}
156
+		if (null != telServiceOne) {
157
+			responseBean.addError("此号码已存在");
158
+			return responseBean;
159
+		}
160
+		announcementTel.setUpdateUser(userElement.getId());
161
+		announcementTel.setUpdateDate(LocalDateTime.now());
162
+		boolean state = announcementTelService.updateById(announcementTel);
163
+		if (state){
164
+			responseBean.addSuccess("修改物业端号码成功");
165
+			return responseBean;
166
+		}
167
+		responseBean.addError("修改物业端号码失败");
168
+		return responseBean;
169
+	}
170
+	
171
+	@ApiOperation(value = "获取Id获取物业端号码详情", notes = "获取Id获取物业端号码详情")
172
+	@ApiImplicitParams({
173
+			@ApiImplicitParam(paramType = "Path", dataType = "integer", name = "id", value = "主键Id"),
174
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
175
+	})
176
+	@RequestMapping(value = "/tel/{id}",method = RequestMethod.GET)
177
+	public ResponseBean getNoticeById(@PathVariable(value ="id") Integer id, HttpServletRequest request){
178
+		ResponseBean responseBean = new ResponseBean();
179
+		AnnouncementTel announcementTel = announcementTelService.getById(id);
180
+		responseBean.addSuccess(announcementTel);
181
+		return responseBean;
182
+	}
183
+	
184
+	@ApiOperation(value = "根据ID批量删除物业端号码", notes = "根据ID批量删除物业端号码")
185
+	@ApiImplicitParams({
186
+			@ApiImplicitParam(paramType = "body", dataType = "integer", name = "ids", value = "主键Id"),
187
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
188
+	})
189
+	@RequestMapping(value = "/tel/delete", method = RequestMethod.POST)
190
+	public ResponseBean deleteNotice(@RequestBody List<Integer> ids, HttpSession session) {
191
+		ResponseBean responseBean = new ResponseBean();
192
+		boolean state = announcementTelService.removeByIds(ids);
193
+		if (state){
194
+			responseBean.addSuccess("删除物业端号码成功");
195
+			return responseBean;
196
+		}
197
+		responseBean.addError("删除物业端号码失败");
198
+		return responseBean;
199
+	}
200
+}

+ 2
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillController.java View File

@@ -80,9 +80,9 @@ public class BillController extends BaseController {
80 80
 
81 81
     @ApiOperation(value = "上传缴费项接口, 预览", notes = "上传缴费项接口, 预览")
82 82
     @PostMapping(value = "/bill/uploadExcel/get", consumes = "multipart/*", headers = "content-type=multipart/form-data")
83
-    public ResponseBean getUploadExcel(@RequestParam("file") MultipartFile file, @RequestParam("billExplain") String billExplain) {
83
+    public ResponseBean getUploadExcel(@RequestParam("file") MultipartFile file) {
84 84
         ResponseBean responseBean = new ResponseBean();
85
-        responseBean = iBillService.getExcelData(file, billExplain);
85
+        responseBean = iBillService.getExcelData(file);
86 86
         return responseBean;
87 87
     }
88 88
 

+ 28
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillInvoiceController.java View File

@@ -6,12 +6,14 @@ import com.community.commom.mode.ResponseBean;
6 6
 import com.community.commom.session.UserElement;
7 7
 import com.community.commom.utils.PayPriceUtils;
8 8
 import com.community.huiju.common.base.BaseController;
9
+import com.community.huiju.model.BillInvoice;
9 10
 import com.community.huiju.service.IBillInvoiceService;
10 11
 import com.community.huiju.service.IBillService;
11 12
 import io.swagger.annotations.Api;
12 13
 import io.swagger.annotations.ApiImplicitParam;
13 14
 import io.swagger.annotations.ApiImplicitParams;
14 15
 import io.swagger.annotations.ApiOperation;
16
+import org.apache.commons.lang.StringUtils;
15 17
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
16 18
 import org.springframework.beans.factory.annotation.Autowired;
17 19
 import org.springframework.cloud.context.config.annotation.RefreshScope;
@@ -168,6 +170,32 @@ public class BillInvoiceController extends BaseController {
168 170
         return responseBean;
169 171
     }
170 172
 
173
+    @ApiOperation(value = "根据缴费单id, 修改收费说明", notes = "根据缴费单id, 修改收费说明")
174
+    @ApiImplicitParams({
175
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "path", name = "billId", value = "缴费id"),
176
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "billInvoiceExplain收费说明"),
177
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
178
+    })
179
+    @RequestMapping(value = "/bill/invoice/updateBillInvoiceIdBillInvoiceExplain/{billId}", method = RequestMethod.POST)
180
+    public ResponseBean updateBillInvoiceIdBillInvoiceExplain(HttpSession session,@PathVariable Integer billId, @RequestBody String parameter) {
181
+        ResponseBean responseBean = new ResponseBean();
182
+        UserElement userElement = getUserElement(session);
183
+        String billInvoiceExplain = JSONObject.parseObject(parameter).getString("billInvoiceExplain");
184
+        if (StringUtils.isBlank(billInvoiceExplain)) {
185
+            responseBean.addError("收费说明不能为空!");
186
+            return responseBean;
187
+        }
188
+        BillInvoice billInvoice = iBillInvoiceService.getById(billId);
189
+        billInvoice.setBillInvoiceExplain(billInvoiceExplain);
190
+        boolean b = iBillInvoiceService.updateById(billInvoice);
191
+        if (b) {
192
+            responseBean.addSuccess("操作成功!");
193
+            return responseBean;
194
+        }
195
+        responseBean.addError("操作失败!");
196
+        return responseBean;
197
+    }
198
+
171 199
 
172 200
     @ApiOperation(value = "导出Excel", notes = "导出Excel")
173 201
     @ApiImplicitParams({

+ 135
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/CarouselSettingController.java View File

@@ -0,0 +1,135 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.alibaba.fastjson.JSONObject;
5
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
+import com.community.commom.mode.ResponseBean;
7
+import com.community.commom.session.UserElement;
8
+import com.community.huiju.common.base.BaseController;
9
+import com.community.huiju.model.TpCarouselSetting;
10
+import com.community.huiju.service.ICarouselSettingService;
11
+import io.swagger.annotations.Api;
12
+import io.swagger.annotations.ApiImplicitParam;
13
+import io.swagger.annotations.ApiImplicitParams;
14
+import io.swagger.annotations.ApiOperation;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.web.bind.annotation.*;
17
+
18
+import javax.servlet.http.HttpSession;
19
+import java.util.HashMap;
20
+import java.util.Map;
21
+
22
+/**
23
+ * <p>
24
+ * 轮播数设置表 前端控制器
25
+ * </p>
26
+ *
27
+ * @author weiximei
28
+ * @since 2019-03-06
29
+ */
30
+@RestController
31
+@RequestMapping("/")
32
+@Api(value = "轮播数设置表 API", description = "轮播数设置表 API")
33
+public class CarouselSettingController extends BaseController {
34
+
35
+    @Autowired
36
+    private ICarouselSettingService iCarouselSettingService;
37
+
38
+    @ApiOperation(value = "添加/修改公告的Banner数量", notes = "添加/修改公告的Banner数量")
39
+    @ApiImplicitParams({
40
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
41
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "parameter", value = "carouselNum数量值")
42
+    })
43
+    @RequestMapping(value = "/carousel/announcement/banner", method = RequestMethod.PUT)
44
+    public ResponseBean updateAnnouncementBanner(@RequestBody String parameter, HttpSession session) {
45
+        ResponseBean responseBean = new ResponseBean();
46
+        UserElement userElement = getUserElement(session);
47
+        QueryWrapper<TpCarouselSetting> queryWrapper = new QueryWrapper<>();
48
+        queryWrapper.eq("community_id", userElement.getCommunityId());
49
+        queryWrapper.eq("carousel_type","announcement");
50
+        TpCarouselSetting one = iCarouselSettingService.getOne(queryWrapper);
51
+        Integer carouselNum = JSONObject.parseObject(parameter).getInteger("carouselNum");
52
+        boolean b = false;
53
+        // 修改
54
+        if (null != one) {
55
+            one.setCarouselNum(carouselNum);
56
+            b = iCarouselSettingService.updateById(one);
57
+        } else {
58
+            one = new TpCarouselSetting();
59
+            one.setCarouselNum(carouselNum);
60
+            one.setCarouselType("announcement");
61
+            one.setCommunityId(userElement.getCommunityId());
62
+            // 添加
63
+            b = iCarouselSettingService.save(one);
64
+
65
+        }
66
+
67
+        if (b) {
68
+            responseBean.addSuccess("操作成功!");
69
+            return responseBean;
70
+        }
71
+        responseBean.addError("操作失败!");
72
+        return responseBean;
73
+    }
74
+
75
+    @ApiOperation(value = "添加/修改活动的Banner数量", notes = "添加/修改活动的Banner数量")
76
+    @ApiImplicitParams({
77
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
78
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "parameter", value = "carouselNum数量值")
79
+    })
80
+    @RequestMapping(value = "/carousel/activity/banner", method = RequestMethod.PUT)
81
+    public ResponseBean updateActivityBanner(@RequestBody String parameter, HttpSession session) {
82
+        ResponseBean responseBean = new ResponseBean();
83
+        UserElement userElement = getUserElement(session);
84
+        QueryWrapper<TpCarouselSetting> queryWrapper = new QueryWrapper<>();
85
+        queryWrapper.eq("community_id", userElement.getCommunityId());
86
+        queryWrapper.eq("carousel_type","activity");
87
+        TpCarouselSetting one = iCarouselSettingService.getOne(queryWrapper);
88
+        Integer carouselNum = JSONObject.parseObject(parameter).getInteger("carouselNum");
89
+        boolean b = false;
90
+        if (null != one) {
91
+            one.setCarouselNum(carouselNum);
92
+            b = iCarouselSettingService.updateById(one);
93
+        } else {
94
+            one = new TpCarouselSetting();
95
+            one.setCarouselType("activity");
96
+            one.setCommunityId(userElement.getCommunityId());
97
+            one.setCarouselNum(carouselNum);
98
+            b = iCarouselSettingService.save(one);
99
+        }
100
+
101
+
102
+        if (b) {
103
+            responseBean.addSuccess("操作成功!");
104
+            return responseBean;
105
+        }
106
+        responseBean.addError("操作失败!");
107
+        return responseBean;
108
+    }
109
+
110
+    @ApiOperation(value = "获取Banner数量", notes = "获取Banner数量")
111
+    @ApiImplicitParams({
112
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
113
+    })
114
+    @RequestMapping(value = "/carousel/getBanner", method = RequestMethod.GET)
115
+    public ResponseBean getBannerNum(HttpSession session) {
116
+        ResponseBean responseBean = new ResponseBean();
117
+        UserElement userElement = getUserElement(session);
118
+        QueryWrapper<TpCarouselSetting> activityQueryWrapper = new QueryWrapper<>();
119
+        activityQueryWrapper.eq("community_id", userElement.getCommunityId());
120
+        activityQueryWrapper.eq("carousel_type","activity");
121
+        TpCarouselSetting activityOne = iCarouselSettingService.getOne(activityQueryWrapper);
122
+
123
+        QueryWrapper<TpCarouselSetting> announcementQueryWrapper = new QueryWrapper<>();
124
+        announcementQueryWrapper.eq("community_id", userElement.getCommunityId());
125
+        announcementQueryWrapper.eq("carousel_type","announcement");
126
+        TpCarouselSetting announcementOne = iCarouselSettingService.getOne(announcementQueryWrapper);
127
+
128
+        Map<String, Object> map = new HashMap<>();
129
+        map.put("activity", activityOne);
130
+        map.put("announcement", announcementOne);
131
+        responseBean.addSuccess(map);
132
+        return responseBean;
133
+    }
134
+
135
+}

+ 73
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/MessageController.java View File

@@ -0,0 +1,73 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.service.IMessageService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RestController;
17
+import com.community.huiju.common.base.BaseController;
18
+
19
+import javax.servlet.http.HttpSession;
20
+
21
+/**
22
+ * <p>
23
+ * 物业端消息表 前端控制器
24
+ * </p>
25
+ *
26
+ * @author jobob
27
+ * @since 2019-03-05
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+@Api(value = "消息通知API", description = "消息通知API")
32
+public class MessageController extends BaseController {
33
+
34
+    @Autowired
35
+    private IMessageService messageService;
36
+    @ApiOperation(value = "消息待办", notes = "消息待办")
37
+    @ApiImplicitParams({
38
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "messageType:待办消息类型(-1:论坛,-2:工单,-3:缴费),status:(0:无效,1:有效),createDate:时间,messageContent:内容 ")
39
+    })
40
+    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
41
+    @RequestMapping(value = "/messageLiset", method = RequestMethod.POST)
42
+    public ResponseBean messageLiset(@RequestBody String parameter, HttpSession session){
43
+        UserElement userElement = getUserElement(session);
44
+        ResponseBean  responseBean = messageService.messageLiset(parameter,userElement.getCommunityId(),userElement.getId());
45
+        return responseBean;
46
+    }
47
+
48
+    @ApiOperation(value = "我的消息", notes = "我的消息")
49
+    @ApiImplicitParams({
50
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "messageType:消息类型(-1:论坛,-2:工单,-3:缴费),readStatus:(0:未读,1:已读),createDate:时间,messageContent:内容 ")
51
+    })
52
+    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
53
+    @RequestMapping(value = "/myMessageList", method = RequestMethod.POST)
54
+    public ResponseBean myMessageList(@RequestBody String parameter, HttpSession session){
55
+        UserElement userElement = getUserElement(session);
56
+        ResponseBean  responseBean = messageService.myMessageList(parameter,userElement.getCommunityId(),userElement.getId());
57
+        return responseBean;
58
+    }
59
+
60
+    @ApiOperation(value = "消息已读", notes = "消息已读")
61
+    @ApiImplicitParams({
62
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "id:(多个) ")
63
+    })
64
+    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
65
+    @RequestMapping(value = "/delectRead", method = RequestMethod.POST)
66
+    public ResponseBean delectRead(@RequestBody String parameter, HttpSession session){
67
+        UserElement userElement = getUserElement(session);
68
+        ResponseBean  responseBean = messageService.delectRead(parameter,userElement.getId());
69
+        return responseBean;
70
+    }
71
+}
72
+
73
+

+ 4
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/SysMenuController.java View File

@@ -1,6 +1,8 @@
1 1
 package com.community.huiju.controller;
2 2
 
3 3
 
4
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
5
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 6
 import com.community.commom.mode.ResponseBean;
5 7
 import com.community.commom.session.UserElement;
6 8
 import com.community.huiju.common.base.BaseController;
@@ -12,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParams;
12 14
 import io.swagger.annotations.ApiOperation;
13 15
 import org.springframework.beans.factory.annotation.Autowired;
14 16
 import org.springframework.cloud.context.config.annotation.RefreshScope;
17
+import org.springframework.web.bind.annotation.PathVariable;
15 18
 import org.springframework.web.bind.annotation.RequestBody;
16 19
 import org.springframework.web.bind.annotation.RequestMapping;
17 20
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -19,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam;
19 22
 import org.springframework.web.bind.annotation.RestController;
20 23
 
21 24
 import javax.servlet.http.HttpSession;
25
+import java.util.List;
22 26
 
23 27
 /**
24 28
  * <p>

+ 95
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TaSysMenuController.java View File

@@ -0,0 +1,95 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
7
+import com.community.huiju.common.base.BaseController;
8
+import com.community.huiju.model.TaSysMenu;
9
+import com.community.huiju.service.ITaSysMenuService;
10
+import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiImplicitParam;
12
+import io.swagger.annotations.ApiImplicitParams;
13
+import io.swagger.annotations.ApiOperation;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.web.bind.annotation.PathVariable;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RestController;
19
+
20
+import javax.servlet.http.HttpSession;
21
+import java.util.List;
22
+
23
+/**
24
+ * <p>
25
+ * APP端菜单页面 前端控制器
26
+ * </p>
27
+ *
28
+ * @author jobob
29
+ * @since 2019-03-06
30
+ */
31
+@RestController
32
+@RequestMapping("/")
33
+@Api(value = "APP菜单 API", description = "APP菜单 API")
34
+public class TaSysMenuController extends BaseController {
35
+	
36
+	@Autowired
37
+	private ITaSysMenuService taSysMenuService;
38
+	
39
+	@ApiOperation(value = "获取菜单列表", notes = "获取菜单列表")
40
+	@ApiImplicitParams({
41
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
42
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
43
+	})
44
+	@RequestMapping(value = "/ta/menu/list",method = RequestMethod.GET)
45
+	public ResponseBean getList(HttpSession session) {
46
+		ResponseBean responseBean = new ResponseBean();
47
+		UserElement userElement = getUserElement(session);
48
+		responseBean = taSysMenuService.getList(userElement);
49
+		return responseBean;
50
+	}
51
+	
52
+	@ApiOperation(value = "启用菜单", notes = "启用菜单")
53
+	@ApiImplicitParams({
54
+			@ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "编号id"),
55
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
56
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
57
+	})
58
+	@RequestMapping(value = "/ta/menu/enable/{id}",method = RequestMethod.POST)
59
+	public ResponseBean enableMenu(@PathVariable(value = "id") Integer id, HttpSession session) {
60
+		ResponseBean responseBean = new ResponseBean();
61
+		UserElement userElement = getUserElement(session);
62
+		TaSysMenu sysMenu = new TaSysMenu();
63
+		sysMenu.setId(id);
64
+		sysMenu.setStatus("0");
65
+		boolean stste = taSysMenuService.updateById(sysMenu);
66
+		if (stste){
67
+			responseBean.addSuccess("启用成功");
68
+			return responseBean;
69
+		}
70
+		responseBean.addSuccess("启用失败");
71
+		return responseBean;
72
+	}
73
+	
74
+	@ApiOperation(value = "停用菜单", notes = "停用菜单")
75
+	@ApiImplicitParams({
76
+			@ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "编号id"),
77
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
78
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
79
+	})
80
+	@RequestMapping(value = "/ta/menu/disable/{id}",method = RequestMethod.POST)
81
+	public ResponseBean disableMenu(@PathVariable(value = "id") Integer id,HttpSession session) {
82
+		ResponseBean responseBean = new ResponseBean();
83
+		UserElement userElement = getUserElement(session);
84
+		TaSysMenu sysMenu = new TaSysMenu();
85
+		sysMenu.setId(id);
86
+		sysMenu.setStatus("1");
87
+		boolean stste = taSysMenuService.updateById(sysMenu);
88
+		if (stste){
89
+			responseBean.addSuccess("停用成功");
90
+			return responseBean;
91
+		}
92
+		responseBean.addSuccess("停用失败");
93
+		return responseBean;
94
+	}
95
+}

+ 27
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/AnnouncementTelMapper.java View File

@@ -0,0 +1,27 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
+import com.community.huiju.model.AnnouncementTel;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * <p>
12
+ * 物业号码表 Mapper 接口
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-03-05
17
+ */
18
+public interface AnnouncementTelMapper extends BaseMapper<AnnouncementTel> {
19
+	
20
+	/**
21
+	 * 分页获取电话号码
22
+	 * @param page
23
+	 * @param announcementTel
24
+	 * @return
25
+	 */
26
+	List<AnnouncementTel> selectListByParams(Page page,@Param("announcementTel") AnnouncementTel announcementTel);
27
+}

+ 67
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/MessageMapper.java View File

@@ -0,0 +1,67 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.community.huiju.model.Message;
8
+import com.community.huiju.model.TpTicket;
9
+import org.apache.ibatis.annotations.Mapper;
10
+import org.apache.ibatis.annotations.Param;
11
+
12
+import java.util.Date;
13
+import java.util.List;
14
+import java.util.Map;
15
+
16
+/**
17
+ * <p>
18
+ * 物业web端用户表 Mapper 接口
19
+ * </p>
20
+ *
21
+ * @author jobob
22
+ * @since 2018-12-18
23
+ */
24
+@Mapper
25
+public interface MessageMapper extends BaseMapper<Message> {
26
+    /**
27
+     * 消息待办
28
+     * @param page
29
+     * @param messageType
30
+     * @param status
31
+     * @param createDate
32
+     * @param messageContent
33
+     * @param uuid
34
+     * @return
35
+     */
36
+    IPage<Message> messageLiset(Page page, @Param("messageType")String messageType, @Param("status")String status, @Param("createDate") Date createDate, @Param("messageContent")String messageContent,@Param("uuid") Integer uuid);
37
+
38
+    /**
39
+     * 公告消息推送
40
+     * @param message
41
+     */
42
+    void updateMessage(@Param(value = "message") Message message);
43
+
44
+    /**
45
+     * 工单消息推送
46
+     * @param message
47
+     */
48
+    void updateTicketMessage(Message message);
49
+
50
+    /**
51
+     * 关于我的消息
52
+     * @param page
53
+     * @param messageType
54
+     * @param readStatus
55
+     * @param createDate
56
+     * @param messageContent
57
+     * @param uuid
58
+     * @return
59
+     */
60
+    IPage<Message> myMessageList(Page<Message> page, @Param("messageType") String messageType, @Param("readStatus")String readStatus, @Param("createDate")Date createDate, @Param("messageContent")String messageContent, @Param("uuid")Integer uuid);
61
+
62
+    /**
63
+     * 工单分配后改变message的状态
64
+     * @param ticketId
65
+     */
66
+    void updateTickMessageStatus(@Param("ticketId") Integer ticketId);
67
+}

+ 27
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaSysMenuMapper.java View File

@@ -0,0 +1,27 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TaSysMenu;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * <p>
11
+ * APP端菜单页面 Mapper 接口
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-03-06
16
+ */
17
+@Mapper
18
+public interface TaSysMenuMapper extends BaseMapper<TaSysMenu> {
19
+
20
+    /**
21
+     * 根据小区查询出APP菜单列表
22
+     * @param communityId
23
+     * @return
24
+     */
25
+    List<TaSysMenu> selectList(Integer communityId);
26
+
27
+}

+ 16
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java View File

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpCarouselSetting;
5
+
6
+/**
7
+ * <p>
8
+ * 轮播数设置表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author weiximei
12
+ * @since 2019-03-06
13
+ */
14
+public interface TpCarouselSettingMapper extends BaseMapper<TpCarouselSetting> {
15
+
16
+}

+ 77
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/AnnouncementTel.java View File

@@ -0,0 +1,77 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import javax.validation.constraints.NotBlank;
12
+import javax.validation.constraints.NotNull;
13
+import java.io.Serializable;
14
+import java.time.LocalDateTime;
15
+
16
+/**
17
+ * <p>
18
+ * 物业号码表
19
+ * </p>
20
+ *
21
+ * @author jobob
22
+ * @since 2019-03-05
23
+ */
24
+@Data
25
+@EqualsAndHashCode(callSuper = false)
26
+@Accessors(chain = true)
27
+@TableName("tp_announcement_tel")
28
+public class AnnouncementTel implements Serializable {
29
+
30
+    private static final long serialVersionUID = 1L;
31
+
32
+    @TableId(value = "id", type = IdType.AUTO)
33
+    private Integer id;
34
+
35
+    /**
36
+     * 小区id
37
+     */
38
+    private Integer communityId;
39
+
40
+    /**
41
+     * 电话名称
42
+     */
43
+    @NotBlank(message = "请输入名称")
44
+    private String name;
45
+
46
+    @NotBlank(message = "请输入号码")
47
+    private String tel;
48
+
49
+    private String remark;
50
+
51
+    /**
52
+     * 创建人
53
+     */
54
+    private Integer createUser;
55
+
56
+    /**
57
+     * 创建时间
58
+     */
59
+    private LocalDateTime createDate;
60
+
61
+    /**
62
+     * 更新人
63
+     */
64
+    private Integer updateUser;
65
+
66
+    /**
67
+     * 更新时间
68
+     */
69
+    private LocalDateTime updateDate;
70
+    
71
+    /**
72
+     * 更新人
73
+     */
74
+    @TableField(exist = false)
75
+    private String updateName;
76
+
77
+}

+ 10
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/BillInvoice.java View File

@@ -67,7 +67,10 @@ public class BillInvoice implements Serializable {
67 67
     private Integer billStatementId;
68 68
 
69 69
     /**
70
-     * 缴费状态  0:未缴费  1:已线上缴费 2:已线下缴费
70
+     * 遗弃: 缴费状态  0:未缴费  1:已线上缴费 2:已线下缴费
71
+     *
72
+     * 缴费状态  0:未缴费  1: 已缴费 3: 正在支付中
73
+     *
71 74
      */
72 75
     private String billStatus;
73 76
 
@@ -111,6 +114,11 @@ public class BillInvoice implements Serializable {
111 114
      */
112 115
     private String outTradeNo;
113 116
 
117
+    /**
118
+     * 缴费方式  0:微信支付  1:线下缴费
119
+     */
120
+    private String payType;
121
+
114 122
     /**
115 123
      * 业主姓名
116 124
      */
@@ -151,7 +159,7 @@ public class BillInvoice implements Serializable {
151 159
      * 流水账单编号
152 160
      */
153 161
     @TableField(exist = false)
154
-    private Integer billStatement;
162
+    private String billStatement;
155 163
 
156 164
     /**
157 165
      * 创建人姓名

+ 132
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/Message.java View File

@@ -0,0 +1,132 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.time.LocalDateTime;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 物业端消息表
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-03-05
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@TableName("tp_message")
22
+public class Message implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    private Integer id;
27
+    /**
28
+     * 工单id 非工单不填
29
+     */
30
+    private Integer ticketId;
31
+
32
+    /**
33
+     * 小区id
34
+     */
35
+    private Integer communityId;
36
+
37
+    /**
38
+     * 消息类型  1:投诉   2:报修 3:联系物业  4: 访客  5:公告  6:系统通知  7:账单 8:活动
39
+     */
40
+    private String messageType;
41
+
42
+    /**
43
+     * 通知方式  1 是app内通知  2是短信通知 3 是通知栏消息  4 是 web端消息
44
+     */
45
+    private String adviceType;
46
+
47
+    /**
48
+     * 模板类型 1 是消息模板 2是待办模板
49
+     */
50
+    private String modelType;
51
+
52
+    /**
53
+     * 接收人id
54
+     */
55
+    private Integer uuid;
56
+
57
+    /**
58
+     * 接收人id的类型  1是app用户 2是物业端用户
59
+     */
60
+    private String uuidType;
61
+
62
+    /**
63
+     * 来源 1 是app端  2是物业端
64
+     */
65
+    private String source;
66
+
67
+    /**
68
+     * 消息内容
69
+     */
70
+    private String messageContent;
71
+
72
+    /**
73
+     * 状态 1 是有效 0是无效
74
+     */
75
+    private String status;
76
+
77
+    /**
78
+     * 推送结果
79
+     */
80
+    private String result;
81
+
82
+    /**
83
+     * 事件类型表的id 预留字段
84
+     */
85
+    private String meaasgeTypeId;
86
+
87
+    /**
88
+     * 阅读状态 0 是未读  1是已读
89
+     */
90
+    private String readStatus;
91
+
92
+    /**
93
+     * 创建人
94
+     */
95
+    private Integer createUser;
96
+
97
+    /**
98
+     * 创建时间
99
+     */
100
+    private LocalDateTime createDate;
101
+
102
+    /**
103
+     * 更新人
104
+     */
105
+    private Integer updateUser;
106
+
107
+    /**
108
+     * 更新时间
109
+     */
110
+    private LocalDateTime updateDate;
111
+
112
+    /**
113
+     * 缴费项ID
114
+     */
115
+    private Integer billId;
116
+
117
+    /**
118
+     * 活动Id
119
+     */
120
+    private Integer activityId;
121
+
122
+    /**
123
+     * 公告Id
124
+     */
125
+    private Integer announcementId;
126
+
127
+    /**
128
+     *二手租赁Id
129
+     */
130
+    private Integer transactionId;
131
+
132
+}

+ 72
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TaSysMenu.java View File

@@ -0,0 +1,72 @@
1
+package com.community.huiju.model;
2
+
3
+import lombok.Data;
4
+import lombok.EqualsAndHashCode;
5
+import lombok.experimental.Accessors;
6
+
7
+import java.io.Serializable;
8
+
9
+/**
10
+ * <p>
11
+ * APP端菜单页面
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-03-06
16
+ */
17
+@Data
18
+@EqualsAndHashCode(callSuper = false)
19
+@Accessors(chain = true)
20
+public class TaSysMenu implements Serializable {
21
+
22
+    private static final long serialVersionUID = 1L;
23
+
24
+    private Integer id;
25
+    
26
+    /**
27
+     * 小区id
28
+     */
29
+    private Integer communityId;
30
+
31
+    /**
32
+     * 菜单名称
33
+     */
34
+    private String menuName;
35
+
36
+    /**
37
+     * 菜单链接
38
+     */
39
+    private String menuUrl;
40
+
41
+    /**
42
+     * 父级菜单ID
43
+     */
44
+    private Integer parentId;
45
+
46
+    /**
47
+     * 排序
48
+     */
49
+    private Integer sort;
50
+
51
+    /**
52
+     * 菜单类型 0 H5  1原生开发
53
+     */
54
+    private String menuType;
55
+
56
+    /**
57
+     * 状态 0正常 1 是停用 9 删除
58
+     */
59
+    private String status;
60
+
61
+    /**
62
+     * face 代表人脸录入  monitor 代表是 公区监控
63
+     */
64
+    private String remark;
65
+
66
+    /**
67
+     * 说明
68
+     */
69
+    private String explain;
70
+
71
+
72
+}

+ 47
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpCarouselSetting.java View File

@@ -0,0 +1,47 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+
12
+/**
13
+ * <p>
14
+ * 轮播数设置表
15
+ * </p>
16
+ *
17
+ * @author weiximei
18
+ * @since 2019-03-06
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@TableName("tp_carousel_setting")
24
+public class TpCarouselSetting implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Integer id;
30
+
31
+    /**
32
+     * 小区id
33
+     */
34
+    private Integer communityId;
35
+
36
+    /**
37
+     * 轮播类型: announcement 表示公告  activity 表示活动  banner表示运营banner
38
+     */
39
+    private String carouselType;
40
+
41
+    /**
42
+     * 轮播数量
43
+     */
44
+    private Integer carouselNum;
45
+
46
+
47
+}

+ 27
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IAnnouncementTelService.java View File

@@ -0,0 +1,27 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.model.AnnouncementTel;
7
+
8
+/**
9
+ * <p>
10
+ * 物业号码表 服务类
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-03-05
15
+ */
16
+public interface IAnnouncementTelService extends IService<AnnouncementTel> {
17
+	
18
+	/**
19
+	 *
20
+	 * 获取物业号码列表
21
+	 * @param announcementTel
22
+	 * @param pageNum
23
+	 * @param pageSize
24
+	 * @return
25
+	 */
26
+	ResponseBean getTelList(AnnouncementTel announcementTel, Integer pageNum, Integer pageSize);
27
+}

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillService.java View File

@@ -49,7 +49,7 @@ public interface IBillService extends IService<Bill> {
49 49
 	 * @param file
50 50
 	 * @return
51 51
 	 */
52
-    ResponseBean getExcelData(MultipartFile file, String billExplain);
52
+    ResponseBean getExcelData(MultipartFile file);
53 53
 
54 54
 	/**
55 55
 	 * 上传excel, 解析 入库

+ 16
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ICarouselSettingService.java View File

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.model.TpCarouselSetting;
5
+
6
+/**
7
+ * <p>
8
+ * 轮播数设置表 服务类
9
+ * </p>
10
+ *
11
+ * @author weiximei
12
+ * @since 2019-03-06
13
+ */
14
+public interface ICarouselSettingService extends IService<TpCarouselSetting> {
15
+
16
+}

+ 40
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IMessageService.java View File

@@ -0,0 +1,40 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.Message;
5
+import com.baomidou.mybatisplus.extension.service.IService;
6
+
7
+/**
8
+ * <p>
9
+ * 物业端消息表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-03-05
14
+ */
15
+public interface IMessageService extends IService<Message> {
16
+    /**
17
+     * 查询消息待办列表
18
+     * @param parameter
19
+     * @param communityId
20
+     * @return
21
+     */
22
+    ResponseBean messageLiset(String parameter, Integer communityId,Integer userID);
23
+
24
+    /**
25
+     * 查询关于我的所有消息
26
+     * @param parameter
27
+     * @param communityId
28
+     * @param id
29
+     * @return
30
+     */
31
+    ResponseBean myMessageList(String parameter, Integer communityId, Integer id);
32
+
33
+    /**
34
+     * 批量删除(已读)
35
+     * @param parameter
36
+     * @param id
37
+     * @return
38
+     */
39
+    ResponseBean delectRead(String parameter, Integer id);
40
+}

+ 25
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITaSysMenuService.java View File

@@ -0,0 +1,25 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.model.TaSysMenu;
7
+
8
+/**
9
+ * <p>
10
+ * APP端菜单页面 服务类
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-03-06
15
+ */
16
+public interface ITaSysMenuService extends IService<TaSysMenu> {
17
+
18
+    /**
19
+     * 获取数据列表
20
+     * @param userElement
21
+     * @return
22
+     */
23
+    ResponseBean getList(UserElement userElement);
24
+
25
+}

+ 52
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/AnnouncementTelServiceImpl.java View File

@@ -0,0 +1,52 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
7
+import com.community.huiju.model.AnnouncementTel;
8
+import com.community.huiju.dao.AnnouncementTelMapper;
9
+import com.community.huiju.model.Bill;
10
+import com.community.huiju.service.IAnnouncementTelService;
11
+import com.google.common.collect.Maps;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Service;
14
+
15
+import java.util.List;
16
+import java.util.Map;
17
+
18
+/**
19
+ * <p>
20
+ * 物业号码表 服务实现类
21
+ * </p>
22
+ *
23
+ * @author jobob
24
+ * @since 2019-03-05
25
+ */
26
+@Service
27
+public class AnnouncementTelServiceImpl extends ServiceImpl<AnnouncementTelMapper, AnnouncementTel> implements IAnnouncementTelService {
28
+	
29
+	@Autowired
30
+	private AnnouncementTelMapper announcementTelMapper;
31
+	
32
+	/**
33
+	 * 获取物业号码列表
34
+	 *
35
+	 * @param announcementTel
36
+	 * @param pageNum
37
+	 * @param pageSize
38
+	 * @return
39
+	 */
40
+	@Override
41
+	public ResponseBean getTelList(AnnouncementTel announcementTel, Integer pageNum, Integer pageSize) {
42
+		ResponseBean responseBean = new ResponseBean();
43
+		Page page = new Page(pageNum,pageSize);
44
+		// 分页查询
45
+		List<AnnouncementTel> list = announcementTelMapper.selectListByParams(page,announcementTel);
46
+		Map<String, Object> map = Maps.newHashMap();
47
+		map.put("list",list);
48
+		map.put("total",page.getTotal());
49
+		responseBean.addSuccess(map);
50
+		return responseBean;
51
+	}
52
+}

+ 46
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java View File

@@ -12,6 +12,7 @@ import com.community.huiju.dao.*;
12 12
 import com.community.huiju.exception.WisdomException;
13 13
 import com.community.huiju.model.*;
14 14
 import com.community.huiju.service.IBillInvoiceService;
15
+import com.community.huiju.service.IMessageService;
15 16
 import com.google.common.collect.Maps;
16 17
 import org.apache.poi.hssf.usermodel.*;
17 18
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +20,7 @@ import org.springframework.stereotype.Service;
19 20
 import org.springframework.transaction.annotation.Transactional;
20 21
 
21 22
 import java.text.SimpleDateFormat;
23
+import java.time.LocalDateTime;
22 24
 import java.util.Date;
23 25
 import java.util.HashMap;
24 26
 import java.util.List;
@@ -55,6 +57,9 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
55 57
     @Autowired
56 58
     private TaUserMapper taUserMapper;
57 59
 
60
+    @Autowired
61
+    private IMessageService iMessageService;
62
+
58 63
     @Override
59 64
     public ResponseBean getBillList(String parameter, UserElement userElement) {
60 65
         ResponseBean responseBean = new ResponseBean();
@@ -160,7 +165,8 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
160 165
                 throw new WisdomException("费用已缴,无法更改");
161 166
             }
162 167
 
163
-            billInvoice.setBillStatus("2");
168
+            billInvoice.setBillStatus("1");
169
+            billInvoice.setPayType("1");
164 170
             int rows = billInvoiceMapper.updateById(billInvoice);
165 171
             if (rows > 0) {
166 172
                 TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(billInvoice.getBuildingOwnerInfoId());
@@ -195,6 +201,20 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
195 201
                 }
196 202
                 billMapper.updateById(bill);
197 203
 
204
+                // 把相对应的 APP端用户的代办消息进行设置为无效
205
+                QueryWrapper<Message> messageQueryWrapper = new QueryWrapper<>();
206
+                messageQueryWrapper.eq("community_id", userElement.getCommunityId());
207
+                messageQueryWrapper.eq("bill_id", billInvoice.getId());
208
+                messageQueryWrapper.eq("uuid_type", "1");
209
+                messageQueryWrapper.eq("uuid", billInvoice.getTaUserId());
210
+                messageQueryWrapper.eq("message_type", "7");
211
+                messageQueryWrapper.eq("advice_type", "1");
212
+                messageQueryWrapper.eq("source", "2");
213
+
214
+                Message one = iMessageService.getOne(messageQueryWrapper);
215
+                one.setStatus("0");
216
+                iMessageService.updateById(one);
217
+
198 218
             }
199 219
         });
200 220
 
@@ -296,6 +316,31 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
296 316
         if (b == false) {
297 317
             throw new WisdomException("操作失败");
298 318
         }
319
+
320
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
321
+        List<Message> messageList = billInvoices.stream().map(e -> {
322
+
323
+            // 往APP端用户上面的每一个用户推送
324
+            Message messageModelAPP = new Message();
325
+            messageModelAPP.setCommunityId(userElement.getCommunityId());
326
+            messageModelAPP.setMessageType("7");
327
+            messageModelAPP.setAdviceType("1");
328
+            messageModelAPP.setModelType("2");
329
+            messageModelAPP.setUuid(e.getTaUserId());
330
+            messageModelAPP.setUuidType("1");
331
+            // 消息是物业端 发过来的, 就是 2
332
+            messageModelAPP.setSource("2");
333
+            messageModelAPP.setMessageContent("您有待缴费的账单,点击查看并缴费 " + dateFormat.format(new Date()) + bill.getBillName());
334
+            messageModelAPP.setStatus("1");
335
+            messageModelAPP.setCreateDate(LocalDateTime.now());
336
+            messageModelAPP.setCreateUser(userElement.getId());
337
+            messageModelAPP.setBillId(e.getId());
338
+
339
+            return messageModelAPP;
340
+        }).collect(Collectors.toList());
341
+
342
+        iMessageService.saveBatch(messageList);
343
+
299 344
         responseBean.addSuccess("操作成功");
300 345
         return responseBean;
301 346
     }

+ 163
- 41
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java View File

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8 8
 import com.community.commom.constant.Constant;
9 9
 import com.community.commom.mode.ResponseBean;
10 10
 import com.community.commom.session.UserElement;
11
+import com.community.commom.utils.DateUtils;
11 12
 import com.community.commom.utils.PayPriceUtils;
12 13
 import com.community.huiju.dao.*;
13 14
 import com.community.huiju.exception.WisdomException;
@@ -15,6 +16,7 @@ import com.community.huiju.model.*;
15 16
 import com.community.huiju.service.IBillInvoiceService;
16 17
 import com.community.huiju.service.IBillService;
17 18
 import com.community.huiju.service.IBuildingOwnerInfoService;
19
+import com.community.huiju.service.IMessageService;
18 20
 import com.google.common.collect.Lists;
19 21
 import com.google.common.collect.Maps;
20 22
 import com.google.zxing.common.detector.MathUtils;
@@ -35,6 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
35 37
 import java.io.*;
36 38
 import java.text.ParseException;
37 39
 import java.text.SimpleDateFormat;
40
+import java.time.LocalDateTime;
38 41
 import java.util.Date;
39 42
 import java.util.List;
40 43
 import java.util.Map;
@@ -82,6 +85,12 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
82 85
     @Autowired
83 86
     private IBuildingOwnerInfoService iBuildingOwnerInfoService;
84 87
 
88
+    @Autowired
89
+    private MessageMapper messageMapper;
90
+
91
+    @Autowired
92
+    private IMessageService iMessageService;
93
+
85 94
     @Override
86 95
     @Transactional(rollbackFor = Exception.class)
87 96
     public ResponseBean updateBillNameAndBillExplainAndEndDate(UserElement userElement, String parameter) {
@@ -143,7 +152,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
143 152
 
144 153
     @Override
145 154
     @Transactional(rollbackFor = Exception.class)
146
-    public ResponseBean getExcelData(MultipartFile file, String billExplain) {
155
+    public ResponseBean getExcelData(MultipartFile file) {
147 156
         ResponseBean responseBean = new ResponseBean();
148 157
         if (file == null) {
149 158
             responseBean.addError("对象不能为空");
@@ -152,9 +161,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
152 161
 
153 162
         responseBean = getExcelData(file, responseBean);
154 163
         List<TempBill> tempBills = (List<TempBill>) responseBean.getData();
155
-        tempBills.forEach(e -> {
156
-            e.setBillExplain(billExplain);
157
-        });
158 164
 
159 165
         Map<String, Object> map = Maps.newHashMap();
160 166
         map.put("list", tempBills);
@@ -229,7 +235,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
229 235
 
230 236
         bill.setPayedNum(0);
231 237
         bill.setBillStatus(billStatus);
232
-        //为草稿时不创建时间
238
+        //为草稿时不创建时间, 2表示草稿
233 239
         if(!"2".equals(billStatus)) {
234 240
             bill.setCreateDate(new Date());
235 241
             bill.setCreateUser(userElement.getId());
@@ -261,6 +267,65 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
261 267
         // int rows = billMapper.insert(bill);
262 268
         boolean b = this.saveOrUpdate(bill);
263 269
         if (b) {
270
+            // 草稿时插入消息
271
+            if ("2".equals(bill.getBillStatus())) {
272
+                Message message = new Message();
273
+                message.setCommunityId(userElement.getCommunityId());
274
+                message.setMessageType("7");
275
+                message.setAdviceType("4");
276
+                message.setModelType("2");
277
+                message.setUuid(userElement.getId());
278
+                message.setUuidType("2");
279
+                // 消息是物业端发过来的, 就是 2
280
+                message.setSource("2");
281
+                message.setMessageContent("收费组“" + bill.getBillName() +  "”还未发布,点击发布");
282
+                message.setStatus("1");
283
+                message.setCreateDate(LocalDateTime.now());
284
+                message.setCreateUser(userElement.getId());
285
+                message.setBillId(bill.getId());
286
+
287
+                messageMapper.insert(message);
288
+
289
+            }
290
+            // 发布时消息为无效
291
+            if ("0".equals(bill.getBillStatus())) {
292
+                QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
293
+                queryWrapper.eq("community_id", userElement.getCommunityId());
294
+                queryWrapper.eq("message_type", "7");
295
+                queryWrapper.eq("model_type", "2");
296
+                queryWrapper.eq("source", "2");
297
+                queryWrapper.eq("status", "1");
298
+                queryWrapper.eq("advice_type","4");
299
+                Message message = messageMapper.selectOne(queryWrapper);
300
+                if (null != message) {
301
+                    message.setStatus("0");
302
+                    message.setUpdateDate(LocalDateTime.now());
303
+                    message.setUpdateUser(userElement.getId());
304
+                    messageMapper.updateById(message);
305
+                }
306
+
307
+
308
+                // 插入消息表, 消息类型为 消息
309
+                Message messageModel = new Message();
310
+                messageModel.setCommunityId(userElement.getCommunityId());
311
+                messageModel.setMessageType("7");
312
+                messageModel.setAdviceType("4");
313
+                messageModel.setModelType("1");
314
+                messageModel.setUuid(userElement.getId());
315
+                messageModel.setUuidType("2");
316
+                // 消息是物业端发过来的, 就是 2
317
+                messageModel.setSource("2");
318
+
319
+                messageModel.setMessageContent("收费组“" + bill.getBillName() + "”还有" + DateUtils.getDaysBetween(new Date(), bill.getEndDate()) + "天就到截止日期了,但还有未缴用户,点击去查看");
320
+                messageModel.setStatus("1");
321
+                messageModel.setCreateDate(LocalDateTime.now());
322
+                messageModel.setCreateUser(userElement.getId());
323
+                messageModel.setBillId(bill.getId());
324
+
325
+                messageMapper.insert(messageModel);
326
+
327
+
328
+            }
264 329
             List<BillInvoice> billInvoices = tempBills.stream().map(e -> {
265 330
                 BillInvoice billInvoice = new BillInvoice();
266 331
                 billInvoice.setCommunityId(userElement.getCommunityId());
@@ -294,7 +359,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
294 359
                 if (null != taUser) {
295 360
                     billInvoice.setTaUserId(taUser.getId());
296 361
                 }
297
-                billInvoice.setBillInvoiceExplain(bill.getBillExplain());
362
+                billInvoice.setBillInvoiceExplain(e.getBillExplain());
298 363
                 billInvoice.setPayPrice(e.getPayPrice());
299 364
                 billInvoice.setBillStatus("0");
300 365
                 billInvoice.setCreateUser(userElement.getId());
@@ -303,10 +368,40 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
303 368
                 Random random = new Random();
304 369
                 billInvoice.setOutTradeNo(String.valueOf(System.currentTimeMillis()) + random.nextInt());
305 370
 
371
+
306 372
                 return billInvoice;
307 373
             }).collect(Collectors.toList());
308 374
 
309
-            iBillInvoiceService.saveBatch(billInvoices);
375
+            boolean batchBool = iBillInvoiceService.saveBatch(billInvoices);
376
+            if (batchBool) {
377
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
378
+                // 发布时, 往 APP端推送
379
+                if ("0".equals(bill.getBillStatus())) {
380
+                    List<Message> messageList = billInvoices.stream().map(e -> {
381
+
382
+                        // 往APP端用户上面的每一个用户推送
383
+                        Message messageModelAPP = new Message();
384
+                        messageModelAPP.setCommunityId(userElement.getCommunityId());
385
+                        messageModelAPP.setMessageType("7");
386
+                        messageModelAPP.setAdviceType("1");
387
+                        messageModelAPP.setModelType("2");
388
+                        messageModelAPP.setUuid(e.getTaUserId());
389
+                        messageModelAPP.setUuidType("1");
390
+                        // 消息是物业端 发过来的, 就是 2
391
+                        messageModelAPP.setSource("2");
392
+                        messageModelAPP.setMessageContent("您有待缴费的账单,点击查看并缴费 " + dateFormat.format(new Date()) + bill.getBillName());
393
+                        messageModelAPP.setStatus("1");
394
+                        messageModelAPP.setCreateDate(LocalDateTime.now());
395
+                        messageModelAPP.setCreateUser(userElement.getId());
396
+                        messageModelAPP.setBillId(e.getId());
397
+
398
+                        return messageModelAPP;
399
+
400
+                    }).collect(Collectors.toList());
401
+                    iMessageService.saveBatch(messageList);
402
+                }
403
+
404
+            }
310 405
         }
311 406
         responseBean.addSuccess("操作成功!");
312 407
         return responseBean;
@@ -346,37 +441,48 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
346 441
             Row row = sheetAt.getRow(i);
347 442
             Cell cell = getCell(row.getCell(0));
348 443
             if (null == cell) {
349
-                throw new WisdomException("第" + i + "行 期/区 不能为空");
444
+                throw new WisdomException("第" + i+1 + "行 期/区 不能为空");
350 445
             }
351 446
             String phase = cell.getStringCellValue().trim();
352 447
             cell = getCell(row.getCell(1));
353 448
             if (null == cell) {
354
-                throw new WisdomException("第" + i + "行 楼栋 不能为空");
449
+                throw new WisdomException("第" + i+1 + "行 楼栋 不能为空");
355 450
             }
356 451
             String building = cell.getStringCellValue().trim();
357 452
             cell = getCell(row.getCell(2));
358 453
             if (null == cell) {
359
-                throw new WisdomException("第" + i + "行 单元 不能为空");
454
+                throw new WisdomException("第" + i+1 + "行 单元 不能为空");
360 455
             }
361 456
             String unit = cell.getStringCellValue().trim();
362 457
             cell = getCell(row.getCell(3));
363 458
             if (null == cell) {
364
-                throw new WisdomException("第" + i + "行 楼层 不能为空");
459
+                throw new WisdomException("第" + i+1 + "行 楼层 不能为空");
365 460
             }
366 461
             String level = cell.getStringCellValue().trim();
367 462
             cell = getCell(row.getCell(4));
368 463
             if (null == cell) {
369
-                throw new WisdomException("第" + i + "行 房号 不能为空");
464
+                throw new WisdomException("第" + i+1 + "行 房号 不能为空");
370 465
             }
371 466
             String roomNo = cell.getStringCellValue().trim();
372 467
             cell = getCell(row.getCell(5));
373 468
             if (null == cell) {
374
-                throw new WisdomException("第" + i + "行 业主姓名 不能为空");
469
+                throw new WisdomException("第" + i+1 + "行 业主姓名 不能为空");
375 470
             }
376 471
             String ownerName = cell.getStringCellValue().trim();
472
+
473
+            // 收费说明可以为空
377 474
             cell = getCell(row.getCell(6));
475
+            String billExplain = null;
476
+            if (null != cell) {
477
+                billExplain = cell.getStringCellValue().trim();
478
+                if (billExplain.length() > 100) {
479
+                    throw new WisdomException("第" + i+1 + "行 收费说明超出100字,请精简到100字以内");
480
+                }
481
+            }
482
+
483
+            cell = getCell(row.getCell(7));
378 484
             if (null == cell) {
379
-                throw new WisdomException("第" + i + "行 金额 不能为空");
485
+                throw new WisdomException("第" + i+1 + "行 金额 不能为空");
380 486
             }
381 487
             String money = cell.getStringCellValue().trim();
382 488
 
@@ -388,6 +494,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
388 494
             temp.setUnit(unit);
389 495
             temp.setRoomNo(roomNo);
390 496
             temp.setOwnerName(ownerName);
497
+            temp.setBillExplain(billExplain);
391 498
 
392 499
 
393 500
             if (StringUtils.isNotBlank(money)) {
@@ -440,6 +547,22 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
440 547
             QueryWrapper<BillInvoice> deleteQueryWrapper = new QueryWrapper<>();
441 548
             deleteQueryWrapper.eq("bill_id", bill.getId());
442 549
             billInvoiceMapper.delete(deleteQueryWrapper);
550
+
551
+            // 发布时消息为无效
552
+            QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
553
+            queryWrapper.eq("community_id", userElement.getCommunityId());
554
+            queryWrapper.eq("message_type", "7");
555
+            queryWrapper.eq("model_type", "2");
556
+            queryWrapper.eq("source", "2");
557
+            queryWrapper.eq("status", "1");
558
+            Message message = messageMapper.selectOne(queryWrapper);
559
+            if (null != message) {
560
+                message.setStatus("0");
561
+                message.setUpdateDate(LocalDateTime.now());
562
+                message.setUpdateUser(userElement.getId());
563
+                messageMapper.updateById(message);
564
+            }
565
+
443 566
         });
444 567
 
445 568
         responseBean.addSuccess("操作成功!");
@@ -510,9 +633,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
510 633
         List<TpBuildingOwnerInfo> records = infoIPage.getRecords();
511 634
         // 总页数
512 635
         Long pages = infoIPage.getPages();
513
-        do {
514
-
515
-        } while (false);
516 636
 
517 637
 
518 638
         // 行数 默认从 第 6 行开始
@@ -520,30 +640,32 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
520 640
         // 记录坐标
521 641
         int index = 0;
522 642
 
523
-        do {
524
-            TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
525
-            row = sheet.createRow(currentRow);
526
-            cell = row.createCell(0);
527
-            cell.setCellValue(buildingOwnerInfo.getPhase());
528
-            cell = row.createCell(1);
529
-            cell.setCellValue(buildingOwnerInfo.getBuilding());
530
-            cell = row.createCell(2);
531
-            cell.setCellValue(buildingOwnerInfo.getUnit());
532
-            cell = row.createCell(3);
533
-            cell.setCellValue(buildingOwnerInfo.getLevel());
534
-            cell = row.createCell(4);
535
-            cell.setCellValue(buildingOwnerInfo.getRoomNo());
536
-            cell = row.createCell(5);
537
-            cell.setCellValue(buildingOwnerInfo.getOwnerName());
538
-            currentRow ++;
539
-            index ++;
540
-            if (index == records.size()) {
541
-                index = 0;
542
-                page = new Page(infoIPage.getCurrent() + 1,pageSize);
543
-                infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
544
-                records = infoIPage.getRecords();
545
-            }
546
-        } while (infoIPage.getCurrent() <= pages);
643
+        if (records.size() > 0) {
644
+            do {
645
+                TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
646
+                row = sheet.createRow(currentRow);
647
+                cell = row.createCell(0);
648
+                cell.setCellValue(buildingOwnerInfo.getPhase());
649
+                cell = row.createCell(1);
650
+                cell.setCellValue(buildingOwnerInfo.getBuilding());
651
+                cell = row.createCell(2);
652
+                cell.setCellValue(buildingOwnerInfo.getUnit());
653
+                cell = row.createCell(3);
654
+                cell.setCellValue(buildingOwnerInfo.getLevel());
655
+                cell = row.createCell(4);
656
+                cell.setCellValue(buildingOwnerInfo.getRoomNo());
657
+                cell = row.createCell(5);
658
+                cell.setCellValue(buildingOwnerInfo.getOwnerName());
659
+                currentRow ++;
660
+                index ++;
661
+                if (index == records.size()) {
662
+                    index = 0;
663
+                    page = new Page(infoIPage.getCurrent() + 1,pageSize);
664
+                    infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
665
+                    records = infoIPage.getRecords();
666
+                }
667
+            } while (infoIPage.getCurrent() <= pages);
668
+        }
547 669
 
548 670
         responseBean.addSuccess(workbook);
549 671
         return responseBean;

+ 107
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java View File

@@ -0,0 +1,107 @@
1
+package com.community.huiju.service.impl;
2
+
3
+
4
+import com.alibaba.fastjson.JSONArray;
5
+import com.alibaba.fastjson.JSONObject;
6
+import com.baomidou.mybatisplus.core.metadata.IPage;
7
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
+import com.community.commom.mode.ResponseBean;
10
+import com.community.huiju.dao.MessageMapper;
11
+import com.community.huiju.model.Message;
12
+import com.community.huiju.service.IMessageService;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Service;
15
+
16
+import java.time.LocalDateTime;
17
+import java.util.Date;
18
+import java.util.HashMap;
19
+import java.util.List;
20
+
21
+/**
22
+ * <p>
23
+ * 物业端消息表 服务实现类
24
+ * </p>
25
+ *
26
+ * @author jobob
27
+ * @since 2019-03-05
28
+ */
29
+@Service
30
+public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements IMessageService {
31
+    @Autowired
32
+    private MessageMapper messageMapper;
33
+    @Override
34
+    public ResponseBean messageLiset(String parameter, Integer communityId,Integer user) {
35
+        ResponseBean response= new  ResponseBean();
36
+        JSONObject  object = JSONObject.parseObject(parameter);
37
+        //待办消息类型(-1:论坛,-2:工单,-3:缴费)
38
+        String  messageType = object.getString("messageType");
39
+        //0:无效,1:有效
40
+        String  status = object.getString("status");
41
+        Date createDate = object.getDate("createDate");
42
+
43
+        String  messageContent = object.getString("messageContent");
44
+        Integer pageNum = object.getInteger("pageNum");
45
+        Integer pageSize = object.getInteger("pageSize");
46
+
47
+        Page<Message> page = new Page<>();
48
+        page.setSize(pageSize == null ? 10 : pageSize);
49
+        page.setCurrent(pageNum == null ? 1 : pageNum);
50
+        IPage<Message> pageInfo = messageMapper.messageLiset(page,messageType,status,createDate,messageContent,user);
51
+        List<Message> ticketList = pageInfo.getRecords();
52
+        HashMap map=new HashMap<>();
53
+        map.put("list",ticketList);
54
+        map.put("total", pageInfo.getTotal());
55
+        map.put("pageNum", pageInfo.getCurrent());
56
+        map.put("pageSize", pageInfo.getSize());
57
+        response.addSuccess(map);
58
+        return response;
59
+    }
60
+
61
+    @Override
62
+    public ResponseBean myMessageList(String parameter, Integer communityId, Integer user) {
63
+        ResponseBean response= new  ResponseBean();
64
+        JSONObject  object = JSONObject.parseObject(parameter);
65
+        //待办消息类型(-1:论坛,-2:工单,-3:缴费)
66
+        String  messageType = object.getString("messageType");
67
+        //0:无效,1:有效
68
+        String  readStatus = object.getString("readStatus");
69
+        Date createDate = object.getDate("createDate");
70
+
71
+        String  messageContent = object.getString("messageContent");
72
+        Integer pageNum = object.getInteger("pageNum");
73
+        Integer pageSize = object.getInteger("pageSize");
74
+
75
+        Page<Message> page = new Page<>();
76
+        page.setSize(pageSize == null ? 10 : pageSize);
77
+        page.setCurrent(pageNum == null ? 1 : pageNum);
78
+        IPage<Message> pageInfo = messageMapper.myMessageList(page,messageType,readStatus,createDate,messageContent,user);
79
+        List<Message> ticketList = pageInfo.getRecords();
80
+        HashMap map=new HashMap<>();
81
+        map.put("list",ticketList);
82
+        map.put("total", pageInfo.getTotal());
83
+        map.put("pageNum", pageInfo.getCurrent());
84
+        map.put("pageSize", pageInfo.getSize());
85
+        response.addSuccess(map);
86
+        return response;
87
+    }
88
+
89
+    @Override
90
+    public ResponseBean delectRead(String parameter, Integer userID) {
91
+        ResponseBean response = new ResponseBean();
92
+        JSONObject parseObject = JSONObject.parseObject(parameter);
93
+
94
+        JSONArray message = parseObject.getJSONArray("id");
95
+        Integer[] messageListID = message.toArray(new Integer[]{});
96
+        for (Integer id : messageListID) {
97
+            Message mes= new Message();
98
+                    mes.setId(id);
99
+                    mes.setReadStatus("1");
100
+                    mes.setUpdateDate(LocalDateTime.now());
101
+                    mes.setUpdateUser(userID);
102
+                    messageMapper.updateById(mes);
103
+        }
104
+                response.addSuccess("成功");
105
+                return response;
106
+    }
107
+}

+ 36
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TaSysMenuServiceImpl.java View File

@@ -0,0 +1,36 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.model.TaSysMenu;
7
+import com.community.huiju.dao.TaSysMenuMapper;
8
+import com.community.huiju.service.ITaSysMenuService;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+
12
+import java.util.List;
13
+
14
+/**
15
+ * <p>
16
+ * APP端菜单页面 服务实现类
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-03-06
21
+ */
22
+@Service
23
+public class TaSysMenuServiceImpl extends ServiceImpl<TaSysMenuMapper, TaSysMenu> implements ITaSysMenuService {
24
+
25
+    @Autowired
26
+    private TaSysMenuMapper taSysMenuMapper;
27
+
28
+    @Override
29
+    public ResponseBean getList(UserElement userElement) {
30
+        ResponseBean responseBean = new ResponseBean();
31
+
32
+        List<TaSysMenu> taSysMenus = taSysMenuMapper.selectList(userElement.getCommunityId());
33
+        responseBean.addSuccess(taSysMenus);
34
+        return responseBean;
35
+    }
36
+}

+ 101
- 3
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java View File

@@ -9,12 +9,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 9
 import com.community.commom.mode.ResponseBean;
10 10
 import com.community.commom.session.UserElement;
11 11
 import com.community.commom.utils.BeanTools;
12
+import com.community.huiju.dao.MessageMapper;
13
+import com.community.huiju.dao.TaUserMapper;
12 14
 import com.community.huiju.dao.TdImagesMapper;
13 15
 import com.community.huiju.dao.TpActivityMapper;
14 16
 import com.community.huiju.exception.WisdomException;
15
-import com.community.huiju.model.TdImages;
16
-import com.community.huiju.model.TpActivity;
17
-import com.community.huiju.model.User;
17
+import com.community.huiju.model.*;
18 18
 import com.community.huiju.service.ITdImagesService;
19 19
 import com.community.huiju.service.ITpActivityService;
20 20
 import com.community.huiju.service.IUserService;
@@ -55,6 +55,11 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
55 55
     @Autowired
56 56
     private IUserService iUserService;
57 57
 
58
+    @Autowired
59
+    private MessageMapper messageMapper;
60
+
61
+    @Autowired
62
+    private TaUserMapper taUserMapper;
58 63
     @Override
59 64
     public ResponseBean listQuery(String parameter, UserElement userElement) {
60 65
         ResponseBean responseBean = new ResponseBean();
@@ -153,6 +158,62 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
153 158
         if (row <= 0) {
154 159
             throw new WisdomException("操作失败!");
155 160
         } else {
161
+
162
+                // 草稿时插入消息
163
+                Message activityMessage = new Message();
164
+            activityMessage.setCommunityId(userElement.getCommunityId());
165
+            activityMessage.setMessageType("8");
166
+            activityMessage.setAdviceType("4");
167
+            activityMessage.setModelType("2");
168
+            activityMessage.setUuid(userElement.getId());
169
+            activityMessage.setUuidType("2");
170
+            activityMessage.setSource("2");
171
+            activityMessage.setMessageContent("活动“{" + tpActivity.getActivityTitle() + "}”还未发布,点击发布");
172
+            activityMessage.setStatus("1");
173
+            activityMessage.setActivityId(tpActivity.getId());
174
+            activityMessage.setCreateDate(LocalDateTime.now());
175
+            activityMessage.setCreateUser(userElement.getId());
176
+            activityMessage.setReadStatus("0");
177
+                //为草稿时
178
+                if ("2".equals(tpActivity.getStatus())) {
179
+                    messageMapper.insert(activityMessage);
180
+                }
181
+            activityMessage.setModelType("1");
182
+            activityMessage.setAdviceType("1");
183
+            activityMessage.setSource("1");
184
+            activityMessage.setUuidType("1");
185
+            activityMessage.setMessageContent(tpActivity.getActivityTitle());
186
+
187
+            if("1".equals(tpActivity.getStatus())) {
188
+                QueryWrapper<TaUser> queryWrapperTaUser = new QueryWrapper<>();
189
+                queryWrapperTaUser.eq("community_id",userElement.getCommunityId());
190
+                List<TaUser> userList= taUserMapper.selectList(queryWrapperTaUser);
191
+                for (TaUser taUser:userList){
192
+                    activityMessage.setUuid(taUser.getId());
193
+                    messageMapper.insert(activityMessage);
194
+                }
195
+
196
+            }
197
+                // 发布时消息为无效
198
+                if ("1".equals(tpActivity.getStatus())) {
199
+                    QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
200
+                    queryWrapper.eq("community_id", userElement.getCommunityId());
201
+                    queryWrapper.eq("message_type", "8");
202
+                    queryWrapper.eq("model_type", "2");
203
+                    queryWrapper.eq("source", "2");
204
+                    queryWrapper.eq("status", "1");
205
+                    Message message = messageMapper.selectOne(queryWrapper);
206
+                    if (null != message) {
207
+                        message.setStatus("0");
208
+                        message.setUpdateDate(LocalDateTime.now());
209
+                        message.setUpdateUser(userElement.getId());
210
+                        messageMapper.updateById(message);
211
+                    }
212
+
213
+
214
+                }
215
+
216
+
156 217
             responseBean.addSuccess("操作成功!");
157 218
         }
158 219
 
@@ -212,6 +273,25 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
212 273
             selectTpActivity.setUpdateUser(userElement.getId());
213 274
         }
214 275
 
276
+        // 发布时消息为无效
277
+        if ("1".equals(tpActivity.getStatus())) {
278
+            QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
279
+            queryWrapper.eq("community_id", userElement.getCommunityId());
280
+            queryWrapper.eq("message_type", "8");
281
+            queryWrapper.eq("model_type", "2");
282
+            queryWrapper.eq("source", "2");
283
+            queryWrapper.eq("status", "1");
284
+            queryWrapper.eq("activity_id",tpActivity.getId());
285
+            Message message = messageMapper.selectOne(queryWrapper);
286
+            if (null != message) {
287
+                message.setStatus("0");
288
+                message.setUpdateDate(LocalDateTime.now());
289
+                message.setUpdateUser(userElement.getId());
290
+                messageMapper.updateById(message);
291
+            }
292
+
293
+
294
+        }
215 295
 
216 296
         int row = tpActivityMapper.updateById(selectTpActivity);
217 297
 
@@ -269,6 +349,24 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
269 349
             }
270 350
             e.setStatus("0");
271 351
             // e.setUpdateUser(userElement.getId());
352
+            // 作废时消息为无效
353
+            if ("0".equals(e.getStatus())) {
354
+                QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
355
+                queryWrapper.eq("community_id", userElement.getCommunityId());
356
+                queryWrapper.eq("message_type", "8");
357
+                queryWrapper.eq("model_type", "2");
358
+                queryWrapper.eq("source", "2");
359
+                queryWrapper.eq("status", "1");
360
+                Message message = messageMapper.selectOne(queryWrapper);
361
+                if (null != message) {
362
+                    message.setStatus("0");
363
+                    message.setUpdateDate(LocalDateTime.now());
364
+                    message.setUpdateUser(userElement.getId());
365
+                    messageMapper.updateById(message);
366
+                }
367
+
368
+
369
+            }
272 370
         });
273 371
         updateBatchById(tpActivityList);
274 372
 

+ 56
- 9
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpAnnouncementServiceImpl.java View File

@@ -7,12 +7,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
7 7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8 8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 9
 import com.community.commom.mode.ResponseBean;
10
-import com.community.huiju.dao.TdImagesMapper;
11
-import com.community.huiju.dao.TpAnnouncementMapper;
12
-import com.community.huiju.dao.UserMapper;
13
-import com.community.huiju.model.TdImages;
14
-import com.community.huiju.model.TpAnnouncement;
15
-import com.community.huiju.model.TpBuildingOwnerInfo;
10
+import com.community.huiju.dao.*;
11
+import com.community.huiju.model.*;
16 12
 import com.community.huiju.service.TpAnnouncementService;
17 13
 import com.community.huiju.vo.AnnouncementTable;
18 14
 import com.google.common.collect.Maps;
@@ -48,8 +44,11 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
48 44
     @Autowired
49 45
     private UserMapper userMapper;
50 46
 
47
+    @Autowired
48
+    private MessageMapper messageMapper;
51 49
 
52
-
50
+    @Autowired
51
+    private TaUserMapper taUserMapper;
53 52
     @Override
54 53
     public ResponseBean tpAnnouncemenList(String paramets, Integer CommunityId) {
55 54
         ResponseBean responseBean = new ResponseBean();
@@ -112,8 +111,40 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
112 111
             return response;
113 112
         }
114 113
         tpAnnouncementMapper.insert(tpAnnouncement);
115
-
116
-
114
+        //根据1.5需求维护tp_message
115
+            Message message = new Message();
116
+            message.setCommunityId(communityId);
117
+            message.setMessageType("5");
118
+            message.setModelType("2");
119
+            message.setAdviceType("4");
120
+            message.setUuid(userId);
121
+            message.setUuidType("2");
122
+            message.setSource("2");
123
+            message.setMessageContent("公告“" + tpAnnouncement.getAnnouncementTitle() + "”还未发布,查看详情");
124
+            message.setStatus("1");
125
+            message.setReadStatus("0");
126
+            message.setCreateUser(userId);
127
+            message.setCreateDate(LocalDateTime.now());
128
+            message.setAnnouncementId(tpAnnouncement.getId());
129
+            //为草稿的时
130
+            if ("2".equals(tpAnnouncement.getStatus())) {
131
+                messageMapper.insert(message);
132
+            }
133
+            message.setModelType("1");
134
+            message.setAdviceType("1");
135
+            message.setSource("1");
136
+            message.setUuidType("1");
137
+            message.setMessageContent(tpAnnouncement.getAnnouncementTitle());
138
+
139
+        if ("1".equals(tpAnnouncement.getStatus())) {
140
+            QueryWrapper<TaUser> queryWrapperTaUser = new QueryWrapper<>();
141
+            queryWrapperTaUser.eq("community_id",communityId);
142
+            List<TaUser> userList= taUserMapper.selectList(queryWrapperTaUser);
143
+            for (TaUser taUser:userList) {
144
+                message.setUuid(taUser.getId());
145
+                messageMapper.insert(message);
146
+            }
147
+        }
117 148
         for (String img : contentImgArray) {
118 149
             TdImages tdImages = new TdImages();
119 150
             tdImages.setImageUrl(img);
@@ -182,6 +213,15 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
182 213
                 tdImages.setCreateUser(userId);
183 214
                 imagesMapper.insert(tdImages);
184 215
             }
216
+                // 公告发布成功删除时消息变为无效
217
+                Message message = new Message();
218
+                message.setMessageContent("公告“" + tpAnnouncement.getAnnouncementTitle() + "”还未发布,查看详情");
219
+                message.setAnnouncementId(tpAnnouncement.getId());
220
+                message.setUpdateDate(LocalDateTime.now());
221
+                message.setUpdateUser(userId);
222
+                message.setStatus("0");
223
+                messageMapper.updateMessage(message);
224
+
185 225
         }
186 226
         return response;
187 227
     }
@@ -199,6 +239,13 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
199 239
             tpAnnouncement.setCommunityId(communityId);
200 240
             tpAnnouncement.setStatus("0");
201 241
             tpAnnouncementMapper.updateTpAnnouncement(tpAnnouncement);
242
+            //1.5版本维护消息
243
+            Message message= new Message();
244
+            message.setStatus("0");
245
+            message.setAnnouncementId(id);
246
+            message.setUpdateUser(userId);
247
+            message.setUpdateDate(LocalDateTime.now());
248
+            messageMapper.updateMessage(message);
202 249
         }
203 250
         return response;
204 251
     }

+ 20
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpCarouselSettingServiceImpl.java View File

@@ -0,0 +1,20 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.huiju.dao.TpCarouselSettingMapper;
5
+import com.community.huiju.model.TpCarouselSetting;
6
+import com.community.huiju.service.ICarouselSettingService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 轮播数设置表 服务实现类
12
+ * </p>
13
+ *
14
+ * @author weiximei
15
+ * @since 2019-03-06
16
+ */
17
+@Service
18
+public class TpCarouselSettingServiceImpl extends ServiceImpl<TpCarouselSettingMapper, TpCarouselSetting> implements ICarouselSettingService {
19
+
20
+}

+ 67
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpTicketServiceImpl.java View File

@@ -49,6 +49,10 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
49 49
 
50 50
     @Autowired
51 51
     private TaUserMapper taUserMapper;
52
+
53
+    @Autowired
54
+    private MessageMapper messageMapper;
55
+
52 56
     @Override
53 57
     public ResponseBean ticketLiset(String parameter,Integer communityId) {
54 58
          ResponseBean response= new ResponseBean<>();
@@ -190,12 +194,29 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
190 194
                 tdImagesMapper.insert(tdImages);
191 195
             }
192 196
         }
197
+        //1.5维护工单对话推送到app消息
198
+        Message message = new Message();
199
+        message.setCommunityId(communityId);
200
+        message.setMessageType("10");
201
+        message.setTicketId(tpTicket.getId());
202
+        message.setAdviceType("1");
203
+        message.setUuid(tpTicket.getCreateUser());
204
+        message.setModelType("1");
205
+        message.setUuidType("1");
206
+        message.setSource("2");
207
+        message.setMessageContent(content);
208
+        message.setStatus("1");
209
+        message.setReadStatus("0");
210
+        message.setCreateUser(tpTicket.getCreateUser());
211
+        message.setCreateDate(LocalDateTime.now());
212
+        message.setTicketId(ticketId);
193 213
         response.addSuccess("成功");
214
+        messageMapper.insert(message);
194 215
         return response;
195 216
     }
196 217
 
197 218
     @Override
198
-    public ResponseBean addRecord(String parameter, Integer id, Integer communityId) {
219
+    public ResponseBean addRecord(String parameter, Integer user, Integer communityId) {
199 220
         ResponseBean response=new ResponseBean();
200 221
 
201 222
         JSONObject object= JSONObject.parseObject(parameter);
@@ -217,9 +238,42 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
217 238
         tpTicketRecord.setTicketId(ticketId);
218 239
         tpTicketRecord.setContent("您的联系单已经分配给物业处理人员" + userName.getUserName()+",联系方式:" + userName.getLoginName());
219 240
         tpTicketRecord.setStatus("3");
220
-        tpTicketRecord.setCreateUser(id);
241
+        tpTicketRecord.setCreateUser(user);
221 242
         tpTicketRecord.setCreateDate(LocalDateTime.now());
222 243
         tpTicketRecordMapper.insert(tpTicketRecord);
244
+
245
+        //待办模板
246
+        QueryWrapper<TpTicket> queryWrapper = new QueryWrapper<>();
247
+        queryWrapper.eq("id", ticketId);
248
+        queryWrapper.eq("community_id", communityId);
249
+       TpTicket ticket = tpTicketMapper.selectOne(queryWrapper);
250
+        Message message = new Message();
251
+        message.setCommunityId(communityId);
252
+        message.setMessageType(ticket.getType());
253
+        message.setTicketId(ticket.getId());
254
+        message.setAdviceType("4");
255
+        message.setUuid(userID);
256
+        message.setModelType("2");
257
+        message.setUuidType("2");
258
+        message.setSource("2");
259
+        message.setMessageContent("工单“" + ticket.getTicketTitle() + "”已被分配给您,点击查看并处理");
260
+        message.setStatus("1");
261
+        message.setReadStatus("0");
262
+        message.setCreateUser(user);
263
+        message.setCreateDate(LocalDateTime.now());
264
+        message.setTicketId(ticketId);
265
+        messageMapper.insert(message);
266
+        //如果分配给本人维护消息模板
267
+        if (null!=userID&userID.equals(user)){
268
+            message.setModelType("1");
269
+            messageMapper.insert(message);
270
+        }
271
+        //分配成功后推送app
272
+        message.setUuidType("1");
273
+        message.setUuid(ticket.getCreateUser());
274
+        message.setMessageContent("工单“" + ticket.getTicketTitle() + "”已被分配给:"+userName.getUserName());
275
+        message.setAdviceType("1");
276
+        messageMapper.insert(message);
223 277
         response.addSuccess("成功");
224 278
         return response;
225 279
     }
@@ -259,6 +313,14 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
259 313
         ticketRecordComment.setCreateDate(LocalDateTime.now());
260 314
         response.addSuccess("成功");
261 315
         tpTicketRecordCommentMapper.insert(ticketRecordComment);
316
+
317
+        //维护1.5版本
318
+        Message message = new Message();
319
+        message.setTicketId(ticketId);
320
+        message.setUpdateUser(id);
321
+        message.setUpdateDate(LocalDateTime.now());
322
+        message.setStatus("0");
323
+        messageMapper.updateTicketMessage(message);
262 324
         return response;
263 325
     }
264 326
 
@@ -310,6 +372,9 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
310 372
                 tdImagesMapper.insert(tdImages);
311 373
             }
312 374
         }
375
+        //分配成功后这只messgae消息表status为无效
376
+        messageMapper.updateTickMessageStatus(ticketId);
377
+
313 378
         response.addSuccess("成功");
314 379
         return response;
315 380
     }

+ 0
- 0
CODE/smart-community/property-api/src/main/resources/mapper/AnnouncementTelMapper.xml View File


Some files were not shown because too many files changed in this diff