Selaa lähdekoodia

update gitignore

weiximei 6 vuotta sitten
vanhempi
commit
8ece3f12e4
56 muutettua tiedostoa jossa 2006 lisäystä ja 88 poistoa
  1. 22
    0
      CODE/smart-community/app-api/pom.xml
  2. 9
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/AppApplication.java
  3. 15
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/ICode.java
  4. 23
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/entity/CodeEntity.java
  5. 13
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/impl/ImgCodeImpl.java
  6. 49
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java
  7. 21
    21
      CODE/smart-community/app-api/src/main/java/com/community/huiju/config/HttpSessionConfig.java
  8. 34
    34
      CODE/smart-community/app-api/src/main/java/com/community/huiju/config/entity/UserElement.java
  9. 45
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AgreementController.java
  10. 41
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java
  11. 46
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CodeController.java
  12. 41
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java
  13. 60
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  14. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaAgreementMapper.java
  15. 35
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserMapper.java
  16. 13
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java
  17. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java
  18. 27
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaAgreement.java
  19. 178
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUser.java
  20. 145
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/ToBanner.java
  21. 175
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java
  22. 29
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/AgreementServicel.java
  23. 16
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BannerServiceI.java
  24. 28
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  25. 7
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java
  26. 55
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/AgreementServiceimpl.java
  27. 28
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BannerServiceImpl.java
  28. 25
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java
  29. 76
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  30. 76
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaAgreementMapper.xml
  31. 250
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml
  32. 29
    0
      CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml
  33. 248
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml
  34. 28
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  35. 38
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/utils/AccountValidatorUtil.java
  36. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class
  37. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/FastJsonSerializer.class
  38. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisConfiguration.class
  39. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisJsonSerializer.class
  40. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisObjectSerializer.class
  41. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisSerializer.class
  42. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisTemplate.class
  43. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/SerializationFailedException.class
  44. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/SingleRedisTemplate.class
  45. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/AccountValidatorUtil.class
  46. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/BeanTools.class
  47. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/CommonUtils.class
  48. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/CookieUtil.class
  49. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/DESUtils.class
  50. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/DateUtils.class
  51. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/EnumUtils.class
  52. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/HttpClientUtils.class
  53. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/MD5Utils.class
  54. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/QRCodeGeneratorUtils.class
  55. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/StringConverter.class
  56. 33
    33
      CODE/smart-community/zuul/src/main/java/com/community/huiju/config/entity/UserElement.java

+ 22
- 0
CODE/smart-community/app-api/pom.xml Näytä tiedosto

@@ -128,6 +128,28 @@
128 128
 			<version>${commons.logging.version}</version>
129 129
 		</dependency>
130 130
 
131
+		<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
132
+		<dependency>
133
+			<groupId>com.google.guava</groupId>
134
+			<artifactId>guava</artifactId>
135
+			<version>26.0-jre</version>
136
+		</dependency>
137
+
138
+		<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
139
+		<dependency>
140
+			<groupId>org.apache.commons</groupId>
141
+			<artifactId>commons-lang3</artifactId>
142
+			<version>3.8.1</version>
143
+		</dependency>
144
+
145
+		<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
146
+		<dependency>
147
+			<groupId>commons-lang</groupId>
148
+			<artifactId>commons-lang</artifactId>
149
+			<version>2.6</version>
150
+		</dependency>
151
+
152
+
131 153
 
132 154
 	</dependencies>
133 155
 

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/AppApplication.java Näytä tiedosto

@@ -4,13 +4,22 @@ import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6 6
 import org.springframework.cloud.openfeign.EnableFeignClients;
7
+import org.springframework.context.annotation.Bean;
8
+import org.springframework.transaction.annotation.EnableTransactionManagement;
9
+import org.springframework.web.client.RestTemplate;
7 10
 
8 11
 @EnableDiscoveryClient
9 12
 @SpringBootApplication
10 13
 @EnableFeignClients
14
+@EnableTransactionManagement
11 15
 public class AppApplication {
12 16
 
13 17
 	public static void main(String[] args) {
14 18
 		SpringApplication.run(AppApplication.class, args);
15 19
 	}
20
+
21
+	@Bean
22
+	public RestTemplate restTemplate(){
23
+		return new RestTemplate();
24
+	}
16 25
 }

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/ICode.java Näytä tiedosto

@@ -0,0 +1,15 @@
1
+package com.community.huiju.common.code;
2
+
3
+
4
+/**
5
+ * 验证码接口
6
+ * @author weiximei
7
+ */
8
+public interface ICode {
9
+
10
+    /**
11
+     * 验证码
12
+     */
13
+    boolean sendCode(String phone,String code);
14
+
15
+}

+ 23
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/entity/CodeEntity.java Näytä tiedosto

@@ -0,0 +1,23 @@
1
+package com.community.huiju.common.code.entity;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+@Data
8
+@AllArgsConstructor
9
+@NoArgsConstructor
10
+public class CodeEntity {
11
+
12
+   private String code;
13
+
14
+   private String tel;
15
+
16
+    /**
17
+     * 参数 格式 String params = "["xxx"]"
18
+     */
19
+   private String params;
20
+
21
+
22
+
23
+}

+ 13
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/impl/ImgCodeImpl.java Näytä tiedosto

@@ -0,0 +1,13 @@
1
+package com.community.huiju.common.code.impl;
2
+
3
+import com.community.huiju.common.code.ICode;
4
+
5
+/**
6
+ * 图片验证码
7
+ * @author weiximei
8
+ */
9
+public class ImgCodeImpl {
10
+
11
+
12
+
13
+}

+ 49
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java Näytä tiedosto

@@ -0,0 +1,49 @@
1
+package com.community.huiju.common.code.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.constant.Constant;
5
+import com.community.huiju.common.code.ICode;
6
+import com.community.huiju.common.code.entity.CodeEntity;
7
+import lombok.extern.log4j.Log4j;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+import org.springframework.web.client.RestTemplate;
12
+
13
+/**
14
+ * 手机验证码
15
+ * @author weiximei
16
+ */
17
+@Service("phoneCodeImpl")
18
+@Slf4j
19
+public class PhoneCodeImpl implements ICode {
20
+
21
+    @Autowired
22
+    private RestTemplate restTemplate;
23
+
24
+
25
+    @Override
26
+    public boolean sendCode(String phone, String code) {
27
+        boolean bool = false;
28
+        CodeEntity codeEntity = new CodeEntity();
29
+        codeEntity.setCode(Constant.CODE);
30
+        codeEntity.setTel(phone);
31
+        codeEntity.setParams("[\""+code+"\"]");
32
+        try {
33
+            String result = restTemplate.postForObject(Constant.REQUEST_URL, JSONObject.toJSONString(codeEntity),String.class);
34
+            if ("发送成功".equals(result)) {
35
+                bool = true;
36
+                log.info("手机号 {} 验证码 {} 发送成功!",phone,code);
37
+            }else {
38
+                bool = false;
39
+                log.error("短信发送验证码失败!{}",result);
40
+            }
41
+        } catch (Exception e){
42
+            e.printStackTrace();
43
+            log.error("短信发送错误!",e);
44
+            bool = false;
45
+        }
46
+
47
+        return bool;
48
+    }
49
+}

+ 21
- 21
CODE/smart-community/app-api/src/main/java/com/community/huiju/config/HttpSessionConfig.java Näytä tiedosto

@@ -1,21 +1,21 @@
1
-package com.community.huiju.config;
2
-
3
-import org.springframework.context.annotation.Bean;
4
-import org.springframework.context.annotation.Configuration;
5
-import org.springframework.session.jdbc.config.annotation.web.http.EnableJdbcHttpSession;
6
-import org.springframework.session.web.http.HeaderHttpSessionIdResolver;
7
-import org.springframework.session.web.http.HttpSessionIdResolver;
8
-
9
-/**
10
- * @author weiximei
11
- */
12
-@Configuration
13
-@EnableJdbcHttpSession
14
-public class HttpSessionConfig {
15
-
16
-    @Bean
17
-    public HttpSessionIdResolver httpSessionIdResolver() {
18
-        return HeaderHttpSessionIdResolver.xAuthToken();
19
-    }
20
-
21
-}
1
+package com.community.huiju.config;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+import org.springframework.session.jdbc.config.annotation.web.http.EnableJdbcHttpSession;
6
+import org.springframework.session.web.http.HeaderHttpSessionIdResolver;
7
+import org.springframework.session.web.http.HttpSessionIdResolver;
8
+
9
+/**
10
+ * @author weiximei
11
+ */
12
+@Configuration
13
+@EnableJdbcHttpSession
14
+public class HttpSessionConfig {
15
+
16
+    @Bean
17
+    public HttpSessionIdResolver httpSessionIdResolver() {
18
+        return HeaderHttpSessionIdResolver.xAuthToken();
19
+    }
20
+
21
+}

