dingxin 6 years ago
parent
commit
bd3b378e24
14 changed files with 367 additions and 5 deletions
  1. 2
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java
  2. 59
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BuildingOwnerInfoController.java
  3. 12
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/UserController.java
  4. 16
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/BuildingOwnerInfoMapper.java
  5. 2
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/UserMapper.java
  6. 108
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/BuildingOwnerInfo.java
  7. 0
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/User.java
  8. 33
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfoService.java
  9. 4
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IUserService.java
  10. 102
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java
  11. 11
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/UserServiceImpl.java
  12. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/BuildingOwnerInfoMapper.xml
  13. 2
    2
      CODE/smart-community/property-api/src/main/resources/mapper/UserMapper.xml
  14. 11
    0
      CODE/smart-community/property-api/src/test/java/com/community/huiju/DemoApplicationTests.java

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

@@ -1,7 +1,9 @@
1 1
 package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpCarouselSetting;
4
+import org.apache.ibatis.annotations.Mapper;
4 5
 
6
+@Mapper
5 7
 public interface TpCarouselSettingMapper {
6 8
     int deleteByPrimaryKey(Integer id);
7 9
 

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

@@ -0,0 +1,59 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.common.base.BaseController;
6
+import com.community.huiju.service.IBuildingOwnerInfoService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+/**
18
+ * <p>
19
+ * 楼栋业主资料信息表 前端控制器
20
+ * </p>
21
+ *
22
+ * @author weiximei
23
+ * @since 2018-12-18
24
+ */
25
+@RestController
26
+@RequestMapping("/tp/building-owner-info")
27
+@Api(value = "楼栋业主资料信息", description = "楼栋业主资料信息 Api")
28
+public class BuildingOwnerInfoController extends BaseController {
29
+
30
+    @Autowired
31
+    private IBuildingOwnerInfoService iBuildingOwnerInfoService;
32
+
33
+    @ApiOperation(value = "获取楼栋业主信息", notes = "根据条件获取")
34
+    @ApiImplicitParams({
35
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter",value = "building栋;" +
36
+                    "unit单元;level楼层;roomNo户号;" +
37
+                    "ownerName业主姓名;" +
38
+                    "pageNum第几页;pageSize 一页多少行;")
39
+    })
40
+    @RequestMapping(value = "list", method = RequestMethod.POST)
41
+    public ResponseBean getList(@RequestBody String parameter){
42
+        ResponseBean responseBean = new ResponseBean();
43
+        responseBean = iBuildingOwnerInfoService.listQuery(parameter);
44
+        return responseBean;
45
+    }
46
+
47
+    @ApiOperation(value = "修改楼栋业务信息", notes = "修改楼栋业主信息")
48
+    @ApiImplicitParams({
49
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter",value = "building栋;" +
50
+                    "unit单元;level楼层;roomNo户号;" +
51
+                    "ownerName业主姓名;" +
52
+                    "ownerTel业主手机号")
53
+    })
54
+    public ResponseBean update(@RequestBody String parameter){
55
+        ResponseBean responseBean = new ResponseBean();
56
+        return responseBean;
57
+    }
58
+
59
+}

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

@@ -49,4 +49,16 @@ public class UserController extends BaseController {
49 49
 //		response.addSuccess(userService.page(a));
50 50
 		return response;
51 51
 	}
52
+
53
+	@ApiOperation(value = "获取已认证通过的用户信息",nickname ="获取已认证通过的用户信息")
54
+	@ApiImplicitParams({
55
+			@ApiImplicitParam(paramType="body",dataType = "String",name ="phone",value = "电话"),
56
+			@ApiImplicitParam(paramType="body",dataType = "String",name ="name",value = "姓名"),
57
+			@ApiImplicitParam(paramType="body",dataType = "String",name ="status",value = "认证状态")
58
+	})
59
+	@RequestMapping(value = "/userPassCertification",method = RequestMethod.GET)
60
+	public ResponseBean userPassCertification(){
61
+
62
+		return null;
63
+	}
52 64
 }

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

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.BuildingOwnerInfo;
5
+
6
+/**
7
+ * <p>
8
+ * 楼栋业主资料信息表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author weiximei
12
+ * @since 2018-12-18
13
+ */
14
+public interface BuildingOwnerInfoMapper extends BaseMapper<BuildingOwnerInfo> {
15
+
16
+}

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.User;
5 5
 
