Browse Source

本地合并

weiximei 6 years ago
parent
commit
9be742da9b

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

@@ -1,8 +1,10 @@
1 1
 package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.Communities;
4 5
 import com.community.huiju.model.SysNation;
5 6
 import com.community.huiju.service.CommonServiceI;
7
+import com.community.huiju.service.CommunitiesServiceI;
6 8
 import io.swagger.annotations.Api;
7 9
 import io.swagger.annotations.ApiImplicitParam;
8 10
 import io.swagger.annotations.ApiImplicitParams;
@@ -25,6 +27,8 @@ import java.util.List;
25 27
 @RequestMapping("/")
26 28
 @Api(value = "运营端公共API", description = "运营端公共API")
27 29
 public class CommonController {
30
+	@Autowired
31
+	private CommunitiesServiceI communitiesServiceI;
28 32
 	
29 33
 	@Autowired
30 34
 	private CommonServiceI commonService;
@@ -63,4 +67,14 @@ public class CommonController {
63 67
 		responseBean.addSuccess(nationList);
64 68
 		return responseBean;
65 69
 	}
70
+
71
+	@ApiOperation(value = "获取所有小区经纬度", notes = "获取所有小区经纬度")
72
+	@RequestMapping(value = "/communities",method = RequestMethod.GET)
73
+	public ResponseBean getAgreement(){
74
+		ResponseBean responseBean = new ResponseBean();
75
+		List <Communities> communities= communitiesServiceI.getCommunities();
76
+		responseBean.addSuccess(communities);
77
+		return responseBean;
78
+	}
79
+
66 80
 }

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

@@ -22,4 +22,6 @@ public interface ToCommunitiesMapper {
22 22
     int updateByPrimaryKey(ToCommunities record);
23 23
     
24 24
     List<ToCommunities> selectByCommunityName(ToCommunities record);
25
+
26
+    List<ToCommunities> selectLongitude();
25 27
 }

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

@@ -0,0 +1,74 @@
1
+package com.community.huiju.model;
2
+import java.time.LocalDateTime;
3
+import java.io.Serializable;
4
+import lombok.Data;
5
+import lombok.EqualsAndHashCode;
6
+import lombok.experimental.Accessors;
7
+
8
+/**
9
+ * <p>
10
+ * 所有小区表
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2018-12-18
15
+ */
16
+@Data
17
+@EqualsAndHashCode(callSuper = false)
18
+@Accessors(chain = true)
19
+public class Communities implements Serializable {
20
+
21
+    private static final long serialVersionUID = 1L;
22
+
23
+    /**
24
+     * 小区名称
25
+     */
26
+    private String communityName;
27
+
28
+    /**
29
+     * 小区别名
30
+     */
31
+    private String communityAlias;
32
+
33
+    /**
34
+     * 省份id
35
+     */
36
+    private Integer provinceId;
37
+
38
+    private Integer cityId;
39
+
40
+    /**
41
+     * 县/区id
42
+     */
43
+    private Integer districtId;
44
+
45
+    /**
46
+     * 经度
47
+     */
48
+    private String longitude;
49
+
50
+    /**
51
+     * 纬度
52
+     */
53
+    private String latitude;
54
+
55
+    /**
56
+     * 用户名
57
+     */
58
+    private String userName;
59
+
60
+    /**
61
+     * 登录账号
62
+     */
63
+    private String loginName;
64
+
65
+    private Integer createUser;
66
+
67
+    private LocalDateTime createDate;
68
+
69
+    private Integer updateUser;
70
+
71
+    private LocalDateTime updateDate;
72
+
73
+
74
+}

+ 23
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/CommunitiesServiceI.java View File

@@ -0,0 +1,23 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.Communities;
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/12/18
14
+ **/
15
+public interface CommunitiesServiceI {
16
+    /**
17
+     * 获取所有小区的经纬度
18
+     * @return
19
+     */
20
+     List<Communities> getCommunities();
21
+
22
+
23
+}

+ 32
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunitiesServiceImpl.java View File

