weiximei 6 vuotta sitten
vanhempi
commit
d763b636f6

+ 14
- 28
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java Näytä tiedosto

@@ -62,29 +62,19 @@ public class CommunityServiceImpl implements CommunityServiceI {
62 62
 		if (size < 1){
63 63
 			return 0;
64 64
 		}
65
-		//查询这个用户是否包含多个小区
66
-		TpUser tpUserAlread = tpUserMapper.selectByLoginName(toCommunities.getLoginName());
67
-		if (null == tpUserAlread){
68
-			//构建用户信息
69
-			TpUser tpUser = new TpUser();
70
-			tpUser.setUserName(toCommunities.getUserName());
71
-			tpUser.setLoginName(toCommunities.getLoginName());
72
-			tpUser.setCreateDate(new Date());
73
-			tpUser.setCreateUser(1);
74
-			tpUser.setStatus(Constant.EFFECTIVE);
75
-			//插入用户信息
76
-			tpUserMapper.insertSelective(tpUser);
77
-			//维护此用户的角色
78
-			addUserAndRole(tpUser.getId(), 1);
79
-			//维护住户端用户与社区关系表
80
-			addUserAndCommunity(tpUser.getId(), toCommunities.getId());
81
-		}else {
82
-			//维护此用户的角色
83
-			addUserAndRole(tpUserAlread.getId(), 1);
84
-			//维护住户端用户与社区关系表
85
-			addUserAndCommunity(tpUserAlread.getId(), toCommunities.getId());
86
-		}
87
-		
65
+	 
66
+		//构建用户信息
67
+		TpUser tpUser = new TpUser();
68
+		tpUser.setUserName(toCommunities.getUserName());
69
+		tpUser.setLoginName(toCommunities.getLoginName());
70
+		tpUser.setCreateDate(new Date());
71
+		tpUser.setCreateUser(1);
72
+		tpUser.setCommunityId(toCommunities.getId());
73
+		tpUser.setStatus(Constant.EFFECTIVE);
74
+		//插入用户信息
75
+		tpUserMapper.insertSelective(tpUser);
76
+		//维护此用户的角色
77
+		addUserAndRole(tpUser.getId(), 1);
88 78
 		return size;
89 79
 	}
90 80
 
