Browse Source

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

hzp 7 năm trước cách đây
mục cha
commit
220999b03d
36 tập tin đã thay đổi với 377 bổ sung99 xóa
  1. 23 0
      patient-co-statistics-es/doc/sql/system_dict.sql
  2. 7 0
      patient-co-statistics-es/doc/sql/wlyy_dimension.sql
  3. 7 0
      patient-co-statistics-es/doc/sql/wlyy_dimension_quota.sql
  4. 38 0
      patient-co-statistics-es/doc/sql/wlyy_job_config.sql
  5. 1 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/dao/QuartzJobConfigDao.java
  6. 1 0
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/compute/ComputeHelper.java
  7. 2 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/Convert.java
  8. 5 3
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/ConvertHelper.java
  9. 2 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/AgeConvert.java
  10. 2 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/ConsultTimeConvert.java
  11. 56 0
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/HealthLableConvert.java
  12. 2 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/SexConvert.java
  13. 2 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/SimpleConvert.java
  14. 33 0
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/model/HealthLable.java
  15. 1 0
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/extract/db/DBPageExtract.java
  16. 1 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/filter/FilterHelper.java
  17. 2 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/save/es/ElastricSearchSave.java
  18. 13 18
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java
  19. 1 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/MysqlToEsQuotaJob.java
  20. 1 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/model/job/QuartzJobConfig.java
  21. 1 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java
  22. 9 0
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/DataModel.java
  23. 2 1
      patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java
  24. 61 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/SignFamilyServer.java
  25. 4 5
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/security/Token.java
  26. 13 4
      patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java
  27. 12 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyServerDao.java
  28. 4 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/security/TokenDao.java
  29. 4 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/EvaluateService.java
  30. 17 7
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java
  31. 8 7
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/TokenService.java
  32. 26 32
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/system/SystemDictService.java
  33. 5 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemData.java
  34. 7 5
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  35. 1 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java
  36. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

+ 23 - 0
patient-co-statistics-es/doc/sql/system_dict.sql

@ -0,0 +1,23 @@
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''462'', ''RENEW_CHANGE_REASON'', ''1'', ''常住地变更'', NULL, ''1'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''463'', ''RENEW_CHANGE_REASON'', ''2'', ''医生专业度不够'', NULL, ''2'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''464'', ''RENEW_CHANGE_REASON'', ''3'', ''咨询回复慢'', NULL, ''3'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''465'', ''RENEW_CHANGE_REASON'', ''4'', ''无获得感'', NULL, ''4'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''466'', ''RENEW_CHANGE_REASON'', ''5'', ''医生服务态度差'', NULL, ''5'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''467'', ''RENEW_CHANGE_REASON'', ''6'', ''其它'', NULL, ''6'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1000'', ''QUOTA_SEX_DICT'', ''1'', ''男'', NULL, ''1'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1001'', ''QUOTA_SEX_DICT'', ''2'', ''女'', NULL, ''2'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1003'', ''QUOTA_SEX_DICT'', ''3'', ''未知'', NULL, ''3'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1004'', ''QUOTA_AGE_DICT'', ''1'', ''0~6'', NULL, ''1'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1006'', ''QUOTA_AGE_DICT'', ''2'', ''7~18'', NULL, ''2'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1007'', ''QUOTA_AGE_DICT'', ''3'', ''19~30'', NULL, ''3'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1008'', ''QUOTA_AGE_DICT'', ''4'', ''31~50'', NULL, ''4'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1009'', ''QUOTA_AGE_DICT'', ''5'', ''51~65'', NULL, ''5'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1010'', ''QUOTA_AGE_DICT'', ''6'', ''>65'', NULL, ''6'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1011'', ''QUOTA_SIGN_EXPESEX'', ''0'', ''已扣费'', NULL, ''1'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1012'', ''QUOTA_SIGN_EXPESEX'', ''1'', ''已缴费'', NULL, ''2'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1013'', ''QUOTA_SIGN_EXPESEX'', ''2'', ''已退费'', NULL, ''3'');
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1014'', ''QUOTA_CONSULT_TIME'', ''1'', ''0~8'', NULL, NULL);
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1015'', ''QUOTA_CONSULT_TIME'', ''2'', ''8~12'', NULL, NULL);
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1016'', ''QUOTA_CONSULT_TIME'', ''3'', ''12~13'', NULL, NULL);
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1017'', ''QUOTA_CONSULT_TIME'', ''4'', ''13~18'', NULL, NULL);
INSERT INTO `data_for_stats`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES (''1018'', ''QUOTA_CONSULT_TIME'', ''5'', ''18~24'', NULL, NULL);

