魏熙美 6 年之前
父節點
當前提交
c9b186674f
共有 35 個文件被更改,包括 776 次插入15 次删除
  1. 1
    0
      CODE/foreign-service/pom.xml
  2. 6
    2
      CODE/foreign-service/src/main/java/com/community/huiju/ForeignServiceApplication.java
  3. 3
    2
      CODE/foreign-service/src/main/java/com/community/huiju/aop/LogAOP.java
  4. 40
    0
      CODE/foreign-service/src/main/java/com/community/huiju/config/Swagger2.java
  5. 1
    1
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TaUserController.java
  6. 77
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpAddressController.java
  7. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpLevelController.java
  8. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpRoomNoController.java
  9. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpUnitController.java
  10. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpLevelMapper.java
  11. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java
  12. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpUnitMapper.java
  13. 1
    0
      CODE/foreign-service/src/main/java/com/community/huiju/enums/ResponseErrorsMessages.java
  14. 9
    0
      CODE/foreign-service/src/main/java/com/community/huiju/exception/ExceptionHandleAdice.java
  15. 4
    2
      CODE/foreign-service/src/main/java/com/community/huiju/model/TaUser.java
  16. 3
    1
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpBuilding.java
  17. 84
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpLevel.java
  18. 2
    1
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpPhase.java
  19. 94
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpRoomNo.java
  20. 74
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpUnit.java
  21. 9
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpBuildingService.java
  22. 27
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpLevelService.java
  23. 28
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpRoomNoService.java
  24. 26
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpUnitService.java
  25. 2
    1
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  26. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpBuildingServiceImpl.java
  27. 36
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpLevelServiceImpl.java
  28. 38
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpRoomNoServiceImpl.java
  29. 35
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpUnitServiceImpl.java
  30. 5
    2
      CODE/foreign-service/src/main/resources/application.yml
  31. 5
    0
      CODE/foreign-service/src/main/resources/mapper/TpLevelMapper.xml
  32. 5
    0
      CODE/foreign-service/src/main/resources/mapper/TpRoomNoMapper.xml
  33. 5
    0
      CODE/foreign-service/src/main/resources/mapper/TpUnitMapper.xml
  34. 1
    1
      CODE/smart-community/community-common/src/main/java/com/community/commom/fushi/FuShiRequestAPI.java
  35. 31
    2
      CODE/smart-community/community-common/src/main/java/com/community/commom/fushi/error/FuShiException.java

+ 1
- 0
CODE/foreign-service/pom.xml 查看文件

@@ -31,6 +31,7 @@
31 31
         <dependency>
32 32
             <groupId>mysql</groupId>
33 33
             <artifactId>mysql-connector-java</artifactId>
34
+            <version>6.0.6</version>
34 35
             <scope>runtime</scope>
35 36
         </dependency>
36 37
         <dependency>

+ 6
- 2
CODE/foreign-service/src/main/java/com/community/huiju/ForeignServiceApplication.java 查看文件

@@ -3,12 +3,16 @@ package com.community.huiju;
3 3
 import com.alibaba.fastjson.serializer.SerializerFeature;
4 4
 import com.alibaba.fastjson.support.config.FastJsonConfig;
5 5
 import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
6
+import org.mybatis.spring.annotation.MapperScan;
6 7
 import org.springframework.boot.SpringApplication;
7 8
 import org.springframework.boot.autoconfigure.SpringBootApplication;
8 9
 import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
9 10
 import org.springframework.context.annotation.Bean;
11
+import org.springframework.transaction.annotation.EnableTransactionManagement;
10 12
 
11 13
 @SpringBootApplication