6 6
 import java.util.List;
7
+import java.util.Map;
7 8
 
8 9
 /**
9 10
  * <p>
@@ -15,6 +16,6 @@ import java.util.List;
15 16
  */
16 17
 public interface UserMapper extends BaseMapper<User> {
17 18
 
18
-    List<User> userApprove();
19
+    List<Map<Object,Object>> selectUserApprove(Map<Object,Object> map);
19 20
 
20 21
 }

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

@@ -0,0 +1,108 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import lombok.Data;
5
+import lombok.EqualsAndHashCode;
6
+import lombok.experimental.Accessors;
7
+
8
+import java.io.Serializable;
9
+import java.time.LocalDateTime;
10
+
11
+/**
12
+ * <p>
13
+ * 楼栋业主资料信息表
14
+ * </p>
15
+ *
16
+ * @author jobob
17
+ * @since 2018-12-18
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+@TableName("tp_building_owner_info")
23
+public class BuildingOwnerInfo implements Serializable {
24
+
25
+    private static final long serialVersionUID = 1L;
26
+
27
+    /**
28
+     * 主键
29
+     */
30
+    private Integer id;
31
+
32
+    /**
33
+     * 小区id
34
+     */
35
+    private Integer communityId;
36
+
37
+    /**
38
+     * 身份证号码
39
+     */
40
+    private String idCard;
41
+
42
+    /**
43
+     * 楼栋
44
+     */
45
+    private String building;
46
+
47
+    /**
48
+     * 单元
49
+     */
50
+    private String unit;
51
+
52
+    /**
53
+     * 楼层
54
+     */
55
+    private String level;
56
+
57
+    /**
58
+     * 户号
59
+     */
60
+    private String roomNo;
61
+
62
+    /**
63
+     * 业主姓名
64
+     */
65
+    private String ownerName;
66
+
67
+    /**
68
+     * 业主手机号
69
+     */
70
+    private String ownerTel;
71
+
72
+    /**
73
+     * 性别 1:男   2:女
74
+     */
75
+    private String gender;
76
+
77
+    /**
78
+     * 关联状态   0 未关联  1 是已关联
79
+     */
80
+    private String pairStatus;
81
+
82
+    /**
83
+     * 认证状态  0 是未认证    1是认证通过   2是已作废
84
+     */
85
+    private String verifyStatus;
86
+
87
+    /**
88
+     * 创建人
89
+     */
90
+    private Integer createUser;
91
+
92
+    /**
93
+     * 创建时间
94
+     */
95
+    private LocalDateTime createDate;
96
+
97
+    /**
98
+     * 更新人
99
+     */
100
+    private Integer updateUser;
101
+
102
+    /**
103
+     * 更新时间
104
+     */
105
+    private LocalDateTime updateDate;
106
+
107
+
108
+}

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

@@ -84,5 +84,4 @@ public class User implements Serializable {
84 84
      */
85 85
     private LocalDateTime updateDate;
86 86
 
87
-
88 87
 }

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

@@ -0,0 +1,33 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.model.BuildingOwnerInfo;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * <p>
11
+ * 楼栋业主资料信息表 服务类
12
+ * </p>
13
+ *
14
+ * @author weiximei
15
+ * @since 2018-12-18
16
+ */
17
+public interface IBuildingOwnerInfoService extends IService<BuildingOwnerInfo> {
18
+
19
+    /**
20
+     * 根据条件查询
21
+     * @param parameter
22
+     * @return
23
+     */
24
+    ResponseBean listQuery(String parameter);
25
+
26
+    /**
27
+     * 修改 楼栋业主信息
28
+     * @param parameter
29
+     * @return
30
+     */
31
+    ResponseBean update(String parameter);
32
+
33
+}

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

