Browse Source

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

trick9191 7 years ago
parent
commit
5554289f80

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

@ -1,23 +0,0 @@
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 `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1000', 'QUOTA_SEX_DICT', '1', '男', '', '1');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1001', 'QUOTA_SEX_DICT', '2', '女', '', '2');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1003', 'QUOTA_SEX_DICT', '3', '未知', '', '3');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1004', 'QUOTA_AGE_DICT', '1', '0~6', '', '1');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1006', 'QUOTA_AGE_DICT', '2', '7~18', '', '2');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1007', 'QUOTA_AGE_DICT', '3', '19~30', '', '3');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1008', 'QUOTA_AGE_DICT', '4', '31~50', '', '4');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1009', 'QUOTA_AGE_DICT', '5', '51~65', '', '5');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1010', 'QUOTA_AGE_DICT', '6', '>65', '', '6');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1011', 'QUOTA_SIGN_EXPESEX', '0', '已扣费', '', '1');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1012', 'QUOTA_SIGN_EXPESEX', '1', '已缴费', '', '2');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1013', 'QUOTA_SIGN_EXPESEX', '2', '已退费', '', '3');
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1014', 'QUOTA_CONSULT_TIME', '1', '0~8', '', NULL);
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1015', 'QUOTA_CONSULT_TIME', '2', '8~12', '', NULL);
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1016', 'QUOTA_CONSULT_TIME', '3', '12~13', '', NULL);
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1017', 'QUOTA_CONSULT_TIME', '4', '13~18', '', NULL);
INSERT INTO `wlyy_quota`.`system_dict` (`id`, `dict_name`, `code`, `value`, `py_code`, `sort`) VALUES ('1018', 'QUOTA_CONSULT_TIME', '5', '18~24', '', NULL);

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

@ -1,25 +0,0 @@
CREATE TABLE `wlyy_dimension` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键(uuid)',
  `code` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '业务代码',
  `type` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '类型:1 性别 2 年龄 ',
  `name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '指标名称',
  `status` int(2) DEFAULT NULL COMMENT '1: 正常 0:不可以用 -1 已删除',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_user` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '创建人',
  `create_user_name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '创建人名',
  `update_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '修改时间',
  `update_user` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '修改人',
  `update_user_name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '修改人名',
  `remark` varchar(1500) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `wlyy_quota`.`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 `wlyy_quota`.`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 `wlyy_quota`.`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 `wlyy_quota`.`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 `wlyy_quota`.`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 `wlyy_quota`.`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 `wlyy_quota`.`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);
INSERT INTO `wlyy_quota`.`wlyy_dimension` (`id`, `code`, `type`, `name`, `status`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `remark`) VALUES ('8', '8', '8', '患者疾病标签', '1', '2017-07-19 16:53:44', NULL, NULL, '2017-07-19 16:53:46', NULL, NULL, NULL);

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

@ -1,21 +0,0 @@
CREATE TABLE `wlyy_dimension_quota` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `quota_code` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '关联 wlyy_quota code',
  `dimension_code` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '关联 wlyy_dimension',
  `dict_sql` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
  `convert_clazz` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '数据转换的类',
  `sort` int(2) DEFAULT NULL COMMENT '维度顺序',
  `key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '查询出来的key',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `wlyy_quota`.`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 `wlyy_quota`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('2', '7', '3', NULL, NULL, NULL, NULL);
INSERT INTO `wlyy_quota`.`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 `wlyy_quota`.`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 `wlyy_quota`.`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 `wlyy_quota`.`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', '');
INSERT INTO `wlyy_quota`.`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');
INSERT INTO `wlyy_quota`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('9', '12', '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 `wlyy_quota`.`wlyy_dimension_quota` (`id`, `quota_code`, `dimension_code`, `dict_sql`, `convert_clazz`, `sort`, `key`) VALUES ('10', '12', '8', 'select label_code code,label_name name from wlyy_sign_patient_label where label_type=\'3\' and status=1', 'com.yihu.wlyy.statistics.etl.convert.wlyy.DiseaseLableConvert', '2', NULL);