14
+@MapperScan("com.community.huiju.dao")
15
+@EnableTransactionManagement
12 16
 public class ForeignServiceApplication {
13 17
 
14 18
     public static void main(String[] args) {
@@ -19,9 +23,9 @@ public class ForeignServiceApplication {
19 23
     public HttpMessageConverters fastJsonConfigure(){
20 24
         FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
21 25
         FastJsonConfig fastJsonConfig = new FastJsonConfig();
22
-        fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat,SerializerFeature.DisableCircularReferenceDetect,SerializerFeature.WriteMapNullValue, SerializerFeature.BrowserCompatible);
26
+        fastJsonConfig.setSerializerFeatures(SerializerFeature.BrowserCompatible, SerializerFeature.PrettyFormat,SerializerFeature.DisableCircularReferenceDetect,SerializerFeature.WriteMapNullValue);
23 27
         //日期格式化
24
-        //fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss");
28
+        fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss");
25 29
         converter.setFastJsonConfig(fastJsonConfig);
26 30
         return new HttpMessageConverters(converter);
27 31
     }

+ 3
- 2
CODE/foreign-service/src/main/java/com/community/huiju/aop/LogAOP.java 查看文件

@@ -83,8 +83,9 @@ public class LogAOP {
83 83
 
84 84
     @AfterThrowing(value = "pointLog()", throwing = "cause")
85 85
     public void doException(JoinPoint joinPoint, Throwable cause) {
86
-        if (null != cause) {
87
-            throw new FuShiException(cause.getMessage());
86
+        if (null != cause && cause instanceof FuShiException) {
87
+            FuShiException fuShiException = (FuShiException)cause;
88
+            throw new FuShiException(fuShiException.getCode(), fuShiException.getMessage());
88 89
         }
89 90
     }
90 91
 

+ 40
- 0
CODE/foreign-service/src/main/java/com/community/huiju/config/Swagger2.java 查看文件

@@ -0,0 +1,40 @@
1
+package com.community.huiju.config;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+import springfox.documentation.builders.ApiInfoBuilder;
6
+import springfox.documentation.builders.PathSelectors;
7
+import springfox.documentation.builders.RequestHandlerSelectors;
8
+import springfox.documentation.service.ApiInfo;
9
+import springfox.documentation.service.Contact;
10
+import springfox.documentation.spi.DocumentationType;
11
+import springfox.documentation.spring.web.plugins.Docket;
12
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
13
+
14
+/**
15
+ * @author FXF
16
+ * @date 2018-09-27
17
+ */
18
+@Configuration
19
+@EnableSwagger2
20
+public class Swagger2 {
21
+    @Bean
22
+    public Docket docket(){
23
+        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
24
+                .apis(RequestHandlerSelectors.basePackage("com.community.huiju.controller"))
25
+                .paths(PathSelectors.any()).build();
26
+    }
27
+    //构建api文档的详细信息函数
28
+    private ApiInfo apiInfo(){
29
+        return new ApiInfoBuilder()
30
+                //页面标题
31
+                .title("对外接口 的 RESTful API")
32
+                //创建人
33
+                .contact(new Contact("fuxingfan","","fuxingfan@dingtalk.com"))
34
+                //版本号
35
+                .version("1.0")
36
+                //描述
37
+                .description("API 描述")
38
+                .build();
39
+    }
40
+}

+ 1
- 1
CODE/foreign-service/src/main/java/com/community/huiju/controller/TaUserController.java 查看文件

@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
21 21
  */
22 22
 @RestController
23 23
 @RequestMapping("/")
24
-@Api(value = "用户操作 API")
24
+@Api(value = "用户操作 API", description = "用户操作 API")
25 25
 public class TaUserController extends BaseController {
26 26
 
27 27
     @Autowired

+ 77
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpAddressController.java 查看文件

@@ -0,0 +1,77 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.service.*;
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.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
+/**
18
+ * <p>
19
+ * 小区楼栋资料表 前端控制器
20
+ * </p>
21
+ *
22
+ * @author jobob
23
+ * @since 2019-05-15
24
+ */
25
+@RestController
26
+@RequestMapping("/")
27
+@Api(value = "楼栋资料 API", description = "楼栋资料 API")
28
+public class TpAddressController extends BaseController {
29
+
30
+    @Autowired
31
+    private ITpPhaseService iTpPhaseService;
32
+
33
+    @Autowired
34
+    private ITpBuildingService iTpBuildingService;
35
+
36
+    @Autowired
37
+    private ITpLevelService iTpLevelService;
38
+
39
+    @Autowired
40
+    private ITpUnitService iTpUnitService;
41
+
42
+    @Autowired
43
+    private ITpRoomNoService iTpRoomNoService;
44
+
45
+    @RequestMapping(value = "/building/info", method = RequestMethod.GET)
46
+    @ApiOperation(value = "查询 期/栋/单元/楼层/户号 列表", notes = "查询 期/栋/单元/楼层/户号 列表")
47
+    @ApiImplicitParams({
48
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "communityId", value = "小区id"),
49
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "phaseId", value = "期id"),
50
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "buildingId", value = "楼栋id"),
51
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "unitId", value = "单元id"),
52
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "levelId", value = "楼层id"),
53
+    })
54
+    public ResponseBean getBuildingInfo(@RequestParam("communityId") Integer communityId,
55
+                                        @RequestParam(value = "phaseId", required = false) Integer phaseId,
56
+                                        @RequestParam(value = "buildingId", required = false) Integer buildingId,
57
+                                        @RequestParam(value = "unitId", required = false) Integer unitId,
58
+                                        @RequestParam(value = "levelId", required = false) Integer levelId) {
59
+
60
+        ResponseBean responseBean = new ResponseBean();
61
+        if (null == phaseId && null == buildingId && null == unitId && null == levelId) {
62
+            responseBean = iTpPhaseService.getPhase(communityId);
63
+        } else if (null == buildingId && null == unitId && null == levelId) {
64
+            responseBean = iTpBuildingService.getBuilding(communityId, phaseId);
65
+        } else if (null == unitId && null == levelId) {
66
+            responseBean = iTpUnitService.getUnit(communityId, phaseId, buildingId);
67
+        } else if (null == levelId) {
68
+            responseBean = iTpLevelService.getLevel(communityId, phaseId, buildingId, unitId);
69
+        } else {
70
+            responseBean = iTpRoomNoService.getRoomNo(communityId, phaseId, buildingId, unitId, levelId);
71
+        }
72
+
73
+        return responseBean;
74
+
75
+    }
76
+
77
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpLevelController.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 小区楼层资料表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpLevelController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpRoomNoController.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 户号信息表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpRoomNoController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpUnitController.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 小区单元资料表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpUnitController extends BaseController {
19
+
20
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpLevelMapper.java 查看文件

@@ -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.TpLevel;
5
+
6
+/**
7
+ * <p>
8
+ * 小区楼层资料表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpLevelMapper extends BaseMapper<TpLevel> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java 查看文件

@@ -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.TpRoomNo;
5
+
6
+/**
7
+ * <p>
8
+ * 户号信息表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpUnitMapper.java 查看文件

@@ -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.TpUnit;
5
+
6
+/**
7
+ * <p>
8
+ * 小区单元资料表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpUnitMapper extends BaseMapper<TpUnit> {
15
+
16
+}

+ 1
- 0
CODE/foreign-service/src/main/java/com/community/huiju/enums/ResponseErrorsMessages.java 查看文件

@@ -13,6 +13,7 @@ public enum ResponseErrorsMessages {
13 13
     NOT_GENDER(1003, "性别不能为空!"),
14 14
     EXISTING_GENDER(1004, "手机号已存在!"),
15 15
     NOT_USER(1004, "用户不存在!"),
16
+    NOT_LICENSE(44036, "未找到该车辆的月卡信息!"),
16 17
     ;
17 18
 
18 19
 

+ 9
- 0
CODE/foreign-service/src/main/java/com/community/huiju/exception/ExceptionHandleAdice.java 查看文件

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.exception;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4
+import com.community.commom.fushi.error.FuShiException;
4 5
 import com.community.huiju.common.base.ResponseBean;
5 6
 import com.community.huiju.enums.ResponseErrorsMessages;
6 7
 import lombok.extern.slf4j.Slf4j;
@@ -39,5 +40,13 @@ public class ExceptionHandleAdice {
39 40
         return response;
40 41
     }
41 42
 
43
+    @ExceptionHandler(FuShiException.class)
44
+    public ResponseBean handleException(FuShiException e) {
45
+        log.error(e.getMessage(),e);
46
+        ResponseBean response = new ResponseBean();
47
+        response.addError(e.getCode(),e.getMessage());
48
+        return response;
49
+    }
50
+
42 51
 
43 52
 }

+ 4
- 2
CODE/foreign-service/src/main/java/com/community/huiju/model/TaUser.java 查看文件

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import com.baomidou.mybatisplus.annotation.TableName;
6 7
 import lombok.Data;
@@ -9,6 +10,7 @@ import lombok.experimental.Accessors;
9 10
 
10 11
 import java.io.Serializable;
11 12
 import java.time.LocalDateTime;
13
+import java.util.Date;
12 14
 
13 15
 /**
14 16
  * <p>
@@ -102,7 +104,7 @@ public class TaUser implements Serializable {
102 104
     /**
103 105
      * 创建时间
104 106
      */
105
-    private LocalDateTime createDate;
107
+    private Date createDate;
106 108
 
107 109
     /**
108 110
      * 更新人
@@ -112,7 +114,7 @@ public class TaUser implements Serializable {
112 114
     /**
113 115
      * 更新时间
114 116
      */
115
-    private LocalDateTime updateDate;
117
+    private Date updateDate;
116 118
 
117 119
     /**
118 120
      * 海康人员编号

+ 3
- 1
CODE/foreign-service/src/main/java/com/community/huiju/model/TpBuilding.java 查看文件

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
5 5
 import com.baomidou.mybatisplus.annotation.TableName;
6 6
 import java.time.LocalDateTime;
7 7
 import java.io.Serializable;
8
+import java.util.Date;
9
+
8 10
 import lombok.Data;
9 11
 import lombok.EqualsAndHashCode;
10 12
 import lombok.experimental.Accessors;
@@ -56,7 +58,7 @@ public class TpBuilding implements Serializable {
56 58
     /**
57 59
      * 创建时间
58 60
      */
59
-    private LocalDateTime createDate;
61
+    private Date createDate;
60 62
 
61 63
 
62 64
 }

+ 84
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpLevel.java 查看文件

@@ -0,0 +1,84 @@
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
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 小区楼层资料表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_level")
26
+public class TpLevel implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer levelId;
32
+
33
+    /**
34
+     * 小区ID
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 期区ID
40
+     */
41
+    private Integer phaseId;
42
+
43
+    /**
44
+     * 期区名称
45
+     */
46
+    private String phaseName;
47
+
48
+    /**
49
+     * 楼栋ID
50
+     */
51
+    private Integer buildingId;
52
+
53
+    /**
54
+     * 楼栋名称
55
+     */
56
+    private String buildingName;
57
+
58
+    /**
59
+     * 单元ID
60
+     */
61
+    private Integer unitId;
62
+
63
+    /**
64
+     * 单元名称
65
+     */
66
+    private String unitName;
67
+
68
+    /**
69
+     * 楼层名称
70
+     */
71
+    private String name;
72
+
73
+    /**
74
+     * 排序
75
+     */
76
+    private String sort;
77
+
78
+    /**
79
+     * 创建时间
80
+     */
81
+    private Date createDate;
82
+
83
+
84
+}