+ 7 - 0
patient-co-statistics-es/doc/sql/wlyy_dimension.sql

@ -0,0 +1,7 @@
INSERT INTO `data_for_stats`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('1', '1', '1', '患者性别维度', '1', '2017-07-11 09:42:33', NULL, NULL, '2017-06-02 14:19:25', NULL, NULL, NULL);
INSERT INTO `data_for_stats`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('2', '2', '2', '患者年龄维度', '1', '2017-07-11 09:42:34', NULL, NULL, '2017-06-02 14:19:27', NULL, NULL, NULL);
INSERT INTO `data_for_stats`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('3', '3', '3', '患者健康分布标签', '1', '2017-07-12 14:07:59', NULL, NULL, '2017-06-02 15:01:56', NULL, NULL, NULL);
INSERT INTO `data_for_stats`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('4', '4', '4', '签约扣费状态', '1', '2017-07-11 09:42:18', NULL, NULL, '2017-07-11 09:41:14', NULL, NULL, NULL);
INSERT INTO `data_for_stats`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('5', '5', '5', '签约服务类别', '1', '2017-07-12 12:05:40', NULL, NULL, '2017-07-11 09:41:44', NULL, NULL, NULL);
INSERT INTO `data_for_stats`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('6', '6', '6', '续签转签原因', '1', '2017-07-12 17:29:43', NULL, NULL, '2017-07-12 17:28:37', NULL, NULL, NULL);
INSERT INTO `data_for_stats`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('7', '7', '7', '咨询回复时间分布', '1', '2017-07-12 17:29:45', NULL, NULL, '2017-07-12 17:28:39', NULL, NULL, NULL);

+ 7 - 0
patient-co-statistics-es/doc/sql/wlyy_dimension_quota.sql

@ -0,0 +1,7 @@
INSERT INTO `data_for_stats`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('1', '6', '1', 'select s.code code,s.value name from system_dict s where  s.dict_name=\'QUOTA_SEX_DICT\'', 'com.yihu.wlyy.statistics.etl.convert.wlyy.SexConvert', '1', 'Idcard');
INSERT INTO `data_for_stats`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('2', '7', '3', NULL, NULL, NULL, NULL);
INSERT INTO `data_for_stats`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('3', '8', '2', 'select s.code code,s.value name from system_dict s where  s.dict_name=\'QUOTA_AGE_DICT\'', 'com.yihu.wlyy.statistics.etl.convert.wlyy.AgeConvert', '1', 'Idcard');
INSERT INTO `data_for_stats`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('4', '30', '6', 'select s.code code,s.value name from system_dict s where  s.dict_name=\'RENEW_CHANGE_REASON\'', 'com.yihu.wlyy.statistics.etl.convert.wlyy.SimpleConvert', '1', 'slavekey1');
INSERT INTO `data_for_stats`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('6', '36', '5', 'select DISTINCT code,name from wlyy_sign_dict where type=1', 'com.yihu.wlyy.statistics.etl.convert.wlyy.SimpleConvert', '1', 'ServerType');
INSERT INTO `data_for_stats`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('7', '15', '3', 'select label_code code,label_name name from wlyy_sign_patient_label where label_type=\'2\' and status=1', 'com.yihu.wlyy.statistics.etl.convert.wlyy.HealthLableConvert', '1', 'HealthLable');
INSERT INTO `data_for_stats`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('8', '24', '7', 'select s.code code,s.value name from system_dict s where  s.dict_name=\'QUOTA_CONSULT_TIME\'', 'com.yihu.wlyy.statistics.etl.convert.wlyy.ConsultTimeConvert', '1', 'slavekey1');

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 38 - 0
patient-co-statistics-es/doc/sql/wlyy_job_config.sql


+ 1 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/dao/QuartzJobConfigDao.java

@ -18,7 +18,7 @@ public interface QuartzJobConfigDao extends PagingAndSortingRepository<QuartzJob
    @Query(" FROM QuartzJobConfig a WHERE a.status=?1 and a.del='1'")
    List<QuartzJobConfig> findByAll(String s);
    @Query(" FROM QuartzJobConfig a WHERE  a.del='1' ")
    @Query(" FROM QuartzJobConfig a WHERE  a.del='1' order by a.id asc")
    List<QuartzJobConfig> findByIds();
    @Query(" FROM QuartzJobConfig a WHERE a.id=?1 and a.del='1'")

+ 1 - 0
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/compute/ComputeHelper.java

