Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

zhenglingfeng 8 years ago
parent
commit
f920e945b3
38 changed files with 1918 additions and 162 deletions
  1. 9 9
      patient-co-statistics/pom.xml
  2. 49 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/AsyncConfig.java
  3. 6 6
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/ServletInitializer.java
  4. 6 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/ConsultDataFilter.java
  5. 6 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/FollowUpDataFilter.java
  6. 6 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/HealthGuideDataFilter.java
  7. 8 3
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/SignDataFilter.java
  8. 7 6
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/extract/DBExtract.java
  9. 102 2
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/extract/DBPageExtract.java
  10. 2 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/storage/DBStorage.java
  11. 5 5
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/AllSignExpenseStatusJob.java
  12. 2 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/AllSignJob.java
  13. 0 15
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/SignJob.java
  14. 1 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/UnSignJob.java
  15. 11 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/doctor/Doctor.java
  16. 12 0
      patient-co-wlyy/pom.xml
  17. 10 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java
  18. 53 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientFamilyMember.java
  19. 34 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientFamilyMemberDao.java
  20. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java
  21. 31 2
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java
  22. 9 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java
  23. 302 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java
  24. 6 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java
  25. 212 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/InspectionService.java
  26. 10 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  27. 20 8
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/SMSService.java
  28. 2 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/DoctorService.java
  29. 1 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/RSAUtils.java
  30. 652 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/XMLUtil.java
  31. 38 29
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  32. 4 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/sms/SMSController.java
  33. 40 11
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java
  34. 8 6
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthRecordController.java
  35. 31 6
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/InspectionController.java
  36. 8 7
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java
  37. 176 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  38. 36 36
      patient-co-wlyy/src/main/resources/application.properties

+ 9 - 9
patient-co-statistics/pom.xml

@ -8,8 +8,8 @@
    <modelVersion>4.0.0</modelVersion>
    <!--打成war包需要的配置-->
    <packaging>war</packaging>
    <!--<packaging>jar</packaging>-->
    <!--<packaging>war</packaging>-->
    <packaging>jar</packaging>
    <name>patient-co-statistics</name>
    <properties>
@ -371,7 +371,7 @@
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
                <version>${version.spring-boot}</version>
                <scope>provided</scope>
                <!--<scope>provided</scope>-->
            </dependency>
        <dependency>
            <groupId>org.json</groupId>
@ -394,12 +394,12 @@
    <build>
        <plugins>
            <!--打成war包需要的配置-->
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <!--<plugin>-->
                <!--<artifactId>maven-war-plugin</artifactId>-->
                <!--<configuration>-->
                    <!--<failOnMissingWebXml>false</failOnMissingWebXml>-->
                <!--</configuration>-->
            <!--</plugin>-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>

+ 49 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/AsyncConfig.java

@ -0,0 +1,49 @@
package com.yihu.wlyy.statistics.config;
import java.util.concurrent.Executor;
import org.apache.tomcat.util.threads.ThreadPoolExecutor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/**
 * Created by Administrator on 2016.10.18.
 * 启用多綫程
 */
@Configuration
@EnableAsync
public class AsyncConfig  {
    /** 如果池中的实际线程数小于corePoolSize,无论是否其中有空闲的线程,都会给新的任务产生新的线程 */
    private int corePoolSize = 5;
    /** 如果池中的线程数=maximumPoolSize,则有空闲线程使用空闲线程,否则新任务放入queueCapacity. */
    private int maxPoolSize = 20;
    /** 缓冲队列. */
    private int queueCapacity = 10;
    @Bean
    public Executor dbExtractExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(corePoolSize);
        executor.setMaxPoolSize(maxPoolSize);
        executor.setQueueCapacity(queueCapacity);
        // rejection-policy:当pool已经达到max size的时候,如何处理新任务
        // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        executor.initialize();
        return executor;
    }
    @Bean
    public Executor dbStorageExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(corePoolSize);
        executor.setMaxPoolSize(maxPoolSize);
        executor.setQueueCapacity(queueCapacity);
        // rejection-policy:当pool已经达到max size的时候,如何处理新任务
        // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        executor.initialize();
        return executor;
    }
}

+ 6 - 6
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/ServletInitializer.java

@ -7,9 +7,9 @@ import org.springframework.boot.context.web.SpringBootServletInitializer;
/**
 * Created by Administrator on 2016.10.14.
 */
public class ServletInitializer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }
}
//public class ServletInitializer extends SpringBootServletInitializer {
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
//        return application.sources(Application.class);
//    }
//}

+ 6 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/ConsultDataFilter.java