+ 2
- 1
CODE/foreign-service/src/main/java/com/community/huiju/model/TpPhase.java 查看文件

@@ -10,6 +10,7 @@ import lombok.experimental.Accessors;
10 10
 
11 11
 import java.io.Serializable;
12 12
 import java.time.LocalDateTime;
13
+import java.util.Date;
13 14
 
14 15
 /**
15 16
  * <p>
@@ -49,7 +50,7 @@ public class TpPhase implements Serializable {
49 50
     /**
50 51
      * 创建时间
51 52
      */
52
-    private LocalDateTime createDate;
53
+    private Date createDate;
53 54
 
54 55
 
55 56
 }

+ 94
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpRoomNo.java 查看文件

@@ -0,0 +1,94 @@
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
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 户号信息表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_room_no")
26
+public class TpRoomNo implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer roomNoId;
32
+
33
+    /**
34
+     * 小区id
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 期区ID
40
+     */
41
+    private Integer phaseId;
42
+
43
+    /**
44
+     * 期区名称
45
+     */
46
+    private String phaseName;
47
+
48
+    /**
49
+     * 楼栋ID
50
+     */
51
+    private Integer buildingId;
52
+
53
+    /**
54
+     * 楼栋姓名
55
+     */
56
+    private String buildingName;
57
+
58
+    /**
59
+     * 单元ID
60
+     */
61
+    private Integer unitId;
62
+
63
+    /**
64
+     * 单元名称
65
+     */
66
+    private String unitName;
67
+
68
+    /**
69
+     * 楼层ID
70
+     */
71
+    private Integer levelId;
72
+
73
+    /**
74
+     * 楼层名字
75
+     */
76
+    private String levelName;
77
+
78
+    /**
79
+     * 户号
80
+     */
81
+    private String name;
82
+
83
+    /**
84
+     * 排序
85
+     */
86
+    private String sort;
87
+
88
+    /**
89
+     * 创建时间
90
+     */
91
+    private Date createDate;
92
+
93
+
94
+}

