Bläddra i källkod

Merge branch 'develop' of http://git.ycjcjy.com/fuxingfan/smartCommunity into develop

傅行帆 6 år sedan
förälder
incheckning
3961c2cd49
28 ändrade filer med 1099 tillägg och 87 borttagningar
  1. 59
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java
  2. 25
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorLicenseMapper.java
  3. 27
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorMapper.java
  4. 166
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitor.java
  5. 85
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitorLicense.java
  6. 16
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java
  7. 73
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java
  8. 135
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorLicenseMapper.xml
  9. 319
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorMapper.xml
  10. 6
    3
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  11. Binär
      CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class
  12. 11
    4
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/BannerController.java
  13. 3
    1
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToBannerService.java
  14. 18
    18
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToSysRoleService.java
  15. 4
    1
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java
  16. 24
    24
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToSysRoleServiceImpl.java
  17. 2
    3
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestAuthenticationEntryPoint.java
  18. 12
    1
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateProvider.java
  19. 2
    2
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticatedProcessingFilter.java
  20. 11
    0
      VUECODE/smart-operate-manage/src/api/banner.js
  21. 2
    2
      VUECODE/smart-operate-manage/src/api/login.js
  22. 1
    1
      VUECODE/smart-operate-manage/src/api/table.js
  23. 4
    4
      VUECODE/smart-operate-manage/src/router/index.js
  24. 1
    1
      VUECODE/smart-operate-manage/src/store/modules/user.js
  25. 1
    1
      VUECODE/smart-operate-manage/src/utils/auth.js
  26. 3
    3
      VUECODE/smart-operate-manage/src/utils/request.js
  27. 62
    0
      VUECODE/smart-operate-manage/src/views/banner/index.vue
  28. 27
    18
      VUECODE/smart-operate-manage/src/views/login/index.vue

+ 59
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java Visa fil

