Browse Source

合并本地文件

weiximei 6 years ago
parent
commit
c33e1fc09c
20 changed files with 2064 additions and 1057 deletions
  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. 2
    2
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  11. 42
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToCommunities.java
  12. 18
    18
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToSysRoleService.java
  13. 24
    24
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToSysRoleServiceImpl.java
  14. 6
    2
      CODE/smart-community/operate-api/src/main/resources/mapper/ToCommunitiesMapper.xml
  15. 0
    32
      VUECODE/smart-operate-manage/src/api/community.js
  16. 3
    1
      VUECODE/smart-operate-manage/src/store/index.js
  17. 36
    0
      VUECODE/smart-operate-manage/src/store/modules/community.js
  18. 63
    97
      VUECODE/smart-operate-manage/src/views/community/communityTable.vue
  19. 486
    444
      文档/MYSQL/smartCommunity.pdb
  20. 479
    437
      文档/MYSQL/smartCommunity.pdm

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

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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>

+ 2
- 2
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java View File

@@ -63,10 +63,10 @@ public class Constant {
63 63
     /** banner类型公告**/
64 64
     public static final String BANNER = "banner";
65 65
 
66
-    /**有效状态**/
66
+    /**有效状态,开车**/
67 67
     public static final String EFFECTIVE = "1";
68 68
 
69
-    /**无效状态**/
69
+    /**无效状态,不开车**/
70 70
     public static final String INVALID = "0";
71 71
 
72 72
     /**业主角色**/

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

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import java.util.Date;
4
+
3 5
 public class ToCommunities {
4 6
     private Integer id;
5 7
 
@@ -20,6 +22,14 @@ public class ToCommunities {
20 22
     private String userName;
21 23
     
22 24
     private String loginName;
25
+    
26
+    private Integer createUser;
27
+    
28
+    private Date createDate;
29
+    
30
+    private Integer updateUser;
31
+    
32
+    private Date updateDate;
23 33
 
24 34
     public Integer getId() {
25 35
         return id;
@@ -100,4 +110,36 @@ public class ToCommunities {
100 110
     public void setLoginName(String loginName) {
101 111
         this.loginName = loginName;
102 112
     }
113
+    
114
+    public Integer getCreateUser() {
115
+        return createUser;
116
+    }
117
+    
118
+    public void setCreateUser(Integer createUser) {
119
+        this.createUser = createUser;
120
+    }
121
+    
122
+    public Date getCreateDate() {
123
+        return createDate;
124
+    }
125
+    
126
+    public void setCreateDate(Date createDate) {
127
+        this.createDate = createDate;
128
+    }
129
+    
130
+    public Integer getUpdateUser() {
131
+        return updateUser;
132
+    }
133
+    
134
+    public void setUpdateUser(Integer updateUser) {
135
+        this.updateUser = updateUser;
136
+    }
137
+    
138
+    public Date getUpdateDate() {
139
+        return updateDate;
140
+    }
141
+    
142
+    public void setUpdateDate(Date updateDate) {
143
+        this.updateDate = updateDate;
144
+    }
103 145
 }

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

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

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

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

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

@@ -12,10 +12,14 @@
12 12
     <result column="latitude" property="latitude" jdbcType="VARCHAR" />
13 13
     <result column="user_name" property="userName" jdbcType="VARCHAR" />
14 14
     <result column="login_name" property="loginName" jdbcType="VARCHAR" />
15
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
16
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
17
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
18
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
15 19
   </resultMap>
16 20
   <sql id="Base_Column_List" >
17
-    id, community_name, community_alias, province_id, city_id, district_id, longitude, 
18
-    latitude,user_name,login_name
21
+    id, community_name, community_alias, province_id, city_id, district_id, longitude,
22
+    latitude,user_name,login_name,create_user,create_date,update_user,update_date
19 23
   </sql>
20 24
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21 25
     select 

+ 0
- 32
VUECODE/smart-operate-manage/src/api/community.js View File

@@ -7,35 +7,3 @@ export function fetchList(query) {
7 7
     params: query
8 8
   })
9 9
 }
10
-
11
-export function fetchArticle(id) {
12
-  return request({
13
-    url: '/article/detail',
14
-    method: 'get',
15
-    params: { id }
16
-  })
17
-}
18
-
19
-export function fetchPv(pv) {
20
-  return request({
21
-    url: '/article/pv',
22
-    method: 'get',
23
-    params: { pv }
24
-  })
25
-}
26
-
27
-export function createArticle(data) {
28
-  return request({
29
-    url: '/article/create',
30
-    method: 'post',
31
-    data
32
-  })
33
-}
34
-
35
-export function updateArticle(data) {
36
-  return request({
37
-    url: '/article/update',
38
-    method: 'post',
39
-    data
40
-  })
41
-}

+ 3
- 1
VUECODE/smart-operate-manage/src/store/index.js View File

@@ -2,6 +2,7 @@ import Vue from 'vue'
2 2
 import Vuex from 'vuex'
3 3
 import app from './modules/app'
4 4
 import user from './modules/user'
5
+import community from './modules/community'
5 6
 import getters from './getters'
6 7
 
7 8
 Vue.use(Vuex)
@@ -9,7 +10,8 @@ Vue.use(Vuex)
9 10
 const store = new Vuex.Store({
10 11
   modules: {
11 12
     app,
12
-    user
13
+    user,
14
+    community
13 15
   },
14 16
   getters
15 17
 })

+ 36
- 0
VUECODE/smart-operate-manage/src/store/modules/community.js View File

@@ -0,0 +1,36 @@
1
+import { fetchList } from '@/api/community'
2
+
3
+const community = {
4
+  namespace: true,
5
+  state: {
6
+    total: '',
7
+    list: []
8
+  },
9
+
10
+  mutations: {
11
+    SET_LIST: (state, list) => {
12
+      state.list = list
13
+    },
14
+    SET_TOTAL: (state, total) => {
15
+      state.total = total
16
+    }
17
+  },
18
+
19
+  actions: {
20
+    // fetchList,获取社区列表
21
+    FetchList({ commit }, listQuery) {
22
+      return new Promise((resolve, reject) => {
23
+        fetchList(listQuery).then(response => {
24
+          const data = response.data
25
+          commit('SET_LIST', data.items)
26
+          commit('SET_TOTAL', data.total)
27
+          resolve()
28
+        }).catch(error => {
29
+          reject(error)
30
+        })
31
+      })
32
+    }
33
+  }
34
+}
35
+
36
+export default community

+ 63
- 97
VUECODE/smart-operate-manage/src/views/community/communityTable.vue View File

@@ -1,20 +1,19 @@
1 1
 <template>
2 2
   <div class="app-container">
3 3
     <div class="filter-container">
4
-      <el-input :placeholder="$t('table.title')" v-model="listQuery.title" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
5
-      <el-select v-model="listQuery.importance" :placeholder="$t('table.importance')" clearable style="width: 90px" class="filter-item">
4
+      <el-input v-model="listQuery.title" placeholder="社区编号" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
5
+      <el-input v-model="listQuery.title" placeholder="社区名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
6
+      <el-select v-model="listQuery.importance" placeholder="省" clearable style="width: 90px" class="filter-item">
6 7
         <el-option v-for="item in importanceOptions" :key="item" :label="item" :value="item"/>
7 8
       </el-select>
8
-      <el-select v-model="listQuery.type" :placeholder="$t('table.type')" clearable class="filter-item" style="width: 130px">
9
+      <el-select v-model="listQuery.type" placeholder="市" clearable class="filter-item" style="width: 130px">
9 10
         <el-option v-for="item in calendarTypeOptions" :key="item.key" :label="item.display_name+'('+item.key+')'" :value="item.key"/>
10 11
       </el-select>
11
-      <el-select v-model="listQuery.sort" style="width: 140px" class="filter-item" @change="handleFilter">
12
-        <el-option v-for="item in sortOptions" :key="item.key" :label="item.label" :value="item.key"/>
12
+      <el-select v-model="listQuery.type" placeholder="区县乡" clearable class="filter-item" style="width: 130px">
13
+        <el-option v-for="item in calendarTypeOptions" :key="item.key" :label="item.display_name+'('+item.key+')'" :value="item.key"/>
13 14
       </el-select>
14
-      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">{{ $t('table.search') }}</el-button>
15
-      <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">{{ $t('table.add') }}</el-button>
16
-      <el-button v-waves :loading="downloadLoading" class="filter-item" type="primary" icon="el-icon-download" @click="handleDownload">{{ $t('table.export') }}</el-button>
17
-      <el-checkbox v-model="showReviewer" class="filter-item" style="margin-left:15px;" @change="tableKey=tableKey+1">{{ $t('table.reviewer') }}</el-checkbox>
15
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">查询</el-button>
16
+      <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">添加</el-button>
18 17
     </div>
19 18
 
20 19
     <el-table
@@ -26,57 +25,70 @@
26 25
       highlight-current-row
27 26
       style="width: 100%;"
28 27
       @sort-change="sortChange">
29
-      <el-table-column :label="$t('table.id')" prop="id" sortable="custom" align="center" width="65">
28
+      <el-table-column
29
+        label="序号"
30
+        align="center"
31
+        type="index"
32
+        width="50"/>
33
+      <el-table-column label="社区编号" prop="id" align="center" width="105">
30 34
         <template slot-scope="scope">
31 35
           <span>{{ scope.row.id }}</span>
32 36
         </template>
33 37
       </el-table-column>
34
-      <el-table-column :label="$t('table.date')" width="150px" align="center">
38
+      <el-table-column label="社区名称" prop="id" align="center" width="105">
39
+        <template slot-scope="scope">
40
+          <span>{{ scope.row.communityName }}</span>
41
+        </template>
42
+      </el-table-column>
43
+      <el-table-column label="社区别名" prop="id" align="center" width="105">
44
+        <template slot-scope="scope">
45
+          <span>{{ scope.row.communityAlias }}</span>
46
+        </template>
47
+      </el-table-column>
48
+      <el-table-column label="所在地区" prop="id" align="center" width="305">
49
+        <template slot-scope="scope">
50
+          <span>{{ scope.row.province_id }}{{ scope.row.city_id }}{{ scope.row.district_id }}</span>
51
+        </template>
52
+      </el-table-column>
53
+      <el-table-column label="物业人员数量" prop="id" align="center" width="105">
35 54
         <template slot-scope="scope">
36
-          <span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
55
+          <span>52</span>
37 56
         </template>
38 57
       </el-table-column>
39
-      <el-table-column :label="$t('table.title')" min-width="150px">
58
+      <el-table-column label="已核业主数量" prop="id" align="center" width="105">
40 59
         <template slot-scope="scope">
41
-          <span class="link-type" @click="handleUpdate(scope.row)">{{ scope.row.title }}</span>
42
-          <el-tag>{{ scope.row.type | typeFilter }}</el-tag>
60
+          <span>123</span>
43 61
         </template>
44 62
       </el-table-column>
45
-      <el-table-column :label="$t('table.author')" width="110px" align="center">
63
+      <el-table-column label="已核家属数量" prop="id" align="center" width="105">
46 64
         <template slot-scope="scope">
47
-          <span>{{ scope.row.author }}</span>
65
+          <span>345</span>
48 66
         </template>
49 67
       </el-table-column>
50
-      <el-table-column v-if="showReviewer" :label="$t('table.reviewer')" width="110px" align="center">
68
+      <el-table-column label="已核租客数量" prop="id" align="center" width="105">
51 69
         <template slot-scope="scope">
52
-          <span style="color:red;">{{ scope.row.reviewer }}</span>
70
+          <span>234</span>
53 71
         </template>
54 72
       </el-table-column>
55
-      <el-table-column :label="$t('table.importance')" width="80px">
73
+      <el-table-column label="物业管理员" prop="id" align="center" width="105">
56 74
         <template slot-scope="scope">
57
-          <svg-icon v-for="n in +scope.row.importance" :key="n" icon-class="star" class="meta-item__icon"/>
75
+          <span>{{ scope.row.userName }}</span>
58 76
         </template>
59 77
       </el-table-column>
60
-      <el-table-column :label="$t('table.readings')" align="center" width="95">
78
+      <el-table-column label="高德坐标" prop="id" align="center" width="105">
61 79
         <template slot-scope="scope">
62
-          <span v-if="scope.row.pageviews" class="link-type" @click="handleFetchPv(scope.row.pageviews)">{{ scope.row.pageviews }}</span>
63
-          <span v-else>0</span>
80
+          <span>{{ scope.row.longitude }},{{ scope.row.latitude }}</span>
64 81
         </template>
65 82
       </el-table-column>
66
-      <el-table-column :label="$t('table.status')" class-name="status-col" width="100">
83
+      <el-table-column label="录入时间" width="150px" align="center">
67 84
         <template slot-scope="scope">
68
-          <el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
85
+          <span>{{ scope.row.createDate }}</span>
69 86
         </template>
70 87
       </el-table-column>
71
-      <el-table-column :label="$t('table.actions')" align="center" width="230" class-name="small-padding fixed-width">
88
+      <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
72 89
         <template slot-scope="scope">
73
-          <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">{{ $t('table.edit') }}</el-button>
74
-          <el-button v-if="scope.row.status!='published'" size="mini" type="success" @click="handleModifyStatus(scope.row,'published')">{{ $t('table.publish') }}
75
-          </el-button>
76
-          <el-button v-if="scope.row.status!='draft'" size="mini" @click="handleModifyStatus(scope.row,'draft')">{{ $t('table.draft') }}
77
-          </el-button>
78
-          <el-button v-if="scope.row.status!='deleted'" size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">{{ $t('table.delete') }}
79
-          </el-button>
90
+          <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
91
+          <el-button v-if="scope.row.status!='published'" size="mini" type="success" @click="handleModifyStatus(scope.row,'published')">查看</el-button>
80 92
         </template>
81 93
       </el-table-column>
82 94
     </el-table>
@@ -85,32 +97,32 @@
85 97
 
86 98
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
87 99
       <el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
88
-        <el-form-item :label="$t('table.type')" prop="type">
100
+        <el-form-item label="类型" prop="type">
89 101
           <el-select v-model="temp.type" class="filter-item" placeholder="Please select">
90 102
             <el-option v-for="item in calendarTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
91 103
           </el-select>
92 104
         </el-form-item>
93
-        <el-form-item :label="$t('table.date')" prop="timestamp">
105
+        <el-form-item label="时间" prop="timestamp">
94 106
           <el-date-picker v-model="temp.timestamp" type="datetime" placeholder="Please pick a date"/>
95 107
         </el-form-item>
96
-        <el-form-item :label="$t('table.title')" prop="title">
108
+        <el-form-item label="标题" prop="title">
97 109
           <el-input v-model="temp.title"/>
98 110
         </el-form-item>
99
-        <el-form-item :label="$t('table.status')">
111
+        <el-form-item label="状态">
100 112
           <el-select v-model="temp.status" class="filter-item" placeholder="Please select">
101 113
             <el-option v-for="item in statusOptions" :key="item" :label="item" :value="item"/>
102 114
           </el-select>
103 115
         </el-form-item>
104
-        <el-form-item :label="$t('table.importance')">
116
+        <el-form-item label="重要性">
105 117
           <el-rate v-model="temp.importance" :colors="['#99A9BF', '#F7BA2A', '#FF9900']" :max="3" style="margin-top:8px;"/>
106 118
         </el-form-item>
107
-        <el-form-item :label="$t('table.remark')">
119
+        <el-form-item label="点评">
108 120
           <el-input :autosize="{ minRows: 2, maxRows: 4}" v-model="temp.remark" type="textarea" placeholder="Please input"/>
109 121
         </el-form-item>
110 122
       </el-form>
111 123
       <div slot="footer" class="dialog-footer">
112
-        <el-button @click="dialogFormVisible = false">{{ $t('table.cancel') }}</el-button>
113
-        <el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">{{ $t('table.confirm') }}</el-button>
124
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
125
+        <el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">确 定</el-button>
114 126
       </div>
115 127
     </el-dialog>
116 128
 
@@ -120,7 +132,7 @@
120 132
         <el-table-column prop="pv" label="Pv"/>
121 133
       </el-table>
122 134
       <span slot="footer" class="dialog-footer">
123
-        <el-button type="primary" @click="dialogPvVisible = false">{{ $t('table.confirm') }}</el-button>
135
+        <el-button type="primary" @click="dialogPvVisible = false">确 定</el-button>
124 136
       </span>
125 137
     </el-dialog>
126 138
 
@@ -128,7 +140,6 @@
128 140
 </template>
129 141
 
130 142
 <script>
131
-import { fetchList, fetchPv, createArticle, updateArticle } from '@/api/community'
132 143
 import waves from '@/directive/waves' // Waves directive
133 144
 import { parseTime } from '@/utils'
134 145
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
@@ -186,7 +197,7 @@ export default {
186 197
         id: undefined,
187 198
         importance: 1,
188 199
         remark: '',
189
-        timestamp: new Date(),
200
+        createData: '',
190 201
         title: '',
191 202
         type: '',
192 203
         status: 'published'
@@ -201,7 +212,7 @@ export default {
201 212
       pvData: [],
202 213
       rules: {
203 214
         type: [{ required: true, message: 'type is required', trigger: 'change' }],
204
-        timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }],
215
+        createData: [{ type: 'date', required: true, message: 'createData is required', trigger: 'change' }],
205 216
         title: [{ required: true, message: 'title is required', trigger: 'blur' }]
206 217
       },
207 218
       downloadLoading: false
@@ -213,14 +224,17 @@ export default {
213 224
   methods: {
214 225
     getList() {
215 226
       this.listLoading = true
216
-      fetchList(this.listQuery).then(response => {
217
-        this.list = response.data.items
218
-        this.total = response.data.total
227
+      this.$store.dispatch('community/FetchList', this.listQuery).then((data) => {
228
+        this.list = data.items
229
+        this.total = data.total
219 230
 
220 231
         // Just to simulate the time of the request
221 232
         setTimeout(() => {
222 233
           this.listLoading = false
223 234
         }, 1.5 * 1000)
235
+      }).catch(() => {
236
+        this.loading = false
237
+        console.log('get list error')
224 238
       })
225 239
     },
226 240
     handleFilter() {
@@ -267,24 +281,6 @@ export default {
267 281
         this.$refs['dataForm'].clearValidate()
268 282
       })
269 283
     },
270
-    createData() {
271
-      this.$refs['dataForm'].validate((valid) => {
272
-        if (valid) {
273
-          this.temp.id = parseInt(Math.random() * 100) + 1024 // mock a id
274
-          this.temp.author = 'vue-element-admin'
275
-          createArticle(this.temp).then(() => {
276
-            this.list.unshift(this.temp)
277
-            this.dialogFormVisible = false
278
-            this.$notify({
279
-              title: '成功',
280
-              message: '创建成功',
281
-              type: 'success',
282
-              duration: 2000
283
-            })
284
-          })
285
-        }
286
-      })
287
-    },
288 284
     handleUpdate(row) {
289 285
       this.temp = Object.assign({}, row) // copy obj
290 286
       this.temp.timestamp = new Date(this.temp.timestamp)
@@ -294,30 +290,6 @@ export default {
294 290
         this.$refs['dataForm'].clearValidate()
295 291
       })
296 292
     },
297
-    updateData() {
298
-      this.$refs['dataForm'].validate((valid) => {
299
-        if (valid) {
300
-          const tempData = Object.assign({}, this.temp)
301
-          tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
302
-          updateArticle(tempData).then(() => {
303
-            for (const v of this.list) {
304
-              if (v.id === this.temp.id) {
305
-                const index = this.list.indexOf(v)
306
-                this.list.splice(index, 1, this.temp)
307
-                break
308
-              }
309
-            }
310
-            this.dialogFormVisible = false
311
-            this.$notify({
312
-              title: '成功',
313
-              message: '更新成功',
314
-              type: 'success',
315
-              duration: 2000
316
-            })
317
-          })
318
-        }
319
-      })
320
-    },
321 293
     handleDelete(row) {
322 294
       this.$notify({
323 295
         title: '成功',
@@ -328,12 +300,6 @@ export default {
328 300
       const index = this.list.indexOf(row)
329 301
       this.list.splice(index, 1)
330 302
     },
331
-    handleFetchPv(pv) {
332
-      fetchPv(pv).then(response => {
333
-        this.pvData = response.data.pvData
334
-        this.dialogPvVisible = true
335
-      })
336
-    },
337 303
     handleDownload() {
338 304
       this.downloadLoading = true
339 305
       import('@/vendor/Export2Excel').then(excel => {

+ 486
- 444
文档/MYSQL/smartCommunity.pdb
File diff suppressed because it is too large
View File


+ 479
- 437
文档/MYSQL/smartCommunity.pdm
File diff suppressed because it is too large
View File