+ 74
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpUnit.java 查看文件

@@ -0,0 +1,74 @@
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
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 小区单元资料表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_unit")
26
+public class TpUnit implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer unitId;
32
+
33
+    /**
34
+     * 小区ID
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 期区ID
40
+     */
41
+    private Integer phaseId;
42
+
43
+    /**
44
+     * 期区名称
45
+     */
46
+    private String phaseName;
47
+
48
+    /**
49
+     * 楼栋ID
50
+     */
51
+    private Integer buildingId;
52
+
53
+    /**
54
+     * 楼栋名称
55
+     */
56
+    private String buildingName;
57
+
58
+    /**
59
+     * 单元名称
60
+     */
61
+    private String name;
62
+
63
+    /**
64
+     * 排序
65
+     */
66
+    private String sort;
67
+
68
+    /**
69
+     * 创建时间
70
+     */
71
+    private Date createDate;
72
+
73
+
74
+}

+ 9
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpBuildingService.java 查看文件

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
4 5
 import com.community.huiju.model.TpBuilding;
5 6
 
6 7
 /**
@@ -13,4 +14,12 @@ import com.community.huiju.model.TpBuilding;
13 14
  */
14 15
 public interface ITpBuildingService extends IService<TpBuilding> {
15 16
 
17
+    /**
18
+     * 查询 栋
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @return
22
+     */
23
+    ResponseBean getBuilding(Integer communityId, Integer phaseId);
24
+
16 25
 }

