Browse Source

Merge branch 'V1' of http://223.75.76.159:9090/xiao547607/smart-community-server

fllmoyu 5 years ago
parent
commit
1b945d8b2e

+ 2 - 1
common/src/main/resources/mapper/base/CompanyInfo.xml

@@ -137,12 +137,13 @@
             a.${sort.name} ${sort.order}
         </foreach>
     </select>
+
     <select id="findByCompanyCode" resultMap="CompanyInfoMap">
         select a.*,b.name_ as parent_name
         from base_company_info a
         left join base_company_info b on a.parent_id = b.id_
         where a.del_flag=0
-        <trim prefix="and (" prefixOverrides="and | or" suffix=")">
+        <trim prefix="and (" prefixOverrides="AND|OR" suffix=")">
             <if test="code!=null">
                 a.code_ like #{code}
             </if>

+ 5 - 0
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonInfoApiController.java

@@ -186,9 +186,13 @@ public class PersonInfoApiController {
 
             CompanyInfo selectedCompany = new CompanyInfo();
 
+            valueOperations.get(RedisConfig.PERSON_SELECT_COMPANY + personInfo.getId());
+
             Map<String,Object> companyMap = (Map<String, Object>) valueOperations.get(RedisConfig.PERSON_SELECT_COMPANY + personInfo.getId());
 
             if (companyMap==null) {
+                companyMap = new HashMap<>();
+
                 //当前用户默认管理单位
                 if (StringUtils.isNotEmpty(personInfo.getPopedom()) && personInfo.getPopedom().indexOf("2") != -1) {
                     if (personInfo.getAllowViewLocal()) {
@@ -217,6 +221,7 @@ public class PersonInfoApiController {
             messageResult.setCode(200);
         }
         catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
             messageResult.setResult(false);
             messageResult.setMessage(ex.getMessage());
         }

+ 6 - 7
web/src/main/resources/application-production.yml

@@ -5,13 +5,12 @@ server:
 
 spring:
   datasource:
-    url: jdbc:log4jdbc:mysql://127.0.0.1:3306/smart-community?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-    username: root
-    password: slgo^Root_!Q@W#E)P(O*I
-  #  datasource:
-  #    url: jdbc:log4jdbc:mysql://hbjpsoft.mysql.rds.aliyuncs.com:3306/smart?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-  #    username: smart
-  #    password: smart_123
+#    url: jdbc:log4jdbc:mysql://127.0.0.1:3306/smart-community?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#    username: root
+#    password: slgo^Root_!Q@W#E)P(O*I
+    url: jdbc:log4jdbc:mysql://rm-bp1k37vutg1096q45do.mysql.rds.aliyuncs.com:3306/smart?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+    username: smart
+    password: smart_123
   devtools:
     restart:
       enabled: true