@@ -135,11 +125,7 @@ public class CommunityServiceImpl implements CommunityServiceI {
135 125
 		ToCommunities oldCommunities = toCommunitiesMapper.selectByPrimaryKey(toCommunities.getId());
136 126
 		//未修改前的电话号码
137 127
 		String oldTel = oldCommunities.getLoginName();
138
-		//判断电话号码是否重复
139
-		TpUser tpUser = tpUserMapper.selectByTel(toCommunities.getId(),toCommunities.getLoginName());
140
-		if (null != tpUser && !tpUser.getLoginName().equals(oldTel)){
141
-			return Constant.ADMIN_IS_EXIST;
142
-		}
128
+		//修改手机号码
143 129
 		tpUserMapper.updateByTel(toCommunities.getId(),toCommunities.getLoginName(),toCommunities.getUserName(),oldTel);
144 130
 		toCommunitiesMapper.updateByPrimaryKeySelective(toCommunities);
145 131
 		return Constant.SUCCESS;

+ 1
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/TpUserMapper.xml Näytä tiedosto

@@ -203,6 +203,7 @@
203 203
       </if>
204 204
     </set>
205 205
     where login_name = #{oldTel,jdbcType=VARCHAR}
206
+    and community_id = #{id}
206 207
     and status = 1
207 208
   </update>
208 209
 

+ 4
- 4
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/ToCommunitiesMapper.java Näytä tiedosto

@@ -19,11 +19,11 @@ import java.util.List;
19 19
 public interface ToCommunitiesMapper extends BaseMapper<ToCommunities> {
20 20
 
21 21
     /**
22
-     * 根据 用户Id 查询出
23
-     * @param userId
22
+     * 根据 电话号码 查询出
23
+     * @param phone
24 24
      * @return
25 25
      */
26
-    @Select("SELECT tc.* FROM tp_user_community tuc LEFT JOIN to_communities tc on tuc.community_id = tc.id WHERE tuc.tp_user_id=#{userId}")
27
-    List<ToCommunities> selectUserById(Integer userId);
26
+    @Select("SELECT tc.* FROM tp_user tu LEFT JOIN to_communities tc ON tu.community_id = tc.id WHERE tu.login_name = #{phone}")
27
+    List<ToCommunities> selectUserById(String phone);
28 28
 
29 29
 }

+ 4
- 22
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/UserServiceImpl.java Näytä tiedosto

@@ -67,27 +67,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
67 67
         // 查询用户
68 68
         QueryWrapper<User> queryWrapper = new QueryWrapper<>();
69 69
         queryWrapper.eq("login_name", phone);
70
+        queryWrapper.eq("community_id", communityId);
70 71
         User user = userMapper.selectOne(queryWrapper) ;
71 72
         if (null == user) {
72 73
             responseBean.addError("当前手机号不存在, 请联系运营人员!");
73 74
             return responseBean;
74 75
         }
75 76
 
76
-        // 查询这个用户是否有这个小区的管理
77
-        QueryWrapper<TpUserCommunity> userCommunityQueryWrapper = new QueryWrapper<>();
78
-        userCommunityQueryWrapper.eq("tp_user_id", user.getId());
79
-        userCommunityQueryWrapper.eq("community_id", communityId);
80
-        TpUserCommunity tpUserCommunity = tpUserCommunityMapper.selectOne(userCommunityQueryWrapper);
81
-        if (null == tpUserCommunity) {
82
-            responseBean.addError("当前手机号未绑定该社区");
83
-            return responseBean;
84
-        }
85
-
86 77
         UserVO userVO = new UserVO();
87
-
88
-        // 设置为当前小区Id
89
-        user.setCommunityId(tpUserCommunity.getCommunityId());
90
-
91 78
         // 查询该用户的权限
92 79
         // 获取用户权限
93 80
         getUserRole(user,userVO);
@@ -104,18 +91,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
104 91
         checkPhoneAndCode(phone, code);
105 92
 
106 93
         // 获取这个用户所管理的小区
107
-        // 查询用户
108
-        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
109
-        queryWrapper.eq("login_name", phone);
110
-        User user = userMapper.selectOne(queryWrapper);
111
-        if (null == user) {
94
+        List<ToCommunities> toCommunities = toCommunitiesMapper.selectUserById(phone);
95
+        if (toCommunities.size() < 1) {
112 96
             responseBean.addError("当前手机号不存在, 请联系运营人员!");
113 97
             return responseBean;
114 98
         }
115
-
116
-        List<ToCommunities> toCommunities = toCommunitiesMapper.selectUserById(user.getId());
99
+        
117 100
         responseBean.addSuccess(toCommunities);
118
-
119 101
         return responseBean;
120 102
     }
121 103
 

+ 19
- 0
CODE/smart-community/zuul/pom.xml Näytä tiedosto

@@ -158,6 +158,25 @@
158 158
 				<groupId>org.springframework.boot</groupId>
159 159
 				<artifactId>spring-boot-maven-plugin</artifactId>
160 160
 			</plugin>
161
+			<!--服务化打包工具-->
162
+			<plugin>
163
+				<groupId>org.apache.maven.plugins</groupId>
164
+				<artifactId>maven-assembly-plugin</artifactId>
165
+				<configuration>
166
+					<descriptors>
167
+						<descriptor>src/main/assembly/assembly.xml</descriptor>
168
+					</descriptors>
169
+				</configuration>
170
+				<executions>
171
+					<execution>
172
+						<id>make-assembly</id>
173
+						<phase>package</phase>
174
+						<goals>
175
+							<goal>single</goal>
176
+						</goals>
177
+					</execution>
178
+				</executions>
179
+			</plugin>
161 180
 		</plugins>
162 181
 	</build>
163 182
 

+ 30
- 0
CODE/smart-community/zuul/src/main/assembly/assembly.xml Näytä tiedosto

@@ -0,0 +1,30 @@
1
+<assembly>
2
+    <id>assembly</id>
3
+    <formats>
4
+        <format>tar.gz</format>
5
+    </formats>
6
+    <includeBaseDirectory>true</includeBaseDirectory>
7
+    <fileSets>
8
+        <fileSet>
9
+            <directory>src/main/assembly/bin</directory>
10
+            <outputDirectory>bin</outputDirectory>
11
+            <fileMode>0755</fileMode>
12
+        </fileSet>
13
+        <fileSet>
14
+            <directory>target/classes</directory>
15
+            <outputDirectory>conf</outputDirectory>
16
+            <includes>
17
+                <include>META-INF/**</include>
18
+                <include>*.yml</include>
19
+                <include>conf/**</include>
20
+            </includes>
21
+            <fileMode>0755</fileMode>
22
+        </fileSet>
23
+    </fileSets>
24
+    <dependencySets>
25
+        <dependencySet>
26
+            <useProjectArtifact>true</useProjectArtifact>
27
+            <outputDirectory>lib</outputDirectory>
28
+        </dependencySet>
29
+    </dependencySets>
30
+</assembly>

+ 86
- 0
CODE/smart-community/zuul/src/main/assembly/bin/start.sh Näytä tiedosto

@@ -0,0 +1,86 @@
1
+#!/bin/bash
2
+
3
+SERVER_NAME='zuul'
4
+# jar名称
5
+JAR_NAME='zuul-0.0.1.jar'
6
+cd `dirname $0`
7
+BIN_DIR=`pwd`
8
+cd ..
9
+DEPLOY_DIR=`pwd`
10
+CONF_DIR=$DEPLOY_DIR/conf
11
+# 获取应用的端口号
12
+SERVER_PORT=`sed -nr '/port: [0-9]+/ s/.*port: +([0-9]+).*/\1/p' conf/bootstrap.yml`
13
+
14
+PIDS=`ps -f | grep java | grep "$CONF_DIR" |awk '{print $2}'`
15
+if [ "$1" = "status" ]; then
16
+    if [ -n "$PIDS" ]; then
17
+        echo "The $SERVER_NAME is running...!"
18
+        echo "PID: $PIDS"
19
+        exit 0
20
+    else
21
+        echo "The $SERVER_NAME is stopped"
22
+        exit 0
23
+    fi
24
+fi
25
+
26
+if [ -n "$PIDS" ]; then
27
+    echo "ERROR: The $SERVER_NAME already started!"
28
+    echo "PID: $PIDS"
29
+    exit 1
30
+fi
31
+
32
+if [ -n "$SERVER_PORT" ]; then
33
+    SERVER_PORT_COUNT=`netstat -tln | grep $SERVER_PORT | wc -l`
34
+    if [ $SERVER_PORT_COUNT -gt 0 ]; then
35
+        echo "ERROR: The $SERVER_NAME port $SERVER_PORT already used!"
36
+        exit 1
37
+    fi
38
+fi
39
+
40
+LOGS_DIR=$DEPLOY_DIR/logs
41
+if [ ! -d $LOGS_DIR ]; then
42
+    mkdir $LOGS_DIR
43
+fi
44
+STDOUT_FILE=$LOGS_DIR/stdout.log
45
+
46
+JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
47
+JAVA_DEBUG_OPTS=""
48
+if [ "$1" = "debug" ]; then
49
+    JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
50
+fi
51
+
52
+JAVA_JMX_OPTS=""
53
+if [ "$1" = "jmx" ]; then
54
+    JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
55
+fi
56
+
57
+JAVA_MEM_OPTS=""
58
+BITS=`java -version 2>&1 | grep -i 64-bit`
59
+if [ -n "$BITS" ]; then
60
+    JAVA_MEM_OPTS=" -server -Xmx512m -Xms512m -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
61
+else
62
+    JAVA_MEM_OPTS=" -server -Xms512m -Xmx512m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
63
+fi
64
+
65
+CONFIG_FILES=" -Dspring.config.location=$CONF_DIR/ "
66
+echo -e "Starting the $SERVER_NAME ..."
67
+nohup java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS $CONFIG_FILES -jar $DEPLOY_DIR/lib/$JAR_NAME > $STDOUT_FILE 2>&1 &
68
+
69
+COUNT=0
70
+while [ $COUNT -lt 1 ]; do
71
+    echo -e ".\c"
72
+    sleep 1
73
+    if [ -n "$SERVER_PORT" ]; then
74
+        COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
75
+    else
76
+        COUNT=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}' | wc -l`
77
+    fi
78
+    if [ $COUNT -gt 0 ]; then
79
+        break
80
+    fi
81
+done
82
+
83
+echo "OK!"
84
+PIDS=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}'`
85
+echo "PID: $PIDS"
86
+echo "STDOUT: $STDOUT_FILE"

+ 1
- 1
VUECODE/smart-property-manage/src/views/building/batch/batchImport.vue Näytä tiedosto

@@ -4,7 +4,7 @@
4 4
     <el-form :inline="true" :model="listQuery" class="form-listQuery">
5 5
       <el-form-item>
6 6
         <el-upload :on-preview="handlePreview" :on-change="handleChange" :before-upload="beforeUpload" :limit="1" :on-exceed="handleExceed" class="upload-demo" action="" multiple>
7
-          <el-button style="margin-left: 10px;" size="large" type="primary"><a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1547546690">下载模板</a></el-button>
7
+          <el-button style="margin-left: 10px;" size="large" type="primary"><a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1548327771">下载模板</a></el-button>
8 8
           <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
9 9
           <el-button style="margin-left: 10px;" size="large" type="success" @click="submitUpload">提交</el-button>
10 10
           <el-button style="margin-left: 10px;" size="large" type="success" @click="dialogBuildingIndex">取消</el-button>

+ 729
- 601
文档/MYSQL/smartCommunity.pdb
File diff suppressed because it is too large
Näytä tiedosto


+ 729
- 601
文档/MYSQL/smartCommunity.pdm
File diff suppressed because it is too large
Näytä tiedosto