Commit 375771a8af4a2f37a6be6609b82e20f6391a5976
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 13 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/param/CommunityQuery.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommunityConfigService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
- platform-data-api/src/main/java/com/lyms/platform/data/controller/TaskController.java
- platform-data-api/src/main/resources/database.properties
- platform-data-api/src/main/resources/macro.vm
- platform-data-api/src/main/resources/spring/applicationContext-dal.xml
- platform-data-api/src/main/resources/spring/applicationContext-mvc.xml
- platform-data-api/src/main/resources/spring/applicationContext.xml
- platform-data-api/src/main/resources/spring/applicationContext_biz_patient.xml
- platform-data-api/src/main/resources/spring/spring-mongodb.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
- pom.xml
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/param/CommunityQuery.java
View file @
375771a
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | */ |
| 8 | 8 | public class CommunityQuery extends BaseQuery { |
| 9 | 9 | private String keyword; |
| 10 | - private String id; | |
| 10 | + private Integer id; | |
| 11 | 11 | private String level; |
| 12 | 12 | |
| 13 | 13 | public String getLevel() { |
| 14 | 14 | |
| ... | ... | @@ -18,11 +18,11 @@ |
| 18 | 18 | this.level = level; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public String getId() { | |
| 21 | + public Integer getId() { | |
| 22 | 22 | return id; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public void setId(String id) { | |
| 25 | + public void setId(Integer id) { | |
| 26 | 26 | this.id = id; |
| 27 | 27 | } |
| 28 | 28 |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommunityConfigService.java
View file @
375771a
| ... | ... | @@ -47,11 +47,11 @@ |
| 47 | 47 | } |
| 48 | 48 | mongoCondition.and("yn", YnEnums.YES.getId(), MongoOper.IS); |
| 49 | 49 | if(null != communityQuery.getLevel() && communityQuery.getLevel().equals("3")) { |
| 50 | - mongoCondition = mongoCondition.andCondition(new MongoCondition("areaId", Integer.parseInt(communityQuery.getId()), MongoOper.IS)); | |
| 50 | + mongoCondition = mongoCondition.andCondition(new MongoCondition("areaId", communityQuery.getId(), MongoOper.IS)); | |
| 51 | 51 | } else if(null != communityQuery.getLevel() && communityQuery.getLevel().equals("2")) { |
| 52 | - mongoCondition = mongoCondition.andCondition(new MongoCondition("cityId", Integer.parseInt(communityQuery.getId()), MongoOper.IS)); | |
| 52 | + mongoCondition = mongoCondition.andCondition(new MongoCondition("cityId", communityQuery.getId(), MongoOper.IS)); | |
| 53 | 53 | } else if(null != communityQuery.getLevel() && communityQuery.getLevel().equals("1")) { |
| 54 | - mongoCondition = mongoCondition.andCondition(new MongoCondition("provinceId", Integer.parseInt(communityQuery.getId()), MongoOper.IS)); | |
| 54 | + mongoCondition = mongoCondition.andCondition(new MongoCondition("provinceId", communityQuery.getId(), MongoOper.IS)); | |
| 55 | 55 | } |
| 56 | 56 | MongoQuery mongoQuery = mongoCondition.toMongoQuery(); |
| 57 | 57 |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
View file @
375771a
platform-data-api/src/main/java/com/lyms/platform/data/controller/TaskController.java
View file @
375771a
| 1 | 1 | package com.lyms.platform.data.controller; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.data.service.DataImportTaskService; |
| 4 | -import com.lymsh.mommybaby.earlydata.model.MommyExamineInfo; | |
| 5 | -import com.lymsh.mommybaby.earlydata.model.OracleCommonQuery; | |
| 6 | -import com.lymsh.mommybaby.earlydata.model.PlatDataContent; | |
| 7 | -import com.lymsh.mommybaby.earlydata.model.PlatDataType; | |
| 8 | -import com.lymsh.mommybaby.earlydata.service.MommyService; | |
| 9 | -import com.lymsh.mommybaby.earlydata.service.PlatService; | |
| 10 | -import org.apache.commons.lang.StringUtils; | |
| 11 | -import org.joda.time.DateTime; | |
| 12 | 4 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 5 | import org.springframework.stereotype.Controller; |
| 14 | 6 | import org.springframework.web.bind.annotation.RequestMapping; |
| 15 | 7 | import org.springframework.web.servlet.ModelAndView; |
| 16 | 8 | |
| 17 | 9 | import javax.servlet.http.HttpServletResponse; |
| 18 | -import java.util.Date; | |
| 19 | -import java.util.List; | |
| 20 | 10 | |
| 21 | 11 | /** |
| 22 | 12 | * Created by riecard on 15/10/26. |
| ... | ... | @@ -24,14 +14,6 @@ |
| 24 | 14 | @Controller |
| 25 | 15 | @RequestMapping("/task") |
| 26 | 16 | public class TaskController extends BaseController { |
| 27 | - | |
| 28 | - private static final Integer pageSize = 100; | |
| 29 | - | |
| 30 | - @Autowired | |
| 31 | - private PlatService platService; | |
| 32 | - | |
| 33 | - @Autowired | |
| 34 | - private MommyService mommyService; | |
| 35 | 17 | |
| 36 | 18 | @Autowired |
| 37 | 19 | private DataImportTaskService dataImportTaskService; |
platform-data-api/src/main/resources/database.properties
View file @
375771a
| ... | ... | @@ -10,6 +10,44 @@ |
| 10 | 10 | mysql.maxactive=300 |
| 11 | 11 | mysql.validationquery=SELECT 1 FROM DUAL |
| 12 | 12 | |
| 13 | + | |
| 14 | +mongo.db.host=${mongo.db.host} | |
| 15 | +mongo.db.port=${mongo.db.port} | |
| 16 | +mongo.db.dbname=${mongo.db.dbname} | |
| 17 | +mongo.db.username=${mongo.db.username} | |
| 18 | +mongo.db.password=${mongo.db.password} | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | +mongo.connectionsPerHost=8 | |
| 23 | +mongo.threadsAllowedToBlockForConnectionMultiplier=4 | |
| 24 | +mongo.connectTimeout=1000 | |
| 25 | +mongo.maxWaitTime=1500 | |
| 26 | +mongo.autoConnectRetry=true | |
| 27 | +mongo.socketKeepAlive=true | |
| 28 | +mongo.socketTimeout=1500 | |
| 29 | +mongo.slaveOk=true | |
| 30 | +mongo.username=*** | |
| 31 | +mongo.password=*** | |
| 32 | +mongo.dbname=platform | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | +maindata.driver=com.mysql.jdbc.Driver | |
| 39 | +maindata.jdbcurl=${mysql.jdbcurl} | |
| 40 | +maindata.username=${mysql.db.name} | |
| 41 | +maindata.password=${mysql.db.password} | |
| 42 | + | |
| 43 | +maindata.maxpoolsize=5 | |
| 44 | +maindata.initialpoolsize=2 | |
| 45 | +maindata.minpoolsize=2 | |
| 46 | + | |
| 47 | +redis.servers=${redis.servers} | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 13 | 51 | earlydata.driver=oracle.jdbc.driver.OracleDriver |
| 14 | 52 | earlydata.jdbcurl=jdbc:oracle:thin:@119.90.57.27:1521:orcl |
| 15 | 53 | earlydata.username=LYMS_21 |
platform-data-api/src/main/resources/macro.vm
View file @
375771a
| 1 | +#macro(paging $page $url) | |
| 2 | + #set($nextPage = $page.page+1) | |
| 3 | + #set($prevousPage = $page.page - 1 ) | |
| 4 | + #if($page.pages > 1) | |
| 5 | + #if($page.prev) | |
| 6 | + <li> <a href="$!{request.contextPath}/$url?page=$prevousPage" class="active">上一页</a> </li> | |
| 7 | + #else | |
| 8 | + <li> <a disabled="true">上一页</a></li> | |
| 9 | + #end | |
| 10 | + | |
| 11 | + #foreach($num in $page.pageNums) | |
| 12 | + #if($num==$page.page) | |
| 13 | + <li class="active"><a href="$num" class="toPage">$num</a></li> | |
| 14 | + #else | |
| 15 | + <li><a href="$!{request.contextPath}/$url?page=$num" class="toPage">$num</a></li> | |
| 16 | + #end | |
| 17 | + #end | |
| 18 | + | |
| 19 | + #if($page.next) | |
| 20 | + <li> <a href="$!{request.contextPath}/$url?page=$nextPage" class="next">下一页</a></li> | |
| 21 | + #else | |
| 22 | + <li> <a disabled="true">下一页</a></li> | |
| 23 | + #end | |
| 24 | + #end | |
| 25 | + | |
| 26 | + <li class="active"> | |
| 27 | + <a disabled="true">$page.range[0]-$page.range[1] 共 $page.total</a> | |
| 28 | + </li> | |
| 29 | +#end |
platform-data-api/src/main/resources/spring/applicationContext-dal.xml
View file @
375771a
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" | |
| 3 | + xmlns:p="http://www.springframework.org/schema/p" | |
| 4 | + xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" | |
| 5 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 6 | + xmlns:cache="http://www.springframework.org/schema/cache" | |
| 7 | + xmlns:task="http://www.springframework.org/schema/task" | |
| 8 | + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
| 9 | + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd | |
| 10 | + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd | |
| 11 | + http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd | |
| 12 | + http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> | |
| 13 | + | |
| 14 | + | |
| 15 | + <!-- 配置数据源 --> | |
| 16 | + <bean name="dataSourceB" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> | |
| 17 | + <property name="url" value="${maindata.jdbcurl}" /> | |
| 18 | + <property name="username" value="${maindata.username}" /> | |
| 19 | + <property name="password" value="${maindata.password}" /> | |
| 20 | + <property name="initialSize" value="10" /> | |
| 21 | + <property name="maxActive" value="100" /> | |
| 22 | + <property name="maxIdle" value="10" /> | |
| 23 | + <property name="minIdle" value="0" /> | |
| 24 | + <property name="maxWait" value="10000" /> | |
| 25 | + <!-- <property name="validationQuery" value="${validationQuery3}" /> --> | |
| 26 | + <property name="testOnBorrow" value="false" /> | |
| 27 | + <property name="testOnReturn" value="false" /> | |
| 28 | + <property name="testWhileIdle" value="true" /> | |
| 29 | + <property name="timeBetweenEvictionRunsMillis" value="60000" /> | |
| 30 | + <property name="minEvictableIdleTimeMillis" value="25200000" /> | |
| 31 | + <property name="removeAbandoned" value="true" /> | |
| 32 | + <property name="removeAbandonedTimeout" value="1800" /> | |
| 33 | + <property name="logAbandoned" value="true" /> | |
| 34 | + <property name="filters" value="stat" /> | |
| 35 | + </bean> | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + <bean id="mainJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" | |
| 40 | + p:dataSource-ref="dataSourceB" /> | |
| 41 | + | |
| 42 | + <bean id="mainSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> | |
| 43 | + <property name="dataSource" ref="dataSourceB" /> | |
| 44 | + <property name="mapperLocations"> | |
| 45 | + <list> | |
| 46 | + <value>classpath*:mainOrm/*.xml</value> | |
| 47 | + </list> | |
| 48 | + </property> | |
| 49 | + </bean> | |
| 50 | + | |
| 51 | + <!-- all class in the back-package are auto loaded as a mapper --> | |
| 52 | + <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> | |
| 53 | + <property name="sqlSessionFactoryBeanName" value="mainSqlSessionFactory"></property> | |
| 54 | + <property name="basePackage" value="com.lyms.platform.permission.dao" /> | |
| 55 | + </bean> | |
| 56 | + | |
| 57 | + <!-- manage transaction --> | |
| 58 | + <bean id="mainTransactionManager" | |
| 59 | + class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> | |
| 60 | + <property name="dataSource" ref="dataSourceB" /> | |
| 61 | + </bean> | |
| 62 | + | |
| 63 | + <tx:annotation-driven transaction-manager="mainTransactionManager"/> | |
| 64 | + | |
| 65 | + <!-- Mabatis Data Layer --> | |
| 66 | + <bean id="mainSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate"> | |
| 67 | + <constructor-arg index="0" ref="mainSqlSessionFactory" /> | |
| 68 | + </bean> | |
| 69 | + | |
| 70 | + | |
| 71 | +</beans> |
platform-data-api/src/main/resources/spring/applicationContext-mvc.xml
View file @
375771a
| ... | ... | @@ -19,8 +19,6 @@ |
| 19 | 19 | http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd |
| 20 | 20 | http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd |
| 21 | 21 | http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"> |
| 22 | - <import resource="classpath:META-INF/cxf/cxf.xml"/> | |
| 23 | - <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> | |
| 24 | 22 | |
| 25 | 23 | <context:component-scan base-package="com.lyms.platform.data.controller" use-default-filters="false"> |
| 26 | 24 | <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> |
platform-data-api/src/main/resources/spring/applicationContext.xml
View file @
375771a
| ... | ... | @@ -11,6 +11,12 @@ |
| 11 | 11 | |
| 12 | 12 | <!-- 采用注释的方式配置bean --> |
| 13 | 13 | <context:annotation-config /> |
| 14 | + | |
| 15 | + <!-- 配置要扫描的包 --> | |
| 16 | + <context:component-scan base-package="com.lyms.platform.biz.service" /> | |
| 17 | + <!-- 配置要扫描的包 --> | |
| 18 | + <context:component-scan base-package="com.lyms.platform.biz.dal.impl" /> | |
| 19 | + <context:component-scan base-package="com.lyms.platform.permission.*" /> | |
| 14 | 20 | <bean id="configProperties" |
| 15 | 21 | class="org.springframework.beans.factory.config.PropertiesFactoryBean"> |
| 16 | 22 | <property name="locations"> |
| 17 | 23 | |
| ... | ... | @@ -23,48 +29,7 @@ |
| 23 | 29 | class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> |
| 24 | 30 | <property name="properties" ref="configProperties" /> |
| 25 | 31 | </bean> |
| 26 | - | |
| 27 | - | |
| 28 | - <!-- 配置数据源 A--> | |
| 29 | - <bean name="dataSourceA" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> | |
| 30 | - <property name="url" value="${mysql.db.jdbcurl}" /> | |
| 31 | - <property name="username" value="${mysql.db.username}" /> | |
| 32 | - <property name="password" value="${mysql.db.password}" /> | |
| 33 | 32 | |
| 34 | - <!-- 初始化连接大小 --> | |
| 35 | - <property name="initialSize" value="${mysql.initialpoolsize}" /> | |
| 36 | - <!-- 连接池最大使用连接数量 --> | |
| 37 | - <property name="maxActive" value="${mysql.maxactive}" /> | |
| 38 | - <!-- 连接池最大空闲 --> | |
| 39 | - <property name="maxIdle" value="${mysql.maxIdle}" /> | |
| 40 | - <!-- 连接池最小空闲 --> | |
| 41 | - <property name="minIdle" value="${mysql.minpoolsize}" /> | |
| 42 | - <!-- 获取连接最大等待时间 --> | |
| 43 | - <property name="maxWait" value="${mysql.maxwait}" /> | |
| 44 | - | |
| 45 | - <!-- <property name="poolP bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, reparedStatements" value="true" /> <property name="maxPoolPreparedStatementPerConnectionSize" value="33" /> --> | |
| 46 | - <property name="validationQuery" value="${mysql.validationquery}" /> | |
| 47 | - <property name="testOnBorrow" value="true" /> | |
| 48 | - <property name="testOnReturn" value="false" /> | |
| 49 | - <property name="testWhileIdle" value="true" /> | |
| 50 | - <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 --> | |
| 51 | - <property name="timeBetweenEvictionRunsMillis" value="60000" /> | |
| 52 | - <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 --> | |
| 53 | - <property name="minEvictableIdleTimeMillis" value="25200000" /> | |
| 54 | - <!-- 打开removeAbandoned功能 --> | |
| 55 | - <property name="removeAbandoned" value="true" /> | |
| 56 | - <!-- 1800秒,也就是30分钟 --> | |
| 57 | - <property name="removeAbandonedTimeout" value="1800" /> | |
| 58 | - <!-- 关闭abanded连接时输出错误日志 --> | |
| 59 | - <property name="logAbandoned" value="true" /> | |
| 60 | - | |
| 61 | - <!-- 打开PSCache,并且指定每个连接上PSCache的大小 --> | |
| 62 | - <property name="poolPreparedStatements" value="true" /> | |
| 63 | - <property name="maxPoolPreparedStatementPerConnectionSize" value="1000" /> | |
| 64 | - | |
| 65 | - <!-- 监控数据库 --> | |
| 66 | - <property name="filters" value="stat" /> | |
| 67 | - </bean> | |
| 68 | 33 | <!-- 配置要扫描的包 --> |
| 69 | 34 | <context:component-scan base-package="com.lyms.platform.data" /> |
| 70 | 35 | |
| ... | ... | @@ -115,5 +80,8 @@ |
| 115 | 80 | </bean> |
| 116 | 81 | |
| 117 | 82 | <import resource="applicationContext-cxf.xml" /> |
| 83 | + <import resource="classpath:/spring/applicationContext_biz_patient.xml"/> | |
| 84 | + <import resource="classpath:/spring/spring-mongodb.xml"/> | |
| 85 | + <import resource="classpath:/spring/applicationContext-dal.xml"/> | |
| 118 | 86 | </beans> |
platform-data-api/src/main/resources/spring/applicationContext_biz_patient.xml
View file @
375771a
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" | |
| 3 | + xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" | |
| 4 | + xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 5 | + xmlns:cache="http://www.springframework.org/schema/cache" xmlns:task="http://www.springframework.org/schema/task" | |
| 6 | + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
| 7 | + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd | |
| 8 | + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd | |
| 9 | + http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd | |
| 10 | + http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> | |
| 11 | + <context:component-scan base-package="com.lyms.platform" /> | |
| 12 | + <context:annotation-config /> | |
| 13 | + | |
| 14 | + <bean id="configProperties" | |
| 15 | + class="org.springframework.beans.factory.config.PropertiesFactoryBean"> | |
| 16 | + <property name="locations"> | |
| 17 | + <list> | |
| 18 | + <value>classpath:database.properties</value> | |
| 19 | + </list> | |
| 20 | + </property> | |
| 21 | + </bean> | |
| 22 | + <bean id="propertyConfigurer" | |
| 23 | + class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> | |
| 24 | + <property name="properties" ref="configProperties" /> | |
| 25 | + </bean> | |
| 26 | + <!-- Cache --> | |
| 27 | + <cache:annotation-driven cache-manager="cacheManager" /> | |
| 28 | + <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> | |
| 29 | + <property name="caches"> | |
| 30 | + <set> | |
| 31 | + <bean | |
| 32 | + class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" | |
| 33 | + p:name="default" /> | |
| 34 | + <bean | |
| 35 | + class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" | |
| 36 | + p:name="andCache" /> | |
| 37 | + </set> | |
| 38 | + </property> | |
| 39 | + </bean> | |
| 40 | + <!--自动代理dao层 --> | |
| 41 | + <bean | |
| 42 | + class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" id="autoProxyCreator"> | |
| 43 | + <property name="beanNames" value="*Dao" /> | |
| 44 | + <property name="interceptorNames"> | |
| 45 | + <list> | |
| 46 | + <value>dalInterceptor</value> | |
| 47 | + </list> | |
| 48 | + </property> | |
| 49 | + </bean> | |
| 50 | + | |
| 51 | + <bean | |
| 52 | + class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" id="nameAutoProxyCreator"> | |
| 53 | + <property name="beanNames" value="*Mapper" /> | |
| 54 | + <property name="interceptorNames"> | |
| 55 | + <list> | |
| 56 | + <value>mysqlDalInterceptor</value> | |
| 57 | + </list> | |
| 58 | + </property> | |
| 59 | + </bean> | |
| 60 | + | |
| 61 | + <!-- dal层方法性能统计--> | |
| 62 | + <bean id="mysqlDalInterceptor" | |
| 63 | + class="com.lyms.platform.common.perf.DalMethodInterceptor"> | |
| 64 | + <property name="threshold" value="30" /> | |
| 65 | + </bean> | |
| 66 | + <!-- dal层方法性能统计--> | |
| 67 | + <bean id="dalInterceptor" | |
| 68 | + class="com.lyms.platform.common.perf.DalMethodInterceptor"> | |
| 69 | + <property name="threshold" value="10" /> | |
| 70 | + </bean> | |
| 71 | + | |
| 72 | + <!-- <bean id="messageResolver" class="com.lyms.platform.common.core.resolve.MessageResolver" /> --> | |
| 73 | + <import resource="spring-mongodb.xml" /> | |
| 74 | +</beans> |
platform-data-api/src/main/resources/spring/spring-mongodb.xml
View file @
375771a
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" | |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | + xmlns:mongo="http://www.springframework.org/schema/data/mongo" | |
| 5 | + xsi:schemaLocation="http://www.springframework.org/schema/data/mongo | |
| 6 | + http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd | |
| 7 | + http://www.springframework.org/schema/beans | |
| 8 | + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> | |
| 9 | + | |
| 10 | + <bean name="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> | |
| 11 | + <constructor-arg name="mongo" ref="mongo"/> | |
| 12 | + <constructor-arg name="userCredentials" ref="userCredentials"/> | |
| 13 | + <constructor-arg name="databaseName" value="platform"/> | |
| 14 | + </bean> | |
| 15 | + | |
| 16 | + | |
| 17 | + <bean id="defaultMongoTypeMapper" | |
| 18 | + class="org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper"> | |
| 19 | + <constructor-arg name="typeKey"> | |
| 20 | + <null/> | |
| 21 | + </constructor-arg> | |
| 22 | + </bean> | |
| 23 | + | |
| 24 | + <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> | |
| 25 | + <constructor-arg name="username" value="${mongo.db.username}"/> | |
| 26 | + <constructor-arg name="password" value="${mongo.db.password}"/> | |
| 27 | + </bean> | |
| 28 | + | |
| 29 | + <mongo:db-factory mongo-ref="mongo" id="mongoDbFactory"/> | |
| 30 | + | |
| 31 | + <mongo:mongo id="mongo" host="${mongo.db.host}" port="${mongo.db.port}"> | |
| 32 | + <mongo:options connections-per-host="${mongo.connectionsPerHost}" | |
| 33 | + threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}" | |
| 34 | + connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}" | |
| 35 | + auto-connect-retry="${mongo.autoConnectRetry}" socket-keep-alive="${mongo.socketKeepAlive}" | |
| 36 | + socket-timeout="${mongo.socketTimeout}" write-number="1" | |
| 37 | + write-timeout="0" write-fsync="true"/> | |
| 38 | + </mongo:mongo> | |
| 39 | +</beans> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
View file @
375771a
| ... | ... | @@ -100,11 +100,18 @@ |
| 100 | 100 | @TokenRequired |
| 101 | 101 | public FrontEndResult queryCommunity(CommunityQuery communityQuery) { |
| 102 | 102 | List<CommunityConfig> communityConfigList = communityConfigService.queryCommunity(communityQuery); |
| 103 | - Regions regions = regionsService.getRegions(Integer.valueOf(communityQuery.getId())); | |
| 104 | - if(null == regions) { | |
| 105 | - return FrontEndResult.ini(ErrorCodeConstants.PARAMETER_ERROR, "address ID error"); | |
| 103 | + Regions regions = null; | |
| 104 | + if(null != communityQuery.getId()) { | |
| 105 | + regions = regionsService.getRegions(Integer.valueOf(communityQuery.getId())); | |
| 106 | + | |
| 107 | + if(null == regions) { | |
| 108 | + return FrontEndResult.ini(ErrorCodeConstants.PARAMETER_ERROR, "address ID error"); | |
| 109 | + } | |
| 110 | + | |
| 111 | + communityQuery.setLevel(String.valueOf(regions.getLevel())); | |
| 106 | 112 | } |
| 107 | - communityQuery.setLevel(String.valueOf(regions.getLevel())); | |
| 113 | + | |
| 114 | + | |
| 108 | 115 | if(null != communityConfigList) { |
| 109 | 116 | return FrontEndResult.ini().setData(communityConfigList).setPageInfo(communityQuery.getPageInfo()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功"); |
| 110 | 117 | } |
pom.xml
View file @
375771a
| ... | ... | @@ -475,6 +475,16 @@ |
| 475 | 475 | <artifactId>guava</artifactId> |
| 476 | 476 | <version>19.0-rc2</version> |
| 477 | 477 | </dependency> |
| 478 | + <dependency> | |
| 479 | + <groupId>org.apache.velocity</groupId> | |
| 480 | + <artifactId>velocity</artifactId> | |
| 481 | + <version>1.7</version> | |
| 482 | + </dependency> | |
| 483 | + <dependency> | |
| 484 | + <groupId>org.apache.velocity</groupId> | |
| 485 | + <artifactId>velocity-tools</artifactId> | |
| 486 | + <version>2.0</version> | |
| 487 | + </dependency> | |
| 478 | 488 | </dependencies> |
| 479 | 489 | </project> |