@@ -0,0 +1,32 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.huiju.dao.ToCommunitiesMapper;
4
+import com.community.huiju.model.Communities;
5
+import com.community.huiju.service.CommunitiesServiceI;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Service;
8
+import org.springframework.transaction.annotation.Transactional;
9
+
10
+import java.util.List;
11
+
12
+/**
13
+ * version V1.0
14
+ * class_name: $METHOD_NAME$
15
+ * param: $METHOD_PARAM$
16
+ * describe: TODO
17
+ * creat_user:fannaixi
18
+ * creat_time: 2018/12/18
19
+ **/
20
+@Service("communitiesServicei")
21
+@Transactional
22
+public class CommunitiesServiceImpl implements CommunitiesServiceI {
23
+    @Autowired
24
+    private ToCommunitiesMapper toCommunitiesMapper;
25
+
26
+
27
+    @Override
28
+    public List<Communities> getCommunities() {
29
+        List longitudeList=toCommunitiesMapper.selectLongitude();
30
+        return longitudeList;
31
+    }
32
+}

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

@@ -220,4 +220,25 @@
220 220
     </if>
221 221
     order by c.create_date desc
222 222
   </select>
223
+
224
+  <select id="selectLongitude" resultMap="BaseResultMap" >
225
+    SELECT
226
+    c.id,
227
+    c.community_name,
228
+    c.community_alias,
229
+    c.province_id,
230
+    c.city_id,
231
+    c.district_id,
232
+    c.longitude,
233
+    c.latitude,
234
+    c.user_name,
235
+    c.login_name,
236
+    c.create_user,
237
+    c.create_date,
238
+    c.update_user,
239
+    c.update_date
240
+    FROM
241
+    to_communities c
242
+  </select>
243
+
223 244
 </mapper>

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

@@ -44,9 +44,21 @@ public class UserController extends BaseController {
44 44
 	@RequestMapping(value = "/users",method = RequestMethod.GET)
45 45
 	public ResponseBean getInfo(HttpSession session) {
46 46
 		ResponseBean response = new ResponseBean();
47
-		//response.addSuccess(userService.list());
47
+		response.addSuccess(userService.list());
48 48
 		Page a = new Page(1,10);
49
-		response.addSuccess(userService.page(a));
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
 }

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

@@ -3,6 +3,9 @@ package com.community.huiju.dao;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.User;
5 5
 
6
+import java.util.List;
7
+import java.util.Map;
8
+
6 9
 /**
7 10
  * <p>
8 11
  * 物业web端用户表 Mapper 接口
@@ -13,4 +16,6 @@ import com.community.huiju.model.User;
13 16
  */
14 17
 public interface UserMapper extends BaseMapper<User> {
15 18
 
19
+    List<Map<Object,Object>> selectUserApprove(Map<Object,Object> map);
20
+
16 21
 }

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

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

+ 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
 }

+ 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
 }

+ 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
 }

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