+ 34
- 34
CODE/smart-community/app-api/src/main/java/com/community/huiju/config/entity/UserElement.java Näytä tiedosto

@@ -1,34 +1,34 @@
1
-package com.community.huiju.config.entity;
2
-
3
-import lombok.AllArgsConstructor;
4
-import lombok.Data;
5
-import lombok.NoArgsConstructor;
6
-
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-
10
-/**
11
- * session 基础类
12
- */
13
-@Data
14
-@AllArgsConstructor
15
-@NoArgsConstructor
16
-public class UserElement implements Serializable {
17
-
18
-    /** 用户唯一标识符 **/
19
-    private Integer id;
20
-
21
-    /** 用户名 **/
22
-    private String userName;
23
-
24
-    /** 登陆名 **/
25
-    private String loginName;
26
-
27
-    /** 邮箱 **/
28
-    private String email;
29
-
30
-    /** 用户状态 **/
31
-    private String status;
32
-
33
-
34
-}
1
+package com.community.huiju.config.entity;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.io.Serializable;
8
+import java.util.Date;
9
+
10
+/**
11
+ * session 基础类
12
+ */
13
+@Data
14
+@AllArgsConstructor
15
+@NoArgsConstructor
16
+public class UserElement implements Serializable {
17
+
18
+    /** 用户唯一标识符 **/
19
+    private Integer id;
20
+
21
+    /** 用户名 **/
22
+    private String userName;
23
+
24
+    /** 登陆名 **/
25
+    private String loginName;
26
+
27
+    /** 邮箱 **/
28
+    private String email;
29
+
30
+    /** 用户状态 **/
31
+    private String status;
32
+
33
+
34
+}

+ 45
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AgreementController.java Näytä tiedosto

@@ -0,0 +1,45 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.TaAgreement;
5
+import com.community.huiju.service.AgreementServicel;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.cloud.context.config.annotation.RefreshScope;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import java.util.List;
17
+
18
+/**
19
+ * version V1.0
20
+ * class_name: $METHOD_NAME$
21
+ * param: $METHOD_PARAM$
22
+ * describe: TODO
23
+ * creat_user:fannaixi
24
+ * creat_time: 2018/10/22
25
+ **/
26
+
27
+@RestController
28
+@RefreshScope
29
+@RequestMapping("/")
30
+@Api("app端协议相关的API")
31
+public class AgreementController {
32
+
33
+    @Autowired
34
+    private AgreementServicel agreementService;
35
+
36
+    @ApiOperation(value = "获取所有协议", notes = "获取所有协议")
37
+    @RequestMapping(value = "/agreement",method = RequestMethod.GET)
38
+    public ResponseBean getAgreement(){
39
+        ResponseBean responseBean = new ResponseBean();
40
+        TaAgreement agreement = agreementService.getAgreement();
41
+        responseBean.addSuccess(agreement);
42
+        return responseBean;
43
+    }
44
+
45
+}

+ 41
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java Näytä tiedosto

@@ -0,0 +1,41 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.ToBanner;
5
+import com.community.huiju.service.BannerServiceI;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.cloud.context.config.annotation.RefreshScope;
10
+import org.springframework.util.CollectionUtils;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RequestMethod;
13
+import org.springframework.web.bind.annotation.RestController;
14
+
15
+import java.util.List;
16
+
17
+/**
18
+ * @author weichaochao
19
+ * @Title: BannerController
20
+ * @Description: 首页运营banner入口类
21
+ * @date 2018/10/22
22
+ */
23
+@RestController
24
+@RefreshScope
25
+@RequestMapping("/")
26
+@Api("首页运营banner接口类")
27
+public class BannerController {
28
+
29
+    @Autowired
30
+    private BannerServiceI bannerService;
31
+
32
+    @ApiOperation(value = "首页运营banner接口", notes = "获取首页运营banner")
33
+    @RequestMapping(value = "/banners", method = RequestMethod.GET)
34
+    public ResponseBean selectToBannerImg(){
35
+        ResponseBean responseBean = new ResponseBean();
36
+        List<ToBanner> toBannerList = bannerService.viewBannerImg();
37
+        responseBean.addSuccess(toBannerList);
38
+        return responseBean;
39
+    }
40
+
41
+}

+ 46
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CodeController.java Näytä tiedosto

@@ -0,0 +1,46 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.common.code.ICode;
5
+import io.swagger.annotations.Api;
6
+import io.swagger.annotations.ApiImplicitParam;
7
+import io.swagger.annotations.ApiImplicitParams;
8
+import io.swagger.annotations.ApiOperation;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.beans.factory.annotation.Qualifier;
11
+import org.springframework.cloud.context.config.annotation.RefreshScope;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import javax.servlet.http.HttpSession;
17
+
18
+/**
19
+ * @author weiximei
20
+ */
21
+@RestController
22
+@RequestMapping("/code")
23
+@RefreshScope
24
+@Api("获取验证码的API")
25
+public class CodeController {
26
+
27
+    @Autowired
28
+    @Qualifier("phoneCodeImpl")
29
+    private ICode iCode;
30
+
31
+    @ApiOperation(value = "获取手机验证码", notes = "根据手机号发送验证码")
32
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "手机号")})
33
+    @RequestMapping(value = "/sendCode",method = RequestMethod.GET)
34
+    public ResponseBean sendCode(String phone, HttpSession session) {
35
+        ResponseBean response = new ResponseBean();
36
+        int code = (int) ((Math.random()*9+1)*1000);
37
+        boolean result = iCode.sendCode(phone,String.valueOf(code));
38
+        if (result) {
39
+            response.addSuccess("发送成功!");
40
+        } else {
41
+            response.addError("发送失败!");
42
+        }
43
+        return response;
44
+    }
45
+
46
+}

+ 41
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java Näytä tiedosto

@@ -0,0 +1,41 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.ToCommunities;
5
+import com.community.huiju.service.MessageServiceI;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.cloud.context.config.annotation.RefreshScope;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RequestParam;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+import java.util.List;
18
+import java.util.Map;
19
+
20
+/**
21
+ * @author FXF
22
+ * @date 2018-10-22
23
+ */
24
+@RestController
25
+@RefreshScope
26
+@RequestMapping("/")
27
+@Api("app端消息相关的API")
28
+public class MessageController {
29
+	
30
+	@Autowired
31
+	private MessageServiceI messageService;
32
+	
33
+	@ApiOperation(value = "根据小区名获取小区列表", notes = "根据小区名获取小区列表")
34
+	@RequestMapping(value = "/message/total",method = RequestMethod.GET)
35
+	public ResponseBean getMessageTotal(){
36
+		ResponseBean responseBean = new ResponseBean();
37
+		Map<String,Object> totalMap = messageService.getMessageTotal();
38
+		responseBean.addSuccess(totalMap);
39
+		return responseBean;
40
+	}
41
+}

+ 60
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Näytä tiedosto

@@ -0,0 +1,60 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.config.entity.UserElement;
6
+import com.community.huiju.model.TaUser;
7
+import com.community.huiju.service.ITaUserService;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiImplicitParam;
10
+import io.swagger.annotations.ApiImplicitParams;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.beans.BeanUtils;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.cloud.context.config.annotation.RefreshScope;
15
+import org.springframework.web.bind.annotation.RequestBody;
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
+
22
+/**
23
+ * 用户控制器
24
+ * @author weiximei
25
+ */
26
+@RestController
27
+@RefreshScope
28
+@RequestMapping("/user")
29
+@Api("用户相关操作")
30
+public class UserController {
31
+
32
+    @Autowired
33
+    private ITaUserService iTaUserService;
34
+
35
+    @ApiOperation(value = "登录", notes = "根据登录名和密码")
36
+    @ApiImplicitParams({
37
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginName",value = "手机号"),
38
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginPassword",value = "密码")
39
+    })
40
+    @RequestMapping(value = "/login",method = RequestMethod.POST)
41
+    public ResponseBean login(@RequestBody TaUser user, HttpSession session){
42
+        ResponseBean responseBean = iTaUserService.login(user);
43
+        TaUser taUser = (TaUser) responseBean.getData();
44
+
45
+//        userElement.setStatus(taUser.getStatus());
46
+//        userElement.setLoginName(taUser.getLoginName());
47
+//        userElement.setUserName(taUser.getUserName());
48
+//        userElement.setEmail(taUser.getEmail());
49
+//        userElement.setId(taUser.getId());
50
+        if (null != taUser) {
51
+            UserElement userElement = new UserElement();
52
+            BeanUtils.copyProperties(taUser,userElement);
53
+            session.setAttribute(Constant.APP_USER_SESSION,userElement);
54
+        }
55
+
56
+        return responseBean;
57
+
58
+    }
59
+
60
+}

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaAgreementMapper.java Näytä tiedosto

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