+ 27
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpLevelService.java 查看文件

@@ -0,0 +1,27 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpLevel;
6
+
7
+/**
8
+ * <p>
9
+ * 小区楼层资料表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpLevelService extends IService<TpLevel> {
16
+
17
+    /**
18
+     * 获取 楼层
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @param buildingId
22
+     * @param unitId
23
+     * @return
24
+     */
25
+    ResponseBean getLevel(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId);
26
+
27
+}

+ 28
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpRoomNoService.java 查看文件

@@ -0,0 +1,28 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpRoomNo;
6
+
7
+/**
8
+ * <p>
9
+ * 户号信息表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpRoomNoService extends IService<TpRoomNo> {
16
+
17
+    /**
18
+     * 获取 户号
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @param buildingId
22
+     * @param unitId
23
+     * @param levelId
24
+     * @return
25
+     */
26
+    ResponseBean getRoomNo(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId);
27
+
28
+}

+ 26
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpUnitService.java 查看文件

@@ -0,0 +1,26 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpUnit;
6
+
7
+/**
8
+ * <p>
9
+ * 小区单元资料表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpUnitService extends IService<TpUnit> {
16
+
17
+    /**
18
+     * 查询 单元
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @param buildingId
22
+     * @return
23
+     */
24
+    ResponseBean getUnit(Integer communityId, Integer phaseId, Integer buildingId);
25
+
26
+}

+ 2
- 1
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java 查看文件

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
14 14
 import org.springframework.transaction.annotation.Transactional;
15 15
 
16 16
 import java.time.LocalDateTime;
17
+import java.util.Date;
17 18
 
