Jelajahi Sumber

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

chenyongxing 8 tahun lalu
induk
melakukan
4b3e1609b5
39 mengubah file dengan 1667 tambahan dan 122 penghapusan
  1. 6 6
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/war/ServletInitializer.java
  2. 1 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/QuartzJobConfigDao.java
  3. 178 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/AgentAppointmentFilter.java
  4. 129 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/AgentAppointmentJob.java
  5. 26 4
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java
  6. 322 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/patient/PatientReservation.java
  7. 21 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/ConsultTeam.java
  8. 77 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/Evaluate.java
  9. 57 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/EvaluateLabel.java
  10. 10 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java
  11. 8 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java
  12. 0 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java
  13. 107 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/job/consult/EvaluateScoreJob.java
  14. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDoctorDao.java
  15. 36 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/EvaluateDao.java
  16. 28 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/EvaluateLabelDao.java
  17. 17 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  18. 54 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/EvaluateLabelService.java
  19. 130 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/EvaluateService.java
  20. 8 4
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleDoctorService.java
  21. 3 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticlePatientService.java
  22. 3 2
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java
  23. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  24. 17 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java
  25. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java
  26. 6 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  27. 78 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ClazzReflect.java
  28. 21 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java
  29. 26 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java
  30. 82 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorEvaluateController.java
  31. 5 2
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java
  32. 84 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/EvaluateController.java
  33. 2 2
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  34. 18 25
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java
  35. 6 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java
  36. 60 41
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java
  37. 28 28
      patient-co-wlyy/src/main/resources/application.properties
  38. 4 2
      patient-co-wlyy/src/main/resources/system.properties
  39. 1 1
      patient-co-wlyy/src/main/resources/weixin_menu.txt

+ 6 - 6
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/war/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);
//    }
//}

+ 1 - 1
patient-co-statistics/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.id in (1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,20,21,22,23,24,25,26)  and a.del='1' ")
    @Query(" FROM QuartzJobConfig a WHERE a.id in (1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,20,21,22,23,24,25,26,27)  and a.del='1' ")
    List<QuartzJobConfig> findByIds();
    @Query(" FROM QuartzJobConfig a WHERE a.id=?1 and a.del='1'")

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

@ -0,0 +1,178 @@
package com.yihu.wlyy.statistics.etl.dataFilter;
import com.yihu.wlyy.statistics.dao.DoctorAdminTeamDao;
import com.yihu.wlyy.statistics.dao.HospitalDao;
import com.yihu.wlyy.statistics.dao.SignFamilyDao;
import com.yihu.wlyy.statistics.dao.TownDao;
import com.yihu.wlyy.statistics.etl.model.ETLModel;
import com.yihu.wlyy.statistics.etl.model.ErrorModel;
import com.yihu.wlyy.statistics.etl.model.FilterModel;
import com.yihu.wlyy.statistics.etl.model.LogModel;
import com.yihu.wlyy.statistics.job.business.Constant;
import com.yihu.wlyy.statistics.model.hosptial.Hospital;
import com.yihu.wlyy.statistics.model.patient.PatientHealthGuidance;
import com.yihu.wlyy.statistics.model.patient.PatientReservation;
import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
import com.yihu.wlyy.statistics.model.system.Town;
import com.yihu.wlyy.statistics.model.team.AdminTeam;
import com.yihu.wlyy.statistics.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.*;
/**
 * Created by Trick on 2017/5/9.
 */
@Component
@Scope("prototype")
public class AgentAppointmentFilter {
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private TownDao townDao;
    @Autowired
    private DoctorAdminTeamDao doctorAdminTeamDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    List<ErrorModel> errorModels=new ArrayList<ErrorModel>();//错误信息
    public FilterModel filter(List<PatientReservation> patientReservations, String sql, String filterDate){
        //查找出系统全部的全科医生
        List<AdminTeam> adminTeams=doctorAdminTeamDao.findAllTeam();
        Map<String, AdminTeam> adminTeamMap = new HashMap<String, AdminTeam>();
        for (AdminTeam adminTeam : adminTeams) {
            adminTeamMap.put(adminTeam.getId()+"", adminTeam);
        }
        //查找出系统全部的机构
        List<Hospital> hospitals = hospitalDao.findHospital2();
        Map<String, Hospital> hospitalsMap = new HashMap<String, Hospital>();
        for (Hospital hospital : hospitals) {
            hospitalsMap.put(hospital.getCode(), hospital);
        }
        //查找出厦门市全部的区
        List<Town> towns = townDao.findByCityCode(Constant.city);
        Map<String, Town> townsMap = new HashMap<String, Town>();
        for (Town town : towns) {
            townsMap.put(town.getCode(), town);
        }
        Long cityCount = new Long(0L); //统计到市的数目
        Long townCount = new Long(0L); //统计到所有区的数目
        Long orgCount =new Long(0L);//统计到所有机构的数目
        Long adminCount = new Long(0L);//统计到所有团队的数目
        Long errorCount=new Long(0L);//脏数据
        Boolean isAll=true;//是否统计失败
        //统计有已改簽的
        List<ETLModel> etlModels=new ArrayList<ETLModel>();
        LogModel logModel=new LogModel();
        errorModels=new ArrayList<ErrorModel>();
        //数据过滤清洗出脏数据  -----------start
        for(PatientReservation patientReservation:patientReservations){
            ETLModel etlModel=new ETLModel();
            String patient=patientReservation.getPatient();
            SignFamily signFamily= signFamilyDao.findByPatientAndType(patient,2);//只统计家庭签约
            if(signFamily == null) {
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_sign_noExist));
                isAll=false;
                continue;
            }
            String adminId=signFamily.getAdminTeamCode()+"";//得到团队ID
            if(StringUtils.isEmpty(adminId)){
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_adminTeam_null));
                isAll=false;
                continue;
            }
            AdminTeam adminTeam = adminTeamMap.get(adminId);
            if(adminTeam==null){
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_adminTeam_noExist));
                isAll=false;
                continue;
            }
            String orgCode=signFamily.getHospital();//得到机构id
            if(StringUtils.isEmpty(orgCode)){
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_hospital_null));
                isAll=false;
                continue;
            }
            if(orgCode.length()!=10) {
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_hospital_isTest));
                isAll=false;
                errorCount++;
                continue;
            }
            String orgCodeTemp="";
            //统计机构 -----------------start---------------------
            if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
                //统计站
                orgCodeTemp=orgCode.substring(0,orgCode.length()-2)+"00";
            }else{
                //统计社区
                orgCodeTemp=orgCode;
            }
            Hospital hospital=hospitalsMap.get(orgCodeTemp);
            if(hospital == null) {
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_hospital_noExist));
                isAll=false;
                continue;
            }
            String town =hospital.getTown();
            if(StringUtils.isEmpty(town)) {
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_town_null));
                isAll=false;
                errorCount++;
                continue;
            }
            Town townObj =townsMap.get(town);
            if(townObj==null) {
                errorModels.add(ErrorModel.newEM(patientReservation.getId().toString(),ErrorModel.healthGuidance_town_noExist));
                isAll=false;
                errorCount++;
                continue;
            }
            etlModel.setAdminTeam(adminTeam.getId()+"");
            etlModel.setHospital(orgCodeTemp);
            etlModel.setTown(hospital.getTown());
            etlModel.setCity(Constant.city);
            etlModel.setIdcard(signFamily.getIdcard());
            etlModels.add(etlModel);
            //统计数目+1
            cityCount++;
            townCount++;
            orgCount++;
            adminCount++;
        }
        logModel.setDate(filterDate);
        logModel.setEndTime(new Date());
        logModel.setExcuteSql(sql);
        logModel.setSuccess(isAll);
        logModel.setAllNum(patientReservations.size());
        logModel.setSuccessNum(adminCount.intValue());
        logModel.setModelList(errorModels);
        logModel.setErrorNum(errorCount.intValue());
        //String message=saveContent(patientHealthGuidances.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount,sql,filterDate);
        return FilterModel.getFiltrerMode(logModel,etlModels,isAll);
    }
    private String saveContent(Integer size, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent,Long errorCount,String sql,String filterDate) {
        if(StringUtils.isEmpty(filterDate)){
            filterDate= DateUtil.dateToStrLong(new Date());
        }
        StringBuffer string=new StringBuffer("统计"+filterDate+" 的数据完成 ,数据库查询到数目:"+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();
    }
}

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

@ -0,0 +1,129 @@
package com.yihu.wlyy.statistics.job.business;
import com.yihu.wlyy.statistics.dao.QuartzJobLogDao;
import com.yihu.wlyy.statistics.etl.dataFilter.AgentAppointmentFilter;
import com.yihu.wlyy.statistics.etl.dataFilter.HealthGuideDataFilter;
import com.yihu.wlyy.statistics.etl.extract.DBExtract;
import com.yihu.wlyy.statistics.etl.model.ETLModel;
import com.yihu.wlyy.statistics.etl.model.FilterModel;
import com.yihu.wlyy.statistics.etl.role.Level1Role;
import com.yihu.wlyy.statistics.etl.storage.DBStorage;
import com.yihu.wlyy.statistics.model.job.QuartzJobLog;
import com.yihu.wlyy.statistics.model.patient.PatientHealthGuidance;
import com.yihu.wlyy.statistics.model.patient.PatientReservation;
import com.yihu.wlyy.statistics.util.JsonUtil;
import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
import org.quartz.*;
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.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 预约统计指标执行类
 */