+ 35
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserMapper.java Näytä tiedosto

@@ -0,0 +1,35 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TaUser;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+import java.util.Map;
7
+
8
+@Mapper
9
+public interface TaUserMapper {
10
+    int deleteByPrimaryKey(Integer id);
11
+
12
+    int insert(TaUser record);
13
+
14
+    int insertSelective(TaUser record);
15
+
16
+    TaUser selectByPrimaryKey(Integer id);
17
+
18
+    int updateByPrimaryKeySelective(TaUser record);
19
+
20
+    int updateByPrimaryKey(TaUser record);
21
+
22
+    /**
23
+     * 根据loginName和loginPassword 查询用户
24
+     * @param map
25
+     * @return 用户
26
+     */
27
+    TaUser selectByLoginNameAndByLoginPassword(Map<String, Object> map);
28
+
29
+    /**
30
+     * 根据loginName 查询用户
31
+     * @param map
32
+     * @return 用户
33
+     */
34
+    TaUser selectByLoginName(Map<String, Object> map);
35
+}

+ 13
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java Näytä tiedosto

@@ -0,0 +1,13 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ToBanner;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+import java.util.List;
7
+
8
+@Mapper
9
+public interface ToBannerMapper {
10
+
11
+    List<ToBanner> selectByCommunityId(String nowTime);
12
+
13
+}

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java Näytä tiedosto

@@ -0,0 +1,24 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpMessage;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.Map;
8
+
9
+@Mapper
10
+public interface TpMessageMapper {
11
+    int deleteByPrimaryKey(Integer id);
12
+
13
+    int insert(TpMessage record);
14
+
15
+    int insertSelective(TpMessage record);
16
+
17
+    TpMessage selectByPrimaryKey(Integer id);
18
+
19
+    int updateByPrimaryKeySelective(TpMessage record);
20
+
21
+    int updateByPrimaryKey(TpMessage record);
22
+    
23
+    Map<String, Object> getMessageTotal(@Param(value="userId") Integer userId);
24
+}

+ 27
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaAgreement.java Näytä tiedosto

@@ -0,0 +1,27 @@
1
+ package com.community.huiju.model;
2
+import jdk.nashorn.internal.objects.annotations.Getter;
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+
8
+@Data
9
+@AllArgsConstructor
10
+@NoArgsConstructor
11
+public class TaAgreement {
12
+    /**
13
+     * 协议Id
14
+     */
15
+    private Integer id;
16
+
17
+    /**
18
+     * 用户协议信息
19
+     */
20
+    private  String userAgreement;
21
+
22
+    /**
23
+     *保护声明
24
+     */
25
+    private  String urotectionStatement;
26
+
27
+}

+ 178
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUser.java Näytä tiedosto

@@ -0,0 +1,178 @@
1
+package com.community.huiju.model;
2
+
3
+import com.alibaba.fastjson.annotation.JSONField;
4
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
5
+
6
+import java.util.Date;
7
+
8
+public class TaUser {
9
+    private Integer id;
10
+
11
+    private Integer communityId;
12
+
13
+    private Integer buildingOwnerInfoId;
14
+
15
+    private String headPortrait;
16
+
17
+    private String userName;
18
+
19
+    private String loginName;
20
+
21
+    private String loginPassword;
22
+
23
+    private String email;
24
+
25
+    private String gender;
26
+
27
+    private String status;
28
+
29
+    private String remark;
30
+
31
+    private Integer parentId;
32
+
33
+    private String acceptAgreementStatus;
34
+
35
+    private Integer createUser;
36
+
37
+    private Date createDate;
38
+
39
+    private Integer updateUser;
40
+
41
+    private Date updateDate;
42
+
43
+    public Integer getId() {
44
+        return id;
45
+    }
46
+
47
+    public void setId(Integer id) {
48
+        this.id = id;
49
+    }
50
+
51
+    public Integer getCommunityId() {
52
+        return communityId;
53
+    }
54
+
55
+    public void setCommunityId(Integer communityId) {
56
+        this.communityId = communityId;
57
+    }
58
+
59
+    public Integer getBuildingOwnerInfoId() {
60
+        return buildingOwnerInfoId;
61
+    }
62
+
63
+    public void setBuildingOwnerInfoId(Integer buildingOwnerInfoId) {
64
+        this.buildingOwnerInfoId = buildingOwnerInfoId;
65
+    }
66
+
67
+    public String getHeadPortrait() {
68
+        return headPortrait;
69
+    }
70
+
71
+    public void setHeadPortrait(String headPortrait) {
72
+        this.headPortrait = headPortrait == null ? null : headPortrait.trim();
73
+    }
74
+
75
+    public String getUserName() {
76
+        return userName;
77
+    }
78
+
79
+    public void setUserName(String userName) {
80
+        this.userName = userName == null ? null : userName.trim();
81
+    }
82
+
83
+    public String getLoginName() {
84
+        return loginName;
85
+    }
86
+
87
+    public void setLoginName(String loginName) {
88
+        this.loginName = loginName == null ? null : loginName.trim();
89
+    }
90
+
91
+    public String getLoginPassword() {
92
+        return loginPassword;
93
+    }
94
+
95
+    public void setLoginPassword(String loginPassword) {
96
+        this.loginPassword = loginPassword == null ? null : loginPassword.trim();
97
+    }
98
+
99
+    public String getEmail() {
100
+        return email;
101
+    }
102
+
103
+    public void setEmail(String email) {
104
+        this.email = email == null ? null : email.trim();
105
+    }
106
+
107
+    public String getGender() {
108
+        return gender;
109
+    }
110
+
111
+    public void setGender(String gender) {
112
+        this.gender = gender == null ? null : gender.trim();
113
+    }
114
+
115
+    public String getStatus() {
116
+        return status;
117
+    }
118
+
119
+    public void setStatus(String status) {
120
+        this.status = status == null ? null : status.trim();
121
+    }
122
+
123
+    public String getRemark() {
124
+        return remark;
125
+    }
126
+
127
+    public void setRemark(String remark) {
128
+        this.remark = remark == null ? null : remark.trim();
129
+    }
130
+
131
+    public Integer getParentId() {
132
+        return parentId;
133
+    }
134
+
135
+    public void setParentId(Integer parentId) {
136
+        this.parentId = parentId;
137
+    }
138
+
139
+    public String getAcceptAgreementStatus() {
140
+        return acceptAgreementStatus;
141
+    }
142
+
143
+    public void setAcceptAgreementStatus(String acceptAgreementStatus) {
144
+        this.acceptAgreementStatus = acceptAgreementStatus == null ? null : acceptAgreementStatus.trim();
145
+    }
146
+
147
+    public Integer getCreateUser() {
148
+        return createUser;
149
+    }
150
+
151
+    public void setCreateUser(Integer createUser) {
152
+        this.createUser = createUser;
153
+    }
154
+
155
+    public Date getCreateDate() {
156
+        return createDate;
157
+    }
158
+
159
+    public void setCreateDate(Date createDate) {
160
+        this.createDate = createDate;
161
+    }
162
+
163
+    public Integer getUpdateUser() {
164
+        return updateUser;
165
+    }
166
+
167
+    public void setUpdateUser(Integer updateUser) {
168
+        this.updateUser = updateUser;
169
+    }
170
+
171
+    public Date getUpdateDate() {
172
+        return updateDate;
173
+    }
174
+
175
+    public void setUpdateDate(Date updateDate) {
176
+        this.updateDate = updateDate;
177
+    }
178
+}

+ 145
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/ToBanner.java Näytä tiedosto