@@ -0,0 +1,59 @@
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.commom.session.UserElement;
6
+import com.community.huiju.model.TaVisitor;
7
+import com.community.huiju.service.TaVistorServiceI;
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.factory.annotation.Autowired;
13
+import org.springframework.cloud.context.config.annotation.RefreshScope;
14
+import org.springframework.web.bind.annotation.*;
15
+
16
+import javax.servlet.http.HttpSession;
17
+import java.util.List;
18
+
19
+/**
20
+ * @author weichaochao
21
+ * @Title: VistorController
22
+ * @Description: 访客相关API
23
+ * @date 2018/11/1
24
+ */
25
+@RestController
26
+@RefreshScope
27
+@RequestMapping("/")
28
+@Api(value = "访客相关的API", description = "访客相关的API")
29
+public class VistorController {
30
+
31
+    @Autowired
32
+    private TaVistorServiceI vistorServiceI;
33
+
34
+    @RequestMapping(value = "/vistorDetail/{communityId}", method = RequestMethod.POST)
35
+    @ApiOperation(value = "获取访客信息", notes = "获取访客信息")
36
+    @ApiImplicitParams({@ApiImplicitParam(name = "taVisitor", value = "访客", required = true, dataType = "TaVisitor"),
37
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
38
+            @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id")})
39
+    public ResponseBean findVistorDetail(@PathVariable("communityId")Integer communityId, @RequestBody TaVisitor taVisitor, HttpSession session) {
40
+        ResponseBean responseBean = new ResponseBean();
41
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
42
+        Integer userId = userElement.getId();
43
+        vistorServiceI.insertTaVistor(taVisitor, communityId, userId);
44
+        return  responseBean;
45
+    }
46
+
47
+    @RequestMapping(value = "/invateVistorHis/{communityId}", method = RequestMethod.GET)
48
+    @ApiOperation(value = "邀请历史", notes = "邀请历史")
49
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
50
+            @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id")})
51
+    public ResponseBean invateHis(@PathVariable("communityId")Integer communityId, HttpSession session) {
52
+        ResponseBean responseBean = new ResponseBean();
53
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
54
+        Integer userId = userElement.getId();
55
+        List<TaVisitor> taVisitors = vistorServiceI.invateHis(communityId, userId);
56
+        responseBean.addSuccess(taVisitors);
57
+        return  responseBean;
58
+    }
59
+}

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorLicenseMapper.java Visa fil

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

+ 27
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaVisitorMapper.java Visa fil

@@ -0,0 +1,27 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TaVisitor;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+
9
+@Mapper
10
+public interface TaVisitorMapper {
11
+    int deleteByPrimaryKey(Integer id);
12
+
13
+    int insert(TaVisitor record);
14
+
15
+    int insertSelective(TaVisitor record);
16
+
17
+    TaVisitor selectByPrimaryKey(Integer id);
18
+
19
+    int updateByPrimaryKeySelective(TaVisitor record);
20
+
21
+    int updateByPrimaryKey(TaVisitor record);
22
+
23
+    void insertVistorAndLicense();
24
+
25
+    List<TaVisitor> findAllVistors(@Param("communityId") Integer communityId, @Param("userId") Integer userId);
26
+
27
+}

+ 166
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitor.java Visa fil

@@ -0,0 +1,166 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+import java.util.List;
5
+
6
+public class TaVisitor {
7
+    private Integer id;
8
+
9
+    private Integer communityId;
10
+
11
+    private String visitorName;
12
+
13
+    private String visitorTel;
14
+
15
+    private String visitorNum;
16
+
17
+    private Date visitorStatrtTime;
18
+
19
+    private Integer visitorEndTime;
20
+
21
+    private String drivingStatus;
22
+
23
+    private String payEntity;
24
+
25
+    private String visitorCode;
26
+
27
+    private Integer taUserId;
28
+
29
+    private Integer createUser;
30
+
31
+    private Date createDate;
32
+
33
+    private Integer updateUser;
34
+
35
+    private Date updateDate;
36
+
37
+    private List<Integer> carLicense;
38
+
39
+    public Integer getId() {
40
+        return id;
41
+    }
42
+
43
+    public void setId(Integer id) {
44
+        this.id = id;
45
+    }
46
+
47
+    public Integer getCommunityId() {
48
+        return communityId;
49
+    }
50
+
51
+    public void setCommunityId(Integer communityId) {
52
+        this.communityId = communityId;
53
+    }
54
+
55
+    public String getVisitorName() {
56
+        return visitorName;
57
+    }
58
+
59
+    public void setVisitorName(String visitorName) {
60
+        this.visitorName = visitorName == null ? null : visitorName.trim();
61
+    }
62
+
63
+    public String getVisitorTel() {
64
+        return visitorTel;
65
+    }
66
+
67
+    public void setVisitorTel(String visitorTel) {
68
+        this.visitorTel = visitorTel == null ? null : visitorTel.trim();
69
+    }
70
+
71
+    public String getVisitorNum() {
72
+        return visitorNum;
73
+    }
74
+
75
+    public void setVisitorNum(String visitorNum) {
76
+        this.visitorNum = visitorNum == null ? null : visitorNum.trim();
77
+    }
78
+
79
+    public Date getVisitorStatrtTime() {
80
+        return visitorStatrtTime;
81
+    }
82
+
83
+    public void setVisitorStatrtTime(Date visitorStatrtTime) {
84
+        this.visitorStatrtTime = visitorStatrtTime;
85
+    }
86
+
87
+    public Integer getVisitorEndTime() {
88
+        return visitorEndTime;
89
+    }
90
+
91
+    public void setVisitorEndTime(Integer visitorEndTime) {
92
+        this.visitorEndTime = visitorEndTime;
93
+    }
94
+
95
+    public String getDrivingStatus() {
96
+        return drivingStatus;
97
+    }
98
+
99
+    public void setDrivingStatus(String drivingStatus) {
100
+        this.drivingStatus = drivingStatus == null ? null : drivingStatus.trim();
101
+    }
102
+
103
+    public String getPayEntity() {
104
+        return payEntity;
105
+    }
106
+
107
+    public void setPayEntity(String payEntity) {
108
+        this.payEntity = payEntity == null ? null : payEntity.trim();
109
+    }
110
+
111
+    public String getVisitorCode() {
112
+        return visitorCode;
113
+    }
114
+
115
+    public void setVisitorCode(String visitorCode) {
116
+        this.visitorCode = visitorCode == null ? null : visitorCode.trim();
117
+    }
118
+
119
+    public Integer getTaUserId() {
120
+        return taUserId;
121
+    }
122
+
123
+    public void setTaUserId(Integer taUserId) {
124
+        this.taUserId = taUserId;
125
+    }
126
+
127
+    public Integer getCreateUser() {
128
+        return createUser;
129
+    }
130
+
131
+    public void setCreateUser(Integer createUser) {
132
+        this.createUser = createUser;
133
+    }
134
+
135
+    public Date getCreateDate() {
136
+        return createDate;
137
+    }
138
+
139
+    public void setCreateDate(Date createDate) {
140
+        this.createDate = createDate;
141
+    }
142
+
143
+    public Integer getUpdateUser() {
144
+        return updateUser;
145
+    }
146
+
147
+    public void setUpdateUser(Integer updateUser) {
148
+        this.updateUser = updateUser;
149
+    }
150
+
151
+    public Date getUpdateDate() {
152
+        return updateDate;
153
+    }
154
+
155
+    public void setUpdateDate(Date updateDate) {
156
+        this.updateDate = updateDate;
157
+    }
158
+
159
+    public List<Integer> getCarLicense() {
160
+        return carLicense;
161
+    }
162
+
163
+    public void setCarLicense(List<Integer> carLicense) {
164
+        this.carLicense = carLicense;
165
+    }
166
+}

+ 85
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaVisitorLicense.java Visa fil

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

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java Visa fil

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.TaVisitor;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * @author weichaochao
9
+ * @Title: TaVistorServiceI
10
+ * @Description: 访客相关service
11
+ * @date 2018/11/1
12
+ */
13
+public interface TaVistorServiceI {
14
+    void insertTaVistor(TaVisitor taVisitor, Integer communityId, Integer userId);
15
+    List<TaVisitor> invateHis(Integer communityId, Integer userId);
16
+}

+ 73
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java Visa fil

@@ -0,0 +1,73 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.huiju.dao.TaVisitorLicenseMapper;
5
+import com.community.huiju.dao.TaVisitorMapper;
6
+import com.community.huiju.model.TaVisitor;
7
+import com.community.huiju.model.TaVisitorLicense;
8
+import com.community.huiju.service.TaVistorServiceI;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+
12
+import java.util.Date;
13
+import java.util.List;
14
+
15
+/**
16
+ * @author weichaochao
17
+ * @Title: TaVistorServiceImpl
18
+ * @Description: 访客实现类
19
+ * @date 2018/11/1
20
+ */
21
+@Service("TaVistorServiceImpl")
22
+public class TaVistorServiceImpl implements TaVistorServiceI {
23
+
24
+    @Autowired
25
+    private TaVisitorMapper taVisitorMapper;
26
+
27
+    @Autowired
28
+    private TaVisitorLicenseMapper taVisitorLicenseMapper;
29
+
30
+    @Override
31
+    public void insertTaVistor(TaVisitor taVisitor, Integer communityId, Integer userId) {
32
+
33
+        //todo 推送到海康然后返回给我们一个vistor_code,暂未提供
34
+
35
+        taVisitor.setTaUserId(userId);
36
+        taVisitor.setUpdateUser(userId);
37
+        taVisitor.setCreateUser(userId);
38
+        taVisitor.setCreateDate(new Date());
39
+        taVisitor.setUpdateDate(new Date());
40
+
41
+        if (Constant.EFFECTIVE.equals(taVisitor.getDrivingStatus())){
42
+            taVisitorMapper.insertSelective(taVisitor);
43
+
44
+            for (Integer taCarLicense : taVisitor.getCarLicense()){
45
+                TaVisitorLicense taVisitorLicense = new TaVisitorLicense();
46
+                taVisitorLicense.setCommunityId(communityId);
47
+                taVisitorLicense.setVisitorId(taVisitor.getId());
48
+                taVisitorLicense.setLicense(taCarLicense.toString());
49
+                taVisitorLicense.setCreateUser(userId);
50
+                taVisitorLicense.setCreateDate(new Date());
51
+                taVisitorLicense.setUpdateUser(userId);
52
+                taVisitorLicense.setUpdateDate(new Date());
53
+                taVisitorLicenseMapper.insertSelective(taVisitorLicense);
54
+            }
55
+        } else{
56
+            taVisitorMapper.insertSelective(taVisitor);
57
+        }
58
+
59
+
60
+    }
61
+
62
+    @Override
63
+    public List<TaVisitor> invateHis(Integer communityId, Integer userId) {
64
+        List<TaVisitor> taVisitors = taVisitorMapper.findAllVistors(communityId, userId);
65
+        for (TaVisitor taVisitor : taVisitors){
66
+            if (Constant.EFFECTIVE.equals(taVisitor.getDrivingStatus())){
67
+                List<Integer> taVisitorLicenses = taVisitorLicenseMapper.findTaVistorLicenseById(taVisitor.getId());
68
+                taVisitor.setCarLicense(taVisitorLicenses);
69
+            }
70
+        }
71
+        return taVisitors;
72
+    }
73
+}

+ 135
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorLicenseMapper.xml Visa fil

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

+ 319
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaVisitorMapper.xml Visa fil

@@ -0,0 +1,319 @@
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.TaVisitorMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaVisitor" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="visitor_name" property="visitorName" jdbcType="VARCHAR" />
8
+    <result column="visitor_tel" property="visitorTel" jdbcType="VARCHAR" />
9
+    <result column="visitor_num" property="visitorNum" jdbcType="VARCHAR" />
10
+    <result column="visitor_statrt_time" property="visitorStatrtTime" jdbcType="TIMESTAMP" />
11
+    <result column="visitor_end_time" property="visitorEndTime" jdbcType="INTEGER" />
12
+    <result column="driving_status" property="drivingStatus" jdbcType="CHAR" />
13
+    <result column="pay_entity" property="payEntity" jdbcType="VARCHAR" />
14
+    <result column="visitor_code" property="visitorCode" jdbcType="VARCHAR" />
15
+    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
16
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
17
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
18
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
19
+    <result column="update_darte" property="updateDate" jdbcType="TIMESTAMP" />
20
+  </resultMap>
21
+  <sql id="Base_Column_List" >
22
+    id, community_id, visitor_name, visitor_tel, visitor_num, visitor_statrt_time, visitor_end_time, 
23
+    driving_status, pay_entity, visitor_code, ta_user_id, create_user, create_date, update_user, 
24
+    update_darte
25
+  </sql>
26
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
27
+    select 
28
+    <include refid="Base_Column_List" />
29
+    from ta_visitor
30
+    where id = #{id,jdbcType=INTEGER}
31
+  </select>
32
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
33
+    delete from ta_visitor
34
+    where id = #{id,jdbcType=INTEGER}
35
+  </delete>
36
+  <insert id="insert" parameterType="com.community.huiju.model.TaVisitor" >
37
+    insert into ta_visitor (id, community_id, visitor_name, 
38
+      visitor_tel, visitor_num, visitor_statrt_time, 
39
+      visitor_end_time, driving_status, pay_entity, 
40
+      visitor_code, ta_user_id, create_user, 
41
+      create_date, update_user, update_darte
42
+      )
43
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{visitorName,jdbcType=VARCHAR}, 
44
+      #{visitorTel,jdbcType=VARCHAR}, #{visitorNum,jdbcType=VARCHAR}, #{visitorStatrtTime,jdbcType=TIMESTAMP}, 
45
+      #{visitorEndTime,jdbcType=INTEGER}, #{drivingStatus,jdbcType=CHAR}, #{payEntity,jdbcType=VARCHAR}, 
46
+      #{visitorCode,jdbcType=VARCHAR}, #{taUserId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER}, 
47
+      #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP}
48
+      )
49
+  </insert>
50
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaVisitor" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
51
+    insert into ta_visitor
52
+    <trim prefix="(" suffix=")" suffixOverrides="," >
53
+      <if test="id != null" >
54
+        id,
55
+      </if>
56
+      <if test="communityId != null" >
57
+        community_id,
58
+      </if>
59
+      <if test="visitorName != null" >
60
+        visitor_name,
61
+      </if>
62
+      <if test="visitorTel != null" >
63
+        visitor_tel,
64
+      </if>
65
+      <if test="visitorNum != null" >
66
+        visitor_num,
67
+      </if>
68
+      <if test="visitorStatrtTime != null" >
69
+        visitor_statrt_time,
70
+      </if>
71
+      <if test="visitorEndTime != null" >
72
+        visitor_end_time,
73
+      </if>
74
+      <if test="drivingStatus != null" >
75
+        driving_status,
76
+      </if>
77
+      <if test="payEntity != null" >
78
+        pay_entity,
79
+      </if>
80
+      <if test="visitorCode != null" >
81
+        visitor_code,
82
+      </if>
83
+      <if test="taUserId != null" >
84
+        ta_user_id,
85
+      </if>
86
+      <if test="createUser != null" >
87
+        create_user,
88
+      </if>
89
+      <if test="createDate != null" >
90
+        create_date,
91
+      </if>
92
+      <if test="updateUser != null" >
93
+        update_user,
94
+      </if>
95
+      <if test="updateDate != null" >
96
+        update_darte,
97
+      </if>
98
+    </trim>
99
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
100
+      <if test="id != null" >
101
+        #{id,jdbcType=INTEGER},
102
+      </if>
103
+      <if test="communityId != null" >
104
+        #{communityId,jdbcType=INTEGER},
105
+      </if>
106
+      <if test="visitorName != null" >
107
+        #{visitorName,jdbcType=VARCHAR},
108
+      </if>
109
+      <if test="visitorTel != null" >
110
+        #{visitorTel,jdbcType=VARCHAR},
111
+      </if>
112
+      <if test="visitorNum != null" >
113
+        #{visitorNum,jdbcType=VARCHAR},
114
+      </if>
115
+      <if test="visitorStatrtTime != null" >
116
+        #{visitorStatrtTime,jdbcType=TIMESTAMP},
117
+      </if>
118
+      <if test="visitorEndTime != null" >
119
+        #{visitorEndTime,jdbcType=INTEGER},
120
+      </if>
121
+      <if test="drivingStatus != null" >
122
+        #{drivingStatus,jdbcType=CHAR},
123
+      </if>
124
+      <if test="payEntity != null" >
125
+        #{payEntity,jdbcType=VARCHAR},
126
+      </if>
127
+      <if test="visitorCode != null" >
128
+        #{visitorCode,jdbcType=VARCHAR},
129
+      </if>
130
+      <if test="taUserId != null" >
131
+        #{taUserId,jdbcType=INTEGER},
132
+      </if>
133
+      <if test="createUser != null" >
134
+        #{createUser,jdbcType=INTEGER},
135
+      </if>
136
+      <if test="createDate != null" >
137
+        #{createDate,jdbcType=TIMESTAMP},
138
+      </if>
139
+      <if test="updateUser != null" >
140
+        #{updateUser,jdbcType=INTEGER},
141
+      </if>
142
+      <if test="updateDate != null" >
143
+        #{updateDate,jdbcType=TIMESTAMP},
144
+      </if>
145
+    </trim>
146
+  </insert>
147
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaVisitor" >
148
+    update ta_visitor
149
+    <set >
150
+      <if test="communityId != null" >
151
+        community_id = #{communityId,jdbcType=INTEGER},
152
+      </if>
153
+      <if test="visitorName != null" >
154
+        visitor_name = #{visitorName,jdbcType=VARCHAR},
155
+      </if>
156
+      <if test="visitorTel != null" >
157
+        visitor_tel = #{visitorTel,jdbcType=VARCHAR},
158
+      </if>
159
+      <if test="visitorNum != null" >
160
+        visitor_num = #{visitorNum,jdbcType=VARCHAR},
161
+      </if>
162
+      <if test="visitorStatrtTime != null" >
163
+        visitor_statrt_time = #{visitorStatrtTime,jdbcType=TIMESTAMP},
164
+      </if>
165
+      <if test="visitorEndTime != null" >
166
+        visitor_end_time = #{visitorEndTime,jdbcType=INTEGER},
167
+      </if>
168
+      <if test="drivingStatus != null" >
169
+        driving_status = #{drivingStatus,jdbcType=CHAR},
170
+      </if>
171
+      <if test="payEntity != null" >
172
+        pay_entity = #{payEntity,jdbcType=VARCHAR},
173
+      </if>
174
+      <if test="visitorCode != null" >
175
+        visitor_code = #{visitorCode,jdbcType=VARCHAR},
176
+      </if>
177
+      <if test="taUserId != null" >
178
+        ta_user_id = #{taUserId,jdbcType=INTEGER},
179
+      </if>
180
+      <if test="createUser != null" >
181
+        create_user = #{createUser,jdbcType=INTEGER},
182
+      </if>
183
+      <if test="createDate != null" >
184
+        create_date = #{createDate,jdbcType=TIMESTAMP},
185
+      </if>
186
+      <if test="updateUser != null" >
187
+        update_user = #{updateUser,jdbcType=INTEGER},
188
+      </if>
189
+      <if test="updateDate != null" >
190
+        update_darte = #{updateDate,jdbcType=TIMESTAMP},
191
+      </if>
192
+    </set>
193
+    where id = #{id,jdbcType=INTEGER}
194
+  </update>
195
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaVisitor" >
196
+    update ta_visitor
197
+    set community_id = #{communityId,jdbcType=INTEGER},
198
+      visitor_name = #{visitorName,jdbcType=VARCHAR},
199
+      visitor_tel = #{visitorTel,jdbcType=VARCHAR},
200
+      visitor_num = #{visitorNum,jdbcType=VARCHAR},
201
+      visitor_statrt_time = #{visitorStatrtTime,jdbcType=TIMESTAMP},
202
+      visitor_end_time = #{visitorEndTime,jdbcType=INTEGER},
203
+      driving_status = #{drivingStatus,jdbcType=CHAR},
204
+      pay_entity = #{payEntity,jdbcType=VARCHAR},
205
+      visitor_code = #{visitorCode,jdbcType=VARCHAR},
206
+      ta_user_id = #{taUserId,jdbcType=INTEGER},
207
+      create_user = #{createUser,jdbcType=INTEGER},
208
+      create_date = #{createDate,jdbcType=TIMESTAMP},
209
+      update_user = #{updateUser,jdbcType=INTEGER},
210
+      update_darte = #{updateDate,jdbcType=TIMESTAMP}
211
+    where id = #{id,jdbcType=INTEGER}
212
+  </update>
213
+
214
+  <insert id="insertVistorAndLicense" parameterType="com.community.huiju.model.TaVisitor" >
215
+    insert into ta_visitor
216
+    <trim prefix="(" suffix=")" suffixOverrides="," >
217
+      <if test="id != null" >
218
+        id,
219
+      </if>
220
+      <if test="communityId != null" >
221
+        community_id,
222
+      </if>
223
+      <if test="visitorName != null" >
224
+        visitor_name,
225
+      </if>
226
+      <if test="visitorTel != null" >
227
+        visitor_tel,
228
+      </if>
229
+      <if test="visitorNum != null" >
230
+        visitor_num,
231
+      </if>
232
+      <if test="visitorStatrtTime != null" >
233
+        visitor_statrt_time,
234
+      </if>
235
+      <if test="visitorEndTime != null" >
236
+        visitor_end_time,
237
+      </if>
238
+      <if test="drivingStatus != null" >
239
+        driving_status,
240
+      </if>
241
+      <if test="payEntity != null" >
242
+        pay_entity,
243
+      </if>
244
+      <if test="visitorCode != null" >
245
+        visitor_code,
246
+      </if>
247
+      <if test="taUserId != null" >
248
+        ta_user_id,
249
+      </if>
250
+      <if test="createUser != null" >
251
+        create_user,
252
+      </if>
253
+      <if test="createDate != null" >
254
+        create_date,
255
+      </if>
256
+      <if test="updateUser != null" >
257
+        update_user,
258
+      </if>
259
+      <if test="updateDate != null" >
260
+        update_darte,
261
+      </if>
262
+    </trim>
263
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
264
+      <if test="id != null" >
265
+        #{id,jdbcType=INTEGER},
266
+      </if>
267
+      <if test="communityId != null" >
268
+        #{communityId,jdbcType=INTEGER},
269
+      </if>
270
+      <if test="visitorName != null" >
271
+        #{visitorName,jdbcType=VARCHAR},
272
+      </if>
273
+      <if test="visitorTel != null" >
274
+        #{visitorTel,jdbcType=VARCHAR},
275
+      </if>
276
+      <if test="visitorNum != null" >
277
+        #{visitorNum,jdbcType=VARCHAR},
278
+      </if>
279
+      <if test="visitorStatrtTime != null" >
280
+        #{visitorStatrtTime,jdbcType=TIMESTAMP},
281
+      </if>
282
+      <if test="visitorEndTime != null" >
283
+        #{visitorEndTime,jdbcType=INTEGER},
284
+      </if>
285
+      <if test="drivingStatus != null" >
286
+        #{drivingStatus,jdbcType=CHAR},
287
+      </if>
288
+      <if test="payEntity != null" >
289
+        #{payEntity,jdbcType=VARCHAR},
290
+      </if>
291
+      <if test="visitorCode != null" >
292
+        #{visitorCode,jdbcType=VARCHAR},
293
+      </if>
294
+      <if test="taUserId != null" >
295
+        #{taUserId,jdbcType=INTEGER},
296
+      </if>
297
+      <if test="createUser != null" >
298
+        #{createUser,jdbcType=INTEGER},
299
+      </if>
300
+      <if test="createDate != null" >
301
+        #{createDate,jdbcType=TIMESTAMP},
302
+      </if>
303
+      <if test="updateUser != null" >
304
+        #{updateUser,jdbcType=INTEGER},
305
+      </if>
306
+      <if test="updateDate != null" >
307
+        #{updateDate,jdbcType=TIMESTAMP},
308
+      </if>
309
+    </trim>
310
+  </insert>
311
+
312
+  <select id="findAllVistors" resultMap="BaseResultMap">
313
+    select
314
+    <include refid="Base_Column_List" />
315
+    from ta_visitor
316
+    where community_id = #{communityId,jdbcType=INTEGER}
317
+    and ta_user_id = #{userId,jdbcType=INTEGER}
318
+  </select>
319
+</mapper>

+ 6
- 3
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Visa fil

@@ -16,7 +16,10 @@ public class Constant {
16 16
     public static final String WEB_USER_SESSION = "webUser";
17 17
 
18 18
     /** 不需要权限的URL身份 **/
19
-    public static final String ROLE_NONE = "ROLE_NONEUSER";
19
+    public static final String ROLE_NONEUSER = "ROLE_NONEUSER";
20
+
21
+    /** 校验出现问题后的默认身份 **/
22
+    public static final String ROLE_NONE = "ROLE_NONE";
20 23
 
21 24
     /** app登陆类型 **/
22 25
     public static final String APP_LOGIN_TYPE = "app";
@@ -60,10 +63,10 @@ public class Constant {
60 63
     /** banner类型公告**/
61 64
     public static final String BANNER = "banner";
62 65
 
63
-    /**有效状态**/
66
+    /**有效状态,开车**/
64 67
     public static final String EFFECTIVE = "1";
65 68
 
66
-    /**无效状态**/
69
+    /**无效状态,不开车**/
67 70
     public static final String INVALID = "0";
68 71
 
69 72
     /**业主角色**/

Binär
CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class Visa fil


+ 11
- 4
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/BannerController.java Visa fil

@@ -17,6 +17,9 @@ import org.springframework.web.bind.annotation.*;
17 17
 import javax.servlet.http.HttpSession;
18 18
 import javax.validation.Valid;
19 19
 
20
+/**
21
+ * @author weiximei
22
+ */
20 23
 @RestController
21 24
 @RefreshScope
22 25
 @RequestMapping("/")
@@ -79,11 +82,15 @@ public class BannerController {
79 82
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "bannerTitle",value = "bannerTitle(标题)"),
80 83
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "bannerPosition",value = "bannerPosition(Banner位)"),
81 84
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "bannerDescription",value = "bannerDescription(跳转概述)"),
85
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "pageNum", value = "分页第几页"),
86
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "pageSize", value = "分页每页长度")
82 87
     })