@@ -4,6 +4,9 @@ package com.community.huiju.service;
4 4
 import com.baomidou.mybatisplus.extension.service.IService;
5 5
 import com.community.huiju.model.User;
6 6
 
7
+import java.util.List;
8
+import java.util.Map;
9
+
7 10
 /**
8 11
  * <p>
9 12
  * 物业web端用户表 服务类
@@ -13,5 +16,6 @@ import com.community.huiju.model.User;
13 16
  * @since 2018-12-18
14 17
  */
15 18
 public interface IUserService extends IService<User> {
19
+    List<Object> selectUserApprove(Map map);
16 20
 
17 21
 }

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

@@ -0,0 +1,102 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.EmptyWrapper;
5
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
7
+import com.baomidou.mybatisplus.core.metadata.IPage;
8
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
10
+import com.community.commom.mode.ResponseBean;
11
+import com.community.huiju.dao.BuildingOwnerInfoMapper;
12
+import com.community.huiju.model.BuildingOwnerInfo;
13
+import com.community.huiju.service.IBuildingOwnerInfoService;
14
+import com.google.common.collect.Lists;
15
+import com.google.common.collect.Maps;
16
+import org.springframework.beans.BeanUtils;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.stereotype.Service;
19
+
20
+import java.util.List;
21
+import java.util.Map;
22
+
23
+/**
24
+ * <p>
25
+ * 楼栋业主资料信息表 服务实现类
26
+ * </p>
27
+ *
28
+ * @author weiximei
29
+ * @since 2018-12-18
30
+ */
31
+@Service("iBuildingOwnerInfoService")
32
+public class BuildingOwnerInfoServiceImpl extends ServiceImpl<BuildingOwnerInfoMapper, BuildingOwnerInfo> implements IBuildingOwnerInfoService {
33
+
34
+    @Autowired
35
+    private BuildingOwnerInfoMapper buildingOwnerInfoMapper;
36
+
37
+    @Override
38
+    public ResponseBean listQuery(String parameter) {
39
+
40
+        ResponseBean responseBean = new ResponseBean();
41
+
42
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
43
+        BuildingOwnerInfo buildingOwnerInfo = jsonObject.toJavaObject(BuildingOwnerInfo.class);
44
+
45
+        Long pageNum = jsonObject.getLong("pageNum") == null ? 1 : jsonObject.getLong("pageNum");
46
+        Long pageSize = jsonObject.getLong("pageSize") == null ? 10 : jsonObject.getLong("pageSize");
47
+
48
+        Page<BuildingOwnerInfo> page = new Page(pageNum,pageSize);
49
+
50
+        Map<String, Object> map = Maps.newHashMap();
51
+        // 栋
52
+        map.put("building",buildingOwnerInfo.getBuilding());
53
+        // 单元
54
+        map.put("unit",buildingOwnerInfo.getUnit());
55
+        // 楼层
56
+        map.put("level",buildingOwnerInfo.getLevel());
57
+        // 房号
58
+        map.put("room_no",buildingOwnerInfo.getRoomNo());
59
+
60
+        QueryWrapper<BuildingOwnerInfo> queryWrapper = new QueryWrapper<>();
61
+        queryWrapper.allEq(map,false);
62
+        queryWrapper.like(buildingOwnerInfo.getOwnerName() != null,"owner_name",buildingOwnerInfo.getOwnerName());
63
+        // 分页查询
64
+        IPage<BuildingOwnerInfo> infoIPage = buildingOwnerInfoMapper.selectPage(page, queryWrapper);
65
+
66
+
67
+        Map<String, Object> retMap = Maps.newHashMap();
68
+        // 获取数据
69
+        List<BuildingOwnerInfo> list = infoIPage.getRecords();
70
+
71
+        retMap.put("data", list);
72
+        retMap.put("total", infoIPage.getTotal());
73
+        retMap.put("pageNum", infoIPage.getCurrent());
74
+        retMap.put("pageSize", infoIPage.getSize());
75
+
76
+        responseBean.addSuccess(list);
77
+
78
+        return responseBean;
79
+    }
80
+
81
+
82
+    @Override
83
+    public ResponseBean update(String parameter) {
84
+        ResponseBean responseBean = new ResponseBean();
85
+
86
+        BuildingOwnerInfo buildingOwnerInfo = JSONObject.parseObject(parameter, BuildingOwnerInfo.class);
87
+        BuildingOwnerInfo oldBuildingOwnerInfo = buildingOwnerInfoMapper.selectById(buildingOwnerInfo.getId());
88
+        if (null == oldBuildingOwnerInfo) {
89
+            responseBean.addError("数据不存在!");
90
+            return responseBean;
91
+        }
92
+
93
+        BeanUtils.copyProperties(buildingOwnerInfo, oldBuildingOwnerInfo);
94
+        int row = buildingOwnerInfoMapper.updateById(buildingOwnerInfo);
95
+        if (row <= 0) {
96
+            responseBean.addError("更新失败!");
97
+        } else {
98
+            responseBean.addSuccess("更新成功!");
99
+        }
100
+        return responseBean;
101
+    }
102
+}

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