@@ -0,0 +1,145 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class ToBanner {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private String bannerDescription;
11
+
12
+    private Integer sort;
13
+
14
+    private String bannerCover;
15
+
16
+    private Integer bannerPosition;
17
+
18
+    private Date effTime;
19
+
20
+    private Date expTime;
21
+
22
+    private String bannerType;
23
+
24
+    private String externalLink;
25
+
26
+    private String bannerTitle;
27
+
28
+    private Integer createUser;
29
+
30
+    private Date createDate;
31
+
32
+    private String bannerContent;
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 String getBannerDescription() {
51
+        return bannerDescription;
52
+    }
53
+
54
+    public void setBannerDescription(String bannerDescription) {
55
+        this.bannerDescription = bannerDescription == null ? null : bannerDescription.trim();
56
+    }
57
+
58
+    public Integer getSort() {
59
+        return sort;
60
+    }
61
+
62
+    public void setSort(Integer sort) {
63
+        this.sort = sort;
64
+    }
65
+
66
+    public String getBannerCover() {
67
+        return bannerCover;
68
+    }
69
+
70
+    public void setBannerCover(String bannerCover) {
71
+        this.bannerCover = bannerCover == null ? null : bannerCover.trim();
72
+    }
73
+
74
+    public Integer getBannerPosition() {
75
+        return bannerPosition;
76
+    }
77
+
78
+    public void setBannerPosition(Integer bannerPosition) {
79
+        this.bannerPosition = bannerPosition;
80
+    }
81
+
82
+    public Date getEffTime() {
83
+        return effTime;
84
+    }
85
+
86
+    public void setEffTime(Date effTime) {
87
+        this.effTime = effTime;
88
+    }
89
+
90
+    public Date getExpTime() {
91
+        return expTime;
92
+    }
93
+
94
+    public void setExpTime(Date expTime) {
95
+        this.expTime = expTime;
96
+    }
97
+
98
+    public String getBannerType() {
99
+        return bannerType;
100
+    }
101
+
102
+    public void setBannerType(String bannerType) {
103
+        this.bannerType = bannerType == null ? null : bannerType.trim();
104
+    }
105
+
106
+    public String getExternalLink() {
107
+        return externalLink;
108
+    }
109
+
110
+    public void setExternalLink(String externalLink) {
111
+        this.externalLink = externalLink == null ? null : externalLink.trim();
112
+    }
113
+
114
+    public String getBannerTitle() {
115
+        return bannerTitle;
116
+    }
117
+
118
+    public void setBannerTitle(String bannerTitle) {
119
+        this.bannerTitle = bannerTitle == null ? null : bannerTitle.trim();
120
+    }
121
+
122
+    public Integer getCreateUser() {
123
+        return createUser;
124
+    }
125
+
126
+    public void setCreateUser(Integer createUser) {
127
+        this.createUser = createUser;
128
+    }
129
+
130
+    public Date getCreateDate() {
131
+        return createDate;
132
+    }
133
+
134
+    public void setCreateDate(Date createDate) {
135
+        this.createDate = createDate;
136
+    }
137
+
138
+    public String getBannerContent() {
139
+        return bannerContent;
140
+    }
141
+
142
+    public void setBannerContent(String bannerContent) {
143
+        this.bannerContent = bannerContent == null ? null : bannerContent.trim();
144
+    }
145
+}

+ 175
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java Näytä tiedosto

@@ -0,0 +1,175 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpMessage {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private String messageType;
11
+
12
+    private String adviceType;
13
+
14
+    private String modelType;
15
+
16
+    private Integer uuid;
17
+
18
+    private String uuidType;
19
+
20
+    private String source;
21
+
22
+    private String messageContent;
23
+
24
+    private String status;
25
+
26
+    private String result;
27
+
28
+    private String meaasgeTypeId;
29
+
30
+    private String readStatus;
31
+
32
+    private Integer createUser;
33
+
34
+    private Date createDate;
35
+
36
+    private Integer updateUser;
37
+
38
+    private Date updateDate;
39
+
40
+    public Integer getId() {
41
+        return id;
42
+    }
43
+
44
+    public void setId(Integer id) {
45
+        this.id = id;
46
+    }
47
+
48
+    public Integer getCommunityId() {
49
+        return communityId;
50
+    }
51
+
52
+    public void setCommunityId(Integer communityId) {
53
+        this.communityId = communityId;
54
+    }
55
+
56
+    public String getMessageType() {
57
+        return messageType;
58
+    }
59
+
60
+    public void setMessageType(String messageType) {
61
+        this.messageType = messageType == null ? null : messageType.trim();
62
+    }
63
+
64
+    public String getAdviceType() {
65
+        return adviceType;
66
+    }
67
+
68
+    public void setAdviceType(String adviceType) {
69
+        this.adviceType = adviceType == null ? null : adviceType.trim();
70
+    }
71
+
72
+    public String getModelType() {
73
+        return modelType;
74
+    }
75
+
76
+    public void setModelType(String modelType) {
77
+        this.modelType = modelType == null ? null : modelType.trim();
78
+    }
79
+
80
+    public Integer getUuid() {
81
+        return uuid;
82
+    }
83
+
84
+    public void setUuid(Integer uuid) {
85
+        this.uuid = uuid;
86
+    }
87
+
88
+    public String getUuidType() {
89
+        return uuidType;
90
+    }
91
+
92
+    public void setUuidType(String uuidType) {
93
+        this.uuidType = uuidType == null ? null : uuidType.trim();
94
+    }
95
+
96
+    public String getSource() {
97
+        return source;
98
+    }
99
+
100
+    public void setSource(String source) {
101
+        this.source = source == null ? null : source.trim();
102
+    }
103
+
104
+    public String getMessageContent() {
105
+        return messageContent;
106
+    }
107
+
108
+    public void setMessageContent(String messageContent) {
109
+        this.messageContent = messageContent == null ? null : messageContent.trim();
110
+    }
111
+
112
+    public String getStatus() {
113
+        return status;
114
+    }
115
+
116
+    public void setStatus(String status) {
117
+        this.status = status == null ? null : status.trim();
118
+    }
119
+
120
+    public String getResult() {
121
+        return result;
122
+    }
123
+
124
+    public void setResult(String result) {
125
+        this.result = result == null ? null : result.trim();
126
+    }
127
+
128
+    public String getMeaasgeTypeId() {
129
+        return meaasgeTypeId;
130
+    }
131
+
132
+    public void setMeaasgeTypeId(String meaasgeTypeId) {
133
+        this.meaasgeTypeId = meaasgeTypeId == null ? null : meaasgeTypeId.trim();
134
+    }
135
+
136
+    public String getReadStatus() {
137
+        return readStatus;
138
+    }
139
+
140
+    public void setReadStatus(String readStatus) {
141
+        this.readStatus = readStatus == null ? null : readStatus.trim();
142
+    }
143
+
144
+    public Integer getCreateUser() {
145
+        return createUser;
146
+    }
147
+
148
+    public void setCreateUser(Integer createUser) {
149
+        this.createUser = createUser;
150
+    }
151
+
152
+    public Date getCreateDate() {
153
+        return createDate;
154
+    }
155
+
156
+    public void setCreateDate(Date createDate) {
157
+        this.createDate = createDate;
158
+    }
159
+
160
+    public Integer getUpdateUser() {
161
+        return updateUser;
162
+    }
163
+
164
+    public void setUpdateUser(Integer updateUser) {
165
+        this.updateUser = updateUser;
166
+    }
167
+
168
+    public Date getUpdateDate() {
169
+        return updateDate;
170
+    }
171
+
172
+    public void setUpdateDate(Date updateDate) {
173
+        this.updateDate = updateDate;
174
+    }
175
+}

+ 29
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/AgreementServicel.java Näytä tiedosto

@@ -0,0 +1,29 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.TaAgreement;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * version V1.0
9
+ * class_name: $METHOD_NAME$
10
+ * param: $METHOD_PARAM$
11
+ * describe: TODO
12
+ * creat_user:fannaixi
13
+ * creat_time: 2018/10/22
14
+ **/
15
+public interface AgreementServicel {
16
+    int deleteByPrimaryKey(Integer id);
17
+
18
+    int insert(TaAgreement record);
19
+
20
+    int insertSelective(TaAgreement record);
21
+
22
+    TaAgreement selectByPrimaryKey(Integer id);
23
+
24
+    int updateByPrimaryKeySelective(TaAgreement record);
25
+
26
+    int updateByPrimaryKey(TaAgreement record);
27
+
28
+    TaAgreement getAgreement();
29
+}

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BannerServiceI.java Näytä tiedosto

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.ToBanner;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * @author weichaochao
9
+ * @Title: BannerServiceI
10
+ * @date 2018/10/22
11
+ */
12
+public interface BannerServiceI {
13
+
14
+    List<ToBanner> viewBannerImg();
15
+
16
+}

+ 28
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Näytä tiedosto

@@ -0,0 +1,28 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.TaUser;
5
+
6
+/**
7
+ * 用户业务 接口
8
+ * @author weiximei
9
+ */
10
+public interface ITaUserService {
11
+
12
+    /**
13
+     * 用户登录
14
+     * @param user
15
+     * @return 用户对象
16
+     */
17
+    ResponseBean login(TaUser user);
18
+
19
+    /**
20
+     * 注册用户
21
+     * @param user
22
+     * @return 用户对象
23
+     */
24
+    ResponseBean register(TaUser user);
25
+
26
+
27
+
28
+}

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java Näytä tiedosto

@@ -0,0 +1,7 @@
1
+package com.community.huiju.service;
2
+
3
+import java.util.Map;
4
+
5
+public interface MessageServiceI {
6
+	Map<String, Object> getMessageTotal();
7
+}

+ 55
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/AgreementServiceimpl.java Näytä tiedosto