@Component
@Scope("prototype")
@DisallowConcurrentExecution//防止到了执行时间点前一任务还在执行中,但是这时有空闲的线程,那么马上又会执行,这样一来就会存在同一job被并行执行
public class AgentAppointmentJob implements Job {
    private WlyyQuotaVO wlyyQuota;//指标对象
    private WlyyJobConfigVO wlyyJobConfig;//配置对象
    @Autowired
    private QuartzJobLogDao quartzJobLogDao;//执行日志Dao
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private Level1Role levelRole;
    @Autowired
    private DBStorage dbStorage;
    @Autowired
    private DBExtract dbExtract;
    @Autowired
    private HealthGuideDataFilter healthGuideDataFilter;
    @Autowired
    private AgentAppointmentFilter agentAppointmentFilter;
    String yesterday;
    String daybefore;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try{
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            //初始化参数
            JobDataMap map = context.getJobDetail().getJobDataMap();
            wlyyQuota = (WlyyQuotaVO) map.get("quota");
            wlyyJobConfig = (WlyyJobConfigVO) map.get("jobConfig");
            daybefore= StringUtils.isEmpty(map.get("daybefore"))?SignJob.getDayString(-2):map.get("daybefore").toString();
            yesterday= StringUtils.isEmpty(map.get("yesterday"))?SignJob.getDayString(-1):map.get("yesterday").toString();
            //计算指标
            computequota();
        }catch (Exception e){
            //如果出錯立即重新執行
            JobExecutionException e2 =new JobExecutionException(e);
            e2.setRefireImmediately(true);
        }
    }
    @Transactional
    private void computequota() {
        try {
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='" + yesterday + "' and quato_code='" + 27 + "'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();
            quartzJobLog.setJobStartTime(new Date());
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            //找出今天的健康指导信息
            String sql="select w.id,w.patient from  wlyy_patient_reservation w,wlyy_doctor d where w.doctor = d.code and  w.doctor is not null and w.dname is not null and w.czrq>='"+daybefore+ Constant.quota_date_last+"' and w.czrq< '"+yesterday+ Constant.quota_date_last+"'";
            //抽取數據
            List<PatientReservation> patientReservations = dbExtract.extract(PatientReservation.class,sql);
            //過濾數據
            FilterModel etlModels= agentAppointmentFilter.filter(patientReservations,sql,yesterday);
            //统计数据
            List<Map<String, List<ETLModel>>>  returnDatas= levelRole.elt(etlModels.getEtlModelList());
            //保存数据
            dbStorage.saveByLevel1(returnDatas,yesterday,wlyyQuota);
            //保存日志
            quartzJobLog.setJobEndTime(new Date());
            quartzJobLog.setJobContent(JsonUtil.objToStr(etlModels.getLogModel()));
            quartzJobLog.setJobType(etlModels.getError()?"1":"0");
            quartzJobLogDao.save(quartzJobLog);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    private String saveContent(List<PatientHealthGuidance> patientHealthGuidances, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent, Long errorCount,String sql) {
        StringBuffer string=new StringBuffer("统计"+yesterday+" 的健康指导数据完成 ,数据库查询到健康指导数目:"+patientHealthGuidances.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();
    }
    public String getYesterday() {
        return yesterday;
    }
}

+ 26 - 4
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -1,10 +1,7 @@
package com.yihu.wlyy.statistics.job.business;
import com.yihu.wlyy.statistics.dao.*;
import com.yihu.wlyy.statistics.etl.dataFilter.ConsultDataFilter;
import com.yihu.wlyy.statistics.etl.dataFilter.FollowUpDataFilter;
import com.yihu.wlyy.statistics.etl.dataFilter.HealthGuideDataFilter;
import com.yihu.wlyy.statistics.etl.dataFilter.SignDataFilter;
import com.yihu.wlyy.statistics.etl.dataFilter.*;
import com.yihu.wlyy.statistics.etl.extract.DBExtract;
import com.yihu.wlyy.statistics.etl.model.ETLModel;
import com.yihu.wlyy.statistics.etl.model.FilterModel;
@ -18,6 +15,7 @@ import com.yihu.wlyy.statistics.model.job.QuartzJobLog;
import com.yihu.wlyy.statistics.model.label.SignPatientLabelInfo;
import com.yihu.wlyy.statistics.model.patient.Patient;
import com.yihu.wlyy.statistics.model.patient.PatientHealthGuidance;
import com.yihu.wlyy.statistics.model.patient.PatientReservation;
import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
import com.yihu.wlyy.statistics.model.system.Town;
import com.yihu.wlyy.statistics.model.team.AdminTeam;
@ -70,6 +68,8 @@ public class CurrentDayAllQuotaJob implements Job {
    @Autowired
    private HealthGuideDataFilter healthGuideDataFilter;
    @Autowired
    private AgentAppointmentFilter agentAppointmentFilter;
    @Autowired
    private FollowUpDataFilter followUpDataFilter;
    @Autowired
    private JdbcTemplate jdbcTemplate;
@ -181,6 +181,7 @@ public class CurrentDayAllQuotaJob implements Job {
        computequota_24();//及时回复的咨询量时间分布
        computequota_25();//统计质询量总数
        computequota_26();//统计未缴费签约总数
        computequota_27();//统计代预约量
        quartzJobLog.setJobContent(allContent.toString());
        quartzJobLog.setJobName("实时统计");
@ -943,6 +944,27 @@ public class CurrentDayAllQuotaJob implements Job {
        allContent.append("-----------26----------");
    }
    private void computequota_27() {
        String quotaId="27";
        String sql="select w.id,w.patient from  wlyy_patient_reservation w,wlyy_doctor d where w.doctor = d.code and  w.doctor is not null and w.dname is not null and w.czrq< '"+tomorrow+"' and w.czrq>= '"+now+"'";
        try{
            //抽取數據
            List<PatientReservation> patientReservations = SpringUtil.getBean(DBExtract.class).extract(PatientReservation.class,sql);
            //過濾數據
            FilterModel etlModels= agentAppointmentFilter.filter(patientReservations,sql,null);
            //统计数据
            List<Map<String, List<ETLModel>>>  returnDatas= SpringUtil.getBean(Level1Role.class).elt(etlModels.getEtlModelList());
            //保存数据
            SpringUtil.getBean(RedisStorage.class).saveByLevel1(returnDatas,null,quotaId);
            allContent.append(JsonUtil.objToStr(etlModels.getLogModel()));
        }catch (Exception e){
            e.printStackTrace();
            allContent.append("统计失败:"+e.getMessage());
        }
        allContent.append("-----------27----------");
    }
    public static String getDayString(Integer size) {
        Date date = new Date();//取时间

+ 322 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/patient/PatientReservation.java

@ -0,0 +1,322 @@
package com.yihu.wlyy.statistics.model.patient;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.statistics.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 预约挂号记录表
 * @author George
 *
 */
@Entity
@Table(name = "wlyy_patient_reservation")
public class PatientReservation extends IdEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8452660447546825044L;
	// 预约号/预约流水号
	private String code;
	// 医生标识(医生帮患者预约时才会有值)
	private String doctor;
	// 医生姓名(医生帮患者预约时才会有值)
	private String dname;
	// 患者标识
	private String patient;
	// 患者身份证
	private String idcard;
	// 患者姓名
	private String name;
	// 患者手机号
	private String phone;
	// 患者社保卡号
	private String ssc;
	// 预约时间段:AM (上午)或者PM (下午)
	private String sectionType;
	// 一次预约段的开始时间
	private Date startTime;
	// 一次预约段的结束时间
	private Date endTime;
	// 医生所在医疗机构编码
	private String orgCode;
	// 医疗机构名称
	private String orgName;
	// 科室编码
	private String deptCode;
	// 科室名称
	private String deptName;
	// 专家ID/编码
	private String doctorCode;
	// 专家姓名
	private String doctorName;
	// 专家头像
	private String doctorPhoto;
	// 专家职称
	private String doctorJob;
	// 状态:1预约成功,0预约取消
	private Integer status;
	//取消预约者(状态为预约取消时才有值)
	private String canceler;
	//取消预约者姓名(状态为预约取消时才有值)
	private String cancelerName;
	//取消预约者角色(状态为预约取消时才有值)1专科医生,2全科医生,3健康管理师,4临时专科 5.患者 (与医生服务团队角色一直)
	private Integer cancelerType;
	//取消时间(状态为预约取消时才有值)
	private String cancelerTime;
	// 预约时间
	private Date czrq;
	// 0 健康之路 1智业
	private String type;
	// 签约类型 1三师 2家庭
	private Integer signType;
	// 行政团队
	private Long adminTeamCode;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getDoctor() {
		return doctor;
	}
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	public String getDname() {
		return dname;
	}
	public void setDname(String dname) {
		this.dname = dname;
	}
	public String getPatient() {
		return patient;
	}
	public void setPatient(String patient) {
		this.patient = patient;
	}
	public String getIdcard() {
		return idcard;
	}
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getSsc() {
		return ssc;
	}
	public void setSsc(String ssc) {
		this.ssc = ssc;
	}
	@Column(name = "section_type")
	public String getSectionType() {
		return sectionType;
	}
	public void setSectionType(String sectionType) {
		this.sectionType = sectionType;
	}
	@Column(name = "start_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@Column(name = "end_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	@Column(name = "org_code")
	public String getOrgCode() {
		return orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "org_name")
	public String getOrgName() {
		return orgName;
	}
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	@Column(name = "dept_code")
	public String getDeptCode() {
		return deptCode;
	}
	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}
	@Column(name = "dept_name")
	public String getDeptName() {
		return deptName;
	}
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	@Column(name = "doctor_code")
	public String getDoctorCode() {
		return doctorCode;
	}
	public void setDoctorCode(String doctorCode) {
		this.doctorCode = doctorCode;
	}
	@Column(name = "doctor_name")
	public String getDoctorName() {
		return doctorName;
	}
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	@Column(name = "doctor_photo")
	public String getDoctorPhoto() {
		return doctorPhoto;
	}
	public void setDoctorPhoto(String doctorPhoto) {
		this.doctorPhoto = doctorPhoto;
	}
	@Column(name = "doctor_job")
	public String getDoctorJob() {
		return doctorJob;
	}
	public void setDoctorJob(String doctorJob) {
		this.doctorJob = doctorJob;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getCanceler() {
		return canceler;
	}
	public void setCanceler(String canceler) {
		this.canceler = canceler;
	}
	@Column(name = "canceler_name")
	public String getCancelerName() {
		return cancelerName;
	}
	public void setCancelerName(String cancelerName) {
		this.cancelerName = cancelerName;
	}
	@Column(name = "canceler_type")
	public Integer getCancelerType() {
		return cancelerType;
	}
	public void setCancelerType(Integer cancelerType) {
		this.cancelerType = cancelerType;
	}
	@Column(name = "canceler_time")
	public String getCancelerTime() {
		return cancelerTime;
	}
	public void setCancelerTime(String cancelerTime) {
		this.cancelerTime = cancelerTime;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCzrq() {
		return czrq;
	}
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Integer getSignType() {
		return signType;
	}
	public void setSignType(Integer signType) {
		this.signType = signType;
	}
	public Long getAdminTeamCode() {
		return adminTeamCode;
	}
	public void setAdminTeamCode(Long adminTeamCode) {
		this.adminTeamCode = adminTeamCode;
	}
}

+ 21 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/ConsultTeam.java

@ -9,6 +9,7 @@ import javax.persistence.Transient;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import io.swagger.models.auth.In;
/**
 * 三师咨询
@ -53,6 +54,26 @@ public class ConsultTeam extends IdEntity {
	private Integer endType;
	// 结束时间
	private Date endTime;
	//是否评价 1、已评价 0、未评价'
	private Integer evaluate;
	//评价时间
	private Date evaluateTime;
	public Integer getEvaluate() {
		return evaluate;
	}
	public void setEvaluate(Integer evaluate) {
		this.evaluate = evaluate;
	}
	public Date getEvaluateTime() {
		return evaluateTime;
	}
	public void setEvaluateTime(Date evaluateTime) {
		this.evaluateTime = evaluateTime;
	}
	@Column(name = "admin_team_code")
	public Long getAdminTeamId() {

+ 77 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/Evaluate.java

@ -0,0 +1,77 @@
package com.yihu.wlyy.entity.consult;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by 卓 on 2017/5/10.
 */
@Entity
@Table(name = "wlyy_evaluate")
public class Evaluate extends IdEntity {
    private static final long serialVersionUID = -161924234234189L;
    private String doctor;//被评价的医生
    private String patient;//评价人
    private String consult;//咨询
    private Integer score;//分数
    private Integer type;//1、实名,2、匿名
    private Integer evaluateType;//评价种类0、实名评价, 1、专业能力,2、服务态度,3、回复速度
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getConsult() {
        return consult;
    }
    public void setConsult(String consult) {
        this.consult = consult;
    }
    public Integer getScore() {
        return score;
    }
    public void setScore(Integer score) {
        this.score = score;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getEvaluateType() {
        return evaluateType;
    }
    public void setEvaluateType(Integer evaluateType) {
        this.evaluateType = evaluateType;
    }
}

+ 57 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/EvaluateLabel.java

@ -0,0 +1,57 @@
package com.yihu.wlyy.entity.consult;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by 卓 on 2017/5/10.
 */
@Entity
@Table(name = "wlyy_evaluate_label")
public class EvaluateLabel extends IdEntity {
    private static final long serialVersionUID = -161943424234234189L;
    private String doctor; //被评价的医生
    private String patient; //被评价的患者
    private String consult; //咨询code
    private String content;//标签内容
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getConsult() {
        return consult;
    }
    public void setConsult(String consult) {
        this.consult = consult;
    }
}

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

@ -64,6 +64,16 @@ public class Doctor extends IdEntity {
    private String isPasswordPrompt;// 是否提示密码信息 1是 0或者空是否
    private String isHelp;//是否求助  1已经求助 0未求助
    private Double evaluateScore;//评分
    public Double getEvaluateScore() {
        return evaluateScore;
    }
    public void setEvaluateScore(Double evaluateScore) {
        this.evaluateScore = evaluateScore;
    }
    public Doctor() {
    }

+ 8 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.event;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.util.SystemConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
@ -30,6 +31,13 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            } else {
                System.out.println("sign end job exist");
            }
            if (!quartzHelper.isExistJob("evaluate_score_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("evaluate_score_job");
                quartzHelper.addJob(EvaluateScoreJob.class, trigger, "evaluate_score_job", new HashMap<String, Object>());
                System.out.println("evaluate_score_job start success");
            } else {
                System.out.println("evaluate_score_job exist");
            }
        } catch (Exception e) {
            System.out.println("sign end job start failed");
        }

+ 0 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java

@ -27,7 +27,6 @@ public class DoctorInterceptor extends BaseInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        boolean flag = true;
        if(flag)return true;
        try {
            request.setCharacterEncoding("UTF-8");
            request.setAttribute("log-start", new Date().getTime());

+ 107 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/consult/EvaluateScoreJob.java

@ -0,0 +1,107 @@
package com.yihu.wlyy.job.consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.ConsultTeamDoctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.service.quota.JobService;
import com.yihu.wlyy.util.DateUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.math.BigDecimal;
import java.util.*;
import static com.yihu.wlyy.job.consult.ConsultCleanerJob.ConsultTerminatorJobKey;
/**
 * @author Sand
 * @since 2016/9/26
 */
@Service
public class EvaluateScoreJob implements Job{
    @Autowired
    ConsultTeamDoctorDao consultTeamDoctorDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    DoctorDao doctorDao;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            System.out.println("calculate evaluate job start");
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            //获取有被评价过的医生列表
            String doctorsSql = "select w.doctor from wlyy_evaluate w group by w.doctor";
            String sql = "select w.evaluate_type,sum(w.score) as score from wlyy_evaluate w where w.doctor =? GROUP BY w.evaluate_type,w.doctor";
            String evaluateTimesSql = "select count(1) as count from wlyy_evaluate w where w.doctor =? GROUP BY w.consult,w.doctor";
            List<Map<String, Object>> doctorList = jdbcTemplate.queryForList(doctorsSql);
            for (Map<String, Object> doctorMap : doctorList) {
                //获取医生的所有评价信息
                String doctor =  doctorMap.get("doctor").toString();
                List<Map<String, Object>> evaluateList = jdbcTemplate.queryForList(sql, new Object[]{doctor});
                BigDecimal score = BigDecimal.ZERO;//总分
                BigDecimal anonymousScore = BigDecimal.ZERO;//匿名评价分
                BigDecimal realScore = BigDecimal.ZERO;//实名评价分
                BigDecimal jiaquan = BigDecimal.ZERO;//加权平均分
                for (Map<String, Object> evaluate : evaluateList) {
                    BigDecimal scoreTemp = new BigDecimal(evaluate.get("score").toString());
                    switch (evaluate.get("evaluate_type").toString()) {
                        case "0":
                            realScore = realScore.add(scoreTemp.multiply(new BigDecimal("0.3")));
                            break;
                        case "1":
                            anonymousScore=  anonymousScore.add(scoreTemp.multiply(new BigDecimal("0.2")));
                            break;
                        case "2":
                            anonymousScore=  anonymousScore.add(scoreTemp.multiply(new BigDecimal("0.25")));
                            break;
                        case "3":
                            anonymousScore=  anonymousScore.add(scoreTemp.multiply(new BigDecimal("0.25")));
                            break;
                    }
                }
                //获取有效评价次数
                List<Map<String, Object>> evaluateTimesList = jdbcTemplate.queryForList(evaluateTimesSql, new Object[]{doctor});
                int evaTimes = Integer.parseInt(evaluateTimesList.get(0).get("count").toString());
                if(evaTimes>0){
                    evaTimes = evaluateTimesList.size();
                }
                int consultTimes = consultTeamDoctorDao.countByDoctorAndType(2, doctor);
                jiaquan = (anonymousScore.add(realScore)).divide(BigDecimal.valueOf(evaTimes),2,BigDecimal.ROUND_HALF_UP);
                if (consultTimes <= 100) {  //咨询系数 咨询次数≤100次,对应系数为3;
                    //100次<咨询次数≤1000次,对应系数为2;
                    //咨询次数>1000次,对应系数为1。
                    jiaquan = (jiaquan.subtract(BigDecimal.valueOf(80L))).divide(BigDecimal.valueOf(3L),2,BigDecimal.ROUND_HALF_UP);
                } else if (consultTimes > 100 && consultTimes <= 1000) {
                    jiaquan = (jiaquan.subtract(BigDecimal.valueOf(80L))).divide(BigDecimal.valueOf(2L),2,BigDecimal.ROUND_HALF_UP);
                } else {
                    jiaquan = (jiaquan.subtract(BigDecimal.valueOf(80L))).divide(BigDecimal.valueOf(1L),2,BigDecimal.ROUND_HALF_UP);
                }
                score = jiaquan.add(BigDecimal.valueOf(80L)).setScale(1, BigDecimal.ROUND_HALF_UP);
                //计算完毕
                Doctor d  =  doctorDao.findByCode(doctor);
                d.setEvaluateScore(score.doubleValue());
                doctorDao.save(d);
            }
            System.out.println("calculate evaluate job end");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("calculate evaluate job failed");
        }
    }
}

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

@ -12,6 +12,9 @@ public interface ConsultTeamDoctorDao extends PagingAndSortingRepository<Consult
	@Query("select count(1) from ConsultTeamDoctor a where a.consult = ?1 and a.to = ?2")
	int isExist(String consult, String doctor);
	@Query("select count(1) from ConsultTeamDoctor a,ConsultTeam t where t.consult = a.consult and t.type = ?1 and a.to = ?2")
	int countByDoctorAndType(int type,String doctor);
	// 更新为有回复
	@Modifying
	@Query("update ConsultTeamDoctor a set a.reply = 1 where a.consult = ?1 and a.to = ?2")

+ 36 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/EvaluateDao.java

@ -0,0 +1,36 @@
package com.yihu.wlyy.repository.consult;
import com.yihu.wlyy.entity.consult.Evaluate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by 卓 on 2017/5/10.
 */
public interface EvaluateDao extends PagingAndSortingRepository<Evaluate, Long>, JpaSpecificationExecutor<Evaluate> {
    /**
     * 获取某个咨询的评分
     * @param consult
     * @return
     */
    List<Evaluate> findByConsult(String consult);
    /**
     * 根据咨询获取实名或者匿名评分
     * @param consult
     * @return
     */
    List<Evaluate> findByConsultAndType(String consult,int type);
    /**
     * 根据医生获取实名或者匿名评分
     * @param doctor
     * @return
     */
    List<Evaluate> findByDoctorAndType(String doctor,int type);
}

+ 28 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/EvaluateLabelDao.java

@ -0,0 +1,28 @@
package com.yihu.wlyy.repository.consult;
import com.yihu.wlyy.entity.consult.EvaluateLabel;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by 卓 on 2017/5/10.
 */
public interface EvaluateLabelDao extends PagingAndSortingRepository<EvaluateLabel, Long>, JpaSpecificationExecutor<EvaluateLabel> {
    /**
     * 获取某个咨询的标签
     * @param consult
     * @return
     */
    List<EvaluateLabel> findByConsult(String consult);
    /**
     * 获取某个医生的标签
     * @param doctor
     * @return
     */
    List<EvaluateLabel> findByDoctor(String doctor);
}

+ 17 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -26,6 +26,7 @@ import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
@ -46,6 +47,7 @@ import org.springside.modules.persistence.SearchFilter;
import org.springside.modules.persistence.SearchFilter.Operator;
import org.springside.modules.utils.Clock;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -84,6 +86,9 @@ public class ConsultTeamService extends ConsultService {
    @Autowired
    private com.yihu.wlyy.service.common.account.DoctorService doctorService;
    @Autowired
    WeiXinAccessTokenUtils accessTokenUtils;
    /**
     * 查询患者是否还有未结束的三师咨询
     *
@ -758,6 +763,7 @@ public class ConsultTeamService extends ConsultService {
            if (patient.equals(key)) {
                continue;
            }
            //记录咨询的医生详情误删
            ConsultTeamDoctor cd = new ConsultTeamDoctor();
            cd.setConsult(consult.getCode());
            cd.setDel("1");
@ -1623,6 +1629,17 @@ public class ConsultTeamService extends ConsultService {
                endId = d.getCode();
                endName = d.getName();
            }
            if(consultTeam.getType()==2){
                Patient p = patientDao.findByCode(consultTeam.getPatient());
                String name = p.getName();
                String openId = p.getOpenid();
                JSONObject json = new JSONObject();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                json.put("keyword1", sdf.format(new Date()));
                json.put("toUser", p.getCode());
                json.put("first", name +",您好!您有1条咨询已结束,请及时对咨询医生进行满意度评价。待办事项:满意度评价");
                PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 10, openId, p.getName(), json);
            }
        }
        JSONObject obj = ImUtill.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
        if (obj == null) {

+ 54 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/EvaluateLabelService.java

@ -0,0 +1,54 @@
package com.yihu.wlyy.service.app.consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.Evaluate;
import com.yihu.wlyy.entity.consult.EvaluateLabel;
import com.yihu.wlyy.repository.consult.EvaluateLabelDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.ClazzReflect;
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.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Component
@Transactional
public class EvaluateLabelService extends BaseService {
	@Autowired
	EvaluateLabelDao evaluateLabelDao;
	@Autowired
	JdbcTemplate jdbcTemplate;
	public void save(List<EvaluateLabel> evaluateLabels){
		evaluateLabelDao.save(evaluateLabels);
	}
	public List<EvaluateLabel> findByDoctor(String doctor){
		return	this.evaluateLabelDao.findByDoctor(doctor);
	}
	public List<EvaluateLabel> findByConsult(String consult){
		return this.evaluateLabelDao.findByConsult(consult);
	}
	public 	List<Map<String, Object>> findDistinctLabelByLaDoctor(String doctor){
		String sql ="select content,count(content) as amount from wlyy_evaluate_label where doctor =? group by content";
		List<Object> params = new ArrayList<Object>();
		params.add(doctor);
		List<Map<String, Object>> result = this.jdbcTemplate.queryForList(sql,params.toArray());
		return  result;
	}
}

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

@ -0,0 +1,130 @@
package com.yihu.wlyy.service.app.consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.Evaluate;
import com.yihu.wlyy.entity.consult.EvaluateLabel;
import com.yihu.wlyy.repository.consult.EvaluateDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.ClazzReflect;
import com.yihu.wlyy.util.ImUtill;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Component
@Transactional
public class EvaluateService extends BaseService {
	@Autowired
	EvaluateDao evaluateDao;
	@Autowired
	ConsultTeamService consultTeamService;
	@Autowired
	EvaluateLabelService evaluateLabelService;
	public void save(List<Evaluate> evaluates){
		evaluateDao.save(evaluates);
	}
	public void saveByJson(String jsonData,String patient){
		JSONObject jsonObject = new JSONObject(jsonData);
		String consult = jsonObject.getString("consult");
		ConsultTeam consultTeam  = consultTeamService.findByCode(consult);
		if(consultTeam.getEvaluate()==1){
			throw new RuntimeException("已经评价不允许重复评价!");
		}
		JSONArray evaluateArray = jsonObject.getJSONArray("evaluate");
		JSONArray labelArray = jsonObject.getJSONArray("label");
		List<Evaluate> evaluateList = new ArrayList<>();
		List<EvaluateLabel> evaluateLabelList = new ArrayList<>();
		for(Object evaluateObj: evaluateArray){
			Evaluate evaluate = new Evaluate();
			JSONObject obj =(JSONObject) evaluateObj;
			ClazzReflect clazzReflect = new ClazzReflect();
			evaluate = (Evaluate)clazzReflect.formatToClazz(evaluate,obj);
			evaluate.setConsult(consult);
			evaluate.setPatient(patient);
			evaluateList.add(evaluate);
		}
		for(Object labelObj: labelArray){
			EvaluateLabel evaluateLabel = new EvaluateLabel();
			JSONObject obj =(JSONObject) labelObj;
			ClazzReflect clazzReflect = new ClazzReflect();
			evaluateLabel = (EvaluateLabel)clazzReflect.formatToClazz(evaluateLabel,obj);
			evaluateLabel.setConsult(consult);
			evaluateLabel.setPatient(patient);
			evaluateLabelList.add(evaluateLabel);
		}
		this.save(evaluateList);
		evaluateLabelService.save(evaluateLabelList);
		consultTeam.setEvaluate(1);
		consultTeam.setEvaluateTime(new Date());
		JSONObject topicObject = new JSONObject();
		topicObject.put("evaluate",1);
		topicObject.put("evaluate_time",new Date());
		ImUtill.updateTopics(consult,topicObject.toString());
		this.consultTeamService.save(consultTeam);
	}
	/**
	 * 查询某个咨询某种类型的评价
	 * @param consult
	 * @param type
	 * @return
	 */
	public List<Evaluate> getEvaluateByConsultAndType(String consult,int type){
		List<Evaluate> evaluates = evaluateDao.findByConsultAndType(consult,type);
		return 	evaluates;
	}
	/**
	 * 查询某个咨询的评价
	 * @param consult
	 * @return
	 */
	public List<Evaluate> getEvaluateByConsult(String consult){
		List<Evaluate> evaluates = evaluateDao.findByConsult(consult);
		return 	evaluates;
	}
	/**
	 * 获取某个医生的某种类型的评价
	 * @param doctor
	 * @param type
	 * @return
	 */
	public List<Evaluate> getEvaluateByDoctorAndType(String doctor,int type){
		List<Evaluate> evaluates = evaluateDao.findByDoctorAndType(doctor,type);
		return 	evaluates;
	}
	//public static void main(String args[]){
	//	JSONObject object = new JSONObject();
	//	JSONArray evaluateArray = new JSONArray();
	//	JSONArray labelArray = new JSONArray();
	//	JSONObject evaluateObject = new JSONObject();
	//	evaluateObject.put("doctor","要评价的医生code");
	//	evaluateObject.put("evaluateType","评价种类0、实名评价, 1、专业能力,2、服务态度,3、回复速度");
	//	evaluateObject.put("type","1、实名,2、匿名");
	//	evaluateObject.put("score","得分多少");
	//	evaluateArray.put(evaluateObject);
	//	JSONObject labelObject = new JSONObject();
	//	labelObject.put("doctor","要贴标签的医生code");
	//	labelObject.put("content","标签内容");
	//	labelArray.put(labelObject);
	//	object.put("consult","咨询的code");
	//	object.put("evaluate",evaluateArray);
	//	object.put("label",labelArray);
	//	System.out.print(object.toString());
	//}
}

+ 8 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleDoctorService.java

@ -92,16 +92,17 @@ public class HealthEduArticleDoctorService extends BaseService {
	 * @param pagesize 分页大小
	 * @return
	 */
	public List<Map<String, Object>> list(int page, int pagesize,String filter,String doctor,String patient) {
	public List<Map<String, Object>> list(int page, int pagesize,String filter,String doctor,String patient,Integer wheaType) {
		if (pagesize <= 0) {
			pagesize = 10;
		}
		if(page<0){
			page = 0;
		if(page<=0){
			page = 1;
		}
		page = page-1;
		List<Object> params = new ArrayList<Object>();
		StringBuffer sql = new StringBuffer();
		sql.append("select a.id,a.article,a.doctor,a.title,a.url,a.czrq,b.summary content,b.keyword");
		sql.append("select a.id,a.article,a.doctor,a.title,a.url,a.czrq,b.summary content,b.keyword,b.whea_type");
		sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.article and c.status = 1) as readAmount");
		sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.article and c.status = 2) as collectionAmount");
		sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.article and c.status = 3) as repeatAmount");
@ -112,6 +113,9 @@ public class HealthEduArticleDoctorService extends BaseService {
		}
		sql.append(" from wlyy_health_edu_article_doctor a left join wlyy_health_edu_article b on a.article = b.code ");//内联取文章内容
		String where = " where a.doctor = ?";
		if(wheaType>-1){
			where += " and  whea_type ="+wheaType;
		}
		params.add(doctor);
		if(StringUtils.isNotBlank(filter)){
			//记录搜索记录

+ 3 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticlePatientService.java

@ -161,7 +161,7 @@ public class HealthEduArticlePatientService extends BaseService {
        " a.article = b.code"+
        " and a.patient = p.code"+
        " and a.doctor =? "+
        " group BY a.batch_no,a.article,a.attached_content,b.summary,a.doctor limit ?,?";
        " group BY a.batch_no,a.article,a.attached_content,b.summary,a.doctor order by a.czrq desc  limit ?,? ";
        Object params[] = new Object[]{doctor,start,pagesize};
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql,params);
        return list;
@ -186,7 +186,7 @@ public class HealthEduArticlePatientService extends BaseService {
                " and a.article =? "+
                (StringUtils.isNotBlank(batchNo)?" and a.batch_no =? ":"and a.batch_no is null ")+
                " group BY a.batch_no,a.article,b.content,b.summary,a.doctor,b.title";
        Object params[] =  (StringUtils.isNotBlank(batchNo)?new Object[]{doctor,article,batchNo}:new Object[]{doctor,article,});
        Object params[] =  (StringUtils.isNotBlank(batchNo)?new Object[]{doctor,article,batchNo}:new Object[]{doctor,article});
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql,params);
        for(Map<String,Object> dataMap :list){
            String patientListSql ="select a.patient,p.name,a.is_read "+
@ -200,7 +200,7 @@ public class HealthEduArticlePatientService extends BaseService {
            List<Map<String,Object>> patientList = jdbcTemplate.queryForList(patientListSql,params);
            dataMap.put("patients",patientList);
            dataMap.put("read_amount",patientList.size()-Integer.parseInt(dataMap.get("no_read").toString()));
            dataMap.put("admount",patientList.size());
            dataMap.put("amount",patientList.size());
        }
        return list;
    }

+ 3 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java

@ -168,9 +168,10 @@ public class HealthEduArticleService extends BaseService {
        if (pagesize <= 0) {
            pagesize = 10;
        }
        if (page < 0) {
            page = 0;
        if (page <=0) {
            page = 1;
        }
        page = page-1;
        List<Object> params = new ArrayList<Object>();
        StringBuffer sql = new StringBuffer();
        sql.append("select a.id,a.code,a.title,a.url,a.czrq,a.summary content,a.keyword");

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -90,6 +90,7 @@ public class PatientHealthIndexService extends BaseService {
        Map<String, Object> map = new HashMap<>();
        for (Map<String, Object> device : devicePatient) {
            String time = device.get("record_date") == null ? null : device.get("record_date").toString();
            String deviceSN = device.get("device_sn") == null ? "0" : "1";
            String value1 = device.get("value1") == null ? null : device.get("value1").toString();
            String value2 = device.get("value2") == null ? null : device.get("value2").toString();
            String value3 = device.get("value3") == null ? null : device.get("value3").toString();
@ -97,6 +98,7 @@ public class PatientHealthIndexService extends BaseService {
            String value5 = device.get("value5") == null ? null : device.get("value5").toString();
            String value6 = device.get("value6") == null ? null : device.get("value6").toString();
            String value7 = device.get("value7") == null ? null : device.get("value7").toString();
            map.put("isDevice", deviceSN);
            if (StringUtils.isNotEmpty(time)) {
                Date date = sdf.parse(time);
                time = sdf.format(date);

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

@ -2461,10 +2461,27 @@ public class StatisticsAllService extends BaseService {
                    double rate = (double)bindCout/signCout*100;
                    DecimalFormat decimalFormat = new DecimalFormat("0.00");
                    map.put("bindRate",decimalFormat.format(rate)+"%");
                    map.put("bindDoubleRate",rate);
                }else{
                    map.put("bindRate","0.00%");
                    map.put("bindDoubleRate",0.00);
                }
            }
            // 排序
            resultList.sort(new Comparator<Map<String, Object>>() {
                @Override
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    if ((double)o1.get("bindDoubleRate")>=(double)o2.get("bindDoubleRate")) {
                        return -1;
                    } else if ((double)o1.get("bindDoubleRate")<(double)o2.get("bindDoubleRate")) {
                        return 1;
                    } else {
                        return 0;
                    }
                }
            });
            return new JSONArray(resultList);
        } else {
            return new JSONArray();

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -295,4 +295,7 @@ public class PatientService extends TokenService {
        return null;
    }
    public JSONObject checkCanRenew(String patient){
        return  null;
    }
}

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -518,6 +518,12 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }else if(type == 15){
                temp.setTemplate_id(SystemConf.getInstance().getSystemProperties().getProperty("template_doctor_survey"));
                WechatTemplateData  keyword1= new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
            }
            temp.setData(m);

+ 78 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ClazzReflect.java

@ -0,0 +1,78 @@
package com.yihu.wlyy.util;
import org.json.JSONObject;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.ParseException;
import java.util.Date;
/**
 * Created by 卓 on 2017/3/14.
 */
public class ClazzReflect {
    public Object formatToClazz(Object clazz, JSONObject jsonObject){
        Field[] field = clazz.getClass().getDeclaredFields(); // 获取实体类的所有属性,返回Field数组
            try {
            for (int j = 0; j < field.length; j++) { // 遍历所有属性
                String name = field[j].getName(); // 获取属性的名字
                String key = field[j].getName();
                if(jsonObject.isNull(name))continue;
                name = name.substring(0, 1).toUpperCase() + name.substring(1); // 将属性的首字符大写,方便构造get,set方法
                String type = field[j].getGenericType().toString(); // 获取属性的类型
                Method m = null;
                if (type.equals("class java.lang.String")) { // 如果type是类类型,则前面包含"class ",后面跟类名
                    String value = jsonObject.getString(key);
                    m = clazz.getClass().getMethod("set"+name,String.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.lang.Integer")) {
                    Integer value =  jsonObject.getInt(key);
                    m = clazz.getClass().getMethod("set"+name,Integer.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.lang.Boolean")) {
                    Boolean value =  jsonObject.getBoolean(key);
                    m = clazz.getClass().getMethod("set"+name,Boolean.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.lang.Long")) {
                    Long value =  getJsonLong(jsonObject,key);
                    m = clazz.getClass().getMethod("set"+name,Long.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.util.Date")) {
                    String valueString = jsonObject.getString(key);
                    Date value =  DateUtil.strToDate(valueString);
                    m = clazz.getClass().getMethod("set"+name,Date.class);
                    m.invoke(clazz, value);
                }// 如果有需要,可以仿照上面继续进行扩充,再增加对其它类型的判断
            }
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }catch (Exception e){
              e.printStackTrace();
        }
        return clazz;
    }
    private Long getJsonLong(JSONObject jsonObject,String key){
            Object object = jsonObject.get(key);
            if(object==null||"".equals(object)){
                return null;
            }else{
                return jsonObject.getLong(key);
            }
    }
}

+ 21 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -32,6 +32,14 @@ public class ImUtill {
        return response;
    }
    public static void updateTopics(String topicId,String jsonValue){
        String imAddr = im_host + "api/v2/sessions/"+topicId+"/topics";
        JSONObject params = new JSONObject();
        params.put("topic_id",topicId);
        params.put("data",jsonValue);
        HttpClientUtil.putBody(imAddr, params);
    }
    /**
     * 列表接口
     * 获取团队内医生的健康咨询状况
@ -90,6 +98,19 @@ public class ImUtill {
        return response;
    }
    /**
     * 更新会话状态
     *
     * @param sessionId       会话ID
     * @param status 状态
     */
    public static String updateTopicEvaluate(String sessionId,String status) {
        String imAddr = im_host + "api/v2/sessions/"+sessionId+"/status?status="+status+"&sessionId="+sessionId;
        JSONObject params = new JSONObject();
        String response = HttpClientUtil.postBody(imAddr, params);
        return response;
    }
    /**
     * 发送消息给IM

+ 26 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -2,7 +2,9 @@ package com.yihu.wlyy.web.common.util;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.repository.consult.ConsultTeamDoctorDao;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
@ -18,12 +20,14 @@ import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
@ -52,6 +56,8 @@ public class ManagerUtilController extends BaseController {
    ManageUtilService manageUtilService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    ConsultTeamDoctorDao consultTeamDoctorDao;
    /*********************************************患者疾病相关******************************************/
    /**
@ -265,4 +271,24 @@ public class ManagerUtilController extends BaseController {
            return error(-1, "启动失败");
        }
    }
    /**
     * 开始名医咨询剩余次数统计任务
     *
     * @return
     */
    @RequestMapping(value = "/start_evaluate_score_job")
    @ResponseBody
    public String startEvaluateScoreJob() {
        try {
            if (!quartzHelper.isExistJob("evaluate_score_job")) {
                quartzHelper.addJob(SignEndJob.class, "59 59 23 * * ?", "evaluate_score_job", new HashMap<String, Object>());
                return write(200, "启动成功");
            } else {
                return write(200, "任务已存在");
            }
        } catch (Exception e) {
            return error(-1, "启动失败");
        }
    }
}

+ 82 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorEvaluateController.java

@ -0,0 +1,82 @@
package com.yihu.wlyy.web.doctor.consult;
import com.yihu.wlyy.entity.consult.Evaluate;
import com.yihu.wlyy.entity.consult.EvaluateLabel;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.service.app.consult.EvaluateLabelService;
import com.yihu.wlyy.service.app.consult.EvaluateService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by 卓 on 2017/5/10.
 */
@Controller
@RequestMapping(value = "/doctor/consult/evaluate", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生评价")
public class DoctorEvaluateController extends BaseController {
    @Autowired
    ConsultTeamService consultTeamService;
    @Autowired
    EvaluateService evaluateService;
    @Autowired
    EvaluateLabelService evaluateLabelService;
    /**
     * 获取评价
     * @param consult 咨询
     * @return
     */
    @RequestMapping(value = "list")
    @ResponseBody
    public String list(@RequestParam(required = true,value="consult") String consult,@RequestParam(required = false,value="type") Integer type){
        try{
            List<Evaluate> evaluates = null;
            List<EvaluateLabel> evaluateLabels = new ArrayList<>();
            if(type==null){
                evaluates  =  evaluateService.getEvaluateByConsult(consult);
                evaluateLabels  =  evaluateLabelService.findByConsult(consult);
                JSONArray evaluatesJson = new JSONArray(evaluates);
                JSONArray evaluateLabelsJson = new JSONArray(evaluateLabels);
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("evaluate",evaluatesJson);
                jsonObject.put("label",evaluateLabelsJson);
                return  write(200,"查询成功!","data",jsonObject);
            }else{
                evaluates = evaluateService.getEvaluateByConsultAndType(consult,type);
                return  write(200,"查询成功!","list",evaluates);
            }
        }catch (Exception e){
            error(e);
            return write(-1,e.getMessage());
        }
    }
    /**
     * 获取去重的标签
     * @return
     */
    @RequestMapping(value = "label")
    @ResponseBody
    public String label(){
        try{
            List<Map<String,Object>> result = evaluateLabelService.findDistinctLabelByLaDoctor(getUID());
            return write(200,"查询成功!","list",result);
        }catch (Exception e){
            error(e);
            return write(-1,e.getMessage());
        }
    }
}

+ 5 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -18,6 +18,7 @@ import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.htmlparser.Parser;
import org.htmlparser.beans.StringBean;
@ -202,9 +203,9 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
     */
    @RequestMapping(value = "listDoctor")
    @ResponseBody
    public String listDoctor(@RequestParam(value = "page", required = true) int page, @RequestParam(value = "pagesize", required = true) int pagesize, @RequestParam(value = "filter", required = false) String filter, @RequestParam(value = "patient", required = false) String patient) {
    public String listDoctor(@RequestParam(value = "page", required = true) int page, @RequestParam(value = "pagesize", required = true) int pagesize, @RequestParam(value = "filter", required = false) String filter, @RequestParam(value = "patient", required = false) String patient, @RequestParam(value = "wheaType", required = false) Integer wheaType) {
        try {
            List<Map<String, Object>> list = healthEduArticleDoctorService.list(page, pagesize, filter, getUID(), patient);
            List<Map<String, Object>> list = healthEduArticleDoctorService.list(page, pagesize, filter, getUID(), patient,wheaType);
            JSONArray jsonArray = new JSONArray();
            for (Map<String, Object> map : list) {
                JSONObject json = new JSONObject();
@ -233,6 +234,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                json.put("repeatAmount", map.get("repeatAmount"));
                //是否收藏(医生收藏的列表肯定是收藏的无需额外校验)
                json.put("collection", 1);
                jsonArray.put(json);
            }
            return write(200, "查询成功", "list", jsonArray);
@ -554,6 +556,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
            List<Map<String,Object>> result  =   healthEduArticlePatientService.findByBatchNo(getUID(),article,batchNo);
            return write(200,"查询成功!","list",result);
        }catch (Exception e){
            error(e);
            return write(-1,"查询失败!");
        }
    }

+ 84 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/EvaluateController.java

@ -0,0 +1,84 @@
package com.yihu.wlyy.web.patient.consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.Evaluate;
import com.yihu.wlyy.entity.consult.EvaluateLabel;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.service.app.consult.EvaluateLabelService;
import com.yihu.wlyy.service.app.consult.EvaluateService;
import com.yihu.wlyy.util.ClazzReflect;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by 卓 on 2017/5/10.
 */
@Controller
@RequestMapping(value = "/patient/consult/evaluate", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生评价")
public class EvaluateController  extends BaseController {
    @Autowired
    ConsultTeamService consultTeamService;
    @Autowired
    EvaluateService evaluateService;
    @Autowired
    EvaluateLabelService evaluateLabelService;
    /**
     * 保存评价
     * @param evaluateJson 保存评价内容的JSON
     * @return
     */
    @RequestMapping(value = "save")
    @ResponseBody
    public String save(@RequestParam(required = true,value="evaluate") String evaluateJson){
        try{
            evaluateService.saveByJson(evaluateJson,getUID());
            return  write(200,"保存成功!");
        }catch (Exception e){
            error(e);
            return write(-1,e.getMessage());
        }
    }
    /**
     * 获取评价
     * @param consult 咨询
     * @return
     */
    @RequestMapping(value = "list")
    @ResponseBody
    public String list(@RequestParam(required = true,value="consult") String consult,@RequestParam(required = false,value="type") Integer type){
        try{
            List<Evaluate> evaluates = null;
            List<EvaluateLabel> evaluateLabels = new ArrayList<>();
            if(type==null){
                evaluates  =  evaluateService.getEvaluateByConsult(consult);
                evaluateLabels  =  evaluateLabelService.findByConsult(consult);
                JSONArray evaluatesJson = new JSONArray(evaluates);
                JSONArray evaluateLabelsJson = new JSONArray(evaluateLabels);
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("evaluate",evaluatesJson);
                jsonObject.put("label",evaluateLabelsJson);
                return  write(200,"查询成功!","data",jsonObject);
            }else{
                evaluates = evaluateService.getEvaluateByConsultAndType(consult,type);
                return  write(200,"查询成功!","list",evaluates);
            }
        }catch (Exception e){
            error(e);
            return write(-1,e.getMessage());
        }
    }
}

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

@ -321,8 +321,8 @@ public class FamilyMemberController extends WeixinBaseController {
    @ApiOperation(value = "发送微信模板")
    public String sendWXTemp(@RequestParam("member")String member,@RequestParam("relation")int relation){
        try {
            int result = familyMemberService.sendWXTemp(getUID(),member,getAccessToken(),relation);
            //int result = familyMemberService.sendWXTemp("28ea723708514c9bbf5a84c1db6c0215",member,getAccessToken(),relation);
            //int result = familyMemberService.sendWXTemp(getUID(),member,getAccessToken(),relation);
            int result = familyMemberService.sendWXTemp("d682497b7552459797145b6cd63f0ef5",member,getAccessToken(),relation);
            if(result==-1){
                return error(-1, "居民信息查询失败");
            }else if(result==-2){

+ 18 - 25
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -42,14 +42,17 @@ public class PatientHealthController extends BaseController {
        try {
            List list = new ArrayList();
            String patient = getUID();
//            String patient = "test_4429a0a4138a281e7c6316eb9bd";
//            健康指标类型(1血糖,2血压,3体重,4腰围)
            Map map = healthIndexService.findDataByPatient(patient, 1);
            Map map1 = healthIndexService.findDataByPatient(patient, 2);
            Map map2 = healthIndexService.findDataByPatient(patient, 3);
            Map map3 = healthIndexService.findDataByPatient(patient, 4);
            if (map != null) {
//            血糖各个时间段取值
            if (map.size()!=0) {
                Map sugar = new HashMap();
                Object time = map.get("time");
                String isDevice = map.get("isDevice").toString();
                Object value1 = map.get("value1");
                Object value2 = map.get("value2");
                Object value3 = map.get("value3");
@ -58,6 +61,7 @@ public class PatientHealthController extends BaseController {
                Object value6 = map.get("value6");
                Object value7 = map.get("value7");
                sugar.put("type", 1);
                sugar.put("isDevice", isDevice);
                if (time!=null){
                    sugar.put("time", time);
                }
@ -90,9 +94,11 @@ public class PatientHealthController extends BaseController {
                }
                list.add(sugar);
            }
            if (map1 != null) {
//            血压  value1高压 value2低压 value3脉搏 value4心率不齐
            if (map1.size()!=0) {
                Map pa = new HashMap();
                Object time = map1.get("time");
                String isDevice = map1.get("isDevice").toString();
                Object value1 = map1.get("value1");
                Object value2 = map1.get("value2");
                Object value3 = map1.get("value3");
@ -101,6 +107,7 @@ public class PatientHealthController extends BaseController {
                Object value6 = map1.get("value6");
                Object value7 = map1.get("value7");
                pa.put("type", 2);
                pa.put("isDevice", isDevice);
                if (time!=null){
                    pa.put("time", time);
                }
@ -108,34 +115,30 @@ public class PatientHealthController extends BaseController {
                    pa.put("value1", value1);
                }
                if (value2!=null) {
                    pa.remove("value1");
                    pa.put("value2", value2);
                }
                if (value3!=null) {
                    pa.remove("value2");
                    pa.put("value3", value3);
                }
                if (value4!=null) {
                    pa.remove("value3");
                    pa.put("value4", value4);
                }
                if (value5!=null) {
                    pa.remove("value4");
                    pa.put("value5", value5);
                }
                if (value6!=null) {
                    pa.remove("value5");
                    pa.put("value6", value6);
                }
                if (value7!=null) {
                    pa.remove("value6");
                    pa.put("value7", value7);
                }
                list.add(pa);
            }
            if (map2 != null) {
//            体重 value1 体重
            if (map2.size()!=0) {
                Map weight = new HashMap();
                Object time = map2.get("time");
                String isDevice = map2.get("isDevice").toString();
                Object value1 = map2.get("value1");
                Object value2 = map2.get("value2");
                Object value3 = map2.get("value3");
@ -144,6 +147,7 @@ public class PatientHealthController extends BaseController {
                Object value6 = map2.get("value6");
                Object value7 = map2.get("value7");
                weight.put("type", 3);
                weight.put("isDevice", isDevice);
                if (time!=null){
                    weight.put("time", time);
                }
@ -151,34 +155,30 @@ public class PatientHealthController extends BaseController {
                    weight.put("value1", value1);
                }
                if (value2!=null) {
                    weight.remove("value1");
                    weight.put("value2", value2);
                }
                if (value3!=null) {
                    weight.remove("value2");
                    weight.put("value3", value3);
                }
                if (value4!=null) {
                    weight.remove("value3");
                    weight.put("value4", value4);
                }
                if (value5!=null) {
                    weight.remove("value4");
                    weight.put("value5", value5);
                }
                if (value6!=null) {
                    weight.remove("value5");
                    weight.put("value6", value6);
                }
                if (value7!=null) {
                    weight.remove("value6");
                    weight.put("value7", value7);
                }
                list.add(weight);
            }
            if (map3 != null) {
//            腰围 value1腰围
            if (map3.size()!=0) {
                Map waist = new HashMap();
                Object time = map3.get("time");
                String isDevice = map3.get("isDevice").toString();
                Object value1 = map3.get("value1");
                Object value2 = map3.get("value2");
                Object value3 = map3.get("value3");
@ -187,6 +187,7 @@ public class PatientHealthController extends BaseController {
                Object value6 = map3.get("value6");
                Object value7 = map3.get("value7");
                waist.put("type", 4);
                waist.put("isDevice", isDevice);
                if (time!=null){
                    waist.put("time", time);
                }
@ -194,27 +195,21 @@ public class PatientHealthController extends BaseController {
                    waist.put("value1", value1);
                }
                if (value2!=null) {
                    waist.remove("value1");
                    waist.put("value2", value2);
                }
                if (value3!=null) {
                    waist.remove("value2");
                    waist.put("value3", value3);
                }
                if (value4!=null) {
                    waist.remove("value3");
                    waist.put("value4", value4);
                }
                if (value5!=null) {
                    waist.remove("value4");
                    waist.put("value5", value5);
                }
                if (value6!=null) {
                    waist.remove("value5");
                    waist.put("value6", value6);
                }
                if (value7!=null) {
                    waist.remove("value6");
                    waist.put("value7", value7);
                }
                list.add(waist);
@ -402,8 +397,7 @@ public class PatientHealthController extends BaseController {
                                               @ApiParam(name = "end", value = "结束时间", defaultValue = "2016-09-23 00:00:00")
                                               @RequestParam(value = "end", required = true) String end) {
        try {
//            List<DevicePatientHealthIndex> list = healthIndexService.findChartByPatien(getUID(), type, begin, end);
            List<DevicePatientHealthIndex> list = healthIndexService.findChartByPatien("test_4429a0a4138a281e7c6316eb9bd", type, begin, end);
            List<DevicePatientHealthIndex> list = healthIndexService.findChartByPatien(getUID(), type, begin, end);
            if (list == null) {
                return success("查询成功!");
            }
@ -456,7 +450,6 @@ public class PatientHealthController extends BaseController {
                                          @RequestParam(value = "pagesize", required = true) int pagesize) {
        try {
            List<DevicePatientHealthIndex> list = healthIndexService.findIndexByPatient(getUID(), type, start, end, page, pagesize);
            System.out.println("<===========================================>");
            JSONArray jsonArray = new JSONArray();
            if (list != null) {
                for (DevicePatientHealthIndex model : list) {

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java

@ -612,4 +612,10 @@ public class FamilyContractController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value = "/checkCanRenew", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public String checkCanRenew(String patient){
        return  null;
    }
}

+ 60 - 41
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -74,7 +74,7 @@ public class StatisticsController extends BaseController {
            if (index != null) {
                for (String idx : indexes) {
                    result.put("index_" + idx, statisticsService.getDateIncrementDetail(startDate, endDate, interval, area, level,idx,level2_type));
                    result.put("index_" + idx, statisticsService.getDateIncrementDetail(startDate, endDate, interval, area, level, idx, level2_type));
                }
            }
@ -119,14 +119,14 @@ public class StatisticsController extends BaseController {
    /**
     * 指标截止日期累积量
     *
     * @param endDate 结束时间
     * @param area 父code
     * @param level 等级  1 团队,2 机构,3 区,4 市
     * @param index 指标代码
     * @param level2_type  指标代码 例如性别 1 男 2 女  不传就返回男和女的总和
     * @param endDate     结束时间
     * @param area        父code
     * @param level       等级  1 团队,2 机构,3 区,4 市
     * @param index       指标代码
     * @param level2_type 指标代码 例如性别 1 男 2 女  不传就返回男和女的总和
     * @return
     */
    @RequestMapping("/total")
        @RequestMapping("/total")
    @ResponseBody
    public String getIndexTotal(@RequestParam(required = true) String endDate,
                                @RequestParam(required = true) String area,
@ -138,7 +138,7 @@ public class StatisticsController extends BaseController {
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
                result.put("index_" + idx, statisticsService.getTotalAmount(endDate, area, level, idx,level2_type));
                result.put("index_" + idx, statisticsService.getTotalAmount(endDate, area, level, idx, level2_type));
            }
            return write(200, "查询成功", "data", result);
@ -184,13 +184,13 @@ public class StatisticsController extends BaseController {
    /**
     * 指标截止日期增量
     *
     * @param endDate 结束时间
     * @param area 父code
     * @param level 等级  1 团队,2 机构,3 区,4 市
     * @param index 指标代码
     * @param sort 排序 1倒叙 2是 正序
     * @param endDate     结束时间
     * @param area        父code
     * @param level       等级  1 团队,2 机构,3 区,4 市
     * @param index       指标代码
     * @param sort        排序 1倒叙 2是 正序
     * @param lowLevel
     * @param level2_type  指标代码 例如性别 1 男 2 女  不传就返回男和女的总和
     * @param level2_type 指标代码 例如性别 1 男 2 女  不传就返回男和女的总和
     * @return
     */
    @RequestMapping("/lowlevel_total")
@ -207,7 +207,7 @@ public class StatisticsController extends BaseController {
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
                result.put("index_" + idx, statisticsService.getLowLevelTotalDetail(endDate, area, level, idx, sort, lowLevel,level2_type));
                result.put("index_" + idx, statisticsService.getLowLevelTotalDetail(endDate, area, level, idx, sort, lowLevel, level2_type));
            }
            return write(200, "查询成功", "data", result);
@ -240,39 +240,56 @@ public class StatisticsController extends BaseController {
            JSONArray returnJa = new JSONArray();
            List<JSONArray> jsonArrays = new ArrayList<>();
            JSONArray jsonArray1 = statisticsService.getLowLevelTotalDetail(endDate, area, level, indexes[0], sort, lowLevel,null);
            JSONArray jsonArray1 = statisticsService.getLowLevelTotalDetail(endDate, area, level, indexes[0], sort, lowLevel, null);
            jsonArrays.add(jsonArray1);
            JSONArray jsonArray2 = statisticsService.getLowLevelIncrementDetail(endDate, endDate, area, level, indexes[1], sort, lowLevel);
            jsonArrays.add(jsonArray2);
            //遍历合并2个指标中key值一样的
            for (int i = 0; i < jsonArrays.get(0).length(); i++) {
                if (jsonArrays.get(1).length() == 0) {
            if (jsonArrays.get(1).length() == 0) {
                //如果只有一个指标的时候 另外一个指标默认是0
                for (int i = 0; i < jsonArrays.get(0).length(); i++) {
                    //未回复咨询不存在的时候默认是0
                    JSONObject map1 = jsonArrays.get(0).getJSONObject(i);
                    String amount = map1.get("amount").toString() + ",0";
                    map1.put("amount", amount);
                    returnJa.put(map1);
                } else {
                    for (int j = 0; j < jsonArrays.get(1).length(); j++) {
                        JSONObject map1 = jsonArrays.get(0).getJSONObject(i);
                        JSONObject map2 = jsonArrays.get(1).getJSONObject(j);
                        String amount = "";
                        if (map1.get("code").equals(map2.get("code"))) {
                            amount = map1.get("amount").toString() + "," + map2.get("amount").toString();
                            map1.put("amount", amount);
                            returnJa.put(map1);
                        }
                    }
                }
            } else {
                //如果是2个指标的时候,分别放入map中,以减少查询次数
                Map<String,JSONObject> index1=new HashMap<>();
                Map<String,JSONObject> index2=new HashMap<>();
                for (int i = 0; i < jsonArrays.get(0).length(); i++) {
                    JSONObject map1 = jsonArrays.get(0).getJSONObject(i);
                    index1.put(map1.get("code").toString(),map1);
                }
                for (int i = 0; i < jsonArrays.get(1).length(); i++) {
                    JSONObject map1 = jsonArrays.get(1).getJSONObject(i);
                    index2.put(map1.get("code").toString(),map1);
                }
                for(Map.Entry<String , JSONObject> one:index1.entrySet()){
                    JSONObject map1 = one.getValue();
                    JSONObject map2 = index2.get(one.getKey());
                    String amount = map1.get("amount").toString() + "," + map2.get("amount").toString();
                    map1.put("amount", amount);
                    returnJa.put(map1);
                }
            }
            result.put("index_" + indexes[0], returnJa);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
        } catch (
                Exception e
                )
        {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
@ -450,6 +467,7 @@ public class StatisticsController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取三师转签或高危人群
     *
@ -572,13 +590,13 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/Consulting_StatList")
    @ResponseBody
    public String getConsultingStatisticsList(@RequestParam(required = true) Integer level,
                                               @RequestParam(required = true) String area ,
                                               @RequestParam(required = false) String lowlevel) {
                                              @RequestParam(required = true) String area,
                                              @RequestParam(required = false) String lowlevel) {
        try {
            JSONObject data = statisticsService.getConsultingStatisticsList(level,area,lowlevel);
            if(data!=null){
            JSONObject data = statisticsService.getConsultingStatisticsList(level, area, lowlevel);
            if (data != null) {
                return write(200, "查询成功", "data", data);
            }else{
            } else {
                return error(-1, "查询失败");
            }
        } catch (Exception e) {
@ -599,12 +617,12 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/Consulting_Title")
    @ResponseBody
    public String getConsultingTitle(@RequestParam(required = true) Integer level,
                                      @RequestParam(required = true) String area) {
                                     @RequestParam(required = true) String area) {
        try {
            JSONObject data = statisticsService.getConsultingTitle(level,area);
            if(data!=null){
            JSONObject data = statisticsService.getConsultingTitle(level, area);
            if (data != null) {
                return write(200, "查询成功", "data", data);
            }else{
            } else {
                return error(-1, "查询失败");
            }
        } catch (Exception e) {
@ -614,15 +632,16 @@ public class StatisticsController extends BaseController {
    /**
     * 获取回复数时间分布数
     *
     * @param level
     * @param area
     * @return
     */
    @RequestMapping("/getCoutListByTime")
    @ResponseBody
    public String getCoutListByTime(@RequestParam(required = true)String level,@RequestParam(required = true) String area){
    public String getCoutListByTime(@RequestParam(required = true) String level, @RequestParam(required = true) String area) {
        try {
            return write(200, "查询成功", "data", statisticsService.getCoutListByTime(level,area));
            return write(200, "查询成功", "data", statisticsService.getCoutListByTime(level, area));
        } catch (Exception e) {
            return error(-1, "查询失败");
        }

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

@ -53,45 +53,45 @@
##------------------------------------�����������ݿ�����------------------------------------#
#### 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
redis.password=
#---------------------------------���Ի������ݿ�����---------------------------------------#
##### 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.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.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.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
redis.password=
#---------------------------------���Ի������ݿ�����---------------------------------------#
##### 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=linzhou
jdbc.password=linzhou
##### 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=linzhou
health.jdbc.password=linzhou
##### 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=linzhou
fv.jdbc.password=linzhou
#
###### redis
#redis.host=172.19.103.88

+ 4 - 2
patient-co-wlyy/src/main/resources/system.properties

@ -64,6 +64,8 @@ admin_token=0a5c5258-8863-4b07-a3f9-88c768528ab4
# 签约到期JOB触发时间
sign_end_job_trigger=0 0 0 * * ?
evaluate_score_job = 59 59 23 * * ?
#-------------------------开发环境配置-------------------------#
 服务器基本配置
server_ip=weixin.xmtyw.cn
@ -80,8 +82,8 @@ chat_server=http://weixin.xmtyw.cn/res/chat/
sign_check_upload=http://172.19.103.87:8011/wlyy_service
# IM配置
im_list_get=http://172.19.103.29:3008/
#im_list_get=http://192.168.131.102:3008/
#im_list_get=http://172.19.103.88:3000/
im_list_get=http://192.168.131.107:3000/
im_group_server=http://172.19.103.29:3000/api/v1/chats/gm
msg_push_server=http://172.19.103.29:3000/api/v1/chats/sm

+ 1 - 1
patient-co-wlyy/src/main/resources/weixin_menu.txt

@ -82,7 +82,7 @@
        {
        	 "type":"view",
        	 "name":"意见反馈",
        	 "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fmy-appointment.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        	 "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyjfk%2fhtml%2ffeedback.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        }
	 ]
  }