@ -65,6 +65,7 @@ public class ComputeHelper {
                sms=returnMap.get(key);
            }
            sms.add(one);
            returnMap.put(key,sms);
        });
        return returnMap;

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/Convert.java

@ -4,6 +4,7 @@ package com.yihu.wlyy.statistics.etl.convert;
import com.yihu.wlyy.statistics.model.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.vo.DataModel;
import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
@ -11,5 +12,5 @@ import java.util.List;
 * Created by chenweida on 2017/6/5.
 */
public interface Convert {
    public List<DataModel> convert(List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp );
    public List<DataModel> convert(JdbcTemplate jdbcTemplate,List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp );
}

+ 5 - 3
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/ConvertHelper.java

@ -8,6 +8,7 @@ import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@ -24,7 +25,8 @@ import java.util.Map;
public class ConvertHelper {
    @Autowired
    private WlyyDimensionQuotaDao wlyyDimensionQuotaDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 把每个维度的key清洗到对应的slaveKey中
     * @param filterModel  过滤之后的model
@ -39,8 +41,8 @@ public class ConvertHelper {
            if (!StringUtils.isEmpty(clazz)) {
                //反射出对象并且调用convert方法去转换对应的slavekey
                Object obj = Class.forName(clazz).newInstance();
                Method method = obj.getClass().getMethod("convert", List.class,String.class,WlyyDimensionQuota.class);
                method.invoke(obj, filterModel.getData(), String.valueOf(i + 1),temp);
                Method method = obj.getClass().getMethod("convert",JdbcTemplate.class, List.class,String.class,WlyyDimensionQuota.class);
                method.invoke(obj,jdbcTemplate, filterModel.getData(), String.valueOf(i + 1),temp);
            }
        }
        return filterModel;

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/AgeConvert.java

@ -7,6 +7,7 @@ import com.yihu.wlyy.statistics.util.Contant;
import com.yihu.wlyy.statistics.util.IdCardUtil;
import com.yihu.wlyy.statistics.vo.DataModel;
import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
@ -19,7 +20,7 @@ public class AgeConvert implements Convert {
     * @param slaveLevel 从1开始
     * @return
     */
    public List<DataModel> convert(List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/ConsultTimeConvert.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.model.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.util.IdCardUtil;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
@ -18,7 +19,7 @@ public class ConsultTimeConvert implements Convert {
     * @param slaveLevel 从1开始
     * @return
     */
    public List<DataModel> convert(List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);

+ 56 - 0
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/HealthLableConvert.java

@ -0,0 +1,56 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy;
import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.etl.convert.wlyy.model.HealthLable;
import com.yihu.wlyy.statistics.model.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.util.IdCardUtil;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/5.
 */
public class HealthLableConvert implements Convert {
    /**
     * @param oneList    数据
     * @param slaveLevel 从1开始
     * @return
     */
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp) {
        //得到全部的服务标签
        String sql = "SELECT " +
                "  spli.label AS health_lable, " +
                "  spli.patient " +
                "FROM " +
                "  wlyy_sign_patient_label_info spli " +
                "WHERE " +
                "  spli.label_type = '2' " +
                "AND spli. STATUS = '1'";
        List<HealthLable> healthLables = jdbcTemplate.query(sql, new BeanPropertyRowMapper(HealthLable.class));
        Map<String, String> healthLablesMap = new HashMap<>();
        healthLables.stream().forEach(one -> {
            healthLablesMap.put(one.getPatient(), one.getHealthLable());
        });
        oneList.stream().forEach(one -> {
            try {
                Object value = healthLablesMap.get(one.getPatient());
                String sex = IdCardUtil.getSexForIdcard(String.valueOf(value));
                DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(one, sex);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        return oneList;
    }
}

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/SexConvert.java

@ -7,6 +7,7 @@ import com.yihu.wlyy.statistics.util.Contant;
import com.yihu.wlyy.statistics.util.IdCardUtil;
import com.yihu.wlyy.statistics.vo.DataModel;
import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
@ -20,7 +21,7 @@ public class SexConvert implements Convert {
     * @param slaveLevel 从1开始
     * @return
     */
    public List<DataModel> convert(List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel>  oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/SimpleConvert.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.model.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.util.IdCardUtil;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
@ -18,7 +19,7 @@ public class SimpleConvert implements Convert {
     * @param slaveLevel 从1开始
     * @return
     */
    public List<DataModel> convert(List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel>  oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);

+ 33 - 0
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/model/HealthLable.java

@ -0,0 +1,33 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy.model;
/**
 * Created by chenweida on 2017/7/1.
 * SELECT
 * spli.label AS health_lable,
 * spli.patient
 * FROM
 * wlyy_sign_patient_label_info spli
 * WHERE
 * spli.label_type = '2'
 * AND spli. STATUS = '1'
 */
public class HealthLable {
    private String healthLable;
    private String patient;
    public String getHealthLable() {
        return healthLable;
    }
    public void setHealthLable(String healthLable) {
        this.healthLable = healthLable;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
}

+ 1 - 0
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/extract/db/DBPageExtract.java

@ -111,6 +111,7 @@ public class DBPageExtract<T> {
            }
            return returnList;
        }catch (Exception e){
            e.printStackTrace();
            //如果多线程错误 就改用单线程
            return noMultiThreadExtract(clazz,sql,pageSize,jdbcTemplate);
        }

+ 1 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/filter/FilterHelper.java

@ -35,7 +35,7 @@ public class FilterHelper {
        dataModels.stream().forEach(one -> {
            String returnStr=one.isNull();
            if (StringUtils.isEmpty(returnStr)) {
                dataModels.add(one);
                newList.add(one);
            }else{
                //脏数据
                errorList.add(new ErrModel(one.getBusinessId(),returnStr));

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/save/es/ElastricSearchSave.java

@ -45,7 +45,8 @@ public class ElastricSearchSave {
            }
            BulkResult br = jestClient.execute(bulk.build());
            //关闭链接
            jestClient.shutdownClient();
            logger.info("save data count:" + sms.size());
            logger.info("save flag:" + br.isSucceeded());
            return br.isSucceeded();
        } catch (Exception e) {
            logger.error(" save error :" + e.getMessage());

+ 13 - 18
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java

@ -153,6 +153,11 @@ public class CurrentMysqlToEsQuotaJob implements Job {
            } catch (Exception e) {
                e.printStackTrace();
            }
            try {
                Thread.sleep(20000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
    }
@ -177,32 +182,22 @@ public class CurrentMysqlToEsQuotaJob implements Job {
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();
            SearchResult result = jestClient.execute(search);
            List<SaveModel> saveModels = result.getSourceAsObjectList(SaveModel.class);
            //如果之前有值批量更新
            if (saveModels != null && saveModels.size() > 0) {
            List<SaveModel> quarySaveModels = result.getSourceAsObjectList(SaveModel.class);
            //如果之前有值就用查询出来的然后修改数目即可
            if (quarySaveModels != null && quarySaveModels.size() > 0) {
                //list转map
                Map<String, SaveModel> smsMap = new HashMap<>();
                sms.stream().forEach(one -> {
                    smsMap.put(one.getId(), one);
                    smsMap.put(one.getTeam(), one);
                });
                //根据id批量更新
                Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
                for (SaveModel obj : saveModels) {
                    SaveModel newResult = smsMap.get(obj.getId());
                for (SaveModel obj : quarySaveModels) {
                    SaveModel newResult = smsMap.get(obj.getTeam());
                    obj.setResult1(newResult.getResult1());
                    obj.setResult2(newResult.getResult2());
                    Update index = new Update.Builder(obj.getId()).build();
                    bulk.addAction(index);
                }
                BulkResult br = jestClient.execute(bulk.build());
                logger.info("update data count:" + saveModels.size());
                logger.info("update flag:" + br.isSucceeded());
                return br.isSucceeded();
            } else {
                //批量插入
                return saveDate(sms);
                sms=quarySaveModels;
            }
            return saveDate(sms);
        } catch (Exception e) {
            e.printStackTrace();
        }

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

@ -174,7 +174,7 @@ public class MysqlToEsQuotaJob implements Job {
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("quotaCode", quotaCode))
                            .must(QueryBuilders.matchQuery("timeLevel", timeLevel))
                            .must(QueryBuilders.matchQuery("quotaDate", quotaDate))).size(10000);
                            .must(QueryBuilders.matchQuery("quotaDate", quotaDate))).size(10000);//一次取10000条
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();

+ 1 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/model/job/QuartzJobConfig.java

@ -8,7 +8,7 @@ import javax.persistence.*;
 * 计划任务
 */
@Entity
@Table(name = "wlyy_job_config")
@Table(name = "wlyy_job_config_cwd")
public class QuartzJobConfig implements java.io.Serializable {
	private String id;

+ 1 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -260,7 +260,7 @@ public class JobService {
            //往quartz框架添加任务
            params.put("daybefore", getYesterday(0 - i - 1));
            params.put("yesterday", getYesterday(0 - i));
            for (int j = 1; j <= 2; j++) {
            for (int j = 2; j <= 2; j++) {
                params.put("timeLevel", j + "");
                if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                    quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);

+ 9 - 0
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/DataModel.java

@ -17,6 +17,7 @@ public class DataModel {
    private String slaveKey3;//从维度  3级维度
    private String slaveKey4;//从维度  4级维度
    private String expensesStatus;//扣费状态
    private String patient;//患者code、
    private String idcard;// 身份证
    private String serverType;//服务类型
    private String healthLable;//健康标签
@ -164,4 +165,12 @@ public class DataModel {
                ", slaveKey4='" + slaveKey4 + '\'' +
                '}';
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
}

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.statistics.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.elasticsearch.index.analysis.AnalysisSettingsRequired;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
@ -20,7 +21,7 @@ public class SaveModel {
    private Date quotaDate;//统计时间
    private String city;//城市代码 350200
    
    private String cityName;//
    private String town;//区代码 350206

+ 61 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/SignFamilyServer.java

@ -0,0 +1,61 @@
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 Trick on 2017/7/14.
 */
@Entity
@Table(name = "wlyy_sign_family_server")
public class SignFamilyServer extends IdEntity {
    private String signCode; //签约code
    private String serverType; //服务类型
    private String serverTypeName; //服务类型名称
    private Date czrq; //修改时间
    private Date createTime; //创建时间
    public String getSignCode() {
        return signCode;
    }
    public void setSignCode(String signCode) {
        this.signCode = signCode;
    }
    public String getServerType() {
        return serverType;
    }
    public void setServerType(String serverType) {
        this.serverType = serverType;
    }
    public String getServerTypeName() {
        return serverTypeName;
    }
    public void setServerTypeName(String serverTypeName) {
        this.serverTypeName = serverTypeName;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 4 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/security/Token.java

@ -1,12 +1,11 @@
package com.yihu.wlyy.entity.security;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import java.util.Date;
@Entity
@Table(name = "wlyy_token")
@ -14,7 +13,7 @@ public class Token extends IdEntity {
	private static final long serialVersionUID = -3297644428262254694L;
	private String user;
	private Integer platform;   // 1患者端,2医生端,3微信公众号
	private Integer platform;   // 1患者端,2医生端app,3微信公众号wechat,4医生端pc
	private Date timeout;
	private String imei;
	private String token;

+ 13 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java

@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.Map;
/**
 * 医生权限校验
@ -51,6 +52,7 @@ public class DoctorInterceptor extends BaseInterceptor {
            String uid = json.has("uid") ? json.getString("uid") : "";
            String imei = json.has("imei") ? json.getString("imei") : "";
            String observer = json.has("observer") ? json.getString("observer") : "";
            Integer platform  = json.has("platform") ? json.getInt("platform") : 2;
            //如果是观察者直接返回true
            if (!org.springframework.util.StringUtils.isEmpty(observer) && observer.equals("1")) {
                Class cls = ((HandlerMethod) handler).getBeanType();
@ -97,12 +99,19 @@ public class DoctorInterceptor extends BaseInterceptor {
                return false;
            }
            Token token = SystemData.doctorTokens.get(uid);
            Token token = null;
            Map<String, Token> tempMap = null;
            if(platform==2){
                tempMap = SystemData.doctorTokens;
            }else {
                tempMap = SystemData.doctorPCTokens;
            }
            token = tempMap.get(uid);
            if (token == null) {
                token = tokenDao.findByPatient(uid, 2);
                token = tokenDao.findByPatient(uid, platform);
                if (token != null) {
                    // 加入缓存
                    SystemData.doctorTokens.put(uid, token);
                    tempMap.put(uid, token);
                }
            }
            if (token == null || token.getPlatform() != 2) {
@ -124,7 +133,7 @@ public class DoctorInterceptor extends BaseInterceptor {
                        // 今天未更新,则更新缓存
                        token.setCzrq(new Date());
                        // 更新内存
                        SystemData.doctorTokens.put(uid, token);
                        tempMap.put(uid, token);
                        // 更新数据库
                        tokenDao.save(token);
                    }

+ 12 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyServerDao.java

@ -0,0 +1,12 @@
package com.yihu.wlyy.repository.patient;
import com.yihu.wlyy.entity.patient.SignFamilyServer;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2017/7/14.
 */
public interface SignFamilyServerDao extends PagingAndSortingRepository<SignFamilyServer, Long>, JpaSpecificationExecutor<SignFamilyServer> {
}

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/security/TokenDao.java

@ -13,6 +13,10 @@ public interface TokenDao extends PagingAndSortingRepository<Token, Long> {
	@Modifying
	@Query("delete Token a where a.user = ?1")
	int deleteByUser(String user);
	@Modifying
	@Query("delete Token a where a.user = ?1 and platform=?2")
	int deleteByUserAndPlatform(String user,Integer platform);
	
	@Modifying
	@Query("delete Token a where a.token = ?1")

+ 4 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/EvaluateService.java

@ -296,7 +296,7 @@ public class EvaluateService extends BaseService {
    public JSONArray getDoctorSorceList(String doctor,String type,Integer page,Integer size){
        String sql = "SELECT " +
                " (case e.type WHEN 2 then '匿名' ELSE p.`name` END) `name`,  " +
                " (case e.type WHEN 2 then '匿名' ELSE p.`name` END) `name`,p.sex ,LEFT(c.czrq,10) AS date,s.remark, " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age,s.consult,s.score,e.type,  " +
                " max(case e.evaluate_type when 1 then e.score else 0 end) ability,  " +
                " max(case e.evaluate_type when 2 then e.score else 0 end) attitude,  " +
@ -306,6 +306,7 @@ public class EvaluateService extends BaseService {
                " ,wlyy_consult_team c " +
                " ,wlyy_patient p  " +
                " WHERE s.consult = e.consult " +
                " AND s.doctor = e.doctor " +
                " AND s.consult = c.consult   " +
                " AND p.`code` = c.patient " +
                " AND e.evaluate_type <> 0  "+
@ -327,9 +328,9 @@ public class EvaluateService extends BaseService {
        if(page!=null&&size!=null){
            page = page -1;
            sql = sql+ " GROUP BY s.consult LIMIT "+page*size+","+size+" ";
            sql = sql+ " GROUP BY s.consult ORDER BY date DESC LIMIT "+page*size+","+size+" ";
        }else{
            sql = sql=" GROUP BY s.consult ";
            sql = sql +" GROUP BY s.consult ORDER BY date DESC ";
        }
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);

+ 17 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java

@ -14,6 +14,7 @@ import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.statistics.PopulationBaseDao;
import com.yihu.wlyy.repository.statistics.WlyyQuotaResultDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.util.DateUtil;
import org.json.JSONArray;
import org.json.JSONObject;
@ -52,6 +53,8 @@ public class StatisticsAllService extends BaseService {
    private StringRedisTemplate redisTemplate;
    @Autowired
    private WlyyQuotaResultDao wlyyQuotaResultDao;
    @Autowired
    private SystemDictService systemDictService;
    /**
     * 获取时间戳
@ -562,7 +565,7 @@ public class StatisticsAllService extends BaseService {
                }
            }
            if ((level == 4 && "1".equals(lowLevel)) || (level == 2)||(level == 3 && "1".equals(lowLevel))) {
            if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
                translateTeamLeaderName(resultList);
            }
@ -615,12 +618,16 @@ public class StatisticsAllService extends BaseService {
        if (resultList == null || resultList.size() < 1) {
            resultList = getLowLevelMapKey(level, low_level, area);
        }
        //获取目标量和团队的调控量
        String signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_13", year);//目标量
        String signRegulationNum = systemDictService.getDictValueNoRedis("SIGN_TEAM_REGULATION_NUM", year);//调控量
        if (resultList != null) {
            DecimalFormat df = new DecimalFormat("0.0000");
            for (int i = 0; i < resultList.size(); i++) {
                Map<String, Object> map = resultList.get(i);
                map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
                map.put("signTaskNum",signTaskNum);//目标量
                map.put("signRegulationNum",signRegulationNum);//调控量
                if (!low_level.equals("1")) {
                    String code = map.get("code").toString();
@ -2524,7 +2531,7 @@ public class StatisticsAllService extends BaseService {
        if (rs != null && rs.size() > 0) {
            for (Map<String, Object> r : rs) {
                String id = (String) r.get("code");
                    String name = getTeamLeaderNameByTeamCode(leaders, Integer.parseInt(id));
                String name = getTeamLeaderNameByTeamCode(leaders, Integer.parseInt(id));
                if (org.apache.commons.lang3.StringUtils.isNotBlank(name)) {
                    r.put("name", name);
                }
@ -2609,10 +2616,13 @@ public class StatisticsAllService extends BaseService {
        }
        if (resultList != null) {
            String signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            String signRegulationNum = systemDictService.getDictValueNoRedis("SIGN_TEAM_REGULATION_NUM", year);//调控量
            DecimalFormat df = new DecimalFormat("0.0000");
            for (Map<String, Object> map : resultList) {
                map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
                map.put("signTaskNum",signTaskNum);//目标量
                map.put("signRegulationNum",signRegulationNum);//调控量
                if (!low_level.equals("1")) {
                    PopulationBase peopleNum = getPopulationBase(map.get("code").toString(), year);
                    if (peopleNum != null) {
@ -2734,11 +2744,11 @@ public class StatisticsAllService extends BaseService {
            for (Map<String, Object> map : resultList) {
                map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
                //获取去年签约的人数 默认是上个年度的最后一天
                WlyyQuotaResult one=resultMap.get(map.get("code").toString());
                WlyyQuotaResult one = resultMap.get(map.get("code").toString());
                int signNum = 0;
                int renewNum = renewMap.get(map.get("code").toString());
                if(one!=null){
                    signNum=Integer.valueOf(one.getResult());
                if (one != null) {
                    signNum = Integer.valueOf(one.getResult());
                }
                map.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
                map.put("signNum", signNum);

+ 8 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/TokenService.java

@ -1,18 +1,17 @@
package com.yihu.wlyy.service.common.account;
import java.util.Date;
import com.yihu.wlyy.repository.patient.PatientDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.security.TokenDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.SystemData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@Component
@Transactional(rollbackFor = Exception.class)
@ -63,6 +62,8 @@ public class TokenService extends BaseService {
			SystemData.doctorTokens.put(user, token);
		} else if (platform == 3) {
			SystemData.wxPatientTokens.put(user, token);
		}else if(platform == 4){
			SystemData.doctorPCTokens.put(user,token);
		}
		return token;
	}

+ 26 - 32
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/system/SystemDictService.java

@ -23,46 +23,44 @@ public class SystemDictService {
        return systemDictDao.findByDictName(name);
    }
    private String dictName =  "SYSTEM_PARAMS";
    private String dictName = "SYSTEM_PARAMS";
    public String getDictValueNoRedis(String dictName, String code) {
        String re = systemDictDao.findByDictNameAndCode(dictName, code);
        return re;
    }
    /**
     * 字典转译
     *
     * @param dictName
     * @param code
     * @return
     */
    public String getDictValue(String dictName,String code){
    public String getDictValue(String dictName, String code) {
        String re = "";
        try {
            if(!StringUtils.isEmpty(code))
            {
            if (!StringUtils.isEmpty(code)) {
                //判断该字典redis是否存在
                String exit = redisTemplate.opsForValue().get("systemDict:"+dictName);
                if(!StringUtils.isEmpty(exit))
                {
                    re =  redisTemplate.opsForValue().get("systemDict:"+dictName+":"+code);
                }
                else{
                String exit = redisTemplate.opsForValue().get("systemDict:" + dictName);
                if (!StringUtils.isEmpty(exit)) {
                    re = redisTemplate.opsForValue().get("systemDict:" + dictName + ":" + code);
                } else {
                    List<SystemDict> list = systemDictDao.findByDictName(dictName);
                    if(list!=null && list.size()>0)
                    {
                        redisTemplate.opsForValue().set("systemDict:"+dictName,"1");
                        for(SystemDict item:list)
                        {
                            redisTemplate.opsForValue().set("systemDict:"+dictName+":"+item.getCode(),item.getValue());
                            if(code.equals(item.getCode()))
                            {
                    if (list != null && list.size() > 0) {
                        redisTemplate.opsForValue().set("systemDict:" + dictName, "1");
                        for (SystemDict item : list) {
                            redisTemplate.opsForValue().set("systemDict:" + dictName + ":" + item.getCode(), item.getValue());
                            if (code.equals(item.getCode())) {
                                re = item.getValue();
                            }
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
        } catch (Exception ex) {
            ex.printStackTrace();
            re = systemDictDao.findByDictNameAndCode(dictName,code);
            re = systemDictDao.findByDictNameAndCode(dictName, code);
        }
        return re;
    }
@ -70,22 +68,18 @@ public class SystemDictService {
    /************************************** 其他参数 ****************************************/
    /**
     * http_log是否记录成功消息
     *
     * @return
     */
    public Boolean getSaveSuccessLog()
    {
        try{
    public Boolean getSaveSuccessLog() {
        try {
            String re = systemDictDao.findByDictNameAndCode(dictName, "SAVE_SUCCESS_LOG");
            if("1".equals(re))
            {
            if ("1".equals(re)) {
                return true;
            }
            else{
            } else {
                return false;
            }
        }
        catch (Exception ex)
        {
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }

+ 5 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemData.java

@ -1,14 +1,16 @@
package com.yihu.wlyy.util;
import com.yihu.wlyy.entity.security.Token;
import java.util.HashMap;
import java.util.Map;
import com.yihu.wlyy.entity.security.Token;
public class SystemData {
	// 医生验证信息
	// 医生app验证信息
	public static Map<String, Token> doctorTokens = new HashMap<String, Token>();
	// 医生pc端验证信息
	public static Map<String, Token> doctorPCTokens = new HashMap<String, Token>();
	// 患者验证信息
	public static Map<String, Token> patientTokens = new HashMap<String, Token>();
	// 患者公众号验证信息

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

@ -27,7 +27,6 @@ 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;
@ -36,8 +35,6 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.*;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.*;
import java.util.List;
@ -133,6 +130,7 @@ public class LoginController extends BaseController {
     *  @param mobile  手机号
     * @param captcha 短信验证码
     * @param idcard  身份证号
     * @param platform  // 1患者端,2医生端app,3微信公众号wechat,4医生端pc
     * @param password 密码
     * @return
     */
@ -141,6 +139,7 @@ public class LoginController extends BaseController {
    public String doctor(@RequestParam(required = false) String mobile,
                         @RequestParam(required = false) String captcha,
                         @RequestParam(required = false) String idcard,
                         @RequestParam(required = false) Integer platform,
                         @RequestParam(required = false) String password) {
        String errorMessage;
        LoginLog loginLog=new LoginLog();
@ -156,6 +155,9 @@ public class LoginController extends BaseController {
                loginLogService.saveLog(loginLog);
                return error(-1, errorMessage);
            }
            if(platform==null){
                platform = 2;//默认为医生app端
            }
            //身份证登录
            if(StringUtils.isNoneEmpty(mobile)&&StringUtils.isNoneEmpty(password)){
                password = RSAUtils.getInstance(doctorService).decryptString(password);
@ -172,7 +174,7 @@ public class LoginController extends BaseController {
                String loginPassword= MD5.GetMD5Code(password+doctor.getSalt());
                if(loginPassword.equals(doctor.getPassword())){
                    // 用户校验通过,生成token
                    Token token = tokenService.newToken(doctor.getCode(), getIMEI(), 2);
                    Token token = tokenService.newToken(doctor.getCode(), getIMEI(), platform);
                    loginLog.setTokenId(token.getId());
                    loginLog.setType("1");
                    Map<String, Object> map = new HashMap<>();
@ -232,7 +234,7 @@ public class LoginController extends BaseController {
                } else {
                    loginLog.setUserCode(doctor.getCode());
                    // 用户校验通过,生成token
                    Token token = tokenService.newToken(doctor.getCode(), getIMEI(), 2);
                    Token token = tokenService.newToken(doctor.getCode(), getIMEI(), platform);
                    loginLog.setTokenId(token.getId());
                    loginLog.setType("1");
                    Map<String, Object> map = new HashMap<>();

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

@ -1818,6 +1818,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/allotOrMoveHealth")
    @ResponseBody
    @ObserverRequired
    public String allotOrMoveHealth(
            @RequestParam String newDoctorCode,
            @RequestParam(required = false) String oldDoctorCode,

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -516,6 +516,7 @@ public class StatisticsController extends BaseController {
            if (StringUtils.isNotEmpty(lowCode)) {
//                指定level下特定查询级别
                if (index.equals("17")) {
                    //sort=1&date=2017-07-13&level=4&index=17&area=350200&lowLevel=1&lowCode=3
                    result.put("index_" + index, statisticsAllService.getLevelTwoLowLevelTotalTeamLeader(date, area, level, index, sort, lowLevel, lowCode,year));
                } else {
                    result.put("index_" + index, statisticsAllService.getLevelTwoLowLevelTotal(date, area, level, index, sort, lowLevel, lowCode,year));
@ -528,8 +529,10 @@ public class StatisticsController extends BaseController {
                    } else if ( index.equals("21")) {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotal2(date, area, level, idx, sort, lowLevel));
                    } else if (idx.equals("28")) {
                        //level=4&area=350200&sort=1&index=28&date=undefined&lowLevel=2
                        result.put("index_" + idx, statisticsService.getAvgAllInfo(level, area, lowLevel));
                    } else if (idx.equals("13")) {
                        // sort=1&date=2017-07-13&level=4&index=13&area=350200&lowCode=
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotalTeamLeader(date, area, level, idx, sort, lowLevel,year));
                    } else {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotal(date, area, level, idx, sort, lowLevel,year));