@@ -0,0 +1,55 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.huiju.dao.TaAgreementMapper;
4
+import com.community.huiju.model.TaAgreement;
5
+import com.community.huiju.service.AgreementServicel;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Service;
8
+
9
+import java.util.List;
10
+
11
+@Service("agreementService")
12
+public class AgreementServiceimpl implements AgreementServicel {
13
+
14
+    @Autowired
15
+    private TaAgreementMapper agreementMapper;
16
+
17
+    @Override
18
+    public int deleteByPrimaryKey(Integer id) {
19
+        return agreementMapper.deleteByPrimaryKey(id);
20
+    }
21
+
22
+    @Override
23
+    public int insert(TaAgreement record) {
24
+        return agreementMapper.insert(record);
25
+    }
26
+
27
+    @Override
28
+    public int insertSelective(TaAgreement record) {
29
+        return agreementMapper.insertSelective(record);
30
+    }
31
+
32
+    @Override
33
+    public TaAgreement selectByPrimaryKey(Integer id) {
34
+        return agreementMapper.selectByPrimaryKey(id);
35
+    }
36
+
37
+    @Override
38
+    public int updateByPrimaryKeySelective(TaAgreement record) {
39
+        return agreementMapper.updateByPrimaryKeySelective(record);
40
+    }
41
+
42
+    @Override
43
+    public int updateByPrimaryKey(TaAgreement record) {
44
+        return agreementMapper.updateByPrimaryKey(record);
45
+    }
46
+
47
+    /**
48
+     *
49
+     * @return
50
+     */
51
+    @Override
52
+    public TaAgreement getAgreement() {
53
+        return agreementMapper.getAgreement();
54
+    }
55
+}

+ 28
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BannerServiceImpl.java Näytä tiedosto

@@ -0,0 +1,28 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.utils.DateUtils;
4
+import com.community.huiju.dao.ToBannerMapper;
5
+import com.community.huiju.model.ToBanner;
6
+import com.community.huiju.service.BannerServiceI;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+import java.util.List;
11
+
12
+/**
13
+ * @author weichaochao
14
+ * @Title: BannerServiceImpl
15
+ * @date 2018/10/22
16
+ */
17
+@Service("/BannerService")
18
+public class BannerServiceImpl implements BannerServiceI {
19
+
20
+    @Autowired
21
+    private ToBannerMapper toBannerMapper;
22
+
23
+    @Override
24
+    public List<ToBanner> viewBannerImg() {
25
+        String nowTime = DateUtils.getDate("yyyy-MM-dd");
26
+        return toBannerMapper.selectByCommunityId(nowTime);
27
+    }
28
+}

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java Näytä tiedosto

@@ -0,0 +1,25 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.huiju.dao.TpMessageMapper;
4
+import com.community.huiju.service.MessageServiceI;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.stereotype.Service;
7
+
8
+import java.util.Map;
9
+
10
+/**
11
+ * @author FXF
12
+ * @date 2018-10-22
13
+ */
14
+@Service("messageService")
15
+public class MessageServiceImpl implements MessageServiceI {
16
+	
17
+	@Autowired
18
+	private TpMessageMapper tpMessageMapper;
19
+	
20
+	@Override
21
+	public Map<String, Object> getMessageTotal() {
22
+		Integer userId = 1;
23
+		return tpMessageMapper.getMessageTotal(userId);
24
+	}
25
+}

+ 76
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Näytä tiedosto

@@ -0,0 +1,76 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.utils.AccountValidatorUtil;
5
+import com.community.commom.utils.MD5Utils;
6
+import com.community.huiju.dao.TaUserMapper;
7
+import com.community.huiju.model.TaUser;
8
+import com.community.huiju.service.ITaUserService;
9
+import com.google.common.collect.Maps;
10
+import lombok.extern.slf4j.Slf4j;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.stereotype.Service;
13
+import org.springframework.transaction.annotation.Transactional;
14
+
15
+import java.util.Date;
16
+import java.util.Map;
17
+
18
+/**
19
+ * 用户业务 实现
20
+ * @author weiximei
21
+ */
22
+@Service("iToUserService")
23
+@Slf4j
24
+public class TaUserServiceImpl implements ITaUserService {
25
+
26
+    @Autowired
27
+    private TaUserMapper taUserMapper;
28
+
29
+    @Transactional
30
+    @Override
31
+    public ResponseBean login(TaUser user) {
32
+        ResponseBean response = new ResponseBean();
33
+        log.info("{} 手机号校验结果: {}",user.getLoginName(),AccountValidatorUtil.isPhone(user.getLoginName()));
34
+        if (!AccountValidatorUtil.isPhone(user.getLoginName())){
35
+            response.addError("请输入正取的手机号!");
36
+            return response;
37
+        }
38
+        Map<String,Object> map = Maps.newHashMap();
39
+        map.put("loginName",user.getLoginName());
40
+        map.put("loginPassword",MD5Utils.encode(user.getLoginPassword()));
41
+        TaUser currentUser = taUserMapper.selectByLoginNameAndByLoginPassword(map);
42
+        if (null != currentUser){
43
+            response.addSuccess(currentUser);
44
+            return response;
45
+        }else {
46
+            // 1.用户在库中,不在则注册一个
47
+            TaUser isTaUser = taUserMapper.selectByLoginName(map);
48
+            if (null == isTaUser) {
49
+                ResponseBean result = register(user);
50
+                response.addSuccess(response.getData());
51
+            }else {
52
+                response.addError("用户名或者密码错误!");
53
+            }
54
+
55
+        }
56
+        return response;
57
+    }
58
+
59
+    @Transactional
60
+    @Override
61
+    public ResponseBean register(TaUser user) {
62
+        ResponseBean<TaUser> response = new ResponseBean();
63
+        // 开始注册
64
+        user.setCreateDate(new Date());
65
+        user.setUpdateDate(new Date());
66
+        user.setStatus("1");
67
+        user.setAcceptAgreementStatus("1");
68
+        user.setUserName(user.getLoginName());
69
+        user.setRemark("这是系统自动注册!");
70
+        user.setLoginPassword(MD5Utils.encode(user.getLoginPassword()));
71
+        taUserMapper.insertSelective(user);
72
+
73
+        response.addSuccess(user);
74
+        return response;
75
+    }
76
+}

+ 76
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaAgreementMapper.xml Näytä tiedosto