File diff suppressed because it is too large
+ 0 - 56
patient-co/patient-co-statistics-es/doc/sql/wlyy_job_config.sql


File diff suppressed because it is too large
+ 193 - 0
patient-co/patient-co-statistics-es/doc/sql/统计相关表数据备份20171121.txt


+ 42 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/controller/JobController.java

@ -240,4 +240,46 @@ public class JobController extends BaseController {
        }
    }
    //================================================没有休眠时间=============================================================
    /**
     * 生成过去某一天到某一天的某个指标的数据
     *
     * @param start
     * @param end
     * @return
     */
    @ApiOperation(value = "生成过去某一天到某一天的某个指标的数据(包含头尾)没有休眠时间")
    @RequestMapping(value = "productDataByDayToDayAndIdNoSleep", method = RequestMethod.GET)
    public String productDataByDayToDayAndIdNoSleep( @ApiParam(name = "start", value = "yyyy-MM-dd")@RequestParam(value = "start", required = true)String start,
                                                     @ApiParam(name = "end", value = "yyyy-MM-dd")@RequestParam(value = "end", required = true)String end,
                                                     @ApiParam(name = "id", value = "任务id")@RequestParam(value = "id", required = true)String id,
                                                     @ApiParam(name = "sleepTime", value = "任务间隔时间(秒)")@RequestParam(value = "sleepTime", required = true)Long sleepTime) {
        try {
            jobService.productDataByDayToDayAndIdNoSleep(start,end,id,sleepTime);
            return success("启动成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
    /**
     * 生成过去某一天的全部的数据
     *
     * @param day
     * @return
     */
    @ApiOperation(value = "生成过去某一天的全部的数据")
    @RequestMapping(value = "productDataByOneDayNoSleep", method = RequestMethod.GET)
    public String productDataByOneDayNoSleep( @ApiParam(name = "day", value = "yyyy-MM-dd")@RequestParam(value = "day", required = true)String day,
                                              @ApiParam(name = "sleepTime", value = "任务间隔时间(秒)")@RequestParam(value = "sleepTime", required = true)Long sleepTime) {
        try {
            jobService.productDataByOneDayNoSleep(day,sleepTime);
            return success("启动成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
}

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

@ -245,6 +245,7 @@ public class JobService {
        }
    }
    public void productDataByDayAndId(Integer day, String id) throws Exception {
        QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById(id);
        if (quartzJobConfig == null) {
@ -320,4 +321,92 @@ public class JobService {
        }
    }
    //================================================没有休眠时间=============================================================
    public void productDataByDayToDayAndIdNoSleep(String start, String end, String id,Long sleepTime) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date startDate = sdf.parse(start);
        Date endDate = sdf.parse(end);
        if (startDate.after(endDate)) {
            throw new Exception("日期参数错误");
        }
        int day = daysBetween(startDate, endDate);
        for (int i = 0; i < day; i++) {
            Cache.cleanCache();//清空缓存
            productDataByOneDayWithIdNoSleep(getYesterday(i, startDate), id,sleepTime);
        }
    }
    public void productDataByOneDayWithIdNoSleep(String yesterday, String id,Long sleepTime) throws Exception {
        SimpleDateFormat dataSimple = new SimpleDateFormat("yyyy-MM-dd");
        Date date = dataSimple.parse(yesterday);
        if (date == null) {
            throw new Exception("时间格式错误");
        }
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        calendar.add(calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动
        Date nowDate = calendar.getTime();   //这个时间就是日期往后推一天的结果
        String daybefore = new SimpleDateFormat("yyyy-MM-dd").format(nowDate.getTime());
        QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById(id);
        if (quartzJobConfig == null) {
            throw new Exception("id不存在");
        }
        WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
        BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
        Map<String, String> params = new HashMap<String, String>();
        params.put("jobConfig", wlyyJobConfigVO.getId());
        //往quartz框架添加任务
        params.put("startTime", daybefore);
        params.put("endTime", yesterday);
        for (int j = 1; j <= 2; j++) {
            params.put("timeLevel", j + "");
            if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
            }
            Thread.sleep(sleepTime*1000L);
        }
    }
    public void productDataByOneDayNoSleep(String yesterday,Long sleepTime) throws Exception {
        String sql="select * from wlyy_job_config_new a where  a.del='1' and a.id !=11 order by a.id asc";
        SimpleDateFormat dataSimple = new SimpleDateFormat("yyyy-MM-dd");
        Date date = dataSimple.parse(yesterday);
        if (date == null) {
            throw new Exception("时间格式错误");
        }
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        calendar.add(calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动
        Date nowDate = calendar.getTime();   //这个时间就是日期往后推一天的结果
        String daybefore = new SimpleDateFormat("yyyy-MM-dd").format(nowDate.getTime());
        List<QuartzJobConfig> quartzJobConfigs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(QuartzJobConfig.class));
        for (QuartzJobConfig quartzJobConfig : quartzJobConfigs) {
            WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
            BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
            Map<String, String> params = new HashMap<String, String>();
            params.put("jobConfig", wlyyJobConfigVO.getId());
            //往quartz框架添加任务
            params.put("startTime", daybefore);
            params.put("endTime", yesterday);
            for (int j = 1; j <= 2; j++) {
                params.put("timeLevel", j + "");
                if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                    quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
                }
                Thread.sleep(sleepTime*1000L);
            }
        }
    }
}

+ 5 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorWorkWeekDao.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.repository.doctor;
import com.yihu.wlyy.entity.doctor.schedule.WlyyDoctorWorkWeek;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -31,10 +32,8 @@ public interface DoctorWorkWeekDao extends PagingAndSortingRepository<WlyyDoctor
    @Query("select a from WlyyDoctorWorkWeek a where a.doctor = ?1 and a.week = ?2")
    WlyyDoctorWorkWeek findDoctorWorkWeek(String doctor,String week);
    /**
     * 删除医生的排班信息
     *
     * @param doctor
     */
    void deleteByDoctor(String doctor);
    //删除医生的排班信息
    @Modifying
    @Query("delete WlyyDoctorWorkWeek a where a.doctor = ?1")
    int deleteByDoctor(String doctor);
}

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

@ -394,14 +394,20 @@ public class FamilyContractService extends BaseService {
        json.put("expertise", d.getExpertise());
        json.put("level", d.getLevel());
        //获取健康文章
        com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray();
        try {
            jsonArray = healthEducationArticleService.getDoctorArticalByUserId(null,1,null,0,3,doctor);
        }catch (Exception e){
            logger.error("获取福州健康文章失败,"+e.getMessage());
        SignFamily sf = signFamilyDao.findByjiatingPatient(patient);
        if(sf==null||!sf.getHospital().startsWith("350211")){
            //未签约和不是集美签约的按原有接口走
        }else {
            //获取健康文章
            com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray();
            try {
                jsonArray = healthEducationArticleService.getDoctorArticalByUserId(null,1,null,0,3,doctor);
            }catch (Exception e){
                logger.error("获取福州健康文章失败,"+e.getMessage());
            }
            json.put("healthEduArticles",jsonArray);
        }
        json.put("healthEduArticles",jsonArray);
        return json;
    }

+ 14 - 19
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -65,6 +65,8 @@ public class StatisticsESService {
    SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXX");
    SimpleDateFormat dateFormat3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    DecimalFormat decimalFormat = new DecimalFormat("0.00");
    @Autowired
    private StringRedisTemplate redisTemplate;
    /**
     * 获取上次统计时间
@ -75,16 +77,7 @@ public class StatisticsESService {
        String date = DateUtil.dateToStrLong(new Date());
        try {
//            date = redisTemplate.opsForValue().get("quota:date");
//            JestClient jestClient = elasticFactory.getJestClient();
//
//            Bulk.Builder bulk = new Bulk.Builder().defaultIndex("health_edu_article_patient_test").defaultType("health_edu_article_patient_test");
//            PrescriptionDispensaryCode ap = new PrescriptionDispensaryCode();
//            ap.setCode("aaaa");
//            ap.setType(2);
//            Index index = new Index.Builder(ap).build();
//            bulk.addAction(index);
//            BulkResult br = jestClient.execute(bulk.build());
            date = redisTemplate.opsForValue().get("quota:date");
        } catch (Exception e) {
            e.printStackTrace();
        }
@ -467,23 +460,25 @@ public class StatisticsESService {
        //求签约总数
        long totalNum = paidTotal + noPayTotal;
        map2.put("code", "0");
        map2.put("amount", noPayTotal);
        map2.put("name", "未缴费人数");
        double rateG2 = (noPayTotal > 0 ? noPayTotal * 1.0000 / totalNum * 100 : 0);
        map2.put("rate", df.format(rateG2));
        map2.put("rateString", noPayTotal + "/" + totalNum);
        resultList.add(map2);
        map1.put("code", "1");
        map1.put("amount", paidTotal);
        map1.put("name", "已缴费人数");
        double rateG = (paidTotal > 0 ? paidTotal * 1.0000 / totalNum * 100 : 0);
        map1.put("rate", df.format(rateG));
        ;
        map1.put("rateString", paidTotal + "/" + totalNum);
        resultList.add(map1);
        map2.put("code", "0");
        map2.put("amount", noPayTotal);
        map2.put("name", "未缴费人数");
        double rateG2 = (noPayTotal > 0 ? noPayTotal * 1.0000 / totalNum * 100 : 0);
        map2.put("rate", df.format(rateG2));
        ;
        map2.put("rateString", noPayTotal + "/" + totalNum);
        resultList.add(map2);
        return new JSONArray(resultList);
    }

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java

@ -186,6 +186,7 @@ public class PatientDeviceController extends BaseController {
            return success("设备保存成功!");
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, ex.getMessage());
        }
    }
@ -208,6 +209,7 @@ public class PatientDeviceController extends BaseController {
            return write(200, "查询成功", "data", list);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, ex.getMessage());
        }
    }
@ -228,6 +230,7 @@ public class PatientDeviceController extends BaseController {
            mapList.put("device", device);
            return write(200, "查询成功", "data", mapList);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, ex.getMessage());
        }
    }
@ -247,6 +250,7 @@ public class PatientDeviceController extends BaseController {
            List<Map<String, String>> list = patientDeviceService.getDeviceUser(getRepUID(), deviceSn, type);
            return write(200, "获取设备绑定信息成功!", "data", list);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, ex.getMessage());
        }
    }
@ -274,6 +278,7 @@ public class PatientDeviceController extends BaseController {
                return error(-1, "不存在该设备!");
            }
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, ex.getMessage());
        }
    }

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -218,6 +218,7 @@ public class HealthEduArticleController extends BaseController {
    @RequestMapping(value = "getDoctorArticalByUserId",method = RequestMethod.GET)
    @ApiOperation("获取医生发表的文章列表")
    @ResponseBody
    public String getDoctorArticalByUserId(@ApiParam(name = "doctorCode", value = "医生code")
                                           @RequestParam(value = "doctorCode", required = true) String doctorCode,
                                           @ApiParam(name = "articleTitle", value = "文章标题")

+ 2 - 2
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -3,11 +3,11 @@ spring:
  profiles: prod
  datasource:
    wlyy:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    health:
      url: jdbc:mysql://59.61.92.90:8079/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://59.61.92.90:9069/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123