Commit f36e889c2df26dc1d6e201fe15711b44fbd0f89e
1 parent
189df7e916
Exists in
master
and in
1 other branch
修改新电子病历
Showing 22 changed files with 753 additions and 56 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/DataAccessLayerService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/DepartmentsServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/PermissionsServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RegionsServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RolePermissionMapsServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RolesServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UserOrganizationMapsServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UserRoleMapsServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UsersServiceImpl.java
- platform-job-index/pom.xml
- platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java
- platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/Runner.java
- platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java
- platform-job-index/src/main/resources/conf.properties
- platform-job-index/src/main/resources/lable.properties
- platform-job-index/src/main/resources/log4j_config.xml
- platform-job-index/src/main/resources/spring/applicationContext-sync-data.xml
- platform-job-index/src/main/resources/spring/spring-mongodb.xml
- platform-job-index/src/main/webapp/WEB-INF/lib/base-common-1.0-SNAPSHOT.jar
- platform-job-index/src/main/webapp/WEB-INF/lib/main-data-1.0-SNAPSHOT.jar
- platform-job-index/src/main/webapp/WEB-INF/lib/mainData.jar
platform-biz-service/src/main/java/com/lyms/platform/permission/DataAccessLayerService.java
View file @
f36e889
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | |
| 30 | 30 | @Override |
| 31 | 31 | public void afterPropertiesSet() throws Exception { |
| 32 | - System.out.print("startUpModel:--------------------" +startUpModel); | |
| 32 | +// System.out.print("startUpModel:--------------------" +startUpModel); | |
| 33 | 33 | } |
| 34 | 34 | public Object getBean(Class clazz){ |
| 35 | 35 | try{ |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/DepartmentsServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/PermissionsServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RegionsServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RolePermissionMapsServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/RolesServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UserOrganizationMapsServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UserRoleMapsServiceImpl.java
View file @
f36e889
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UsersServiceImpl.java
View file @
f36e889
platform-job-index/pom.xml
View file @
f36e889
| ... | ... | @@ -24,8 +24,12 @@ |
| 24 | 24 | |
| 25 | 25 | <dependencyManagement> |
| 26 | 26 | <dependencies> |
| 27 | - | |
| 28 | 27 | <dependency> |
| 28 | + <artifactId>main-data</artifactId> | |
| 29 | + <groupId>mommybaby</groupId> | |
| 30 | + <version>1.0-SNAPSHOT</version> | |
| 31 | + </dependency> | |
| 32 | + <dependency> | |
| 29 | 33 | <groupId>org.apache.lucene</groupId> |
| 30 | 34 | <artifactId>lucene-core</artifactId> |
| 31 | 35 | <version>4.7.0</version> |
| ... | ... | @@ -112,6 +116,20 @@ |
| 112 | 116 | <scope>system</scope> |
| 113 | 117 | <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/httpmime-4.4.1.jar</systemPath> |
| 114 | 118 | </dependency>--> |
| 119 | + <dependency> | |
| 120 | + <groupId>main-data</groupId> | |
| 121 | + <artifactId>main-data-data</artifactId> | |
| 122 | + <version>1.0</version> | |
| 123 | + <scope>system</scope> | |
| 124 | + <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/mainData.jar</systemPath> | |
| 125 | + </dependency> | |
| 126 | + <dependency> | |
| 127 | + <groupId>base-common-1.0-SNAPSHOT</groupId> | |
| 128 | + <artifactId>base-common-1.0-SNAPSHOT</artifactId> | |
| 129 | + <version>1.0</version> | |
| 130 | + <scope>system</scope> | |
| 131 | + <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/base-common-1.0-SNAPSHOT.jar</systemPath> | |
| 132 | + </dependency> | |
| 115 | 133 | <dependency> |
| 116 | 134 | <groupId>com.lyms.core</groupId> |
| 117 | 135 | <artifactId>platform-common</artifactId> |
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java
View file @
f36e889
| 1 | +package com.lyms.platform.job.index.restore.data; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.utils.DateUtil; | |
| 4 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 5 | +import com.lyms.platform.common.utils.ReflectionUtils; | |
| 6 | +import com.lyms.platform.permission.model.Organization; | |
| 7 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 8 | +import com.lyms.platform.pojo.Patients; | |
| 9 | +import com.lymsh.mommybaby.maindata.model.DoctorUsers; | |
| 10 | +import com.lymsh.mommybaby.maindata.model.Hospitals; | |
| 11 | +import com.lymsh.mommybaby.maindata.model.Reports; | |
| 12 | +import org.apache.commons.lang.math.NumberUtils; | |
| 13 | +import org.springframework.core.io.ClassPathResource; | |
| 14 | +import org.springframework.core.io.support.EncodedResource; | |
| 15 | +import org.springframework.core.io.support.PropertiesLoaderUtils; | |
| 16 | + | |
| 17 | +import java.lang.reflect.Field; | |
| 18 | +import java.util.*; | |
| 19 | + | |
| 20 | +/** | |
| 21 | + * Created by Administrator on 2016/9/29 0029. | |
| 22 | + */ | |
| 23 | +public class ConvertHelper { | |
| 24 | + | |
| 25 | + private static String AUTO_WORKER = "system-worker"; | |
| 26 | + | |
| 27 | + private static java.util.Map<Class, List<String>> cachedField = new HashMap<>(); | |
| 28 | + | |
| 29 | + | |
| 30 | + private static Properties properties = new Properties(); | |
| 31 | + | |
| 32 | + static { | |
| 33 | + try { | |
| 34 | + properties = PropertiesLoaderUtils.loadProperties(new EncodedResource(new ClassPathResource("lable.properties"), "utf8")); | |
| 35 | + } catch (Exception e) { | |
| 36 | + e.printStackTrace(); | |
| 37 | + } | |
| 38 | + } | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * mongo的建档信息转换成mysql的患者信息 | |
| 42 | + * | |
| 43 | + * @param patients | |
| 44 | + * @return | |
| 45 | + */ | |
| 46 | + public static com.lymsh.mommybaby.maindata.model.Patients convertPatient(Patients patients) { | |
| 47 | + com.lymsh.mommybaby.maindata.model.Patients localPatient = new com.lymsh.mommybaby.maindata.model.Patients(); | |
| 48 | + localPatient.setDueDate(patients.getDueDate()); | |
| 49 | + localPatient.setCreated(patients.getCreated()); | |
| 50 | + localPatient.setYn(patients.getYn()); | |
| 51 | + localPatient.setForeignId(patients.getId()); | |
| 52 | + localPatient.setUsername(patients.getUsername()); | |
| 53 | + localPatient.setServiceType(patients.getServiceType()); | |
| 54 | + localPatient.setAge(patients.getAge()); | |
| 55 | + localPatient.setBirth(patients.getBirth()); | |
| 56 | + localPatient.setLastMenses(patients.getLastMenses()); | |
| 57 | + localPatient.setPhone(patients.getPhone()); | |
| 58 | + localPatient.setGender(patients.getGender()); | |
| 59 | + localPatient.setVip(patients.getVip()); | |
| 60 | + localPatient.setCrisis(0); | |
| 61 | + //孕妇 | |
| 62 | + localPatient.setType(1); | |
| 63 | + localPatient.setPublishId(0); | |
| 64 | + localPatient.setPublishName(AUTO_WORKER); | |
| 65 | + return localPatient; | |
| 66 | + } | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 转换医生用户信息 | |
| 70 | + * | |
| 71 | + * @param users | |
| 72 | + * @return | |
| 73 | + */ | |
| 74 | + public static DoctorUsers convertUsers(com.lyms.platform.permission.model.Users users) { | |
| 75 | + DoctorUsers users1 = new DoctorUsers(); | |
| 76 | + users1.setCreated(users.getCreated()); | |
| 77 | + users1.setModified(users.getModified()); | |
| 78 | + users1.setUsername(users.getName()); | |
| 79 | + users1.setYn(users.getYn()); | |
| 80 | + users1.setForeignId(users.getId() + ""); | |
| 81 | + users1.setAccount(users.getAccount()); | |
| 82 | + users1.setPhone(users.getPhone()); | |
| 83 | + users1.setPwd(users.getPwd()); | |
| 84 | + //需要单独设置医院id | |
| 85 | +// users1.setHospitalId(); | |
| 86 | + users1.setPublishId(0); | |
| 87 | + users1.setPublishName(AUTO_WORKER); | |
| 88 | + return users1; | |
| 89 | + } | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 院内医院转换成妈咪贝比医院 | |
| 93 | + * | |
| 94 | + * @param organization | |
| 95 | + * @return | |
| 96 | + */ | |
| 97 | + public static Hospitals convertHospital(Organization organization) { | |
| 98 | + Hospitals hospitals = new Hospitals(); | |
| 99 | + hospitals.setCreated(organization.getCreated()); | |
| 100 | + hospitals.setModified(organization.getModified()); | |
| 101 | + hospitals.setYn(organization.getYn()); | |
| 102 | + hospitals.setTitle(organization.getName()); | |
| 103 | + hospitals.setForeignId(organization.getId() + ""); | |
| 104 | + hospitals.setDescription(organization.getDescription()); | |
| 105 | + hospitals.setAddress(organization.getAddress()); | |
| 106 | + | |
| 107 | +// hospitals.setAreaId(organization.getAreaId()); | |
| 108 | + hospitals.setPublishId(0); | |
| 109 | + hospitals.setCode(organization.getShortCode()); | |
| 110 | + hospitals.setPublishName(AUTO_WORKER); | |
| 111 | + return hospitals; | |
| 112 | + } | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * 转换检查报告 | |
| 116 | + * | |
| 117 | + * @param antExChuModel | |
| 118 | + * @return | |
| 119 | + */ | |
| 120 | + public static Reports convertAntExChu(AntExChuModel antExChuModel, Date lastMenses) { | |
| 121 | + Reports reports = new Reports(); | |
| 122 | + //孕期类型 | |
| 123 | + reports.setType(1); | |
| 124 | + reports.setPhysicalTime(antExChuModel.getCheckTime()); | |
| 125 | + reports.setForeignId(antExChuModel.getId()); | |
| 126 | + reports.setDesignation("初诊"); | |
| 127 | + reports.setCreated(antExChuModel.getCreated()); | |
| 128 | + reports.setModified(antExChuModel.getModified()); | |
| 129 | + reports.setYn(antExChuModel.getYn()); | |
| 130 | + reports.setPublishId(0); | |
| 131 | + //产检报告 | |
| 132 | + reports.setCheckType(3); | |
| 133 | + reports.setPublishName(AUTO_WORKER); | |
| 134 | + | |
| 135 | + Integer dueWeek = null; | |
| 136 | + if (null != antExChuModel.getcDueWeek()) { | |
| 137 | + dueWeek = NumberUtils.toInt(antExChuModel.getcDueWeek()); | |
| 138 | + } else { | |
| 139 | + dueWeek = DateUtil.getWeek(lastMenses, antExChuModel.getCheckTime()); | |
| 140 | + } | |
| 141 | + reports.setWeeks(dueWeek); | |
| 142 | + reports.setResult(convertAntExChuResult(antExChuModel)); | |
| 143 | + | |
| 144 | + return reports; | |
| 145 | + } | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * 把初诊转换成json | |
| 149 | + * | |
| 150 | + * @param antExChuModel | |
| 151 | + * @return | |
| 152 | + */ | |
| 153 | + private static String convertAntExChuResult(AntExChuModel antExChuModel) { | |
| 154 | + List list = new ArrayList(); | |
| 155 | + | |
| 156 | + List<String> list2 = getField(antExChuModel); | |
| 157 | + for (int i = 0; i < list2.size(); i++) { | |
| 158 | + Object obj = ReflectionUtils.getFieldValue(antExChuModel, list2.get(i)); | |
| 159 | + String key = properties.getProperty(list2.get(i)); | |
| 160 | + java.util.Map<String, Object> dataMap = new HashMap<>(); | |
| 161 | + if (null != key) { | |
| 162 | + dataMap.put("k", key); | |
| 163 | + if (obj instanceof Date) { | |
| 164 | + dataMap.put("v", DateUtil.getyyyy_MM_dd((Date) obj)); | |
| 165 | + } else { | |
| 166 | + dataMap.put("v", obj); | |
| 167 | + } | |
| 168 | + if(null!=obj){ | |
| 169 | + list.add(dataMap); | |
| 170 | + } | |
| 171 | + } | |
| 172 | + } | |
| 173 | + return JsonUtil.array2JsonString(list); | |
| 174 | + } | |
| 175 | + | |
| 176 | + private static List<String> getField(AntExChuModel antExChuModel) { | |
| 177 | + | |
| 178 | + if (cachedField.containsKey(antExChuModel.getClass())) { | |
| 179 | + return cachedField.get(antExChuModel.getClass()); | |
| 180 | + } | |
| 181 | + Field[] field = AntExChuModel.class.getDeclaredFields(); | |
| 182 | + List<String> fieldName = new ArrayList<>(); | |
| 183 | + for (Field f : field) { | |
| 184 | + fieldName.add(f.getName()); | |
| 185 | + } | |
| 186 | + cachedField.put(antExChuModel.getClass(), fieldName); | |
| 187 | + return fieldName; | |
| 188 | + } | |
| 189 | +} |
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/Runner.java
View file @
f36e889
| 1 | +package com.lyms.platform.job.index.restore.data; | |
| 2 | + | |
| 3 | +import org.apache.log4j.PropertyConfigurator; | |
| 4 | +import org.springframework.context.ApplicationContext; | |
| 5 | +import org.springframework.context.support.ClassPathXmlApplicationContext; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by Administrator on 2016/9/29 0029. | |
| 9 | + */ | |
| 10 | +public class Runner { | |
| 11 | + public static void main(String[] args){ | |
| 12 | + PropertyConfigurator.configure("D:\\git resouce\\regional-platform\\platform-job-index\\target\\classes\\log4j_config.xml"); | |
| 13 | + ApplicationContext applicationContext=new ClassPathXmlApplicationContext("classpath:/spring/applicationContext-sync-data.xml"); | |
| 14 | + SyncDataWork syncDataWork = applicationContext.getBean(SyncDataWork.class); | |
| 15 | + syncDataWork.sync(); | |
| 16 | + } | |
| 17 | +} |
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java
View file @
f36e889
| 1 | +package com.lyms.platform.job.index.restore.data; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.AntenatalExaminationService; | |
| 4 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 5 | +import com.lyms.platform.biz.service.YunBookbuildingService; | |
| 6 | +import com.lyms.platform.common.enums.YnEnums; | |
| 7 | +import com.lyms.platform.common.utils.DateUtil; | |
| 8 | +import com.lyms.platform.permission.model.Organization; | |
| 9 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
| 10 | +import com.lyms.platform.permission.model.Users; | |
| 11 | +import com.lyms.platform.permission.model.UsersQuery; | |
| 12 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 13 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 14 | +import com.lyms.platform.pojo.BasicConfig; | |
| 15 | +import com.lyms.platform.pojo.Patients; | |
| 16 | +import com.lyms.platform.query.AntExChuQuery; | |
| 17 | +import com.lyms.platform.query.BasicConfigQuery; | |
| 18 | +import com.lyms.platform.query.PatientsQuery; | |
| 19 | +import com.lymsh.mommybaby.maindata.model.*; | |
| 20 | +import com.lymsh.mommybaby.maindata.service.*; | |
| 21 | +import org.apache.commons.collections.CollectionUtils; | |
| 22 | +import org.apache.commons.lang.StringUtils; | |
| 23 | +import org.apache.commons.lang.math.NumberUtils; | |
| 24 | +import org.slf4j.Logger; | |
| 25 | +import org.slf4j.LoggerFactory; | |
| 26 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 27 | +import org.springframework.stereotype.Component; | |
| 28 | + | |
| 29 | +import java.util.Date; | |
| 30 | +import java.util.HashMap; | |
| 31 | +import java.util.List; | |
| 32 | +import java.util.concurrent.LinkedBlockingQueue; | |
| 33 | +import java.util.concurrent.ThreadPoolExecutor; | |
| 34 | +import java.util.concurrent.TimeUnit; | |
| 35 | + | |
| 36 | +/** | |
| 37 | + * 同步数据接口 | |
| 38 | + * <p> | |
| 39 | + * Created by Administrator on 2016/9/29 0029. | |
| 40 | + */ | |
| 41 | +@Component | |
| 42 | +public class SyncDataWork { | |
| 43 | + | |
| 44 | + | |
| 45 | + private Logger logger = LoggerFactory.getLogger("sync-data"); | |
| 46 | + | |
| 47 | + @Autowired | |
| 48 | + private OrganizationService organizationService; | |
| 49 | + | |
| 50 | + @Autowired | |
| 51 | + /** | |
| 52 | + * 孕妇建档 | |
| 53 | + */ | |
| 54 | + private YunBookbuildingService yunBookbuildingService; | |
| 55 | + /** | |
| 56 | + * 工作线程池 | |
| 57 | + */ | |
| 58 | + private ThreadPoolExecutor workExecutor = new ThreadPoolExecutor(2, 5, 3, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(50)); | |
| 59 | + @Autowired | |
| 60 | + private AntenatalExaminationService antenatalExaminationService; | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 妈咪贝比的建档 | |
| 64 | + */ | |
| 65 | + @Autowired | |
| 66 | + private PatientsService patientsService; | |
| 67 | + @Autowired | |
| 68 | + private HospitalsService hospitalsService; | |
| 69 | + /** | |
| 70 | + * 妈咪贝比 | |
| 71 | + */ | |
| 72 | + @Autowired | |
| 73 | + private UsersService mamiUsersService; | |
| 74 | + @Autowired | |
| 75 | + private com.lyms.platform.permission.service.UsersService usersService; | |
| 76 | + /** | |
| 77 | + * 省 市 区 | |
| 78 | + */ | |
| 79 | + @Autowired | |
| 80 | + private RegionsService mamiregionsService; | |
| 81 | + @Autowired | |
| 82 | + private BasicConfigService basicConfigService; | |
| 83 | + @Autowired | |
| 84 | + private DoctorUsersService doctorUsersService; | |
| 85 | + @Autowired | |
| 86 | + private ReportsService reportsService; | |
| 87 | + @Autowired | |
| 88 | + private DoctorUsersPatientsMapsService doctorUsersPatientsMapsService; | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * | |
| 92 | + */ | |
| 93 | + private java.util.Map<String, Integer> orgMapToId = new HashMap<>(); | |
| 94 | + //妈咪贝比的省市区 | |
| 95 | + private java.util.Map<String, Integer> mamiRegions = new HashMap<>(); | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * mongo 里面省市区的id | |
| 99 | + */ | |
| 100 | + public static final String CHINA_BASIC_ID = "f6c505dd-835a-43d7-b0bb-fdb9eb0b7b31"; | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * 加载全部省市区的数据到内存里面 | |
| 104 | + */ | |
| 105 | + private void loadMamiAllRegion() { | |
| 106 | + RegionsQuery regionsQuery = new RegionsQuery(); | |
| 107 | + List<Regions> regionsList = mamiregionsService.queryRegions(regionsQuery); | |
| 108 | + Regions regions = null; | |
| 109 | + if (CollectionUtils.isNotEmpty(regionsList)) { | |
| 110 | + for (int i = 0; i < regionsList.size(); i++) { | |
| 111 | + regions = regionsList.get(i); | |
| 112 | + mamiRegions.put(regions.getRegionName(), regions.getId()); | |
| 113 | + } | |
| 114 | + } else { | |
| 115 | + logger.warn("load mami region error.no data"); | |
| 116 | + } | |
| 117 | + } | |
| 118 | + | |
| 119 | + /** | |
| 120 | + * 加载区域平台的省市区 | |
| 121 | + */ | |
| 122 | + private void loadRpAllRegion() { | |
| 123 | + BasicConfigQuery regionsQuery = new BasicConfigQuery(); | |
| 124 | + regionsQuery.setParentId(CHINA_BASIC_ID); | |
| 125 | + regionsQuery.setYn(YnEnums.YES.getId()); | |
| 126 | + List<BasicConfig> basicConfigList = basicConfigService.queryBasicConfig(regionsQuery); | |
| 127 | + if (CollectionUtils.isNotEmpty(basicConfigList)) { | |
| 128 | + | |
| 129 | + } else { | |
| 130 | + logger.warn("load rp region error.no data"); | |
| 131 | + } | |
| 132 | + } | |
| 133 | + | |
| 134 | + public void sync() { | |
| 135 | + long l = System.currentTimeMillis(); | |
| 136 | + logger.info("start sync at " + DateUtil.getyyyy_MM_dd(new Date())); | |
| 137 | + //先加载省市区 | |
| 138 | + loadMamiAllRegion(); | |
| 139 | + | |
| 140 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 141 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 142 | + //查询符合条件的机构 | |
| 143 | + List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
| 144 | + if (CollectionUtils.isNotEmpty(organizationList)) { | |
| 145 | + Hospitals hospitals = null; | |
| 146 | + for (Organization organization : organizationList) { | |
| 147 | + HospitalsQuery hospitalsQuery = new HospitalsQuery(); | |
| 148 | + hospitalsQuery.setForeignId(organization.getId() + ""); | |
| 149 | + hospitalsQuery.setYn(YnEnums.YES.getId()); | |
| 150 | + List<Hospitals> hospitalsList = hospitalsService.queryHospitals(hospitalsQuery); | |
| 151 | + if (CollectionUtils.isNotEmpty(hospitalsList)) { | |
| 152 | + hospitals = hospitalsList.get(0); | |
| 153 | + } else { | |
| 154 | + hospitals = ConvertHelper.convertHospital(organization); | |
| 155 | + if (null != organization.getAreaId()) { | |
| 156 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(organization.getAreaId()); | |
| 157 | + if (null != basicConfig) { | |
| 158 | + hospitals.setAreaId(mamiRegions.get(basicConfig.getName())); | |
| 159 | + } | |
| 160 | + } | |
| 161 | + if (null != organization.getCityId()) { | |
| 162 | + BasicConfig basicConfig1 = basicConfigService.getOneBasicConfigById(organization.getCityId()); | |
| 163 | + if (null != basicConfig1) { | |
| 164 | + hospitals.setCityId(mamiRegions.get(basicConfig1.getName())); | |
| 165 | + } | |
| 166 | + } | |
| 167 | + if (null != organization.getProvinceId()) { | |
| 168 | + BasicConfig basicConfig2 = basicConfigService.getOneBasicConfigById(organization.getProvinceId()); | |
| 169 | + if (null != basicConfig2) { | |
| 170 | + hospitals.setProvinceId(mamiRegions.get(basicConfig2.getName())); | |
| 171 | + } | |
| 172 | + } | |
| 173 | + hospitalsService.addHospitals(hospitals); | |
| 174 | + } | |
| 175 | + | |
| 176 | + if (null != hospitals.getId()) { | |
| 177 | + orgMapToId.put(organization.getId() + "", hospitals.getId()); | |
| 178 | + } else { | |
| 179 | + logger.warn("add hospital don't id."); | |
| 180 | + } | |
| 181 | + new SyncWork(organization.getId() + "").start(); | |
| 182 | + } | |
| 183 | + } | |
| 184 | + | |
| 185 | + | |
| 186 | + logger.info("sync end costTime:" + (System.currentTimeMillis() - l) + "ms."); | |
| 187 | + } | |
| 188 | + | |
| 189 | + /** | |
| 190 | + * 执行同步的工作线程 | |
| 191 | + */ | |
| 192 | + private class SyncWork extends Thread { | |
| 193 | + | |
| 194 | + private String hospitalId; | |
| 195 | + | |
| 196 | + private java.util.Map<Integer, Integer> userMapping = new HashMap<>(); | |
| 197 | + | |
| 198 | + public SyncWork(String hospitalId) { | |
| 199 | + this.hospitalId = hospitalId; | |
| 200 | + } | |
| 201 | + | |
| 202 | + @Override | |
| 203 | + public void run() { | |
| 204 | + logger.info("begin sync work hospital:" + hospitalId + ",at time " + DateUtil.getyyyy_MM_dd(new Date())); | |
| 205 | + //查询出该医院所以的医生用户 | |
| 206 | + UsersQuery usersQuery = new UsersQuery(); | |
| 207 | + usersQuery.setYn(YnEnums.YES.getId()); | |
| 208 | + usersQuery.setOrgId(Integer.valueOf(hospitalId)); | |
| 209 | + List<Users> userses = usersService.queryUsers(usersQuery); | |
| 210 | + DoctorUsers doctorUsers = null; | |
| 211 | + if (CollectionUtils.isNotEmpty(userses)) { | |
| 212 | + for (Users users : userses) { | |
| 213 | + DoctorUsersQuery doctorUsersQuery = new DoctorUsersQuery(); | |
| 214 | + doctorUsersQuery.setForeignId(users.getId() + ""); | |
| 215 | + doctorUsersQuery.setYn(YnEnums.YES.getId()); | |
| 216 | + List<DoctorUsers> doctorUsersList = doctorUsersService.queryDoctorUsers(doctorUsersQuery); | |
| 217 | + if (CollectionUtils.isNotEmpty(doctorUsersList)) { | |
| 218 | + doctorUsers = doctorUsersList.get(0); | |
| 219 | + } else { | |
| 220 | + //医生用户转换 | |
| 221 | + doctorUsers = ConvertHelper.convertUsers(users); | |
| 222 | + doctorUsers.setHospitalId(orgMapToId.get(hospitalId)); | |
| 223 | + } | |
| 224 | + | |
| 225 | + if (null != doctorUsers) { | |
| 226 | + doctorUsersService.addDoctorUsers(doctorUsers); | |
| 227 | + userMapping.put(users.getId(), doctorUsers.getId()); | |
| 228 | + } | |
| 229 | + } | |
| 230 | + } | |
| 231 | + | |
| 232 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
| 233 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
| 234 | + patientsQuery1.setHospitalId(hospitalId); | |
| 235 | + patientsQuery1.setNeed("1"); | |
| 236 | + patientsQuery1.setLimit(100); | |
| 237 | + List<Patients> patientses = yunBookbuildingService.queryPregnantWithQuery(patientsQuery1); | |
| 238 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 239 | + for (Patients patients : patientses) { | |
| 240 | + com.lymsh.mommybaby.maindata.model.Patients mamiPatient = ConvertHelper.convertPatient(patients); | |
| 241 | + DoctorUsersPatientsMaps doctorUsersPatientsMaps = new DoctorUsersPatientsMaps(); | |
| 242 | + doctorUsersPatientsMaps.setCreated(new Date()); | |
| 243 | + doctorUsersPatientsMaps.setYn(YnEnums.YES.getId()); | |
| 244 | + | |
| 245 | + //门诊患者 | |
| 246 | + doctorUsersPatientsMaps.setGroupId(4); | |
| 247 | + //设置为待处理 | |
| 248 | + doctorUsersPatientsMaps.setStatus(1); | |
| 249 | + doctorUsersPatientsMaps.setStatusName("待处理"); | |
| 250 | + | |
| 251 | + //增加建档记录 | |
| 252 | + patientsService.aouPatients(mamiPatient); | |
| 253 | + doctorUsersPatientsMaps.setPatientId(mamiPatient.getId()); | |
| 254 | + if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { | |
| 255 | + doctorUsersPatientsMaps.setDoctorUserId(userMapping.get(Integer.valueOf(patients.getBookbuildingDoctor()))); | |
| 256 | + doctorUsersPatientsMapsService.aouDoctorUsersPatientsMaps(doctorUsersPatientsMaps); | |
| 257 | + } | |
| 258 | + | |
| 259 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 260 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 261 | + antExChuQuery.setParentId(patients.getId()); | |
| 262 | + List<AntExChuModel> antExChuModel = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 263 | + if (CollectionUtils.isEmpty(antExChuModel)) { | |
| 264 | + continue; | |
| 265 | + } | |
| 266 | + for (AntExChuModel antExChuModel1 : antExChuModel) { | |
| 267 | + Reports reports = ConvertHelper.convertAntExChu(antExChuModel1, patients.getLastMenses()); | |
| 268 | + if (NumberUtils.isNumber(antExChuModel1.getProdDoctor())) { | |
| 269 | + Users users = usersService.getUsers(Integer.valueOf(antExChuModel1.getProdDoctor())); | |
| 270 | + if (null != users) { | |
| 271 | + reports.setDoctorName(users.getName()); | |
| 272 | + } | |
| 273 | + } | |
| 274 | + reports.setPatientId(mamiPatient.getId()); | |
| 275 | + reports.setAge(patients.getAge()); | |
| 276 | + reports.setRealName(patients.getUsername()); | |
| 277 | + if (StringUtils.isNotEmpty(patients.getHospitalId())) { | |
| 278 | + Organization organization = organizationService.getOrganization(NumberUtils.toInt(patients.getHospitalId())); | |
| 279 | + if (null != organization) { | |
| 280 | + reports.setHospitalName(organization.getName()); | |
| 281 | + } | |
| 282 | + } | |
| 283 | + reportsService.aouReports(reports); | |
| 284 | + com.lymsh.mommybaby.maindata.model.Patients p = new com.lymsh.mommybaby.maindata.model.Patients(); | |
| 285 | + p.setLastReportId(reports.getId()); | |
| 286 | + p.setLastReportDoctorName(reports.getDoctorName()); | |
| 287 | + p.setId(mamiPatient.getId()); | |
| 288 | + patientsService.updatePatients(p); | |
| 289 | + } | |
| 290 | + } | |
| 291 | + } | |
| 292 | + } | |
| 293 | + } | |
| 294 | +} |
platform-job-index/src/main/resources/conf.properties
View file @
f36e889
| 1 | +#需要导入的妈咪贝比 | |
| 2 | +maindata.driver=com.mysql.jdbc.Driver | |
| 3 | +maindata.jdbcurl=jdbc:mysql://119.90.43.68:3307/mommybaby?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 | |
| 4 | +maindata.username=lyms_chengdu | |
| 5 | +maindata.password=lyms2015 | |
| 6 | + | |
| 7 | +maindata.maxpoolsize=5 | |
| 8 | +maindata.initialpoolsize=2 | |
| 9 | +maindata.minpoolsize=2 | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | +mongo.db.host=119.90.43.68 | |
| 15 | +mongo.db.port=27018 | |
| 16 | +mongo.db.dbname=platform | |
| 17 | +mongo.db.username=platform | |
| 18 | +mongo.db.password=platform123 | |
| 19 | +mongo.socketTimeout=2500 | |
| 20 | +mongo.connectionsPerHost=20 | |
| 21 | +mongo.threadsAllowedToBlockForConnectionMultiplier=10 | |
| 22 | +mongo.connectTimeout=3000 | |
| 23 | +mongo.maxWaitTime=4000 | |
| 24 | +mongo.autoConnectRetry=true | |
| 25 | +mongo.socketKeepAlive=true | |
| 26 | + | |
| 27 | +mysql.db.name=platform | |
| 28 | +mysql.db.password=platform123 | |
| 29 | +mysql.driver=com.mysql.jdbc.Driver | |
| 30 | +mysql.jdbcurl=jdbc:mysql://119.90.43.68:3307/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 | |
| 31 | + | |
| 32 | +mysql.maxpoolsize=5 | |
| 33 | +mysql.initialpoolsize=2 | |
| 34 | +mysql.minpoolsize=2 | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | +mysql.master.db.name=platform | |
| 40 | +mysql.master.db.password=platform123 | |
| 41 | +mysql.master.driver=com.mysql.jdbc.Driver | |
| 42 | +mysql.master.jdbcurl=jdbc:mysql://119.90.57.26:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 | |
| 43 | + | |
| 44 | + | |
| 45 | +redis.servers=localhost:6379 | |
| 46 | + | |
| 47 | + | |
| 48 | +report.db.jdbcurl=jdbc:oracle:thin:@192.168.1.32:1521:orcl | |
| 49 | +report.db.username=LYMS_ODS | |
| 50 | +report.db.password=Welcome1 |
platform-job-index/src/main/resources/lable.properties
View file @
f36e889
| 1 | +dueDate=预产期 | |
| 2 | +lastMenses=末次月经 | |
| 3 | +cDueWeek=当前孕周 | |
| 4 | +pastHistory=既往史 | |
| 5 | +familyHistory=家族史 | |
| 6 | +personalHistory=个人史 | |
| 7 | +ymjzHistory=疫苗接种史 | |
| 8 | +ywgmHistory=药物过敏史 | |
| 9 | +fksxHistory=妇科手术史 | |
| 10 | +ysfyHistory=叶酸服用 | |
| 11 | +pregnancyTimes=孕次 | |
| 12 | +prodTime=产次 | |
| 13 | +delivery=顺产 | |
| 14 | +planedProd=刨宫产 | |
| 15 | +abortion=流产 | |
| 16 | +stillbirth=死胎 | |
| 17 | +stillChan=死产 | |
| 18 | +neoDeath=新生儿死亡 | |
| 19 | +birthDefect=出生缺陷 | |
| 20 | +height=身高 | |
| 21 | +weight=体重 | |
| 22 | +yqWeight=孕前体重 | |
| 23 | +baricIndex=体重指数 | |
| 24 | +cestationInfo=本次妊娠情况 | |
| 25 | +gonggao=宫高 | |
| 26 | +fuwei=腹围 | |
| 27 | +tireNumber1=胎数 | |
| 28 | +heart=心脏 | |
| 29 | +lungs=肺部 | |
| 30 | +vulva=外阴 | |
| 31 | +vagina=阴道 | |
| 32 | +cervical=宫颈 | |
| 33 | +uterus=子宫 | |
| 34 | +fujian=附件 |
platform-job-index/src/main/resources/log4j_config.xml
View file @
f36e889
| ... | ... | @@ -70,6 +70,19 @@ |
| 70 | 70 | </layout> |
| 71 | 71 | </appender> |
| 72 | 72 | |
| 73 | + <appender name="sync-data" class="org.apache.log4j.RollingFileAppender"> | |
| 74 | + <param name="Append" value="true" /> | |
| 75 | + <param name="File" value="${catalina.base}/logs/sync-data.log" /> | |
| 76 | + <param name="MaxFileSize" value="100MB" /> | |
| 77 | + <param name="MaxBackupIndex" value="2" /> | |
| 78 | + <layout class="org.apache.log4j.PatternLayout"> | |
| 79 | + <param name="ConversionPattern" value="%d %p - %m%n" /> | |
| 80 | + </layout> | |
| 81 | + </appender> | |
| 82 | + <logger name="sync-data"> | |
| 83 | + <level value="debug" /> | |
| 84 | + <appender-ref ref="sync-data" /> | |
| 85 | + </logger> | |
| 73 | 86 | <logger name="DAL-MONITOR"> |
| 74 | 87 | <level value="debug" /> |
| 75 | 88 | <appender-ref ref="DAL-MONITOR" /> |
| 76 | 89 | |
| ... | ... | @@ -78,12 +91,15 @@ |
| 78 | 91 | <level value="debug" /> |
| 79 | 92 | <appender-ref ref="Access" /> |
| 80 | 93 | </logger> |
| 81 | - | |
| 94 | + <logger name="org.springframework"> | |
| 95 | + <level value="debug" /> | |
| 96 | + <appender-ref ref="sync-data" /> | |
| 97 | + </logger> | |
| 82 | 98 | <!-- ibatis end --> |
| 83 | 99 | |
| 84 | 100 | <!-- Root Logger --> |
| 85 | 101 | <root> |
| 86 | - <priority value="info" /> | |
| 102 | + <priority value="debug" /> | |
| 87 | 103 | <appender-ref ref="STDOUT" /> |
| 88 | 104 | <appender-ref ref="Error" /> |
| 89 | 105 | </root> |
platform-job-index/src/main/resources/spring/applicationContext-sync-data.xml
View file @
f36e889
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 3 | + xmlns:context="http://www.springframework.org/schema/context" | |
| 4 | + xmlns:solr="http://www.springframework.org/schema/data/solr" | |
| 5 | + xsi:schemaLocation="http://www.springframework.org/schema/data/solr http://www.springframework.org/schema/data/solr/spring-solr.xsd | |
| 6 | + 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.xsd"> | |
| 8 | + | |
| 9 | + <!-- 采用注释的方式配置bean --> | |
| 10 | + <context:annotation-config /> | |
| 11 | + | |
| 12 | + <bean id="configProperties" | |
| 13 | + class="org.springframework.beans.factory.config.PropertiesFactoryBean"> | |
| 14 | + <property name="locations"> | |
| 15 | + <list> | |
| 16 | + <value>classpath:conf.properties</value> | |
| 17 | + </list> | |
| 18 | + </property> | |
| 19 | + </bean> | |
| 20 | + | |
| 21 | + <bean id="propertyConfigurer" | |
| 22 | + class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> | |
| 23 | + <property name="properties" ref="configProperties" /> | |
| 24 | + </bean> | |
| 25 | + | |
| 26 | + <!-- DataSource configuration 项目主数据库 --> | |
| 27 | + <bean id="mainDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> | |
| 28 | + <property name="driverClass" value="${maindata.driver}" /> | |
| 29 | + <property name="jdbcUrl" value="${maindata.jdbcurl}" /> | |
| 30 | + <property name="user" value="${maindata.username}" /> | |
| 31 | + <property name="password" value="${maindata.password}" /> | |
| 32 | + <property name="maxPoolSize" value="${maindata.maxpoolsize}" /> | |
| 33 | + <property name="initialPoolSize" value="${maindata.initialpoolsize}" /> | |
| 34 | + <property name="maxIdleTime" value="7200"></property> | |
| 35 | + <property name="acquireRetryDelay" value="1000"></property> | |
| 36 | + <property name="breakAfterAcquireFailure" value="false"></property> | |
| 37 | + <property name="acquireRetryAttempts" value="3" /> | |
| 38 | + <property name="minPoolSize" value="${maindata.minpoolsize}" /> | |
| 39 | + </bean> | |
| 40 | + | |
| 41 | + <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> | |
| 42 | + <property name="dataSource" ref="mainDataSource"/> | |
| 43 | + <property name="mapperLocations"> | |
| 44 | + <list> | |
| 45 | + <value>classpath*:mainOrm/*.xml</value> | |
| 46 | + </list> | |
| 47 | + </property> | |
| 48 | + </bean> | |
| 49 | + <!-- all class in the back-package are auto loaded as a mapper --> | |
| 50 | + <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> | |
| 51 | + <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property> | |
| 52 | + <property name="basePackage" value="com.lymsh.mommybaby.maindata.dao" /> | |
| 53 | + </bean> | |
| 54 | + | |
| 55 | + | |
| 56 | + <!--我们自己的公网服务器库 begin--> | |
| 57 | + <bean name="masterdataSourceB" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" | |
| 58 | + destroy-method="close"> | |
| 59 | + <property name="url" value="${mysql.master.jdbcurl}"/> | |
| 60 | + <property name="username" value="${mysql.master.db.name}"/> | |
| 61 | + <property name="password" value="${mysql.master.db.password}"/> | |
| 62 | + | |
| 63 | + <property name="initialSize" value="10"/> | |
| 64 | + <property name="maxActive" value="100"/> | |
| 65 | + <property name="maxIdle" value="10"/> | |
| 66 | + <property name="minIdle" value="0"/> | |
| 67 | + <property name="maxWait" value="10000"/> | |
| 68 | + <!-- <property name="validationQuery" value="${validationQuery3}" /> --> | |
| 69 | + <property name="testOnBorrow" value="false"/> | |
| 70 | + <property name="testOnReturn" value="false"/> | |
| 71 | + <property name="testWhileIdle" value="true"/> | |
| 72 | + <property name="timeBetweenEvictionRunsMillis" value="60000"/> | |
| 73 | + <property name="minEvictableIdleTimeMillis" value="25200000"/> | |
| 74 | + <property name="removeAbandoned" value="true"/> | |
| 75 | + <property name="removeAbandonedTimeout" value="1800"/> | |
| 76 | + <property name="logAbandoned" value="true"/> | |
| 77 | + <property name="filters" value="stat"/> | |
| 78 | + </bean> | |
| 79 | + | |
| 80 | + <bean id="masterSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> | |
| 81 | + <property name="dataSource" ref="masterdataSourceB"/> | |
| 82 | + <property name="mapperLocations"> | |
| 83 | + <list> | |
| 84 | + <value>classpath*:mainOrm/master/*.xml</value> | |
| 85 | + </list> | |
| 86 | + </property> | |
| 87 | + </bean> | |
| 88 | + <!-- all class in the back-package are auto loaded as a mapper --> | |
| 89 | + <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer" id="configurer1"> | |
| 90 | + <property name="sqlSessionFactoryBeanName" value="masterSqlSessionFactory"></property> | |
| 91 | + <property name="basePackage" value="com.lyms.platform.permission.dao.master"/> | |
| 92 | + </bean> | |
| 93 | + | |
| 94 | + <context:component-scan base-package="com.lymsh.mommybaby.maindata.service.impl"/> | |
| 95 | + <context:component-scan base-package="com.lyms.platform.job.index.restore.data"/> | |
| 96 | + <context:component-scan base-package="com.lyms.platform.permission.*"/> | |
| 97 | + <context:component-scan base-package="com.lyms.platform.biz.dal.impl"/> | |
| 98 | + <context:component-scan base-package="com.lyms.platform.biz.service"/> | |
| 99 | + | |
| 100 | + <import resource="spring-mongodb.xml"/> | |
| 101 | +</beans> |
platform-job-index/src/main/resources/spring/spring-mongodb.xml
View file @
f36e889
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | 2 | <beans xmlns="http://www.springframework.org/schema/beans" |
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mongo="http://www.springframework.org/schema/data/mongo" | |
| 4 | - xsi:schemaLocation="http://www.springframework.org/schema/data/mongo | |
| 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 | |
| 5 | 6 | http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd |
| 6 | 7 | http://www.springframework.org/schema/beans |
| 7 | 8 | http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> |
| 8 | 9 | |
| 9 | - <mongo:db-factory id="mongoDbFactory" host="${mongo.db.host}" | |
| 10 | - port="${mongo.db.port}" dbname="${mongo.db.dbname}" /> | |
| 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> | |
| 11 | 15 | |
| 12 | - <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> | |
| 13 | - <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> | |
| 14 | - <!-- <constructor-arg name="userCredentials" ref="userCredentials"/> --> | |
| 15 | - <constructor-arg name="mongoConverter" ref="mappingMongoConverter" /> | |
| 16 | - </bean> | |
| 17 | 16 | |
| 18 | - <mongo:mapping-converter base-package="com.lyms.platform.pojo" /> | |
| 19 | - <bean id="mappingContext" class="org.springframework.data.mongodb.core.mapping.MongoMappingContext" /> | |
| 20 | - <!-- 配置mongodb映射类型 --> | |
| 21 | - <bean id="mappingMongoConverter" class="org.springframework.data.mongodb.core.convert.MappingMongoConverter"> | |
| 22 | - <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> | |
| 23 | - <constructor-arg name="mappingContext" ref="mappingContext" /> | |
| 24 | - <property name="typeMapper" ref="defaultMongoTypeMapper" /> | |
| 25 | - </bean> | |
| 17 | + <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> | |
| 18 | + <constructor-arg name="username" value="${mongo.db.username}"/> | |
| 19 | + <constructor-arg name="password" value="${mongo.db.password}"/> | |
| 20 | + </bean> | |
| 26 | 21 | |
| 27 | - <!-- 默认Mongodb类型映射 --> | |
| 28 | - <bean id="defaultMongoTypeMapper" class="org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper"> | |
| 29 | - <constructor-arg name="typeKey"> | |
| 30 | - <null /><!-- 这里设置为空,可以把 spring data mongodb 多余保存的_class字段去掉 --> | |
| 31 | - </constructor-arg> | |
| 32 | - </bean> | |
| 33 | - <!-- | |
| 34 | - <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> | |
| 35 | - <description>认证口令</description> | |
| 36 | - <constructor-arg name="username" value="${${mongo.username}}" /> | |
| 37 | - <constructor-arg name="password" value="${${mongo.password}}" /> | |
| 38 | - </bean> | |
| 22 | + <mongo:db-factory mongo-ref="mongo" id="mongoDbFactory"/> | |
| 39 | 23 | |
| 40 | - <mongo:mongo id="mongo" host="${${mongo.host}}" port="${${mongo.port}}"> | |
| 41 | - | |
| 42 | - <mongo:options connections-per-host="${${mongo.connectionsPerHost}}" | |
| 43 | - | |
| 44 | - threads-allowed-to-block-for-connection-multiplier="${${mongo.threadsAllowedToBlockForConnectionMultiplier}}" | |
| 45 | - | |
| 46 | - connect-timeout="${${mongo.connectTimeout}}" max-wait-time="${${mongo.maxWaitTime}}" | |
| 47 | - | |
| 48 | - auto-connect-retry="${${mongo.autoConnectRetry}}" socket-keep-alive="${${mongo.socketKeepAlive}}" | |
| 49 | - | |
| 50 | - socket-timeout="${${mongo.socketTimeout}}" slave-ok="${${mongo.slaveOk}}" | |
| 51 | - | |
| 52 | - write-number="1" write-timeout="0" write-fsync="true" /> | |
| 53 | - </mongo:mongo>--> | |
| 24 | + <mongo:mongo id="mongo" host="${mongo.db.host}" port="${mongo.db.port}"> | |
| 25 | + <mongo:options connections-per-host="${mongo.connectionsPerHost}" | |
| 26 | + threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}" | |
| 27 | + connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}" | |
| 28 | + auto-connect-retry="${mongo.autoConnectRetry}" socket-keep-alive="${mongo.socketKeepAlive}" | |
| 29 | + socket-timeout="${mongo.socketTimeout}" write-number="1" | |
| 30 | + write-timeout="0" write-fsync="true"/> | |
| 31 | + </mongo:mongo> | |
| 54 | 32 | </beans> |
platform-job-index/src/main/webapp/WEB-INF/lib/base-common-1.0-SNAPSHOT.jar
View file @
f36e889
platform-job-index/src/main/webapp/WEB-INF/lib/main-data-1.0-SNAPSHOT.jar
View file @
f36e889
platform-job-index/src/main/webapp/WEB-INF/lib/mainData.jar
View file @
f36e889