@@ -5,8 +5,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 5
 import com.community.huiju.dao.UserMapper;
6 6
 import com.community.huiju.model.User;
7 7
 import com.community.huiju.service.IUserService;
8
+import org.springframework.beans.factory.annotation.Autowired;
8 9
 import org.springframework.stereotype.Service;
9 10
 
11
+import java.util.List;
12
+import java.util.Map;
13
+
10 14
 /**
11 15
  * <p>
12 16
  * 物业web端用户表 服务实现类
@@ -17,5 +21,11 @@ import org.springframework.stereotype.Service;
17 21
  */
18 22
 @Service("userService")
19 23
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
20
-
24
+@Autowired
25
+private UserMapper userMapper;
26
+    @Override
27
+    public List<Object> selectUserApprove(Map map) {
28
+        List UserApprove=userMapper.selectUserApprove(map);
29
+        return UserApprove;
30
+    }
21 31
 }

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

@@ -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.BuildingOwnerInfoMapper">
4
+
5
+</mapper>

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

@@ -1,7 +1,7 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.community.huiju.dao.UserMapper">
4
-    <select id="userApprove" resultType="com.community.huiju.dao.UserMapper">
4
+    <select id="selectUserApprove" resultType="map" parameterType="map">
5 5
     SELECT
6 6
 	t.user_name,
7 7
 	t.login_name ,
@@ -16,6 +16,6 @@
16 16
         ta_user t
17 17
     LEFT JOIN tp_building_owner_info boi ON t.building_owner_info_id = boi.id
18 18
     LEFT JOIN ta_sys_user_role sur ON t.id=sur.user_id
19
-    WHERE sur.role_id=1
19
+    WHERE sur.role_id=1  and t.status=1 and t.verify_status=1
20 20
     </select>
21 21
 </mapper>

+ 11
- 0
CODE/smart-community/property-api/src/test/java/com/community/huiju/DemoApplicationTests.java View File

@@ -1,16 +1,27 @@
1 1
 package com.community.huiju;
2 2
 
3
+import com.community.huiju.dao.BuildingOwnerInfoMapper;
4
+import com.community.huiju.model.BuildingOwnerInfo;
3 5
 import org.junit.Test;
4 6
 import org.junit.runner.RunWith;
7
+import org.springframework.beans.factory.annotation.Autowired;
5 8
 import org.springframework.boot.test.context.SpringBootTest;
6 9
 import org.springframework.test.context.junit4.SpringRunner;
7 10
 
11
+import java.util.List;
12
+
8 13
 @RunWith(SpringRunner.class)
9 14
 @SpringBootTest
10 15
 public class DemoApplicationTests {
11 16
 
17
+	@Autowired
18
+	private BuildingOwnerInfoMapper buildingOwnerInfoMapper;
19
+
12 20
 	@Test
13 21
 	public void contextLoads() {
22
+
23
+		List<BuildingOwnerInfo> list = buildingOwnerInfoMapper.selectList(null);
24
+		System.out.println(list.size());
14 25
 	}
15 26
 
16 27
 }