@ -87,6 +87,12 @@ public class ConsultDataFilter {
                isAll=false;
                continue;
            }
            if(orgCode.length()!=10) {
                errorContent.append("咨询Id:"+consultTeam.getId()+",团队Id:"+adminTeam.getId()+",咨询的团队(wlyy_consult_team)中的机构是测试机构");
                isAll=false;
                errorCount++;
                continue;
            }
            String orgCodeTemp="";
            //统计机构
            if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){

+ 6 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/FollowUpDataFilter.java

@ -103,6 +103,12 @@ public class FollowUpDataFilter {
                isAll=false;
                continue;
            }
            if(orgCode.length()!=10) {
                errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据是测试数据");
                isAll=false;
                errorCount++;
                continue;
            }
            //统计机构
            if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
                //统计站

+ 6 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/HealthGuideDataFilter.java

@ -95,6 +95,12 @@ public class HealthGuideDataFilter {
                isAll=false;
                continue;
            }
            if(orgCode.length()!=10) {
                errorContent.append("健康咨询id:"+patientHealthGuidance.getId()+",签约code:"+signFamily.getCode()+",咨询的家庭签约的机构Hospital是测试机构");
                isAll=false;
                errorCount++;
                continue;
            }
            String orgCodeTemp="";
            //统计机构 -----------------start---------------------
            if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){

+ 8 - 3
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/SignDataFilter.java

@ -38,7 +38,7 @@ public class SignDataFilter {
    public static String level2Health="5";//健康服务分布
    public static String level3Disease="1";//疾病分组
   public static int size=0;
    private StringBuffer errorContent =new StringBuffer();//错误信息
    @Autowired
@ -126,6 +126,12 @@ public class SignDataFilter {
                errorCount++;
                continue;
            }
            if(orgCode.length()!=10) {
                errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据是测试数据");
                isAll=false;
                errorCount++;
                continue;
            }
            String orgCodeTemp="";
            if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
                //站
@ -300,8 +306,7 @@ public class SignDataFilter {
    }
    private String getExpenses(SignFamily signFamily) {
        String returnLevel2Key;
        returnLevel2Key= StringUtils.isEmpty(signFamily.getExpensesStatus())?"0":signFamily.getExpensesStatus();
        String returnLevel2Key= StringUtils.isEmpty(signFamily.getExpensesStatus())?"0":signFamily.getExpensesStatus();
        return returnLevel2Key;
    }

+ 7 - 6
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/extract/DBExtract.java

@ -40,8 +40,8 @@ public class DBExtract<T> {
     * @param isMultithreading 是否多线程抽取 默认否
     * @return
     */
    public List<T> extractByPage(Class<T> clazz,String sql,int pageSize,Boolean isMultithreading){
        return dbPageExtract.extractByPage(clazz,sql,pageSize,isMultithreading);
    public List<T> extractByPage(Class<T> clazz,String sql,String countSql,int pageSize,Boolean isMultithreading)throws  Exception{
        return dbPageExtract.extractByPage(clazz,sql,countSql,pageSize,isMultithreading);
    }
    /**
     * 分页抽取
@ -50,9 +50,9 @@ public class DBExtract<T> {
     * @param isMultithreading 是否多线程抽取 默认否
     * @return
     */
    public List<Object> extractByPage(Class<T> clazz,String sql,Boolean isMultithreading){
    public List<Object> extractByPage(Class<T> clazz,String sql,String countSql,Boolean isMultithreading)throws  Exception{
        int pageSize=10000;
        return dbPageExtract.extractByPage(clazz,sql,pageSize,isMultithreading);
        return dbPageExtract.extractByPage(clazz,sql,countSql,pageSize,isMultithreading);
    }
    /**
     * 分页抽取
@ -60,9 +60,10 @@ public class DBExtract<T> {
     * @param sql
     * @return
     */
    public List<Object> extractByPage(Class<T> clazz,String sql){
    public List<Object> extractByPage(Class<T> clazz,String sql)throws  Exception{
        int pageSize=10000;
        Boolean isMultithreading=false;
        return dbPageExtract.extractByPage(clazz,sql,pageSize,isMultithreading);
        String countSql="";
        return dbPageExtract.extractByPage(clazz,sql,countSql,pageSize,isMultithreading);
    }
}

+ 102 - 2
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/extract/DBPageExtract.java

@ -4,10 +4,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
/**
 * Created by Administrator on 2016.10.16.
@ -19,14 +26,26 @@ public class DBPageExtract<T> {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public List<T> extractByPage(Class<T> clazz, String sql, int pageSize, Boolean isMultithreading){
     private  List<T> returnList=new ArrayList<T>();
    public List<T> extractByPage(Class<T> clazz, String sql,String countSql, int pageSize, Boolean isMultithreading) throws Exception{
        if(isMultithreading){
            return noMultiThreadExtract(clazz, sql, pageSize);
            if(StringUtils.isEmpty(countSql)){
                throw new Exception("countSql is null");
            }
            return MultiThreadExtract(clazz, sql,countSql, pageSize);
        }else{
            return noMultiThreadExtract(clazz, sql, pageSize);
        }
    }
    /**
     * 不用多线程抽取
     * @param clazz
     * @param sql
     * @param pageSize
     * @return
     */
    private List<T> noMultiThreadExtract(Class<T> clazz, String sql, int pageSize) {
        List<T> returnList=new ArrayList<T>();
        int start=0;
@ -47,5 +66,86 @@ public class DBPageExtract<T> {
        }
        return returnList;
    }
    /**
     * 多线程抽取数据
     * @param clazz
     * @param sql
     * @param pageSize
     * @return
     */
    private List<T> MultiThreadExtract(Class<T> clazz, String sql,String countSql, int pageSize)  {
        try{
            //得到数据的总数
            Integer dataCount=getCount(countSql);
            //根据count 计算出 总共要执行几次
            Integer forCount=getForCount(dataCount,pageSize);
            //綫程返回值的值
            List<AsyncResult<Boolean>> asyncResultPool=new ArrayList<AsyncResult<Boolean>>();
            for(int page=0;page<forCount;page++){
                //启动多线程采集数据
                AsyncResult<Boolean> future= multiExtractData(sql,page*pageSize,pageSize,clazz);
                asyncResultPool.add(future);
            }
            ///循环判断,等待获取结果信息
            while (true){
                //得到迭代器
                Iterator<AsyncResult<Boolean>> asyncResultIterator=asyncResultPool.iterator();
                //判断有没有下一个
                while (asyncResultIterator.hasNext()){
                    AsyncResult<Boolean> asyncResult= asyncResultIterator.next();
                    if(asyncResult.isDone()){
                        //如果做完了就移除迭代器
                        asyncResultIterator.remove();
                    }else{
                        Thread.sleep(500L);
                    }
                }
                //如果一直移除到没有下一个就跳出循环
                if(!asyncResultIterator.hasNext()){
                    break;
                }
            }
            return returnList;
        }catch (Exception e){
            //如果多线程错误 就改用单线程
            return noMultiThreadExtract(clazz,sql,pageSize);
        }
    }
    private Integer getForCount(Integer dataCount, int pageSize) {
        //根据所有的数据取余数
        int yushu=dataCount%pageSize;
        int page=dataCount/pageSize;
        if(yushu==0){
            //如果没有余数 返回总的页数
            return page;
        }else{
            //如果有余数 页数多加1
            page++;
            return page;
        }
    }
    private Integer getCount(String countSql) {
        Integer countMap= jdbcTemplate.queryForObject(countSql,Integer.class);
        return countMap;
    }
    /**
     * 多线程采集数据
     * @param sql
     * @param start
     * @param pageSize
     * @param clazz
     * @return
     */
    @Async("dbExtractExecutor")
    private AsyncResult<Boolean> multiExtractData(String sql, int start, int pageSize, Class<T> clazz) {
        String finalSql=sql+" limit "+start+","+pageSize; //拼凑分页的语句
        List<T> listTemp= jdbcTemplate.query(finalSql,new BeanPropertyRowMapper(clazz));
        returnList.addAll(listTemp);
        return new AsyncResult<>(true);
    }
}

+ 2 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/storage/DBStorage.java

@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -772,6 +773,7 @@ public class DBStorage   {
        return wlyyQuotaResult;
    }
    @Async("dbStorageExecutor")
    @Transactional
    private void saveAll(List<WlyyQuotaResult> wlyyQuotaResults) throws  Exception{
        wlyyQuotaResultDao.save(wlyyQuotaResults);

+ 5 - 5
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/AllSignExpenseStatusJob.java

@ -16,10 +16,7 @@ import com.yihu.wlyy.statistics.model.system.Town;
import com.yihu.wlyy.statistics.model.team.AdminTeam;
import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
@ -40,6 +37,7 @@ import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Calendar;
/**
 * Created by Administrator on 2016.10.11.
@ -47,6 +45,7 @@ import java.util.*;
 */
@Component
@Scope("prototype")
@DisallowConcurrentExecution//防止到了执行时间点前一任务还在执行中,但是这时有空闲的线程,那么马上又会执行,这样一来就会存在同一job被并行执行
public class AllSignExpenseStatusJob implements Job{
    private WlyyQuotaVO wlyyQuota;//指标对象
    private WlyyJobConfigVO wlyyJobConfig;//配置对象
@ -99,8 +98,9 @@ public class AllSignExpenseStatusJob implements Job{
            String dateTemp = date + Constant.quota_date_last;
            String sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2 and  a.apply_date< '"+dateTemp+"' ";
            String sqlCount=" select count(id) from wlyy_sign_family a where  a.type =2 and  a.apply_date< '"+dateTemp+"'";
            //抽取數據
            List<SignFamily> signFamilies= dbExtract.extract(SignFamily.class,sql);
            List<SignFamily> signFamilies= dbExtract.extractByPage(SignFamily.class,sql,sqlCount,true);
            //清洗數據
            FilterModel etlModels= signDataFilter.filter(signFamilies, SignDataFilter.level2Expenses,sql,date);
            //统计数据

+ 2 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/AllSignJob.java

@ -85,8 +85,9 @@ public class AllSignJob implements Job {
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            String dateTemp = date + Constant.quota_date_last;
            String sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2  and expenses_status=1 and a.expenses_time< '"+dateTemp+"'" ;
            String sqlCount="select count(id) from wlyy_sign_family a where  a.type =2  and expenses_status=1 and a.expenses_time< '"+dateTemp+"'";
            //抽取數據 分页抽取
            List<SignFamily> signFamilies= dbExtract.extractByPage(SignFamily.class,sql);
            List<SignFamily> signFamilies= dbExtract.extractByPage(SignFamily.class,sql,sqlCount,true);
            //清洗數據
            FilterModel etlModels= signDataFilter.filter(signFamilies, SignDataFilter.level2Sex,sql,date);
            //统计数据

+ 0 - 15
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/SignJob.java

@ -253,19 +253,4 @@ public class SignJob implements Job {
        return dateString;
    }
    private String saveContent(List<SignFamily> signFamilys, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent,Long errorCount,String sql) {
        StringBuffer string=new StringBuffer("统计"+yesterday+" 的签约数据完成 ,数据库查询到签约数目:"+signFamilys.size());
        string.append(",sql语句:"+sql);
        string.append(",过滤的脏数据数目:"+errorCount);
        string.append(",统计到市的数据总数:"+cityCount);
        string.append(",统计到区的数据总数:"+townCount);
        string.append(",统计到机构的数据总数:"+orgCount);
        string.append(",统计到团队的数据总数:"+qkCount);
        string.append(",是否统计成功:"+isAll);
        if(!isAll){
            string.append(",失败原因:"+errorContent);
        }
        return string.toString();
    }
}

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/UnSignJob.java

@ -88,7 +88,7 @@ public class UnSignJob implements Job {
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            //找出今天的解约信息
            String sql=" select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and a.status in(-3,-4) and  a.apply_unsign_date>= '"+daybefore+ Constant.quota_date_last+"' and  a.apply_unsign_date< '"+yesterday+ Constant.quota_date_last+"' and a.expenses_status=1 ";
            String sql=" select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and a.status in(-3,-4) and  a.apply_unsign_date>= '"+daybefore+ Constant.quota_date_last+"' and  a.apply_unsign_date< '"+yesterday+ Constant.quota_date_last+"'";
            //抽取數據
            List<SignFamily> signFamilies= dbExtract.extract(SignFamily.class,sql);
            //清洗數據

+ 11 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/doctor/Doctor.java

@ -58,6 +58,7 @@ public class Doctor extends IdEntity {
	private String idcard;          //身份证号
	private Integer isFamous;       //是否是名医 1是  0或者空不是
	private String isPasswordPrompt;// 是否提示密码信息 1是 0或者空是否
	public Doctor() {}
@ -348,4 +349,14 @@ public class Doctor extends IdEntity {
    public boolean isHealthDoctor(){
        return level == 3;
    }
	@Column(name = "is_password_prompt")
	public String getIsPasswordPrompt() {
		return isPasswordPrompt;
	}
	public void setIsPasswordPrompt(String isPasswordPrompt) {
		this.isPasswordPrompt = isPasswordPrompt;
	}
}

+ 12 - 0
patient-co-wlyy/pom.xml

@ -255,6 +255,18 @@
        </dependency>
        <!-- JSON end -->
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>xom</groupId>
            <artifactId>xom</artifactId>
            <version>1.1</version>
        </dependency>
        <!-- LOGGING begin -->
        <dependency>
            <groupId>org.slf4j</groupId>

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java

@ -60,6 +60,7 @@ public class Doctor extends IdEntity {
	private String idcard;          //身份证号
	private Integer isFamous;       //是否是名医 1是  0或者空不是
	private String isPasswordPrompt;// 是否提示密码信息 1是 0或者空是否
	public Doctor() {}
@ -350,4 +351,13 @@ public class Doctor extends IdEntity {
    public boolean isHealthDoctor(){
        return level == 3;
    }
	@Column(name = "is_password_prompt")
	public String getIsPasswordPrompt() {
		return isPasswordPrompt;
	}
	public void setIsPasswordPrompt(String isPasswordPrompt) {
		this.isPasswordPrompt = isPasswordPrompt;
	}
}

+ 53 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientFamilyMember.java

@ -0,0 +1,53 @@
package com.yihu.wlyy.entity.patient;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 家庭成员表
 *
 * Created by lyr on 2016/10/17.
 */
@Entity
@Table(name = "wlyy_patient_family_member")
public class PatientFamilyMember extends IdEntity {
    // 居民cdoe
    private String patient;
    // 家庭成员
    private String familyMember;
    // 家庭关系
    private Integer familyRelation;
    // 操作日期
    private Date czrq;
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getFamilyMember() {
        return familyMember;
    }
    public void setFamilyMember(String familyMember) {
        this.familyMember = familyMember;
    }
    public Integer getFamilyRelation() {
        return familyRelation;
    }
    public void setFamilyRelation(Integer familyRelation) {
        this.familyRelation = familyRelation;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
}

+ 34 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientFamilyMemberDao.java

@ -0,0 +1,34 @@
package com.yihu.wlyy.repository.patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 家庭成员
 *
 * Created by lyr on 2016/10/17.
 */
public interface PatientFamilyMemberDao extends PagingAndSortingRepository<PatientFamilyMember, Long>,
        JpaSpecificationExecutor<PatientFamilyMember> {
    /**
     * 查询居民的某个成员
     *
     * @param patient 居民
     * @param member 成员
     * @return
     */
    PatientFamilyMember findByPatientAndFamilyMember(String patient,String member);
    /**
     * 查找某个居民的家庭成员
     *
     * @param patient 居民
     * @return
     */
    List<PatientFamilyMember> findByPatient(String patient);
}

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -302,4 +302,7 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	@Query("select a from SignFamily a where a.type = ?1 and a.signSource = ?2 and a.status > 0 and a.id >= ?3 and a.id <= ?4 order by a.id")
	Page<SignFamily> findByTypeAndSignSourceAndId(Integer type,String signSource,Long start,Long end,Pageable pageable);
	@Query("select a from SignFamily a where a.patient = ?1 and a.status > 0")
	List<SignFamily> findAllSignByPatient(String patient);
}

+ 31 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -720,11 +720,17 @@ public class DoctorInfoService extends BaseService {
            return -1;
        }
        Doctor docMobile = doctorDao.findByMobile(mobile);
        if (docMobile != null) {
            return -2;
        }
        // 验证码验证
        int smsCheck = smsService.check(mobile, type == 1 ? 7 : 8, captcha);
        int smsCheck = smsService.check(mobile, type == 1 ? 8 : 9, captcha);
        // 验证失败,不允许变更
        if (smsCheck != 1) {
            return -2;
            return -3;
        }
        doc.setMobile(mobile);
@ -747,4 +753,27 @@ public class DoctorInfoService extends BaseService {
        String newPassword1Temp= MD5.GetMD5Code(newPassword1+doctor.getSalt());
        doctor.setPassword(newPassword1Temp);
    }
    /**
     * 查询患者是否与医生签约
     *
     * @param patient
     * @param doctor
     * @return
     */
    public boolean isPatientSigned(String patient, String doctor) {
        boolean bo = false;
        //签约团队
        DoctorTeam dt = doctorTeamDao.findByPatientCode(patient);
        DoctorTeam dtSS = doctorTeamDao.findSsTeamByPatientCode(patient);
        //医生是否属于团队成员
        if (dt != null && doctorTeamDoctor.countMemberByTeamAndCode(dt.getCode(), doctor) > 0) {
            bo = true;
        }
        if (dtSS != null && doctorTeamDoctor.countMemberByTeamAndCode(dtSS.getCode(), doctor) > 0) {
            bo = true;
        }
        return bo;
    }
}

+ 9 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -76,11 +76,17 @@ public class PatientInfoService extends BaseService {
			return -1;
		}
		Patient pMobile = patientDao.findByMobile(mobile);
		if (pMobile == null) {
			return -2;
		}
		// 验证码验证
		int smsCheck = smsService.check(mobile, type == 1 ? 7 : 8, captcha);
		int smsCheck = smsService.check(mobile, type == 1 ? 8 : 9, captcha);
		// 验证失败,不允许变更
		if (smsCheck != 1) {
			return -2;
			return -3;
		}
		p.setMobile(mobile);
@ -187,7 +193,7 @@ public class PatientInfoService extends BaseService {
		if(!newPassword1.equals(newPassword2)){
			throw new Exception("新密码不一致");
		}
		if(!newPassword1.equals(oldPassword)){
		if(newPassword1.equals(oldPassword)){
			throw new Exception("新旧密码一致");
		}
		Patient patient=patientDao.findByCode(patientCode);

+ 302 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -0,0 +1,302 @@
package com.yihu.wlyy.service.app.family;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.util.MD5;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 家庭成员服务
 * <p>
 * Created by lyr on 2016/10/17.
 */
@Service
public class FamilyMemberService extends BaseService {
    @Autowired
    PatientFamilyMemberDao memberDao;
    @Autowired
    PatientDao patientDao;
    @Autowired
    SMSService smsService;
    @Autowired
    FamilyContractService contractService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    /**
     * 添加家庭成员
     *
     * @param patient 患者
     * @param member  成员
     * @param captcha 验证码
     * @param member  成员
     * @return
     */
    public int addMember(String patient, String member, String captcha, String password, int relation) {
        Patient p = patientDao.findByCode(patient);
        Patient m = patientDao.findByCode(member);
        if (p == null) {
            return -1;
        }
        // 添加的成员是否注册判断
        if (m == null) {
            return -2;
        }
        // 验证码验证
        if (StringUtils.isNotEmpty(captcha) && smsService.check(m.getMobile(), 10, captcha) != 1) {
            return -3;
        }
        if (StringUtils.isNotEmpty(password)) {
            String loginPassword = MD5.GetMD5Code(password + m.getSalt());
            if (!loginPassword.equals(m.getPassword())) {
                return -3;
            }
        }
        // 添加自己与对方的关系
        PatientFamilyMember fm = memberDao.findByPatientAndFamilyMember(patient, member);
        // 家庭关系已存在时,不重复添加
        if (fm != null) {
            return -4;
        } else {
            fm = new PatientFamilyMember();
            fm.setPatient(patient);
            fm.setFamilyMember(member);
        }
        fm.setFamilyRelation(relation);
        fm.setCzrq(new Date());
        // 添加对方与自己的关系
        PatientFamilyMember fmt = memberDao.findByPatientAndFamilyMember(member, patient);
        // 不存在则创建
        if (fmt == null) {
            fmt = new PatientFamilyMember();
            fmt.setPatient(member);
            fmt.setFamilyMember(patient);
        }
        // 对方与自己的关系转换
        int relationTrans = familyRelationTrans(p, relation);
        fmt.setFamilyRelation(relationTrans);
        fmt.setCzrq(new Date());
        memberDao.save(fm);
        memberDao.save(fmt);
        return 1;
    }
    /**
     * 修改家庭成员关系
     *
     * @param patient  居民
     * @param member   成员
     * @param relation 关系
     * @return
     */
    public int modifyFamilyRelation(String patient, String member, int relation) {
        Patient p = patientDao.findByCode(patient);
        Patient m = patientDao.findByCode(member);
        if (p == null) {
            return -1;
        }
        // 成员是否注册判断
        if (m == null) {
            return -2;
        }
        // 自己与对方的关系
        PatientFamilyMember fm = memberDao.findByPatientAndFamilyMember(patient, member);
        if (fm == null) {
            return -3;
        }
        fm.setFamilyRelation(relation);
        fm.setCzrq(new Date());
        // 对方与自己的关系
        PatientFamilyMember fmt = memberDao.findByPatientAndFamilyMember(member, patient);
        // 不存在则创建
        if (fmt == null) {
            fmt = new PatientFamilyMember();
            fmt.setPatient(patient);
            fmt.setFamilyMember(member);
        }
        int relationTrans = familyRelationTrans(p, relation);
        fmt.setFamilyRelation(relationTrans);
        fmt.setCzrq(new Date());
        memberDao.save(fm);
        memberDao.save(fmt);
        return 1;
    }
    /**
     * 删除家庭成员
     *
     * @param patient 居民
     * @param member  成员
     * @return
     */
    public int deleteMember(String patient, String member) {
        // 自己与对方的关系
        PatientFamilyMember fm = memberDao.findByPatientAndFamilyMember(patient, member);
        if (fm == null) {
            return -1;
        }
        // 对方与自己的关系
        PatientFamilyMember fmt = memberDao.findByPatientAndFamilyMember(member, patient);
        memberDao.delete(fm);
        if (fmt != null) {
            memberDao.delete(fmt);
        }
        return 1;
    }
    /**
     * 判断成员是否注册
     *
     * @param idcard 身份证号
     * @return
     */
    public JSONObject isRegister(String idcard) {
        JSONObject result = new JSONObject();
        Patient p = patientDao.findByIdcard(idcard);
        if (p == null) {
            result.put("isRegister", 0);
        } else {
            result.put("isRegister", 1);
            result.put("mobile", p.getMobile());
            result.put("name", p.getName());
            result.put("code", p.getCode());
        }
        return result;
    }
    /**
     * 获取居民的家庭成员
     *
     * @param patient 居民
     * @return
     */
    public JSONArray getPatientFamilyMembers(String patient) {
        JSONArray resultArray = new JSONArray();
        String sql = "select * " +
                " from " +
                "    wlyy_patient_family_member t1, " +
                "    wlyy_patient t2 " +
                " where " +
                "    t2.code in (select family_member from wlyy_patient_family_member where patient = ? ) " +
                "    and t1.patient = ? " +
                "    and t1.family_member = t2.code ";
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{patient, patient});
        if (result != null && result.size() > 0) {
            for (Map<String, Object> map : result) {
                JSONObject obj = new JSONObject();
                List<SignFamily> signs = contractService.findAllSignByPatient(map.get("code").toString());
                boolean ssSign = false;
                boolean jtSign = false;
                for (SignFamily sign : signs) {
                    if (sign.getType() == 1) {
                        ssSign = true;
                    } else {
                        jtSign = false;
                    }
                }
                obj.put("code", map.get("code"));
                obj.put("name", map.get("name"));
                obj.put("sex", map.get("sex"));
                obj.put("birthday", map.get("birthday"));
                obj.put("idcard", map.get("idcard"));
                obj.put("photo", map.get("photo"));
                obj.put("mobile", map.get("mobile"));
                obj.put("address", map.get("address"));
                obj.put("familyRelation", map.get("family_relation"));
                if (ssSign && jtSign) {
                    obj.put("signType", 3);
                } else if (!ssSign && jtSign) {
                    obj.put("signType", 2);
                } else if (ssSign && !jtSign) {
                    obj.put("signType", 1);
                } else {
                    obj.put("signType", 0);
                }
                resultArray.put(obj);
            }
        }
        return resultArray;
    }
    /**
     * 家庭关系转换
     *
     * @param patient  居民
     * @param relation 关系 1父亲 2母亲 3老公 4老婆 5儿子 6女儿 7其他
     * @return
     */
    public int familyRelationTrans(Patient patient, int relation) {
        int relationTrans = 0;
        switch (relation) {
            case 1:
            case 2:
                if (patient.getSex() == 1) {
                    relationTrans = 5;
                } else if (patient.getSex() == 2) {
                    relationTrans = 6;
                } else {
                    relationTrans = 0;
                }
                break;
            case 3:
                relationTrans = 4;
                break;
            case 4:
                relationTrans = 3;
                break;
            case 5:
            case 6:
                if (patient.getSex() == 1) {
                    relationTrans = 1;
                } else if (patient.getSex() == 1) {
                    relationTrans = 2;
                } else {
                    relationTrans = 0;
                }
                break;
        }
        return relationTrans;
    }
}

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -187,6 +187,8 @@ public class SignPatientLabelInfoService extends BaseService {
                json.put("signType", sign.get("type") == null ? "" : sign.get("type"));
                // 身份证号
                json.put("idcard", p.getIdcard());
                // 社保号
                json.put("ssc", p.getSsc());
                // 患者标签
                //json.put("labels", labels == null ? "" : labels);
@ -280,6 +282,8 @@ public class SignPatientLabelInfoService extends BaseService {
                json.put("signType", sign.get("type") == null ? "" : sign.get("type"));
                // 身份证号
                json.put("idcard", p.getIdcard());
                // 社保号
                json.put("ssc", p.getSsc());
                // 患者标签
                json.put("labels", labels == null ? "" : labels);
@ -719,6 +723,8 @@ public class SignPatientLabelInfoService extends BaseService {
                json.put("signType", sign.get("type") == null ? "" : sign.get("type"));
                // 身份证号
                json.put("idcard", p.getIdcard());
                // 社保号
                json.put("ssc", p.getSsc());
                // 患者标签
                json.put("labels", labels == null ? "" : labels);

File diff suppressed because it is too large
+ 212 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/InspectionService.java


+ 10 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1426,7 +1426,6 @@ public class FamilyContractService extends BaseService {
        return true;
    }
    public String produceSignAdminTeamCode() {
        StringBuffer sf = new StringBuffer();
        StringBuffer sf1 = new StringBuffer();
@ -1534,4 +1533,14 @@ public class FamilyContractService extends BaseService {
        return signFamilyDao.findNoHealthSignFamilyHealth(doctor, pageRequest);
    }
    /**
     * 查询居民的所有签约
     *
     * @param patient
     * @return
     */
    public List<SignFamily> findAllSignByPatient(String patient) {
        return signFamilyDao.findAllSignByPatient(patient);
    }
}

+ 20 - 8
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/SMSService.java

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.patient.PatientDao;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;
@ -28,16 +30,19 @@ public class SMSService extends BaseService {
    @Autowired
    public SMSDao smsDao;
    @Autowired
    PatientDao patientDao;
    /**
     * 发送短信验证码接口
     *
     * @param mobile 手机号
     * @param type   消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录,6用户变更手机号验证 7用户新手机号验证 8绑定手机号
     * @param type   消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录,7用户变更手机号验证 8用户新手机号验证 9绑定手机号
     *               10 家庭成员添加验证
     * @return
     * @throws Exception
     */
    public String send(String mobile, String ip, int type) throws Exception {
    public String send(String mobile, String ip, int type, String code) throws Exception {
        // 生成6位随机验证码
        String captcha = String.valueOf(Math.random()).substring(2, 8);
        // 默认为123456
@ -79,19 +84,26 @@ public class SMSService extends BaseService {
            sms.setContent("您的注册验证码为:" + captcha);
        } else if (type == 2 || type == 3) {
            // 找回密码
            sms.setContent("您的找回密码验证码为:" + captcha);
            sms.setContent("【厦门市民健康系统】您的找回密码验证码为:" + captcha);
        } else if (type == 4 || type == 5) {
            // 登录
            sms.setContent("您的登录验证码为:" + captcha);
        } else if (type == 6) {
        } else if (type == 7) {
            // 手机号变更验证
            sms.setContent("【厦门市民健康系统】您的更换手机号验证码为:" + captcha);
        } else if (type == 7) {
        } else if (type == 8) {
            // 新手机号绑定验证
            sms.setContent("【厦门市民健康系统】您的新手机号验证码为:" + captcha);
        } else if (type == 8) {
        } else if (type == 9) {
            // 新手机号绑定验证
            sms.setContent("【厦门市民健康系统】您绑定手机号的验证码为:" + captcha);
        } else if (type == 10) {
            Patient patient = patientDao.findByCode(code);
            if (patient == null) {
                throw new Exception("短信发送失败!");
            }
            // 新手机号绑定验证
            sms.setContent("【厦门市民健康系统】" + patient.getName() + "欲添加您为家人,验证码为:" + captcha + "。如其非您的家人,请忽略本短信。");
        } else {
            // 其他验证码
            sms.setContent("验证码:" + captcha);
@ -99,7 +111,7 @@ public class SMSService extends BaseService {
        sms.setCaptcha(captcha);
        Date date = new Date();
        // 延后5分钟
        sms.setDeadline(DateUtil.getNextMin(date, 5));
        sms.setDeadline(DateUtil.getNextMin(date, type == 10 ? 30 : 5));
        sms.setCzrq(date);
        sms.setMobile(mobile);
        sms.setIp(ip);
@ -124,7 +136,7 @@ public class SMSService extends BaseService {
     * 验证码校验
     *
     * @param mobile  手机号
     * @param type    type 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录 6用户变更手机号 7用户新手机号验证 8用户绑定手机号
     * @param type    type 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录 7用户变更手机号 8用户新手机号验证 9用户绑定手机号
     * @param captcha 验证码
     * @return -1验证码过期,-1验证码错误,0验证码无效,1验证通过
     */

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/DoctorService.java

@ -72,7 +72,8 @@ public class DoctorService extends TokenService {
	 * 修改医生密码
	 */
	public void updateDoctorPwd(Doctor doctor) {
		EncodesUtil.entryptPassword(doctor);
		//EncodesUtil.entryptPassword(doctor);
		doctor.setIsPasswordPrompt("1");
		doctorDao.save(doctor);
	}

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/RSAUtils.java

@ -261,7 +261,7 @@ public class RSAUtils {
		try {
			byte[] en_data = Hex.decodeHex(encrypttext.toCharArray());
			byte[] data = decrypt((RSAPrivateKey) getKeyPair().getPrivate(), en_data);
			return new String(data);
			return new StringBuffer(new String(data)).reverse().toString() ;
		} catch (NullPointerException ex) {
			LOGGER.error("keyPair cannot be null.");
		} catch (Exception ex) {

File diff suppressed because it is too large
+ 652 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/XMLUtil.java


+ 38 - 29
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -143,8 +143,9 @@ public class LoginController extends BaseController {
                return error(-1, "获取手机IMEI码失败!");
            }
            //身份证登录
            if(StringUtils.isNoneEmpty(idcard)&&StringUtils.isNoneEmpty(password)){
                Doctor doctor=doctorService.findbyIdCard(idcard);
            if(StringUtils.isNoneEmpty(mobile)&&StringUtils.isNoneEmpty(password)){
                password = RSAUtils.getInstance(doctorService).decryptString(password);
                Doctor doctor=doctorService.findDoctorByMobile(mobile);
                if(doctor==null){
                    return error(-1, "该身份证未注册!");
                }
@ -235,8 +236,9 @@ public class LoginController extends BaseController {
                return error(-1, "获取手机IMEI码失败!");
            }
            //身份证登录
            if(StringUtils.isNoneEmpty(idcard)&&StringUtils.isNoneEmpty(password)){
                Patient patient= patientService.findByIdcard(idcard);
            if(StringUtils.isNoneEmpty(mobile)&&StringUtils.isNoneEmpty(password)){
                password = RSAUtils.getInstance(doctorService).decryptString(password);
                Patient patient= patientService.findByMobile(mobile);
                if(patient==null){
                    return error(-1, "该身份证未注册!");
                }
@ -266,7 +268,6 @@ public class LoginController extends BaseController {
                    case 0:
                        return error(-1, "验证码无效!");
                }
                // password = RSAUtils.getInstance(doctorService).decryptString(password);
                // password = URLDecoder.decode(password, "UTF-8");
                // password = StringUtils.reverse(password);
                // idcard = RSAUtils.getInstance(doctorService).decryptString(idcard);
@ -310,38 +311,46 @@ public class LoginController extends BaseController {
     */
    @RequestMapping(value = "forgetpwd")
    @ResponseBody
    public String forgetpwd(int type, @RequestParam(required = false) String idcard, String mobile, String captchaToken, String captcha, String newpwd) {
    public String forgetpwd(int type,
                            @RequestParam(required = false) String idcard,
                            String mobile,
                            @RequestParam(required = false) String captchaToken,
                            @RequestParam(required = false)String captcha,
                            String newpwd) {
        try {
            String ct = request.getSession().getAttribute("captchaToken").toString();
            if (StringUtils.isEmpty(captchaToken)) {
                return error(-1, "图形验证码不允许为空!");
            }
            if (!StringUtils.equalsIgnoreCase(captchaToken, ct)) {
                return error(-1, "图形验证码错误!");
            }
            idcard = RSAUtils.getInstance(doctorService).decryptString(idcard);
            idcard = URLDecoder.decode(idcard, "UTF-8");
            idcard = StringUtils.reverse(idcard);
            newpwd = RSAUtils.getInstance(doctorService).decryptString(newpwd);
            newpwd = URLDecoder.decode(newpwd, "UTF-8");
            newpwd = StringUtils.reverse(newpwd);
            //String ct = request.getSession().getAttribute("captchaToken").toString();
//            if (StringUtils.isEmpty(captchaToken)) {
//                return error(-1, "图形验证码不允许为空!");
//            }
//            if (!StringUtils.equalsIgnoreCase(captchaToken, ct)) {
//                return error(-1, "图形验证码错误!");
//            }
//            idcard = RSAUtils.getInstance(doctorService).decryptString(idcard);
//            idcard = URLDecoder.decode(idcard, "UTF-8");
//            idcard = StringUtils.reverse(idcard);
//            newpwd = RSAUtils.getInstance(doctorService).decryptString(newpwd);
//            newpwd = URLDecoder.decode(newpwd, "UTF-8");
//            newpwd = StringUtils.reverse(newpwd);
            // 对验证码进行校验
            int res = smsService.check(mobile, type, captcha);
            switch (res) {
                case -2:
                    return error(-1, "验证码已过期!");
                case -1:
                    return error(-1, "验证码错误!");
                case 0:
                    return error(-1, "验证码无效!");
            }
//            int res = smsService.check(mobile, type, captcha);
//            switch (res) {
//                case -2:
//                    return error(-1, "验证码已过期!");
//                case -1:
//                    return error(-1, "验证码错误!");
//                case 0:
//                    return error(-1, "验证码无效!");
//            }
            if (type == 2) {
                // 医生端
                Doctor doctor = doctorService.findDoctorByMobile(mobile);
                if (doctor == null) {
                    return error(-1, "操作失败:此用户未注册");
                } else {
                    doctor.setPassword(newpwd);
                    String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
                    password=MD5.GetMD5Code(password+doctor.getSalt());
                    doctor.setPassword(password);
                    doctorService.updateDoctorPwd(doctor);
                    return success("操作成功!");
                }

+ 4 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/sms/SMSController.java

@ -32,14 +32,15 @@ public class SMSController extends BaseController {
	/**
	 * 发送短信验证码接口
	 * @param mobile 手机号
	 * @param type 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录 .6患者签约验证
	 * @param type 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录 .6患者签约验证 7用户变更手机号验证 8用户新手机号验证 9绑定手机号
	 *             10 家庭成员添加验证
	 * @return
	 */
	@RequestMapping(value = "captcha", method = RequestMethod.POST)
	@ResponseBody
	public String send(String mobile, int type, @RequestParam(required = false) String captchaToken) {
		try {
			if (type != 1 && type != 2 && type != 3 && type != 4 && type != 5&& type != 6) {
			if (type > 10 || type < 1) {
				return error(-1, "无效的请求!");
			}
			if (StringUtils.isEmpty(mobile)) {
@ -69,7 +70,7 @@ public class SMSController extends BaseController {
			if (StringUtils.isEmpty(ip)) {
				return error(-1, "无效的ip请求!");
			}
			String res = smsService.send(mobile, ip, type);
			String res = smsService.send(mobile, ip, type, getUID());
			if (StringUtils.equals(res, "ok")) {
				return write(200, "验证码短信已发送!");
			} else {

+ 40 - 11
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -492,6 +492,8 @@ public class DoctorController extends BaseController {
                json.put("isCertified", temp.getIscertified());
                //是否名医
                json.put("isFamous", temp.getIsFamous());
                //是否医生提示 提示过是1 其他都是0
                json.put("isPasswordPrompt", StringUtils.isEmpty(temp.getIsPasswordPrompt()) ? "0" : temp.getIsPasswordPrompt());
                return write(200, "医生信息查询成功!", "data", json);
            } else {
@ -1459,7 +1461,7 @@ public class DoctorController extends BaseController {
     *
     * @param mobile  新手机号
     * @param captcha 验证码
     * @param type 1:变更手机号  2:绑定手机号
     * @param type    1:变更手机号  2:绑定手机号
     * @return
     */
    @RequestMapping(value = "/mobile_update", method = RequestMethod.POST)
@ -1472,7 +1474,7 @@ public class DoctorController extends BaseController {
            if (StringUtils.isEmpty(captcha)) {
                return error(-1, "请输入验证码");
            }
            if (type != 1 || type != 2) {
            if (type != 1 && type != 2) {
                return error(-1, "操作类型参数错误");
            }
@ -1480,8 +1482,9 @@ public class DoctorController extends BaseController {
            if (result == -1) {
                return error(-1, "医生信息查找失败");
            }
            if (result == -2) {
            } else if (result == -2) {
                return error(-1, "手机已注册");
            } else if (result == -3) {
                return error(-1, "验证码错误");
            } else if (result == 1) {
                return write(200, "手机号更新成功");
@ -1496,20 +1499,24 @@ public class DoctorController extends BaseController {
    /**
     * 修改密码
     *
     * @param newPassword1 新密码1
     * @param newPassword2 新密码2
     * @param oldPassword 旧密码
     * @param doctorCode 医生code
     * @param oldPassword  旧密码
     * @param doctorCode   医生code
     * @return
     */
    @RequestMapping(value = "/updatePassword", method = RequestMethod.POST )
    @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
    @ResponseBody
    public String updatePassword(String newPassword1,
                                           String newPassword2,
                                           String oldPassword,
                                           String doctorCode) {
                                 String newPassword2,
                                 String oldPassword,
                                 String doctorCode) {
        try {
            doctorInfoService.updatePassword(newPassword1, newPassword2, oldPassword,doctorCode);
            newPassword1=RSAUtils.getInstance(doctorInfoService).decryptString(newPassword1);
            newPassword2=RSAUtils.getInstance(doctorInfoService).decryptString(newPassword2);
            oldPassword=RSAUtils.getInstance(doctorInfoService).decryptString(oldPassword);
            doctorInfoService.updatePassword(newPassword1, newPassword2, oldPassword, doctorCode);
            return write(200, "更新成功");
        } catch (Exception e) {
            e.printStackTrace();
@ -1517,4 +1524,26 @@ public class DoctorController extends BaseController {
        }
    }
    /**
     * 当前医生是否与居民签约
     *
     * @param patient
     * @return
     */
    @RequestMapping(value = "/is_patient_signed")
    @ResponseBody
    public String isPatientSign(String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "居民不能为空");
            }
            boolean isSigned = doctorInfoService.isPatientSigned(patient, getUID());
            return write(200, "查询成功", "data", isSigned ? "1" : "0");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

+ 8 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthRecordController.java

@ -60,9 +60,10 @@ public class DoctorHealthRecordController extends BaseController {
	 */
	@RequestMapping(value = "list_sports")
	@ResponseBody
	public String sports(String patient, String sortDate, int pagesize) {
	public String sports(String patient, String start,String end,int page, int pagesize) {
		try {
			Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatient(patient, DateUtil.strToDateLong(sortDate), pagesize);
			//Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatient(patient, DateUtil.strToDateLong(sortDate), pagesize);
			Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatientPage(patient, start,end,page, pagesize);
			if (data != null) {
				JSONArray array = new JSONArray();
				for (PatientHealthRecordSports record : data) {
@ -102,9 +103,10 @@ public class DoctorHealthRecordController extends BaseController {
	 */
	@RequestMapping(value = "list_medication")
	@ResponseBody
	public String medication(String patient, String sortDate, int pagesize) {
	public String medication(String patient, String start,String end,int page, int pagesize) {
		try {
			Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicationByPatient(patient, DateUtil.strToDateLong(sortDate), pagesize);
			//Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicationByPatient(patient, DateUtil.strToDateLong(sortDate), pagesize);
			Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(patient, start,end, page, pagesize);
			if (data != null) {
				JSONArray array = new JSONArray();
				for (PatientHealthRecordMedication record : data) {
@ -141,9 +143,9 @@ public class DoctorHealthRecordController extends BaseController {
	 */
	@RequestMapping(value = "list_diet")
	@ResponseBody
	public String diet(String patient, String sortDate, int pagesize) {
	public String diet(String patient, String start,String end,int page, int pagesize) {
		try {
			Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatient(patient, DateUtil.strToDateLong(sortDate), pagesize);
			Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatientPage(patient, start,end, page, pagesize);
			if (data != null) {
				JSONArray array = new JSONArray();
				for (PatientHealthRecordDiet record : data) {

+ 31 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/InspectionController.java

@ -1,13 +1,18 @@
package com.yihu.wlyy.web.doctor.record;
import com.yihu.wlyy.service.app.record.InspectionService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
@ -21,16 +26,26 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Api(description = "医生端- 居民检查/检验记录")
public class InspectionController extends BaseController {
    @Autowired
    private InspectionService inspectionService;
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取检查/检验列表", produces = "application/json", notes = "获取检查/检验列表")
    public String inspectionList() {
    public String inspectionList(
            @ApiParam(name = "strSSID", value = "健康卡号")
            @RequestParam(value = "strSSID") String strSSID,
            @ApiParam(name = "startDate", value = "查询的开始日期")
            @RequestParam(value = "startDate") String startDate,
            @ApiParam(name = "endDate", value = "查询的结束日期")
            @RequestParam(value = "endDate") String endDate,
            @ApiParam(name = "startNum", value = "需要获取的起始行数")
            @RequestParam(value = "startNum") String startNum,
            @ApiParam(name = "endNum", value = "需要获取的结束的行数")
            @RequestParam(value = "endNum") String endNum) {
        try {
            JSONArray array = new JSONArray();
            //TODO 检查/检验报告接口
            JSONArray array = inspectionService.getInspectionAndChecking(strSSID,startDate,endDate,startNum,endNum);
            return write(200, "获取检查/检验记录成功!", "data", array);
        } catch (Exception e) {
            error(e);
@ -41,10 +56,20 @@ public class InspectionController extends BaseController {
    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取检查/检验详情", produces = "application/json", notes = "获取检查/检验详情")
    public String inspectionDetail() {
    public String inspectionDetail(
            @ApiParam(name = "strSSID", value = "健康卡号")
            @RequestParam(value = "strSSID") String strSSID,
            @ApiParam(name = "strEvent", value = "事件ID")
            @RequestParam(value = "strEvent") String strEvent,
            @ApiParam(name = "strCatalog", value = "档案类型")
            @RequestParam(value = "strCatalog") String strCatalog,
            @ApiParam(name = "strSerial", value = "该类别顺序号,默认填1")
            @RequestParam(value = "strSerial") String strSerial
    ) {
        try {
            JSONArray array = new JSONArray();
            JSONObject array = new JSONObject();
            //TODO 调用检查/检验报告接口
            array = inspectionService.getHealthData(strSSID,strEvent,strCatalog,strSerial);
            return write(200, "获取检查/检验详情成功!", "data", array);
        } catch (Exception e) {
            error(e);

+ 8 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -8,10 +8,7 @@ import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.service.app.team.DrHealthTeamService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.EncodesUtil;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
@ -659,7 +656,7 @@ public class PatientController extends WeixinBaseController {
            if (StringUtils.isEmpty(captcha)) {
                return error(-1, "请输入验证码");
            }
            if (type != 1 || type != 2) {
            if (type != 1 && type != 2) {
                return error(-1, "操作类型参数错误");
            }
@ -667,8 +664,9 @@ public class PatientController extends WeixinBaseController {
            if (result == -1) {
                return error(-1, "居民信息查找失败");
            }
            if (result == -2) {
            } else if(result == -2) {
                return error(-1, "手机号已注册");
            } else if (result == -3) {
                return error(-1, "验证码错误");
            } else if (result == 1) {
                return write(200, "手机号更新成功");
@ -696,6 +694,9 @@ public class PatientController extends WeixinBaseController {
                                 String oldPassword,
                                 String patientCode) {
        try {
            newPassword1= RSAUtils.getInstance(doctorService).decryptString(newPassword1);
            newPassword2=RSAUtils.getInstance(doctorService).decryptString(newPassword2);
            oldPassword=RSAUtils.getInstance(doctorService).decryptString(oldPassword);
            patientInfoService.updatePassword(newPassword1, newPassword2, oldPassword,patientCode);
            return write(200, "更新成功");
        } catch (Exception e) {

+ 176 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -0,0 +1,176 @@
package com.yihu.wlyy.web.patient.family;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonAnyFormatVisitor;
import com.yihu.wlyy.service.app.family.FamilyMemberService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * 家庭关系成员控制器
 * <p>
 * Created by lyr-pc on 2016/10/18.
 */
@RestController
@RequestMapping(value = "/patient/family")
@Api(description = "家庭成员")
public class FamilyMemberController extends BaseController {
    @Autowired
    FamilyMemberService familyMemberService;
    /**
     * 添加成员
     *
     * @param member   成员code
     * @param captcha  验证码
     * @param relation 关系
     * @return
     */
    @RequestMapping(value = "/member_add",method = RequestMethod.POST)
    @ApiOperation(value = "添加成员")
    public String addFamilyMember(@RequestParam("member")String member,
                                  @RequestParam(value = "captcha",required = false) String captcha,
                                  @RequestParam(value = "password",required = false) String password,
                                  @RequestParam("relation")int relation) {
        try {
            if (StringUtils.isEmpty(member)) {
                return error(-1, "添加成员不能为空");
            }
            if (StringUtils.isEmpty(captcha) && StringUtils.isEmpty(password)) {
                return error(-1, "验证码或密码不能为空");
            }
            if (relation < 0 || relation > 6) {
                return error(-1, "家庭关系无效");
            }
            int result = familyMemberService.addMember(getUID(), member, captcha, password, relation);
            if (result == -1) {
                return error(-1, "居民信息查询失败");
            } else if (result == -2) {
                return error(-1, "该成员未注册");
            } else if (result == -3) {
                return error(-1, StringUtils.isNotEmpty(captcha) ? "验证码错误" : "密码错误");
            } else if (result == -4) {
                return error(-1, "该家庭成员已存在");
            } else {
                return write(200, "添加成功");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "添加失败");
        }
    }
    /**
     * 更新家庭关系
     *
     * @param member   成员code
     * @param relation 家庭关系
     * @return
     */
    @RequestMapping(value = "/relation_update",method = RequestMethod.POST)
    @ApiOperation(value = "家庭成员关系修改")
    public String modifyFamilyRelation(@RequestParam("member")String member, @RequestParam("relation")int relation) {
        try {
            if (StringUtils.isEmpty(member)) {
                return error(-1, "添加成员不能为空");
            }
            if (relation < 0 || relation > 6) {
                return error(-1, "家庭关系无效");
            }
            int result = familyMemberService.modifyFamilyRelation(getUID(), member, relation);
            if (result == -1) {
                return error(-1, "居民信息查询失败");
            } else if (result == -2) {
                return error(-1, "该成员未注册");
            } else if (result == -3) {
                return error(-1, "与该成员的关系不存在");
            } else {
                return write(200, "更新成功");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "更新失败");
        }
    }
    /**
     * 删除成员
     *
     * @param member
     * @return
     */
    @RequestMapping(value = "/member_delete",method = RequestMethod.POST)
    @ApiOperation(value = "家庭成员删除")
    public String deleteMember(@RequestParam("member")String member) {
        try {
            if (StringUtils.isEmpty(member)) {
                return error(-1, "成员不能为空");
            }
            int result = familyMemberService.deleteMember(getUID(), member);
            if (result == -1) {
                return error(-1, "与该成员的关系不存在");
            } else {
                return write(200, "删除成功");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "删除失败");
        }
    }
    /**
     * 家庭成员查询
     *
     * @return
     */
    @RequestMapping(value = "/members", method = RequestMethod.GET)
    @ApiOperation(value = "家庭成员查询")
    public String getPatientFamilyMembers() {
        try {
            JSONArray result = familyMemberService.getPatientFamilyMembers(getUID());
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 根据身份证号查询居民是否注册
     *
     * @param idcard 身份证号
     * @return
     */
    @RequestMapping(value = "/is_register", method = RequestMethod.GET)
    @ApiOperation(value = "家庭成员查询")
    public String isRegister(@RequestParam("idcard")String idcard) {
        try {
            if (StringUtils.isEmpty(idcard)) {
                return error(-1, "身份证号不能为空");
            }
            JSONObject result = familyMemberService.isRegister(idcard);
            return write(-1, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

+ 36 - 36
patient-co-wlyy/src/main/resources/application.properties

@ -43,50 +43,50 @@
#------------------------------------开发环境数据库配置------------------------------------#
##### mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
jdbc.username=root
jdbc.password=123456
#### health index
health.jdbc.driver=com.mysql.jdbc.Driver
health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
health.jdbc.username=root
health.jdbc.password=123456
#### suifang
fv.jdbc.driver=com.mysql.jdbc.Driver
fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
fv.jdbc.username=root
fv.jdbc.password=123456
#### redis
redis.host=172.19.103.47
redis.port=6379
#---------------------------------测试环境数据库配置---------------------------------------#
###### mysql database setting
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#jdbc.username=ssgg
#jdbc.password=ssgg
#jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#jdbc.username=root
#jdbc.password=123456
#
###### health index
##### health index
#health.jdbc.driver=com.mysql.jdbc.Driver
#health.jdbc.url=jdbc:mysql://172.19.103.85/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#health.jdbc.username=ssgg
#health.jdbc.password=ssgg
#health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#health.jdbc.username=root
#health.jdbc.password=123456
#
###### suifang
##### suifang
#fv.jdbc.driver=com.mysql.jdbc.Driver
#fv.jdbc.url=jdbc:mysql://172.19.103.85/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#fv.jdbc.username=ssgg
#fv.jdbc.password=ssgg
#fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#fv.jdbc.username=root
#fv.jdbc.password=123456
#
###### redis
#redis.host=172.19.103.88
##### redis
#redis.host=172.19.103.47
#redis.port=6379
#---------------------------------测试环境数据库配置---------------------------------------#
##### mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
jdbc.username=luofaqiang
jdbc.password=luofaqiang
##### health index
health.jdbc.driver=com.mysql.jdbc.Driver
health.jdbc.url=jdbc:mysql://172.19.103.85/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
health.jdbc.username=luofaqiang
health.jdbc.password=luofaqiang
##### suifang
fv.jdbc.driver=com.mysql.jdbc.Driver
fv.jdbc.url=jdbc:mysql://172.19.103.85/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
fv.jdbc.username=luofaqiang
fv.jdbc.password=luofaqiang
##### redis
redis.host=172.19.103.88
redis.port=6379
#-----------------------------------通用配置--------------------------------------------#
##### redis
redis.maxIdle=300