18 19
 /**
19 20
  * <p>
@@ -60,7 +61,7 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
60 61
         taUser.setUserName(userName);
61 62
         taUser.setIdCard(idCard);
62 63
         taUser.setLoginName(phone);
63
-        taUser.setCreateDate(LocalDateTime.now());
64
+        taUser.setCreateDate(new Date());
64 65
 
65 66
         boolean saveBool = this.save(taUser);
66 67
         if (saveBool) {

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpBuildingServiceImpl.java 查看文件

@@ -1,11 +1,15 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.huiju.common.base.ResponseBean;
4 6
 import com.community.huiju.model.TpBuilding;
5 7
 import com.community.huiju.dao.TpBuildingMapper;
6 8
 import com.community.huiju.service.ITpBuildingService;
7 9
 import org.springframework.stereotype.Service;
8 10
 
11
+import java.util.List;
12
+
9 13
 /**
10 14
  * <p>
11 15
  * 小区楼栋资料表 服务实现类
@@ -17,4 +21,16 @@ import org.springframework.stereotype.Service;
17 21
 @Service
18 22
 public class TpBuildingServiceImpl extends ServiceImpl<TpBuildingMapper, TpBuilding> implements ITpBuildingService {
19 23
 
24
+
25
+    @Override
26
+    public ResponseBean getBuilding(Integer communityId, Integer phaseId) {
27
+        ResponseBean responseBean = new ResponseBean();
28
+
29
+        QueryWrapper<TpBuilding> buildingQueryWrapper = new QueryWrapper<>();
30
+        buildingQueryWrapper.eq("community_id", communityId);
31
+        buildingQueryWrapper.eq("phase_id", phaseId);
32
+        List<TpBuilding> list = this.list(buildingQueryWrapper);
33
+        responseBean.addSuccess(list);
34
+        return responseBean;
35
+    }
20 36
 }

+ 36
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpLevelServiceImpl.java 查看文件

@@ -0,0 +1,36 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.model.TpLevel;
7
+import com.community.huiju.dao.TpLevelMapper;
8
+import com.community.huiju.service.ITpLevelService;
9
+import org.springframework.stereotype.Service;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 小区楼层资料表 服务实现类
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-05-15
20
+ */
21
+@Service
22
+public class TpLevelServiceImpl extends ServiceImpl<TpLevelMapper, TpLevel> implements ITpLevelService {
23
+
24
+    @Override
25
+    public ResponseBean getLevel(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId) {
26
+        ResponseBean responseBean = new ResponseBean();
27
+        QueryWrapper<TpLevel> queryWrapper = new QueryWrapper<>();
28
+        queryWrapper.eq("community_id", communityId);
29
+        queryWrapper.eq("phase_id", phaseId);
30
+        queryWrapper.eq("building_id", buildingId);
31
+        queryWrapper.eq("unit_id", unitId);
32
+        List<TpLevel> list = this.list(queryWrapper);
33
+        responseBean.addSuccess(list);
34
+        return responseBean;
35
+    }
36
+}

+ 38
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpRoomNoServiceImpl.java 查看文件

@@ -0,0 +1,38 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.model.TpRoomNo;
7
+import com.community.huiju.dao.TpRoomNoMapper;
8
+import com.community.huiju.service.ITpRoomNoService;
9
+import org.springframework.stereotype.Service;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 户号信息表 服务实现类
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-05-15
20
+ */
21
+@Service
22
+public class TpRoomNoServiceImpl extends ServiceImpl<TpRoomNoMapper, TpRoomNo> implements ITpRoomNoService {
23
+
24
+    @Override
25
+    public ResponseBean getRoomNo(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId) {
26
+        ResponseBean responseBean = new ResponseBean();
27
+
28
+        QueryWrapper<TpRoomNo> queryWrapper = new QueryWrapper<>();
29
+        queryWrapper.eq("community_id", communityId);
30
+        queryWrapper.eq("phase_id", phaseId);
31
+        queryWrapper.eq("building_id", buildingId);
32
+        queryWrapper.eq("unit_id", unitId);
33
+        queryWrapper.eq("level_id", levelId);
34
+        List<TpRoomNo> list = this.list(queryWrapper);
35
+        responseBean.addSuccess(list);
36
+        return responseBean;
37
+    }
38
+}