@@ -0,0 +1,124 @@
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.TaSysRoleMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaSysRole" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="role_name" property="roleName" jdbcType="VARCHAR" />
7
+    <result column="description" property="description" jdbcType="VARCHAR" />
8
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
9
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
10
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
11
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
12
+  </resultMap>
13
+  <sql id="Base_Column_List" >
14
+    id, role_name, description, create_user, create_date, update_user, update_date
15
+  </sql>
16
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
17
+    select 
18
+    <include refid="Base_Column_List" />
19
+    from ta_sys_role
20
+    where id = #{id,jdbcType=INTEGER}
21
+  </select>
22
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
23
+    delete from ta_sys_role
24
+    where id = #{id,jdbcType=INTEGER}
25
+  </delete>
26
+  <insert id="insert" parameterType="com.community.huiju.model.TaSysRole" >
27
+    insert into ta_sys_role (id, role_name, description, 
28
+      create_user, create_date, update_user, 
29
+      update_date)
30
+    values (#{id,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
31
+      #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, 
32
+      #{updateDate,jdbcType=TIMESTAMP})
33
+  </insert>
34
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaSysRole" >
35
+    insert into ta_sys_role
36
+    <trim prefix="(" suffix=")" suffixOverrides="," >
37
+      <if test="id != null" >
38
+        id,
39
+      </if>
40
+      <if test="roleName != null" >
41
+        role_name,
42
+      </if>
43
+      <if test="description != null" >
44
+        description,
45
+      </if>
46
+      <if test="createUser != null" >
47
+        create_user,
48
+      </if>
49
+      <if test="createDate != null" >
50
+        create_date,
51
+      </if>
52
+      <if test="updateUser != null" >
53
+        update_user,
54
+      </if>
55
+      <if test="updateDate != null" >
56
+        update_date,
57
+      </if>
58
+    </trim>
59
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
60
+      <if test="id != null" >
61
+        #{id,jdbcType=INTEGER},
62
+      </if>
63
+      <if test="roleName != null" >
64
+        #{roleName,jdbcType=VARCHAR},
65
+      </if>
66
+      <if test="description != null" >
67
+        #{description,jdbcType=VARCHAR},
68
+      </if>
69
+      <if test="createUser != null" >
70
+        #{createUser,jdbcType=INTEGER},
71
+      </if>
72
+      <if test="createDate != null" >
73
+        #{createDate,jdbcType=TIMESTAMP},
74
+      </if>
75
+      <if test="updateUser != null" >
76
+        #{updateUser,jdbcType=INTEGER},
77
+      </if>
78
+      <if test="updateDate != null" >
79
+        #{updateDate,jdbcType=TIMESTAMP},
80
+      </if>
81
+    </trim>
82
+  </insert>
83
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaSysRole" >
84
+    update ta_sys_role
85
+    <set >
86
+      <if test="roleName != null" >
87
+        role_name = #{roleName,jdbcType=VARCHAR},
88
+      </if>
89
+      <if test="description != null" >
90
+        description = #{description,jdbcType=VARCHAR},
91
+      </if>
92
+      <if test="createUser != null" >
93
+        create_user = #{createUser,jdbcType=INTEGER},
94
+      </if>
95
+      <if test="createDate != null" >
96
+        create_date = #{createDate,jdbcType=TIMESTAMP},
97
+      </if>
98
+      <if test="updateUser != null" >
99
+        update_user = #{updateUser,jdbcType=INTEGER},
100
+      </if>
101
+      <if test="updateDate != null" >
102
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
103
+      </if>
104
+    </set>
105
+    where id = #{id,jdbcType=INTEGER}
106
+  </update>
107
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaSysRole" >
108
+    update ta_sys_role
109
+    set role_name = #{roleName,jdbcType=VARCHAR},
110
+      description = #{description,jdbcType=VARCHAR},
111
+      create_user = #{createUser,jdbcType=INTEGER},
112
+      create_date = #{createDate,jdbcType=TIMESTAMP},
113
+      update_user = #{updateUser,jdbcType=INTEGER},
114
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </update>
117
+  <select id="findRoleByUserId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
118
+    select
119
+    <include refid="Base_Column_List" />
120
+    from ta_sys_role
121
+    	where id = (select role_id from ta_sys_user_role where user_id = #{userId})
122
+  </select>
123
+
124
+</mapper>

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

@@ -1,5 +1,21 @@
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
-
4
+    <select id="selectUserApprove" resultType="map" parameterType="map">
5
+    SELECT
6
+	t.user_name,
7
+	t.login_name ,
8
+	t.gender ,
9
+	boi.id_card ,
10
+	boi.unit ,
11
+	boi. LEVEL,
12
+	room_no,
13
+	boi.create_date,
14
+	t.verify_status
15
+    FROM
16
+        ta_user t
17
+    LEFT JOIN tp_building_owner_info boi ON t.building_owner_info_id = boi.id
18
+    LEFT JOIN ta_sys_user_role sur ON t.id=sur.user_id
19
+    WHERE sur.role_id=1  and t.status=1 and t.verify_status=1
20
+    </select>
5 21
 </mapper>