@@ -0,0 +1,76 @@
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.TaAgreementMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaAgreement" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="user_agreement" property="userAgreement" jdbcType="VARCHAR" />
7
+    <result column="protection_statement" property="urotectionStatement" jdbcType="VARCHAR" />
8
+  </resultMap>
9
+  <sql id="Base_Column_List" >
10
+    id, user_agreement, protection_statement
11
+  </sql>
12
+
13
+  <select id="getAgreement" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TaAgreement" >
14
+    select
15
+    <include refid="Base_Column_List" />
16
+    from ta_agreement limit 1
17
+  </select>
18
+
19
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
20
+    select 
21
+    <include refid="Base_Column_List" />
22
+    from ta_agreement
23
+    where id = #{id,jdbcType=INTEGER}
24
+  </select>
25
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
26
+    delete from ta_agreement
27
+    where id = #{id,jdbcType=INTEGER}
28
+  </delete>
29
+  <insert id="insert" parameterType="com.community.huiju.model.TaAgreement" >
30
+    insert into ta_agreement (id, user_agreement, protection_statement)
31
+    values (#{id,jdbcType=INTEGER}, #{userAgreement,jdbcType=VARCHAR}, #{protectionStatement,jdbcType=VARCHAR}
32
+  </insert>
33
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaAgreement" >
34
+    insert into ta_agreement
35
+    <trim prefix="(" suffix=")" suffixOverrides="," >
36
+      <if test="id != null" >
37
+        id,
38
+      </if>
39
+      <if test="communityName != null" >
40
+        user_agreement,
41
+      </if>
42
+      <if test="communityAlias != null" >
43
+        protection_statement,
44
+      </if>
45
+    </trim>
46
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
47
+      <if test="id != null" >
48
+        #{id,jdbcType=INTEGER},
49
+      </if>
50
+      <if test="communityName != null" >
51
+        #{userAgreement,jdbcType=VARCHAR},
52
+      </if>
53
+      <if test="communityAlias != null" >
54
+        #{protectionStatement,jdbcType=VARCHAR},
55
+      </if>
56
+    </trim>
57
+  </insert>
58
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaAgreement" >
59
+    update ta_agreement
60
+    <set >
61
+      <if test="communityName != null" >
62
+        user_agreement = #{userAgreement,jdbcType=VARCHAR},
63
+      </if>
64
+      <if test="communityAlias != null" >
65
+        protection_statement = #{protectionStatement,jdbcType=VARCHAR},
66
+      </if>
67
+    </set>
68
+    where id = #{id,jdbcType=INTEGER}
69
+  </update>
70
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaAgreement" >
71
+    update ta_agreement
72
+    set user_agreement = #{userAgreement,jdbcType=VARCHAR},
73
+      protection_statement = #{protectionStatement,jdbcType=VARCHAR},
74
+    where id = #{id,jdbcType=INTEGER}
75
+  </update>
76
+</mapper>

+ 250
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml Näytä tiedosto

@@ -0,0 +1,250 @@
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.TaUserMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaUser" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="building_owner_info_id" property="buildingOwnerInfoId" jdbcType="INTEGER" />
8
+    <result column="head_portrait" property="headPortrait" jdbcType="VARCHAR" />
9
+    <result column="user_name" property="userName" jdbcType="VARCHAR" />
10
+    <result column="login_name" property="loginName" jdbcType="VARCHAR" />
11
+    <!--<result column="login_password" property="loginPassword" jdbcType="VARCHAR" />-->
12
+    <result column="email" property="email" jdbcType="VARCHAR" />
13
+    <result column="gender" property="gender" jdbcType="CHAR" />
14
+    <result column="status" property="status" jdbcType="CHAR" />
15
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
16
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
17
+    <result column="accept_agreement_status" property="acceptAgreementStatus" jdbcType="CHAR" />
18
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
19
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
20
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
21
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
22
+  </resultMap>
23
+  <sql id="Base_Column_List" >
24
+    id, community_id, building_owner_info_id, head_portrait, user_name, login_name, login_password, 
25
+    email, gender, status, remark, parent_id, accept_agreement_status, create_user, create_date, 
26
+    update_user, update_date
27
+  </sql>
28
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
29
+    select 
30
+    <include refid="Base_Column_List" />
31
+    from ta_user
32
+    where id = #{id,jdbcType=INTEGER}
33
+  </select>
34
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
35
+    delete from ta_user
36
+    where id = #{id,jdbcType=INTEGER}
37
+  </delete>
38
+  <insert id="insert" parameterType="com.community.huiju.model.TaUser" >
39
+    insert into ta_user (id, community_id, building_owner_info_id, 
40
+      head_portrait, user_name, login_name, 
41
+      login_password, email, gender, 
42
+      status, remark, parent_id, 
43
+      accept_agreement_status, create_user, create_date, 
44
+      update_user, update_date)
45
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{buildingOwnerInfoId,jdbcType=INTEGER}, 
46
+      #{headPortrait,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR}, 
47
+      #{loginPassword,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR}, 
48
+      #{status,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, 
49
+      #{acceptAgreementStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
50
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
51
+  </insert>
52
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaUser" >
53
+    insert into ta_user
54
+    <trim prefix="(" suffix=")" suffixOverrides="," >
55
+      <if test="id != null" >
56
+        id,
57
+      </if>
58
+      <if test="communityId != null" >
59
+        community_id,
60
+      </if>
61
+      <if test="buildingOwnerInfoId != null" >
62
+        building_owner_info_id,
63
+      </if>
64
+      <if test="headPortrait != null" >
65
+        head_portrait,
66
+      </if>
67
+      <if test="userName != null" >
68
+        user_name,
69
+      </if>
70
+      <if test="loginName != null" >
71
+        login_name,
72
+      </if>
73
+      <if test="loginPassword != null" >
74
+        login_password,
75
+      </if>
76
+      <if test="email != null" >
77
+        email,
78
+      </if>
79
+      <if test="gender != null" >
80
+        gender,
81
+      </if>
82
+      <if test="status != null" >
83
+        status,
84
+      </if>
85
+      <if test="remark != null" >
86
+        remark,
87
+      </if>
88
+      <if test="parentId != null" >
89
+        parent_id,
90
+      </if>
91
+      <if test="acceptAgreementStatus != null" >
92
+        accept_agreement_status,
93
+      </if>
94
+      <if test="createUser != null" >
95
+        create_user,
96
+      </if>
97
+      <if test="createDate != null" >
98
+        create_date,
99
+      </if>
100
+      <if test="updateUser != null" >
101
+        update_user,
102
+      </if>
103
+      <if test="updateDate != null" >
104
+        update_date,
105
+      </if>
106
+    </trim>
107
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
108
+      <if test="id != null" >
109
+        #{id,jdbcType=INTEGER},
110
+      </if>
111
+      <if test="communityId != null" >
112
+        #{communityId,jdbcType=INTEGER},
113
+      </if>
114
+      <if test="buildingOwnerInfoId != null" >
115
+        #{buildingOwnerInfoId,jdbcType=INTEGER},
116
+      </if>
117
+      <if test="headPortrait != null" >
118
+        #{headPortrait,jdbcType=VARCHAR},
119
+      </if>
120
+      <if test="userName != null" >
121
+        #{userName,jdbcType=VARCHAR},
122
+      </if>
123
+      <if test="loginName != null" >
124
+        #{loginName,jdbcType=VARCHAR},
125
+      </if>
126
+      <if test="loginPassword != null" >
127
+        #{loginPassword,jdbcType=VARCHAR},
128
+      </if>
129
+      <if test="email != null" >
130
+        #{email,jdbcType=VARCHAR},
131
+      </if>
132
+      <if test="gender != null" >
133
+        #{gender,jdbcType=CHAR},
134
+      </if>
135
+      <if test="status != null" >
136
+        #{status,jdbcType=CHAR},
137
+      </if>
138
+      <if test="remark != null" >
139
+        #{remark,jdbcType=VARCHAR},
140
+      </if>
141
+      <if test="parentId != null" >
142
+        #{parentId,jdbcType=INTEGER},
143
+      </if>
144
+      <if test="acceptAgreementStatus != null" >
145
+        #{acceptAgreementStatus,jdbcType=CHAR},
146
+      </if>
147
+      <if test="createUser != null" >
148
+        #{createUser,jdbcType=INTEGER},
149
+      </if>
150
+      <if test="createDate != null" >
151
+        #{createDate,jdbcType=TIMESTAMP},
152
+      </if>
153
+      <if test="updateUser != null" >
154
+        #{updateUser,jdbcType=INTEGER},
155
+      </if>
156
+      <if test="updateDate != null" >
157
+        #{updateDate,jdbcType=TIMESTAMP},
158
+      </if>
159
+    </trim>
160
+  </insert>
161
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaUser" >
162
+    update ta_user
163
+    <set >
164
+      <if test="communityId != null" >
165
+        community_id = #{communityId,jdbcType=INTEGER},
166
+      </if>
167
+      <if test="buildingOwnerInfoId != null" >
168
+        building_owner_info_id = #{buildingOwnerInfoId,jdbcType=INTEGER},
169
+      </if>
170
+      <if test="headPortrait != null" >
171
+        head_portrait = #{headPortrait,jdbcType=VARCHAR},
172
+      </if>
173
+      <if test="userName != null" >
174
+        user_name = #{userName,jdbcType=VARCHAR},
175
+      </if>
176
+      <if test="loginName != null" >
177
+        login_name = #{loginName,jdbcType=VARCHAR},
178
+      </if>
179
+      <if test="loginPassword != null" >
180
+        login_password = #{loginPassword,jdbcType=VARCHAR},
181
+      </if>
182
+      <if test="email != null" >
183
+        email = #{email,jdbcType=VARCHAR},
184
+      </if>
185
+      <if test="gender != null" >
186
+        gender = #{gender,jdbcType=CHAR},
187
+      </if>
188
+      <if test="status != null" >
189
+        status = #{status,jdbcType=CHAR},
190
+      </if>
191
+      <if test="remark != null" >
192
+        remark = #{remark,jdbcType=VARCHAR},
193
+      </if>
194
+      <if test="parentId != null" >
195
+        parent_id = #{parentId,jdbcType=INTEGER},
196
+      </if>
197
+      <if test="acceptAgreementStatus != null" >
198
+        accept_agreement_status = #{acceptAgreementStatus,jdbcType=CHAR},
199
+      </if>
200
+      <if test="createUser != null" >
201
+        create_user = #{createUser,jdbcType=INTEGER},
202
+      </if>
203
+      <if test="createDate != null" >
204
+        create_date = #{createDate,jdbcType=TIMESTAMP},
205
+      </if>
206
+      <if test="updateUser != null" >
207
+        update_user = #{updateUser,jdbcType=INTEGER},
208
+      </if>
209
+      <if test="updateDate != null" >
210
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
211
+      </if>
212
+    </set>
213
+    where id = #{id,jdbcType=INTEGER}
214
+  </update>
215
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaUser" >
216
+    update ta_user
217
+    set community_id = #{communityId,jdbcType=INTEGER},
218
+      building_owner_info_id = #{buildingOwnerInfoId,jdbcType=INTEGER},
219
+      head_portrait = #{headPortrait,jdbcType=VARCHAR},
220
+      user_name = #{userName,jdbcType=VARCHAR},
221
+      login_name = #{loginName,jdbcType=VARCHAR},
222
+      login_password = #{loginPassword,jdbcType=VARCHAR},
223
+      email = #{email,jdbcType=VARCHAR},
224
+      gender = #{gender,jdbcType=CHAR},
225
+      status = #{status,jdbcType=CHAR},
226
+      remark = #{remark,jdbcType=VARCHAR},
227
+      parent_id = #{parentId,jdbcType=INTEGER},
228
+      accept_agreement_status = #{acceptAgreementStatus,jdbcType=CHAR},
229
+      create_user = #{createUser,jdbcType=INTEGER},
230
+      create_date = #{createDate,jdbcType=TIMESTAMP},
231
+      update_user = #{updateUser,jdbcType=INTEGER},
232
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
233
+    where id = #{id,jdbcType=INTEGER}
234
+  </update>
235
+
236
+  <select id="selectByLoginNameAndByLoginPassword" parameterType="map" resultMap="BaseResultMap" >
237
+    select
238
+    <include refid="Base_Column_List" />
239
+    from ta_user
240
+    where login_name=#{loginName} and login_password = #{loginPassword}
241
+  </select>
242
+
243
+  <select id="selectByLoginName" parameterType="map" resultMap="BaseResultMap" >
244
+    select
245
+    <include refid="Base_Column_List" />
246
+    from ta_user
247
+    where login_name=#{loginName}
248
+  </select>
249
+
250
+</mapper>

+ 29
- 0
CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml Näytä tiedosto

@@ -0,0 +1,29 @@
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.ToBannerMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToBanner" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="banner_description" property="bannerDescription" jdbcType="VARCHAR" />
8
+    <result column="sort" property="sort" jdbcType="INTEGER" />
9
+    <result column="banner_cover" property="bannerCover" jdbcType="VARCHAR" />
10
+    <result column="banner_position" property="bannerPosition" jdbcType="INTEGER" />
11
+    <result column="eff_time" property="effTime" jdbcType="TIMESTAMP" />
12
+    <result column="exp_time" property="expTime" jdbcType="TIMESTAMP" />
13
+    <result column="banner_type" property="bannerType" jdbcType="CHAR" />
14
+    <result column="external_link" property="externalLink" jdbcType="VARCHAR" />
15
+    <result column="banner_title" property="bannerTitle" jdbcType="VARCHAR" />
16
+    <result column="banner_content" property="bannerContent" jdbcType="VARCHAR" />
17
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
18
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
19
+  </resultMap>
20
+  <sql id="Base_Column_List" >
21
+    id, community_id, banner_description, sort, banner_cover, banner_position, eff_time, 
22
+    exp_time, banner_type, external_link, banner_title, banner_content, create_user, create_date
23
+  </sql>
24
+  <select id="selectByCommunityId" resultMap="BaseResultMap" parameterType="java.lang.String">
25
+    select
26
+    <include refid="Base_Column_List"></include>
27
+    from to_banner t where t.eff_time &lt; #{nowTime} and t.exp_time &gt; #{nowTime} order by t.sort, t.eff_time
28
+  </select>
29
+</mapper>

+ 248
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml Näytä tiedosto

@@ -0,0 +1,248 @@
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.TpMessageMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpMessage" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="message_type" property="messageType" jdbcType="CHAR" />
8
+    <result column="advice_type" property="adviceType" jdbcType="CHAR" />
9
+    <result column="model_type" property="modelType" jdbcType="CHAR" />
10
+    <result column="uuid" property="uuid" jdbcType="INTEGER" />
11
+    <result column="uuid_type" property="uuidType" jdbcType="CHAR" />
12
+    <result column="source" property="source" jdbcType="CHAR" />
13
+    <result column="message_content" property="messageContent" jdbcType="VARCHAR" />
14
+    <result column="status" property="status" jdbcType="CHAR" />
15
+    <result column="result" property="result" jdbcType="VARCHAR" />
16
+    <result column="meaasge_type_id" property="meaasgeTypeId" jdbcType="VARCHAR" />
17
+    <result column="read_status" property="readStatus" jdbcType="CHAR" />
18
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
19
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
20
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
21
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
22
+  </resultMap>
23
+  <sql id="Base_Column_List" >
24
+    id, community_id, message_type, advice_type, model_type, uuid, uuid_type, source, 
25
+    message_content, status, result, meaasge_type_id, read_status, create_user, create_date, 
26
+    update_user, update_date
27
+  </sql>
28
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
29
+    select 
30
+    <include refid="Base_Column_List" />
31
+    from tp_message
32
+    where id = #{id,jdbcType=INTEGER}
33
+  </select>
34
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
35
+    delete from tp_message
36
+    where id = #{id,jdbcType=INTEGER}
37
+  </delete>
38
+  <insert id="insert" parameterType="com.community.huiju.model.TpMessage" >
39
+    insert into tp_message (id, community_id, message_type, 
40
+      advice_type, model_type, uuid, 
41
+      uuid_type, source, message_content, 
42
+      status, result, meaasge_type_id, 
43
+      read_status, create_user, create_date, 
44
+      update_user, update_date)
45
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{messageType,jdbcType=CHAR}, 
46
+      #{adviceType,jdbcType=CHAR}, #{modelType,jdbcType=CHAR}, #{uuid,jdbcType=INTEGER}, 
47
+      #{uuidType,jdbcType=CHAR}, #{source,jdbcType=CHAR}, #{messageContent,jdbcType=VARCHAR}, 
48
+      #{status,jdbcType=CHAR}, #{result,jdbcType=VARCHAR}, #{meaasgeTypeId,jdbcType=VARCHAR}, 
49
+      #{readStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
50
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
51
+  </insert>
52
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpMessage" >
53
+    insert into tp_message
54
+    <trim prefix="(" suffix=")" suffixOverrides="," >
55
+      <if test="id != null" >
56
+        id,
57
+      </if>
58
+      <if test="communityId != null" >
59
+        community_id,
60
+      </if>
61
+      <if test="messageType != null" >
62
+        message_type,
63
+      </if>
64
+      <if test="adviceType != null" >
65
+        advice_type,
66
+      </if>
67
+      <if test="modelType != null" >
68
+        model_type,
69
+      </if>
70
+      <if test="uuid != null" >
71
+        uuid,
72
+      </if>
73
+      <if test="uuidType != null" >
74
+        uuid_type,
75
+      </if>
76
+      <if test="source != null" >
77
+        source,
78
+      </if>
79
+      <if test="messageContent != null" >
80
+        message_content,
81
+      </if>
82
+      <if test="status != null" >
83
+        status,
84
+      </if>
85
+      <if test="result != null" >
86
+        result,
87
+      </if>
88
+      <if test="meaasgeTypeId != null" >
89
+        meaasge_type_id,
90
+      </if>
91
+      <if test="readStatus != null" >
92
+        read_status,
93
+      </if>
94
+      <if test="createUser != null" >
95
+        create_user,
96
+      </if>
97
+      <if test="createDate != null" >
98
+        create_date,
99
+      </if>
100
+      <if test="updateUser != null" >
101
+        update_user,
102
+      </if>
103
+      <if test="updateDate != null" >
104
+        update_date,
105
+      </if>
106
+    </trim>
107
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
108
+      <if test="id != null" >
109
+        #{id,jdbcType=INTEGER},
110
+      </if>
111
+      <if test="communityId != null" >
112
+        #{communityId,jdbcType=INTEGER},
113
+      </if>
114
+      <if test="messageType != null" >
115
+        #{messageType,jdbcType=CHAR},
116
+      </if>
117
+      <if test="adviceType != null" >
118
+        #{adviceType,jdbcType=CHAR},
119
+      </if>
120
+      <if test="modelType != null" >
121
+        #{modelType,jdbcType=CHAR},
122
+      </if>
123
+      <if test="uuid != null" >
124
+        #{uuid,jdbcType=INTEGER},
125
+      </if>
126
+      <if test="uuidType != null" >
127
+        #{uuidType,jdbcType=CHAR},
128
+      </if>
129
+      <if test="source != null" >
130
+        #{source,jdbcType=CHAR},
131
+      </if>
132
+      <if test="messageContent != null" >
133
+        #{messageContent,jdbcType=VARCHAR},
134
+      </if>
135
+      <if test="status != null" >
136
+        #{status,jdbcType=CHAR},
137
+      </if>
138
+      <if test="result != null" >
139
+        #{result,jdbcType=VARCHAR},
140
+      </if>
141
+      <if test="meaasgeTypeId != null" >
142
+        #{meaasgeTypeId,jdbcType=VARCHAR},
143
+      </if>
144
+      <if test="readStatus != null" >
145
+        #{readStatus,jdbcType=CHAR},
146
+      </if>
147
+      <if test="createUser != null" >
148
+        #{createUser,jdbcType=INTEGER},
149
+      </if>
150
+      <if test="createDate != null" >
151
+        #{createDate,jdbcType=TIMESTAMP},
152
+      </if>
153
+      <if test="updateUser != null" >
154
+        #{updateUser,jdbcType=INTEGER},
155
+      </if>
156
+      <if test="updateDate != null" >
157
+        #{updateDate,jdbcType=TIMESTAMP},
158
+      </if>
159
+    </trim>
160
+  </insert>
161
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpMessage" >
162
+    update tp_message
163
+    <set >
164
+      <if test="communityId != null" >
165
+        community_id = #{communityId,jdbcType=INTEGER},
166
+      </if>
167
+      <if test="messageType != null" >
168
+        message_type = #{messageType,jdbcType=CHAR},
169
+      </if>
170
+      <if test="adviceType != null" >
171
+        advice_type = #{adviceType,jdbcType=CHAR},
172
+      </if>
173
+      <if test="modelType != null" >
174
+        model_type = #{modelType,jdbcType=CHAR},
175
+      </if>
176
+      <if test="uuid != null" >
177
+        uuid = #{uuid,jdbcType=INTEGER},
178
+      </if>
179
+      <if test="uuidType != null" >
180
+        uuid_type = #{uuidType,jdbcType=CHAR},
181
+      </if>
182
+      <if test="source != null" >
183
+        source = #{source,jdbcType=CHAR},
184
+      </if>
185
+      <if test="messageContent != null" >
186
+        message_content = #{messageContent,jdbcType=VARCHAR},
187
+      </if>
188
+      <if test="status != null" >
189
+        status = #{status,jdbcType=CHAR},
190
+      </if>
191
+      <if test="result != null" >
192
+        result = #{result,jdbcType=VARCHAR},
193
+      </if>
194
+      <if test="meaasgeTypeId != null" >
195
+        meaasge_type_id = #{meaasgeTypeId,jdbcType=VARCHAR},
196
+      </if>
197
+      <if test="readStatus != null" >
198
+        read_status = #{readStatus,jdbcType=CHAR},
199
+      </if>
200
+      <if test="createUser != null" >
201
+        create_user = #{createUser,jdbcType=INTEGER},
202
+      </if>
203
+      <if test="createDate != null" >
204
+        create_date = #{createDate,jdbcType=TIMESTAMP},
205
+      </if>
206
+      <if test="updateUser != null" >
207
+        update_user = #{updateUser,jdbcType=INTEGER},
208
+      </if>
209
+      <if test="updateDate != null" >
210
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
211
+      </if>
212
+    </set>
213
+    where id = #{id,jdbcType=INTEGER}
214
+  </update>
215
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpMessage" >
216
+    update tp_message
217
+    set community_id = #{communityId,jdbcType=INTEGER},
218
+      message_type = #{messageType,jdbcType=CHAR},
219
+      advice_type = #{adviceType,jdbcType=CHAR},
220
+      model_type = #{modelType,jdbcType=CHAR},
221
+      uuid = #{uuid,jdbcType=INTEGER},
222
+      uuid_type = #{uuidType,jdbcType=CHAR},
223
+      source = #{source,jdbcType=CHAR},
224
+      message_content = #{messageContent,jdbcType=VARCHAR},
225
+      status = #{status,jdbcType=CHAR},
226
+      result = #{result,jdbcType=VARCHAR},
227
+      meaasge_type_id = #{meaasgeTypeId,jdbcType=VARCHAR},
228
+      read_status = #{readStatus,jdbcType=CHAR},
229
+      create_user = #{createUser,jdbcType=INTEGER},
230
+      create_date = #{createDate,jdbcType=TIMESTAMP},
231
+      update_user = #{updateUser,jdbcType=INTEGER},
232
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
233
+    where id = #{id,jdbcType=INTEGER}
234
+  </update>
235
+
236
+  <select id="getMessageTotal" resultType="map" parameterType="java.lang.Integer" >
237
+    SELECT
238
+        count( CASE WHEN model_type = 1 AND read_status = 0 THEN 1 ELSE NULL END ) AS messageTotal,
239
+        count( CASE WHEN model_type = 2 THEN 1 ELSE NULL END ) AS toDoTotal
240
+    FROM
241
+        tp_message
242
+    WHERE
243
+        uuid_type = 1
244
+        AND uuid = #{userId,jdbcType=INTEGER}
245
+        AND STATUS = 1
246
+        AND advice_type = 1
247
+  </select>
248
+</mapper>

+ 28
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Näytä tiedosto

@@ -0,0 +1,28 @@
1
+package com.community.commom.constant;
2
+
3
+/**
4
+ * 定义公共属性
5
+ * @author weiximei
6
+ */
7
+public class Constant {
8
+
9
+    /** APP端session **/
10
+    public static final String APP_USER_SESSION = "appUser";
11
+
12
+    /** WEB端session **/
13
+    public static final String WEB_USER_SESSION = "webUser";
14
+
15
+    /** 手机验证码 **/
16
+    public static final String SESSION_PHONE_CODE = "phone_code";
17
+
18
+    /** 图形验证码 **/
19
+    public static final String SESSION_OMG_CODE = "img_code";
20
+
21
+    /** 手机验证码 模板 **/
22
+    public static final String CODE = "0201";
23
+
24
+    /** 请求发送验证码的远程服务器地址 **/
25
+    public static final String REQUEST_URL = "http://micservice.ycjcjy.com/sms";
26
+
27
+
28
+}

+ 38
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/utils/AccountValidatorUtil.java Näytä tiedosto

@@ -0,0 +1,38 @@
1
+package com.community.commom.utils;
2
+
3
+import java.util.regex.Matcher;
4
+import java.util.regex.Pattern;
5
+
6
+/**
7
+ * 校验类
8
+ * @author weiximei
9
+ */
10
+public class AccountValidatorUtil {
11
+
12
+    /**
13
+     * 校验手机号
14
+     * @param phone
15
+     * @return
16
+     */
17
+        public static boolean isPhone(String phone) {
18
+            String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$";
19
+            if (phone.length() != 11) {
20
+                //MToast.showToast("手机号应为11位数");
21
+                return false;
22
+            } else {
23
+                Pattern p = Pattern.compile(regex);
24
+                Matcher m = p.matcher(phone);
25
+                boolean isMatch = m.matches();
26
+                if (!isMatch) {
27
+                    //MToast.showToast("请填入正确的手机号");
28
+                }
29
+                return isMatch;
30
+            }
31
+        }
32
+
33
+
34
+    public static void main(String[] args) {
35
+        System.out.println(isPhone("15871301059"));
36
+    }
37
+
38
+}

BIN
CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/FastJsonSerializer.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisConfiguration.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisJsonSerializer.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisObjectSerializer.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisSerializer.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/RedisTemplate.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/SerializationFailedException.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/SingleRedisTemplate.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/AccountValidatorUtil.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/BeanTools.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/CommonUtils.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/CookieUtil.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/DESUtils.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/DateUtils.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/EnumUtils.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/HttpClientUtils.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/MD5Utils.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/QRCodeGeneratorUtils.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/StringConverter.class Näytä tiedosto


+ 33
- 33
CODE/smart-community/zuul/src/main/java/com/community/huiju/config/entity/UserElement.java Näytä tiedosto

@@ -1,33 +1,33 @@
1
-package com.community.huiju.config.entity;
2
-
3
-import lombok.AllArgsConstructor;
4
-import lombok.Data;
5
-import lombok.NoArgsConstructor;
6
-
7
-import java.io.Serializable;
8
-
9
-/**
10
- * session 基础类
11
- */
12
-@Data
13
-@AllArgsConstructor
14
-@NoArgsConstructor
15
-public class UserElement implements Serializable {
16
-
17
-    /** 用户唯一标识符 **/
18
-    private Integer id;
19
-
20
-    /** 用户名 **/
21
-    private String userName;
22
-
23
-    /** 登陆名 **/
24
-    private String loginName;
25
-
26
-    /** 邮箱 **/
27
-    private String email;
28
-
29
-    /** 用户状态 **/
30
-    private String status;
31
-
32
-
33
-}
1
+package com.community.huiju.config.entity;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.io.Serializable;
8
+
9
+/**
10
+ * session 基础类
11
+ */
12
+@Data
13
+@AllArgsConstructor
14
+@NoArgsConstructor
15
+public class UserElement implements Serializable {
16
+
17
+    /** 用户唯一标识符 **/
18
+    private Integer id;
19
+
20
+    /** 用户名 **/
21
+    private String userName;
22
+
23
+    /** 登陆名 **/
24
+    private String loginName;
25
+
26
+    /** 邮箱 **/
27
+    private String email;
28
+
29
+    /** 用户状态 **/
30
+    private String status;
31
+
32
+
33
+}