+ 35
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpUnitServiceImpl.java 查看文件

@@ -0,0 +1,35 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.model.TpUnit;
7
+import com.community.huiju.dao.TpUnitMapper;
8
+import com.community.huiju.service.ITpUnitService;
9
+import org.springframework.stereotype.Service;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 小区单元资料表 服务实现类
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-05-15
20
+ */
21
+@Service
22
+public class TpUnitServiceImpl extends ServiceImpl<TpUnitMapper, TpUnit> implements ITpUnitService {
23
+
24
+    @Override
25
+    public ResponseBean getUnit(Integer communityId, Integer phaseId, Integer buildingId) {
26
+        ResponseBean responseBean = new ResponseBean();
27
+        QueryWrapper<TpUnit> queryWrapper = new QueryWrapper<>();
28
+        queryWrapper.eq("community_id", communityId);
29
+        queryWrapper.eq("phase_id", phaseId);
30
+        queryWrapper.eq("building_id", buildingId);
31
+        List<TpUnit> list = this.list(queryWrapper);
32
+        responseBean.addSuccess(list);
33
+        return responseBean;
34
+    }
35
+}

+ 5
- 2
CODE/foreign-service/src/main/resources/application.yml 查看文件

@@ -3,8 +3,11 @@ server:
3 3
 spring:
4 4
   application:
5 5
     name: foreign-service
6
-  profiles: dev
7
-
6
+  profiles:
7
+    active: dev
8
+  aop:
9
+    auto: true
10
+    proxy-target-class: true
8 11
 
9 12
 
10 13
 

+ 5
- 0
CODE/foreign-service/src/main/resources/mapper/TpLevelMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.TpLevelMapper">
4
+
5
+</mapper>

+ 5
- 0
CODE/foreign-service/src/main/resources/mapper/TpRoomNoMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.TpRoomNoMapper">
4
+
5
+</mapper>

+ 5
- 0
CODE/foreign-service/src/main/resources/mapper/TpUnitMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.TpUnitMapper">
4
+
5
+</mapper>

+ 1
- 1
CODE/smart-community/community-common/src/main/java/com/community/commom/fushi/FuShiRequestAPI.java 查看文件

@@ -62,7 +62,7 @@ public class FuShiRequestAPI {
62 62
         JSONObject jsonObject = JSONObject.parseObject(jsonString);
63 63
         Integer messageCode = jsonObject.getInteger("MessageCode");
64 64
         if (messageCode != 200) {
65
-            throw new FuShiException(jsonObject.getString("MessageContent"));
65
+            throw new FuShiException(messageCode, jsonObject.getString("MessageContent"));
66 66
         }
67 67
     }
68 68
 

+ 31
- 2
CODE/smart-community/community-common/src/main/java/com/community/commom/fushi/error/FuShiException.java 查看文件

@@ -6,15 +6,44 @@ package com.community.commom.fushi.error;
6 6
  */
7 7
 public class FuShiException extends RuntimeException {
8 8
 
9
-    public FuShiException(String msg, Throwable t) {
9
+    private Integer code;
10
+
11
+    private String msg;
12
+
13
+    public FuShiException(Integer code, String msg, Throwable t) {
10 14
         super(msg, t);
15
+        this.code = code;
16
+        this.msg = msg;
11 17
     }
12 18
 
13 19
     public FuShiException(String msg) {
14 20
         super(msg);
21
+        this.msg = msg;
15 22
     }
16 23
 
17
-    public FuShiException(String msg, Object ...args) {
24
+    public FuShiException(Integer code, String msg) {
25
+        super(msg);
26
+        this.code = code;
27
+        this.msg = msg;
28
+    }
29
+
30
+    public FuShiException(Integer code, String msg, Object ...args) {
18 31
         this(String.format(msg, args));
19 32
     }
33
+
34
+    public Integer getCode() {
35
+        return code;
36
+    }
37
+
38
+    public void setCode(Integer code) {
39
+        this.code = code;
40
+    }
41
+
42
+    public String getMsg() {
43
+        return msg;
44
+    }
45
+
46
+    public void setMsg(String msg) {
47
+        this.msg = msg;
48
+    }
20 49
 }