83 88
     @RequestMapping(value = "/banner/list",method = RequestMethod.GET)
84
-    public ResponseBean getBanner(@RequestParam(value = "bannerTitle") String bannerTitle,
85
-                                  @RequestParam(value = "bannerPosition") Integer bannerPosition,
86
-                                  @RequestParam(value = "bannerDescription") String bannerDescription){
89
+    public ResponseBean getBanner(@RequestParam(value = "bannerTitle", required = false) String bannerTitle,
90
+                                  @RequestParam(value = "bannerPosition", required = false) Integer bannerPosition,
91
+                                  @RequestParam(value = "bannerDescription", required = false) String bannerDescription,
92
+                                  @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
93
+                                  @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
87 94
 
88 95
 
89 96
         ResponseBean response = new ResponseBean();
@@ -91,7 +98,7 @@ public class BannerController {
91 98
         banner.setBannerTitle(bannerTitle);
92 99
         banner.setBannerPosition(bannerPosition);
93 100
         banner.setBannerDescription(bannerDescription);
94
-        response = iToBannerService.getBanner(banner);
101
+        response = iToBannerService.getBanner(banner,pageNum,pageSize);
95 102
         return response;
96 103
     }
97 104
 

+ 3
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToBannerService.java Visa fil

@@ -41,8 +41,10 @@ public interface IToBannerService {
41 41
      *
42 42
      *
43 43
      * @param banner
44
+     * @param pageNum
45
+     * @param pageSize
44 46
      * @return
45 47
      */
46
-    ResponseBean getBanner(ToBanner banner);
48
+    ResponseBean getBanner(ToBanner banner, Integer pageNum, Integer pageSize);
47 49
 
48 50
 }

+ 18
- 18
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToSysRoleService.java Visa fil

@@ -1,18 +1,18 @@
1
-package com.community.huiju.service;
2
-
3
-import com.community.huiju.model.ToSysRole;
4
-
5
-import java.util.List;
6
-
7
-/**
8
- * 角色 业务
9
- * @author weiximei
10
- */
11
-public interface IToSysRoleService {
12
-    /**
13
-     * 根据用户ID查询所有角色
14
-     * @param userId
15
-     * @return
16
-     */
17
-    List<ToSysRole> selectRoleByUserId(Integer userId);
18
-}
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.ToSysRole;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * 角色 业务
9
+ * @author weiximei
10
+ */
11
+public interface IToSysRoleService {
12
+    /**
13
+     * 根据用户ID查询所有角色
14
+     * @param userId
15
+     * @return
16
+     */
17
+    List<ToSysRole> selectRoleByUserId(Integer userId);
18
+}

+ 4
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java Visa fil

@@ -12,6 +12,7 @@ import com.community.huiju.model.ToCommunities;
12 12
 import com.community.huiju.model.ToUser;
13 13
 import com.community.huiju.service.IToBannerService;
14 14
 import com.community.huiju.vo.ToBannerVO;
15
+import com.github.pagehelper.PageHelper;
15 16
 import org.apache.commons.lang.StringUtils;
16 17
 import org.springframework.beans.BeanUtils;
17 18
 import org.springframework.beans.factory.annotation.Autowired;
@@ -129,11 +130,13 @@ public class ToBannerServiceImpl implements IToBannerService {
129 130
     }
130 131
 
131 132
     @Override
132
-    public ResponseBean getBanner(ToBanner banner) {
133
+    public ResponseBean getBanner(ToBanner banner,Integer pageNum, Integer pageSize) {
133 134
 
134 135
         ResponseBean response = new ResponseBean();
135 136
 
137
+        PageHelper.startPage(pageNum,pageSize);
136 138
         List<ToBanner> bannerList = toBannerMapper.selectBanner(banner);
139
+
137 140
         List<ToBannerVO> bannerVOList = bannerList.stream().map(e->{
138 141
             ToBannerVO toBannerVO = new ToBannerVO();
139 142
             BeanUtils.copyProperties(e,toBannerVO);

+ 24
- 24
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToSysRoleServiceImpl.java Visa fil

@@ -1,24 +1,24 @@
1
-package com.community.huiju.service.impl;
2
-
3
-import com.community.huiju.dao.ToSysRoleMapper;
4
-import com.community.huiju.model.ToSysRole;
5
-import com.community.huiju.service.IToSysRoleService;
6
-import lombok.extern.slf4j.Slf4j;
7
-import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.stereotype.Service;
9
-
10
-import java.util.List;
11
-
12
-@Service("iToSysRoleService")
13
-@Slf4j
14
-public class ToSysRoleServiceImpl implements IToSysRoleService {
15
-
16
-    @Autowired
17
-    private ToSysRoleMapper toSysRoleMapper;
18
-
19
-    @Override
20
-    public List<ToSysRole> selectRoleByUserId(Integer userId) {
21
-
22
-        return toSysRoleMapper.selectRoleByUserId(userId);
23
-    }
24
-}
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.huiju.dao.ToSysRoleMapper;
4
+import com.community.huiju.model.ToSysRole;
5
+import com.community.huiju.service.IToSysRoleService;
6
+import lombok.extern.slf4j.Slf4j;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+import java.util.List;
11
+
12
+@Service("iToSysRoleService")
13
+@Slf4j
14
+public class ToSysRoleServiceImpl implements IToSysRoleService {
15
+
16
+    @Autowired
17
+    private ToSysRoleMapper toSysRoleMapper;
18
+
19
+    @Override
20
+    public List<ToSysRole> selectRoleByUserId(Integer userId) {
21
+
22
+        return toSysRoleMapper.selectRoleByUserId(userId);
23
+    }
24
+}

+ 2
- 3
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestAuthenticationEntryPoint.java Visa fil

@@ -35,10 +35,9 @@ public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
35 35
             }else if (Status.RESPONSE_STATUS_803.getValue().equals(headerError)) {
36 36
                 result.addError(Status.RESPONSE_STATUS_803.getValue(),Status.RESPONSE_STATUS_803.getComment());
37 37
             }
38
+        } else {
39
+            result.addError(Status.RESPONSE_STATUS_888.getValue(),Status.RESPONSE_STATUS_888.getComment());
38 40
         }
39
-//        else {
40
-//            result.addError(Status.RESPONSE_STATUS_888.getValue(),Status.RESPONSE_STATUS_888.getComment());
41
-//        }
42 41
 
43 42
         try {
44 43
             //设置跨域请求 请求结果json刷到响应里

+ 12
- 1
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateProvider.java Visa fil

@@ -1,11 +1,16 @@
1 1
 package com.community.huiju.security;
2 2
 
3
+import com.community.commom.constant.Constant;
3 4
 import com.community.huiju.exception.WisdomSecurityException;
4 5
 import org.springframework.security.authentication.AuthenticationProvider;
5 6
 import org.springframework.security.core.Authentication;
6 7
 import org.springframework.security.core.AuthenticationException;
8
+import org.springframework.security.core.GrantedAuthority;
7 9
 import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
8 10
 
11
+import java.util.Collection;
12
+import java.util.List;
13
+
9 14
 /**
10 15
  * 授权过程
11 16
  *
@@ -18,7 +23,13 @@ public class RestPreAuthenticateProvider implements AuthenticationProvider {
18 23
 
19 24
 
20 25
         TokenAuthrentication tokenAuthrentication = (TokenAuthrentication) authentication.getPrincipal();
21
-        if (null != tokenAuthrentication.getAuthorities() && tokenAuthrentication.getAuthorities().size() > 0) {
26
+        Collection<GrantedAuthority> grantedAuthorityList = tokenAuthrentication.getAuthorities();
27
+        if (null != grantedAuthorityList && grantedAuthorityList.size() > 0) {
28
+             boolean isNone= grantedAuthorityList.stream().anyMatch(e->e.getAuthority().equals(Constant.ROLE_NONE));
29
+             if (isNone) {
30
+                 tokenAuthrentication.setAuthenticated(false);
31
+                 return tokenAuthrentication;
32
+             }
22 33
             tokenAuthrentication.setAuthenticated(true);
23 34
             return tokenAuthrentication;
24 35
         }

+ 2
- 2
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticatedProcessingFilter.java Visa fil

@@ -57,7 +57,7 @@ public class RestPreAuthenticatedProcessingFilter extends AbstractPreAuthenticat
57 57
         // 不需要的拦截请求处理
58 58
         if (isNoneSecurity(request.getRequestURI().toString()) || "OPTIONS".equals(request.getMethod())){
59 59
             GrantedAuthority[] authorities = new GrantedAuthority[1];
60
-            GrantedAuthority roleNone = new SimpleGrantedAuthority(Constant.ROLE_NONE);
60
+            GrantedAuthority roleNone = new SimpleGrantedAuthority(Constant.ROLE_NONEUSER);
61 61
             authorities[0]=roleNone;
62 62
             grantedAuthorityList.add(authorities[0]);
63 63
             return new TokenAuthrentication(grantedAuthorityList);
@@ -89,7 +89,7 @@ public class RestPreAuthenticatedProcessingFilter extends AbstractPreAuthenticat
89 89
         }else {
90 90
             // 校验有问题后, 需要给个角色, 让流程继续下去
91 91
             GrantedAuthority[] authorities = new GrantedAuthority[1];
92
-            GrantedAuthority roleNone = new SimpleGrantedAuthority("ROLE_NONE");
92
+            GrantedAuthority roleNone = new SimpleGrantedAuthority(Constant.ROLE_NONE);
93 93
             authorities[0]=roleNone;
94 94
             grantedAuthorityList.add(authorities[0]);
95 95
         }

+ 11
- 0
VUECODE/smart-operate-manage/src/api/banner.js Visa fil

@@ -0,0 +1,11 @@
1
+import request from '@/utils/request'
2
+
3
+export function getBanner(...banner) {
4
+  return request({
5
+    url: '/banner/list',
6
+    method: 'get',
7
+    params: {
8
+      ...banner
9
+    }
10
+  });
11
+}

+ 2
- 2
VUECODE/smart-operate-manage/src/api/login.js Visa fil

@@ -16,8 +16,8 @@ export function login(username, password) {
16 16
 export function getInfo(token) {
17 17
   return request({
18 18
     url: '/user/info',
19
-    method: 'get',
20
-    params: { token }
19
+    method: 'get'
20
+    // params: { token }
21 21
   })
22 22
 }
23 23
 

+ 1
- 1
VUECODE/smart-operate-manage/src/api/table.js Visa fil

@@ -2,7 +2,7 @@ import request from '@/utils/request'
2 2
 
3 3
 export function getList(params) {
4 4
   return request({
5
-    url: '/table/list',
5
+    url: '/banner/list',
6 6
     method: 'get',
7 7
     params
8 8
   })

+ 4
- 4
VUECODE/smart-operate-manage/src/router/index.js Visa fil

@@ -56,14 +56,14 @@ export const constantRouterMap = [
56 56
   {
57 57
     path: '/banner',
58 58
     component: Layout,
59
-    redirect: '/banner/download',
59
+    redirect: '/banner/index',
60 60
     alwaysShow: true,
61 61
     meta: { title: '运营数据', icon: 'zip' },
62 62
     children: [
63 63
       {
64
-        path: 'download',
65
-        component: () => import('@/views/table/index'),
66
-        name: 'ExportZip',
64
+        path: 'index',
65
+        component: () => import('@/views/banner/index'),
66
+        name: 'banner-index',
67 67
         meta: { title: 'banner运营', icon: 'table' }
68 68
       }
69 69
     ]

+ 1
- 1
VUECODE/smart-operate-manage/src/store/modules/user.js Visa fil

@@ -50,7 +50,7 @@ const user = {
50 50
           } else {
51 51
             reject('getInfo: roles must be a non-null array !')
52 52
           }
53
-          commit('SET_NAME', data.name)
53
+          commit('SET_NAME', data.userName)
54 54
           commit('SET_AVATAR', data.avatar)
55 55
           resolve(response)
56 56
         }).catch(error => {

+ 1
- 1
VUECODE/smart-operate-manage/src/utils/auth.js Visa fil

@@ -1,6 +1,6 @@
1 1
 import Cookies from 'js-cookie'
2 2
 
3
-const TokenKey = 'Admin-Token'
3
+const TokenKey = 'X-Auth-Token'
4 4
 
5 5
 export function getToken() {
6 6
   return Cookies.get(TokenKey)

+ 3
- 3
VUECODE/smart-operate-manage/src/utils/request.js Visa fil

@@ -13,7 +13,7 @@ const service = axios.create({
13 13
 service.interceptors.request.use(
14 14
   config => {
15 15
     if (store.getters.token) {
16
-      config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
16
+      config.headers['X-Auth-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
17 17
     }
18 18
     return config
19 19
   },
@@ -38,8 +38,8 @@ service.interceptors.response.use(
38 38
         duration: 5 * 1000
39 39
       })
40 40
 
41
-      // 50008:非法的token; 50012:其他客户端登录了;  50014:Token 过期了;
42
-      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
41
+      // 802:Token 身份凭证不存在; 50012:其他客户端登录了;  803:Token 过期了;
42
+      if (res.code === 802 || res.code === 50012 || res.code === 803) {
43 43
         MessageBox.confirm(
44 44
           '你已被登出,可以取消继续留在该页面,或者重新登录',
45 45
           '确定登出',

+ 62
- 0
VUECODE/smart-operate-manage/src/views/banner/index.vue Visa fil

@@ -0,0 +1,62 @@
1
+<template>
2
+  <div class="search-header">
3
+    <el-form ref="form" :model="bannr" label-width="100px">
4
+      <el-form-item label="标题">
5
+        <el-input v-model="bannr.bannerTitle" />
6
+      </el-form-item>
7
+      <el-form-item label="跳转概述">
8
+        <el-input v-model="bannr.bannerDescription" />
9
+      </el-form-item>
10
+      <el-form-item label="适用社区">
11
+        <el-select v-model="bannr.communityId" placeholder="请选择社区">
12
+          <el-option label="智慧社区" value="shanghai" />
13
+        </el-select>
14
+      </el-form-item>
15
+      <el-form-item label="banner位置">
16
+        <el-select v-model="bannr.bannerPosition" placeholder="请选择banner位置">
17
+          <el-option label="首页banner" value="shanghai" />
18
+          <el-option label="服务员banner" value="beijing" />
19
+        </el-select>
20
+      </el-form-item>
21
+      <el-form-item>
22
+        <el-button>清空</el-button>
23
+        <el-button type="primary" @click="search">搜索</el-button>
24
+      </el-form-item>
25
+    </el-form>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+export default {
31
+  name: 'BannerIndex',
32
+  data() {
33
+    return {
34
+      bannr: {
35
+        bannerTitle: '',
36
+        bannerPosition: '',
37
+        bannerDescription: '',
38
+        communityId: '',
39
+        pageNum: '',
40
+        pageSize: ''
41
+      }
42
+    }
43
+  },
44
+  methods: {
45
+    search() {
46
+      console.log(this.bannr)
47
+    }
48
+  }
49
+}
50
+</script>
51
+
52
+<style rel="stylesheet/scss" lang="scss" scoped>
53
+.search-header {
54
+  float: left;
55
+  margin: 20px;
56
+  .el-form-item {
57
+    float: left;
58
+    margin-left: 20px;
59
+  }
60
+}
61
+</style>
62
+

+ 27
- 18
VUECODE/smart-operate-manage/src/views/login/index.vue Visa fil

@@ -8,24 +8,21 @@
8 8
         </span>
9 9
         <el-input v-model="loginForm.username" name="username" type="text" auto-complete="on" placeholder="请输入手机号" />
10 10
       </el-form-item>
11
-      <el-form-item prop="password">
12
-        <span class="svg-container">
13
-          <svg-icon icon-class="password" />
14
-        </span>
15
-        <el-input
16
-          v-model="loginForm.password"
17
-          name="password"
18
-          type="text"
19
-          auto-complete="on"
20
-          placeholder="请输入验证码"
21
-          @keyup.enter.native="handleLogin" />
22
-      </el-form-item>
23
-      <el-button type="primary" @click="sendCode();">发送验证码</el-button>
24
-      <el-form-item>
25
-        <el-button :loading="loading" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
26
-          登录
27
-        </el-button>
28
-      </el-form-item>
11
+      <div class="pwdSend">
12
+        <el-form-item prop="password">
13
+          <el-input
14
+            v-model="loginForm.password"
15
+            name="password"
16
+            type="text"
17
+            auto-complete="on"
18
+            placeholder="请输入验证码"
19
+            @keyup.enter.native="handleLogin" />
20
+        </el-form-item>
21
+        <el-button type="primary" @click="sendCode();">发送验证码</el-button>
22
+      </div>
23
+      <el-button :loading="loading" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
24
+        登录
25
+      </el-button>
29 26
     </el-form>
30 27
   </div>
31 28
 </template>
@@ -149,6 +146,18 @@ $light_gray:#eee;
149 146
     max-width: 100%;
150 147
     padding: 35px 35px 15px 35px;
151 148
     margin: 120px auto;
149
+    .pwdSend {
150
+      float: left;
151
+      .el-form-item {
152
+        float: left;
153
+        .el-input {
154
+          float: left;
155
+        }
156
+      }
157
+      .el-button {
158
+        margin-left: 20px;
159
+      }
160
+    }
152 161
   }
153 162
   .tips {
154 163
     font-size: 14px;