소스 검색

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

huangwenjie 7 년 전
부모
커밋
5c3fad5679
42개의 변경된 파일1313개의 추가작업 그리고 68개의 파일을 삭제
  1. 125 0
      common/common-entity/src/main/java/com/yihu/es/entity/AssistantMsgPushLog.java
  2. 35 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/device/PatientDevice.java
  3. 34 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/device/PatientDeviceLog.java
  4. 3 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java
  5. 132 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/ReplyStaticController.java
  6. 17 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceHealthIndexController.java
  7. 79 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/consult/WlyyConsultTeamExportVO.java
  8. 38 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/consult/WlyyConsultTeamService.java
  9. 29 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java
  10. 18 5
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/DateUtil.java
  11. 3 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp
  12. 42 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_consult.jsp
  13. 183 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_consult_js.jsp
  14. 7 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_device.jsp
  15. 27 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_device_js.jsp
  16. 1 0
      patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js
  17. 62 0
      patient-co/patient-co-doctor-assistant/doc/技术文档/es/推送医生助手消息日志新增索引.txt
  18. 2 1
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  19. 104 0
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/config/es/ElasticFactory.java
  20. 79 0
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/config/es/ElastricSearchSave.java
  21. 48 0
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  22. 6 5
      patient-co/patient-co-doctor-assistant/src/main/resources/application-dev.yml
  23. 4 3
      patient-co/patient-co-doctor-assistant/src/main/resources/application-devtest.yml
  24. 4 3
      patient-co/patient-co-doctor-assistant/src/main/resources/application-local.yml
  25. 4 3
      patient-co/patient-co-doctor-assistant/src/main/resources/application-localtest.yml
  26. 11 1
      patient-co/patient-co-doctor-assistant/src/main/resources/application-prod.yml
  27. 4 3
      patient-co/patient-co-doctor-assistant/src/main/resources/application-test.yml
  28. 30 2
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java
  29. 23 15
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java
  30. 1 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/wechat/util/WeiXinOpenIdUtils.java
  31. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java
  32. 15 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceLogService.java
  33. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java
  34. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  35. 114 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  36. 6 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java
  37. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java
  38. 3 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  39. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java
  40. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java
  41. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  42. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

+ 125 - 0
common/common-entity/src/main/java/com/yihu/es/entity/AssistantMsgPushLog.java

@ -0,0 +1,125 @@
package com.yihu.es.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * Created by 刘文彬 on 2018/8/7.
 * 推送医生助手的日志
 */
public class AssistantMsgPushLog {
    @JestId
    private String id;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;  // 创建时间
    private Integer pushPlatform; //推送的平台 1、微信平台,2、平台消息
    private String accessToken;//微信AccessToken(微信平台)
    private String type;//消息类型
    private String openid;//微信的openid
    private String url;//微信跳转url
    private String data;//数据(微信平台、平台消息)
    private String receiver;//接受人(平台消息)
    private String title;// 标题(平台消息)
    private String msg;//消息(平台消息)
    private Integer success;//是否推送成功(1、成功,-1、失败)
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getPushPlatform() {
        return pushPlatform;
    }
    public void setPushPlatform(Integer pushPlatform) {
        this.pushPlatform = pushPlatform;
    }
    public String getAccessToken() {
        return accessToken;
    }
    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }
    public String getReceiver() {
        return receiver;
    }
    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
    public Integer getSuccess() {
        return success;
    }
    public void setSuccess(Integer success) {
        this.success = success;
    }
}

+ 35 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/device/PatientDevice.java

@ -50,7 +50,16 @@ public class PatientDevice extends IdEntity {
    //上传的协议图片地址
    private String agreementPhoto;
    //========================非表字段======================
    //居民签约所在社区
    private String hospital;
    //居民签约所在社区名字
    private String hospitalName;
    //登记医生名字
    private String checkDoctorName;
  //========================非表字段======================
    //患者居住地址
    private String address;
    ///**
@ -237,7 +246,32 @@ public class PatientDevice extends IdEntity {
        this.agreementPhoto = agreementPhoto;
    }
    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Column(name = "check_doctor_name")
    public String getCheckDoctorName() {
        return checkDoctorName;
    }
    public void setCheckDoctorName(String checkDoctorName) {
        this.checkDoctorName = checkDoctorName;
    }
    @Transient
    public String getAddress() {

+ 34 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/device/PatientDeviceLog.java

@ -37,6 +37,13 @@ public class PatientDeviceLog extends IdEntity {
    private int isDel;
    //上传的协议图片地址
    private String agreementPhoto;
    //居民签约所在社区
    private String hospital;
    //居民签约所在社区名字
    private String hospitalName;
    //登记医生名字
    private String checkDoctorName;
    @Column(name = "device_id")
    public long getDeviceId() {
@ -147,6 +154,33 @@ public class PatientDeviceLog extends IdEntity {
        this.agreementPhoto = agreementPhoto;
    }
    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Column(name = "check_doctor_name")
    public String getCheckDoctorName() {
        return checkDoctorName;
    }
    public void setCheckDoctorName(String checkDoctorName) {
        this.checkDoctorName = checkDoctorName;
    }
    public PatientDeviceLog() {
    }

+ 3 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java

@ -40,7 +40,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                "/admin/device/toExcel",
                "/admin/device/importData",
                "/admin/patientDevice/toExcel",
                "/admin/healthIndex/toExcel",
                "/admin/healthIndex/**",
                "/admin/healthIndex/getExcelByFilter",
                "/admin/static/prescription/toExcel",
                "/admin/static/wechat/listToExcel",
@ -57,7 +57,8 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                "/admin/surveyTemplateResult/**",
                "/admin/surveyAdvice/**",
                "/admin/surveyTemplateAdvice/**",
                "/admin/paylog/**"
                "/admin/paylog/**",
                "/admin/static/consult/**"
        );
    }

+ 132 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/ReplyStaticController.java

@ -0,0 +1,132 @@
package com.yihu.wlyy.controller.manager.datastatic;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.consult.WlyyConsultTeamExportVO;
import com.yihu.wlyy.service.manager.consult.WlyyConsultTeamService;
import jxl.Workbook;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
/**
 * Created by humingfen on 2018/8/7.
 */
@Controller
@RequestMapping("admin/static/consult")
public class ReplyStaticController extends BaseController {
    @Autowired
    private WlyyConsultTeamService consultTeamService;
    @Autowired
    ObjectMapper objectMapper;
    @RequestMapping(value = "initial")
    public String initList(){
        return "static/static_consult";
    }
    //导出报表
    @RequestMapping(value="toExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
    public void exportList(
            @RequestParam(value = "town",required = false)String town,
            @RequestParam(value = "hospital",required = false)String hospital,
            HttpServletResponse response){
        try {
            List<WlyyConsultTeamExportVO> consultTeams = consultTeamService.exportReplyDelayList(town,hospital);
            /*String data = "[{" +
                    "\"symptoms\":\"李医生,我孩子赖抒明的续费,为什么无法操作?\"," +
                    "\"name\":\"易鹭燕\"," +
                    "\"create_time\":\"2018/7/4 13:09:26\"," +
                    "\"reply_time\":\"2018/7/12 20:00:02\"," +
                    "\"content\":\"没有关系,下次来社区现场缴费即可。\"," +
                    "\"team_name\":\"禾山社区团队\"," +
                    "\"doctor_name\":\"李冬彬\"," +
                    "\"doctor_health_name\":\"李冬彬\"" +
                    "}," +
                    "{" +
                    "\"symptoms\":\"小腹会有涨痛感,白天有多次放屁,晨起时也会放屁。要如何治疗?\"," +
                    "\"name\":\"杨秋梅\"," +
                    "\"create_time\":\"2018/7/5 11:15:08\"," +
                    "\"reply_time\":\"2018/7/17 18:24:54\"," +
                    "\"content\":\"不好意思,之前没看到消息,你这样应该是肠胃不好,最好是中药调理,有空过来当面看一下\"," +
                    "\"team_name\":\"岭下社区团队\"," +
                    "\"doctor_name\":\"陈余妍\"," +
                    "\"doctor_health_name\":\"张陈大添\"" +
                    "}" +
                    "]" ;
            List<WlyyConsultTeamExportVO> consultTeams = (List<WlyyConsultTeamExportVO>)JSONArray.toList(JSONArray.fromObject(data), WlyyConsultTeamExportVO.class);*/
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "ReplyDelayList.xls"));
            OutputStream os = response.getOutputStream();
            this.write(os,consultTeams);
        }catch (Exception ex){
            error(ex);
        }
    }
    public void write(OutputStream os, List ls) throws Exception{
        write(Workbook.createWorkbook(os), ls);
    }
    public void write(WritableWorkbook wwb, List ls) throws Exception {
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet",1);
            addHeader(ws);
            int i = 1;
            for (WlyyConsultTeamExportVO c : (List<WlyyConsultTeamExportVO>) ls) {
                addCell(ws, i, 0, c.getSymptoms(),"");
                addCell(ws, i, 1, c.getName(),"");
                addCell(ws, i, 2, c.getCreate_time(),"");
                addCell(ws, i, 3, c.getReply_time(),"");
                addCell(ws, i, 4, c.getContent(),"");
                addCell(ws, i, 5, c.getTeam_name(),"");
                addCell(ws, i, 6, c.getDoctor_name(),"");
                addCell(ws, i, 7, c.getDoctor_health_name(),"");
                i++;
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    public void addHeader(WritableSheet ws) throws WriteException {
        String[] header = {"咨询内容","居民姓名","咨询时间","回复时间","回复内容","团队", "全科医生", "健管师"};
        int i = 0;
        for (String h : header) {
            addCell(ws, 0, i, h);//表名,行,列,header
            i++;
        }
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column,  String data) throws WriteException {
        Label label = new Label(column ,row, data);
        ws.addCell(label);
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column, String data, String memo) throws WriteException {
        Label label = new Label(column ,row, data);
        if(!org.springframework.util.StringUtils.isEmpty(memo)){
            WritableCellFeatures cellFeatures = new WritableCellFeatures();
            cellFeatures.setComment(memo);
            label.setCellFeatures(cellFeatures);
        }
        ws.addCell(label);
    }
}

+ 17 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceHealthIndexController.java

@ -74,6 +74,23 @@ public class DeviceHealthIndexController extends BaseController{
        }
    }
    //设备体征报表导出
    @RequestMapping(value="export",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
    public void export(
            @RequestParam(value = "town",required = false)String town,
            @RequestParam(value = "hospital",required = false)String hospital,
            HttpServletResponse response){
        try {
            List<DeviceHealthIndexExportVO> wlyyDevices = healthIndexService.exportDeviceHealthList(town,hospital);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "deviceHealthIndexDataList.xls"));
            OutputStream os = response.getOutputStream();
            this.write(os,wlyyDevices);
        }catch (Exception ex){
            error(ex);
        }
    }
    /**
     * 按筛选条件导出居民体征数据报表
     * @param deviceSn 设备sn码

+ 79 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/consult/WlyyConsultTeamExportVO.java

@ -0,0 +1,79 @@
package com.yihu.wlyy.entity.consult;
/**
 * @author humingfen
 * @date 2018/8/7
 */
public class WlyyConsultTeamExportVO {
    private String symptoms;
    private String name;
    private String create_time;
    private String reply_time;
    private String content;
    private String team_name;
    private String doctor_name;
    private String doctor_health_name;
    public String getSymptoms() {
        return symptoms;
    }
    public void setSymptoms(String symptoms) {
        this.symptoms = symptoms;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCreate_time() {
        return create_time;
    }
    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }
    public String getReply_time() {
        return reply_time;
    }
    public void setReply_time(String reply_time) {
        this.reply_time = reply_time;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getTeam_name() {
        return team_name;
    }
    public void setTeam_name(String team_name) {
        this.team_name = team_name;
    }
    public String getDoctor_name() {
        return doctor_name;
    }
    public void setDoctor_name(String doctor_name) {
        this.doctor_name = doctor_name;
    }
    public String getDoctor_health_name() {
        return doctor_health_name;
    }
    public void setDoctor_health_name(String doctor_health_name) {
        this.doctor_health_name = doctor_health_name;
    }
}

+ 38 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/consult/WlyyConsultTeamService.java

@ -1,11 +1,16 @@
package com.yihu.wlyy.service.manager.consult;
import com.yihu.wlyy.entity.WlyyConsult;
import com.yihu.wlyy.entity.WlyyConsultTeam;
import com.yihu.wlyy.entity.consult.WlyyConsultTeamExportVO;
import com.yihu.wlyy.repository.WlyyConsultTeamDao;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -15,6 +20,9 @@ import java.util.List;
public class WlyyConsultTeamService {
    @Autowired
    private WlyyConsultTeamDao consultTeamDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    public int isExistUnfinished(String patient){
        return consultTeamDao.searchUnfinished(patient);
    }
@ -22,4 +30,33 @@ public class WlyyConsultTeamService {
       WlyyConsultTeam wlyyConsultTeam =  consultTeamDao.findByCode(consult);
        return wlyyConsultTeam;
    }
    /**
     * 导出咨询未及时回复数据
     * @param town
     * @param hospital
     * @return
     */
    public List<WlyyConsultTeamExportVO> exportReplyDelayList(String town, String hospital) {
        List<WlyyConsultTeamExportVO> list = new ArrayList<>();
        String sql  = "SELECT " +
                "c.symptoms," +
                "c.name," +
                "t.create_time," +
                "t.reply_time," +
                "m.content," +
                "a.`name` as team_name," +
                "f.doctor_name," +
                "f.doctor_health_name "+
                " FROM wlyy_consult_team c, im.topics t, wlyy_admin_team a, wlyy_sign_family f, im.muc_messages m " +
                "WHERE t.create_time >= '"+DateUtil.getSignYear() +"-07-01' and c.admin_team_code = a.id  "+
                "and c.consult = t.id and (TIMESTAMPDIFF(HOUR,t.create_time,t.reply_time)>=24 ) and f.patient = c.patient and f.`status`>0 " +
                "and t.reply_message_id=m.id ORDER BY t.create_time";
        if(StringUtils.isNotBlank(hospital)){
            sql = sql.replace("and c.admin_team_code = a.id ", "and a.org_code = '"+hospital+"' and c.admin_team_code = a.id");
        }
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WlyyConsultTeamExportVO.class));
        return list ;
    }
}

+ 29 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java

@ -477,6 +477,35 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        return list ;
	}
    /**
     * 导出设备体征上传明细(包含绑定未使用)
     * @param town
     * @param hospital
     * @return
     */
    public List<DeviceHealthIndexExportVO> exportDeviceHealthList(String town, String hospital) {
        List<DeviceHealthIndexExportVO> list = new ArrayList<>();
        String sql  = "SELECT " +
                "s.patient," +
                "s.`name`," +
                "case when s.mobile !='' then  CONCAT(left(s.mobile,3),'*******',right(s.mobile,2)) else  s.mobile end mobile," +
                "CONCAT(left(s.idcard,6),'**********',right(s.idcard,2)) idcard," +
                "pd.device_sn," +
                "pd.device_name," +
                "d.record_date," +
                "d.amount,"+
//                "CASE d.type WHEN 1 THEN '血糖' WHEN 2 THEN '血压' WHEN 3 THEN '体重' WHEN 4 THEN '腰围' END statusName,"+
                "s.doctor_name," +
                "p.address FROM wlyy_sign_family s,wlyy_patient p,wlyy_patient_device pd LEFT JOIN(" +
                "SELECT i.`user`,i.device_sn, i.type, max(i.record_date) record_date, count(i.id) amount, w.device_name " +
                "FROM device.wlyy_patient_health_index i,wlyy_patient_device w "+
                "WHERE i.device_sn = w.device_sn AND i.del=1 AND i.`type` IN (1, 2) GROUP BY i.`user`,i.device_sn,i.type) d on pd.user = d.`user` and pd.device_sn=d.device_sn "+
                "WHERE s.patient = pd.`user` AND s.hospital='"+hospital+"' AND s.`status`> 0 AND s.patient=p.code  ORDER BY d.record_date desc ";
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(DeviceHealthIndexExportVO.class));
        return list ;
    }
    public JSONObject gethealthStandard(Integer type, String patientCode) {
        //血糖校验
        JSONObject json = new JSONObject();

+ 18 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -696,9 +696,22 @@ public class DateUtil {
		SimpleDateFormat formatter =   new SimpleDateFormat( "yyyy年MM月dd日 EEEEaaaa hh:mm", Locale.CHINA);
		return formatter.format(date);
	}
//	public static void main(String[] args) {
//		String hour = "12:22:12";
//		System.out.println(Time.valueOf(hour));
//		System.out.println(getNowDate());
//	}
	public static int getNowMonth(){
		Calendar cal = Calendar.getInstance();
		return cal.get(Calendar.MONTH)+1;
	}
	public static int getNowYear(){
		Calendar cal = Calendar.getInstance();
		return cal.get(Calendar.YEAR);
	}
	public static int getSignYear(){
		Calendar ca = Calendar.getInstance();
		if(getNowMonth() >= 7){
			return getNowYear();
		}
		return getNowYear()-1;
	}
}

+ 3 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp

@ -166,6 +166,9 @@
							<sec:authorize url="/admin/paylog/initial">
								<li><a href="javascript:locationMenu('paylog');">支付日志管理</a></li>
							</sec:authorize>
							<sec:authorize url="/admin/static/consult/initial">
								<li><a href="javascript:locationMenu('staticConsult');">信息咨询管理</a></li>
							</sec:authorize>
							<sec:authorize url="/admin/static/center">
						</ul>
					</div>

+ 42 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_consult.jsp

@ -0,0 +1,42 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../head/page_head.jsp"%>
    <title>信息咨询管理</title>
</head>
<style>
    .u-btn-small{width: 100px !important;}
</style>
<body>
<div >
    <div style="font-family:微软雅黑;font-size:Small;display:block;clear:left;padding:0;margin:0;margin-left: 5px">
        <div style="position:relative;display:inline;left:10px;top:8px;white-space:nowrap;text-align:center;background-color:#ffffff;font-weight:bold">信息咨询详情</div>
        <div style="height:auto;width:auto;border:#dde7f1 1px solid;">
            <div class="m-form-group f-mt10" id="we_export_div">
                <div class="m-form-control f-ml15" style="display: none">
                    <input type="text" id="inp_device_name" placeholder="请选择城市" class="f-ml10"/></div>
                <br>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_categoryCode" placeholder="请选择市区" class="f-ml10"/>
            </div>
            <br>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_hos" placeholder="请选择机构" class="f-ml10"/>
            </div>
            <br>
            <div id="export_consult_reply_delay" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                <span>未及时回复明细</span>
                <br>
            </div>
            <br>
        </div>
    </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="static_consult_js.jsp" %>
</html>

+ 183 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_consult_js.jsp

@ -0,0 +1,183 @@
<%--
  Created by IntelliJ IDEA.
  User: hmf
  Date: 2018/8/7
  Time: 11:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
    (function ( $, win) {
        $(function () {
            /* ************************** 变量定义 ******************************** */
            // 通用工具类库
            var retrieve = null;
            var inpStarDate = null,inpEndDate = null;
            retrieve = {
                url: {
                    //接口链接
                    /*
                    * 省,市,区
                    * */
                    district: '/common/district',
                    /*
                    *获取医院列表
                    * */
                    hospitalsByType: '/admin/hos/hospitalsByType',
                },
                $inpDeviceName: $('#inp_device_name'),//城市
                $inpCategoryCode: $('#inp_categoryCode'),//区
                $inpHos: $('#inp_hos'),//机构
                dnc: null,
                ccc: null,
                hc: null,
                $btnReplyDelayList: $('#export_consult_reply_delay'),
                init: function () {
                    this.initComboBox();
                    this.bindEvents();
                },
                //初始化市区下拉框
                initComboBox: function () {
                    this.dnc = this.$inpDeviceName.ligerComboBox({
                        width: 150,
                        data: [
                            {text: '厦门市', statusId: '350200'}
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                    this.dnc.selectValue('350200');//默认选中厦门市
                    this.setCityFun(this);
                    this.initInpCat( [], this);
                    this.initHc( [], this);
                },
                //区
                initInpCat: function ( d, me) {
                    me.ccc = me.$inpCategoryCode.ligerComboBox({
                        width: 250,
                        data: d,
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                },
                //机构
                initHc: function ( d, me) {
                    me.hc = me.$inpHos.ligerComboBox({
                        width: 250,
                        data: d,
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                },
                setCityFun: function (me) {
                    var v = me.dnc.getValue();
                    if (v != '') {
                        me.rAjax( me.url.district, {
                            type: 3,
                            code: v
                        }, function (data) {
                            var d = [];
                            for (var i = 0; i < data.list.length; i++) {
                                d.push({
                                    text: data.list[i].name,
                                    statusId: data.list[i].code
                                });
                            }
                            //区
                            me.initInpCat( d, me);
                        })
                    } else {
                        me.initInpCat( [], me);
                        me.initHc( [], me);
                    }
                },
                setAreaFun: function (me) {
                    var v = me.ccc.getValue();
                    if (v != '') {
                        me.rAjax( me.url.hospitalsByType, {
                            type: 2,
                            code: v
                        }, function (data) {
                            var d = [];
                            for (var i = 0; i < data.list.length; i++) {
                                d.push({
                                    text: data.list[i].name,
                                    statusId: data.list[i].code
                                });
                            }
                            //机构
                            me.initHc( d, me);
                        })
                    } else {
                        me.initHc( [], me);
                    }
                },
                bindEvents: function () {
                    var me = this;
                    //城市下拉
                    me.$inpDeviceName.on( 'change', function () {
                        me.setCityFun(me);
                    });
                    //区下拉
                    me.$inpCategoryCode.on( 'change', function () {
                        me.setAreaFun(me);
                        me.hc.setValue('');
                    });
                    //机构
                    me.$inpHos.on( 'change', function () {
                    });
                    //咨询未及时回复详情导出
                    me.$btnReplyDelayList.on('click',function () {
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/static/consult/toExcel');
                        //区
                        var town = $("<input type='hidden' name='town' />")
                        town.attr('value',$("#inp_categoryCode").val());
                        //社区医院
                        var hospital = $("<input type='hidden' name='hospital' />")
                        hospital.attr('value',$("#inp_hos_val").val());
                        //关注状态
                        var attention = $("<input type='hidden' name='attention' />")
                        attention.attr('value',$("#inp_att_val").val());
                        myform.append(town);
                        myform.append(hospital);
                        myform.append(attention);
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                },
                rAjax: function ( url, d, cb) {
                    $.ajax({
                        url: ctx + url,
                        data: d,
                        type: 'POST',
                        dataType: 'json',
                        success: function (data) {
                            if (data.status == 200) {
                                cb && cb.call( this, data);
                            } else {
                                $.Notice.error(data.msg);
                            }
                        }
                    });
                }
            };
            retrieve.init();
        });
    })( jQuery, window);
</script>

+ 7 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_device.jsp

@ -7,6 +7,9 @@
    <title>机构管理</title>
</head>
<style>
    .u-btn-small{width: 145px !important;}
</style>
<body>
<div >
    <div style="font-family:微软雅黑;font-size:Small;display:block;clear:left;padding:0;margin:0;margin-left: 5px">
@ -33,6 +36,10 @@
                <span>体征上传明细</span>
                <br>
            </div>
            <div id="export_device_healthindex_list" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                <span>体征明细(包含未使用)</span>
                <br>
            </div>
            <br>
        </div>
    </div>

+ 27 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_device_js.jsp

@ -39,6 +39,7 @@
                $btnDeviceList: $('#export_patient_device_list'),
                $btnHealthindexList: $('#export_patient_healthindex_list'),
                $btnDeviceHealthList: $('#export_device_healthindex_list'),
                init: function () {
                    this.initComboBox();
                    this.bindEvents();
@ -181,6 +182,32 @@
                        attention.attr('value',$("#inp_att_val").val());
                        myform.append(town);
                        myform.append(hospital);
                        myform.append(attention);
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                    //居民体征设备详情(包含绑定没有使用过)导出
                    me.$btnDeviceHealthList.on('click',function () {
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/healthIndex/export');
                        //区
                        var town = $("<input type='hidden' name='town' />")
                        town.attr('value',$("#inp_categoryCode").val());
                        //社区医院
                        var hospital = $("<input type='hidden' name='hospital' />")
                        hospital.attr('value',$("#inp_hos_val").val());
                        //关注状态
                        var attention = $("<input type='hidden' name='attention' />")
                        attention.attr('value',$("#inp_att_val").val());
                        myform.append(town);
                        myform.append(hospital);
                        myform.append(attention);

+ 1 - 0
patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js

@ -35,6 +35,7 @@ var menu = {
    "staticPay": "/admin/static/pay/initial",//支付统计报表
    "healthEdu": "/admin/static/healthedu/initial",//健教推送报表
    "paylog": "/admin/paylog/initial",//支付日志管理
    "staticConsult": "/admin/static/consult/initial", //信息回复管理
    //安全管理
    "user": "/admin/user/initial",//人员管理界面

+ 62 - 0
patient-co/patient-co-doctor-assistant/doc/技术文档/es/推送医生助手消息日志新增索引.txt

@ -0,0 +1,62 @@
创建索引
POST  http://172.19.103.68:9200/assistant_msg_push_log
查询索引
GET http://172.19.103.68:9200/assistant_msg_push_log/
给索引加mapping
POST http://172.19.103.68:9200/assistant_msg_push_log/assistant_msg_push_log/_mapping
{
    "assistant_msg_push_log": {
        "properties": {
            "createTime": {
                "format": "strict_date_optional_time||epoch_millis",
                "type": "date"
            },
            "pushPlatform": {
                "type": "integer"
            },
			"accessToken": {
                "index": "not_analyzed",
                "type": "string"
            },
			"type": {
                "index": "not_analyzed",
                "type": "string"
            },
			"openid": {
                "index": "not_analyzed",
                "type": "string"
            },
			"url": {
                "index": "not_analyzed",
                "type": "string"
            },
			"data": {
                "index": "not_analyzed",
                "type": "string"
            },
			"receiver": {
                "index": "not_analyzed",
                "type": "string"
            },
			"title": {
                "index": "not_analyzed",
                "type": "string"
            },
			"msg": {
                "index": "not_analyzed",
                "type": "string"
            },
			"success": {
                "type": "integer"
            }
        }
    }
}
增加索引搜索大小
PUT  http://172.19.103.68:9200/assistant_msg_push_log/_settings
{
  "index": {
    "max_result_window": 500000
  }
}

+ 2 - 1
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -177,7 +177,8 @@ public class SwaggerConfig {
                        regex("/idc10/.*"),
                        regex("/im_new/.*"),
                        regex("/version/.*"),
                        regex("/express/.*")
                        regex("/express/.*"),
                        regex("/wlyy/.*")
                ))
                .build()

+ 104 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/config/es/ElasticFactory.java

@ -0,0 +1,104 @@
package com.yihu.wlyy.config.es;
import io.searchbox.client.JestClient;
import io.searchbox.client.JestClientFactory;
import io.searchbox.client.config.HttpClientConfig;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
/**
 * Created by chenweida on 2017/6/5.
 */
@Component
public class ElasticFactory {
    private static JestClientFactory factory = null;
    @Value("${es.host}")
    private String esHost;//http://59.61.92.90:9065,http://59.61.92.90:9067
    @Value("${es.tHost}")
    private String tHost;// 59.61.92.90:9066,59.61.92.90:9068
    @Value("${es.clusterName}")
    private String clusterName;
//-----------------------------------jestClient----------------------------------------
    /**
     * @param "http://localhost:9200"
     * @return
     */
    public JestClient getJestClient() {
        if (factory == null) {
            //初始化链接
            init();
        }
        return factory.getObject();
    }
    /**
     * 初始化链接
     * 9200
     */
    public synchronized void init() {
        String[] hostArray = esHost.split(",");
        // Construct a new Jest client according to configuration via factory
        factory = new JestClientFactory();
        HttpClientConfig httpClientConfig = new HttpClientConfig
                .Builder(Arrays.asList(hostArray))
                .multiThreaded(true)
                .maxTotalConnection(50)// 最大链接
                .maxConnectionIdleTime(10, TimeUnit.MINUTES)//链接等待时间
                .connTimeout(60 * 1000*10)
                // .discoveryEnabled(true)
                .readTimeout(60 * 1000*10)//60秒
                .build();
        factory.setHttpClientConfig(httpClientConfig);//得到链接
    }
    //-----------------------------------TransportClient----------------------------------------
    private TransportClient transportClient;
    public Client getTransportClient() {
        try {
            initTranClient();
            return transportClient;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * 9300
     *
     * @throws UnknownHostException
     */
    private synchronized void initTranClient() throws UnknownHostException {
        if (transportClient == null) {
            String[] hosts = tHost.split(",");
            Settings settings = Settings.settingsBuilder()
                    // .put("client.transport.sniff", true)//开启嗅探功能
                    .put("cluster.name", StringUtils.isEmpty(clusterName) ? "jkzl" : clusterName)//默认集群名字是jkzl
                    .build();
            transportClient = TransportClient.builder().settings(settings).build();
            for (String oneHost : hosts) {
                String[] hostAndport = oneHost.split(":");
                transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(hostAndport[0]), Integer.valueOf(hostAndport[1])));
            }
        }
    }
}

+ 79 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/config/es/ElastricSearchSave.java

@ -0,0 +1,79 @@
package com.yihu.wlyy.config.es;
import io.searchbox.client.JestClient;
import io.searchbox.core.Bulk;
import io.searchbox.core.BulkResult;
import io.searchbox.core.Index;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.List;
;
/**
 * Created by chenweida on 2017/6/2.
 */
@Component
@Scope("prototype")
public class ElastricSearchSave {
    private Logger logger = LoggerFactory.getLogger(ElastricSearchSave.class);
    @Autowired
    private ElasticFactory elasticFactory;
    public Boolean save(List sms, String esIndex, String esType) {
        JestClient jestClient = null;
        try {
            //得到链接
            jestClient = elasticFactory.getJestClient();
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (Object obj : sms) {
                Index index = new Index.Builder(obj).build();
                bulk.addAction(index);
            }
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("save data count:" + sms.size());
            logger.info("save flag:" + br.isSucceeded());
            return br.isSucceeded();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error(" save error :" + e.getMessage());
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return null;
    }
    public Boolean save(Object obj, String esIndex, String esType) {
        JestClient jestClient = null;
        try {
            //得到链接
            jestClient = elasticFactory.getJestClient();
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            Index index = new Index.Builder(obj).build();
            bulk.addAction(index);
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("save flag:" + br.isSucceeded());
            return br.isSucceeded();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error(" save error :" + e.getMessage());
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return null;
    }
}

+ 48 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -1,6 +1,8 @@
package com.yihu.wlyy.task;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.es.entity.AssistantMsgPushLog;
import com.yihu.wlyy.config.es.ElastricSearchSave;
import com.yihu.wlyy.entity.wechat.WechatTemplate;
import com.yihu.wlyy.entity.wechat.WechatTemplateData;
import com.yihu.wlyy.util.HttpUtil;
@ -15,6 +17,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
@ -64,6 +67,12 @@ public class PushMsgTask {
    private String putMesType;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private ElastricSearchSave elastricSearchSave;
    @Value("${es.type.AssistantMsgPushLog}")
    private String esType;
    @Value("${es.index.AssistantMsgPushLog}")
    private String esIndex;
    /**
@ -118,6 +127,8 @@ public class PushMsgTask {
                mes.put("title", putMesType);
                mes.put("value", json.toString());
                redisTemplate.opsForList().leftPush(redisQueue, mes.toString());
                saveAssistantMsgPushLog(access_token,1,type+"",openid,
                        url,data.toString(),null,null,null,null);
            } else {
                queue.put(json);
            }
@ -187,6 +198,8 @@ public class PushMsgTask {
                        String url = json.has("url") ? json.getString("url") : "";
                        // 发送消息到微信端
                        sendWeixinMessage(access_token, type, openid, url, data);
                        saveAssistantMsgPushLog(access_token,1,type+"",openid,
                                url,data.toString(),null,null,null,null);
                    } else {
                        // 推送平台消息
                        String receiver = json.has("receiver") ? json.getString("receiver") : "";
@ -197,8 +210,12 @@ public class PushMsgTask {
                        boolean res = httpUtil.pushMessage(receiver, type, title, msg, data);
                        if (res) {
                            logger.info("消息推送成功!");
                            saveAssistantMsgPushLog(null,2,type,null,
                                    null,data,receiver,title,msg,1);
                        } else {
                            logger.error("消息推送失败!");
                            saveAssistantMsgPushLog(null,2,type,null,
                                    null,data,receiver,title,msg,-1);
                        }
                    }
                } catch (Exception ex) {
@ -359,4 +376,35 @@ public class PushMsgTask {
        return templateId;
    }
    /**
     * 推送记录保存到ES
     * @param accessToken 微信AccessToken(微信平台)
     * @param pushPlatform 推送的平台 1、微信平台,2、平台消息
     * @param type 消息类型
     * @param openid 微信的openid
     * @param url 微信跳转url
     * @param data 数据(微信平台、平台消息)
     * @param receiver 接受人(平台消息)
     * @param title 标题(平台消息)
     * @param msg 消息(平台消息)
     * @param success 是否推送成功(1、成功,-1、失败)
     */
    public void saveAssistantMsgPushLog(String accessToken,Integer pushPlatform,String type,String openid,
                                        String url,String data,String receiver,String title,String msg,Integer success){
        AssistantMsgPushLog assistantMsgPushLog = new AssistantMsgPushLog();
        assistantMsgPushLog.setAccessToken(accessToken);
        assistantMsgPushLog.setCreateTime(new Date());
        assistantMsgPushLog.setPushPlatform(pushPlatform);
        assistantMsgPushLog.setType(type);
        assistantMsgPushLog.setOpenid(openid);
        assistantMsgPushLog.setUrl(url);
        assistantMsgPushLog.setData(data);
        assistantMsgPushLog.setReceiver(receiver);
        assistantMsgPushLog.setTitle(title);
        assistantMsgPushLog.setMsg(msg);
        assistantMsgPushLog.setSuccess(success);
        elastricSearchSave.save(assistantMsgPushLog, esIndex, esType);
    }
}

+ 6 - 5
patient-co/patient-co-doctor-assistant/src/main/resources/application-dev.yml

@ -92,12 +92,13 @@ pushMes:
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_dev
    HealthEduArticlePatient: health_edu_article_patient_test
    AssistantMsgPushLog: assistant_msg_push_log
  type:
    HealthEduArticlePatient: health_edu_article_patient_dev
  host: 172.19.103.68
  port: 9200
  tPort: 9300
    HealthEduArticlePatient: health_edu_article_patient_test
    AssistantMsgPushLog: assistant_msg_push_log
  host: http://172.19.103.68:9200
  tHost: http://172.19.103.68:9300
  clusterName: jkzl
#消息队列
activemq:

+ 4 - 3
patient-co/patient-co-doctor-assistant/src/main/resources/application-devtest.yml

@ -91,11 +91,12 @@ pushMes:
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test
    AssistantMsgPushLog: assistant_msg_push_log
  type:
    HealthEduArticlePatient: health_edu_article_patient_test
  host: 172.19.103.68
  port: 9200
  tPort: 9300
    AssistantMsgPushLog: assistant_msg_push_log
  host: http://172.19.103.68:9200
  tHost: http://172.19.103.68:9300
  clusterName: jkzl

+ 4 - 3
patient-co/patient-co-doctor-assistant/src/main/resources/application-local.yml

@ -90,11 +90,12 @@ pushMes:
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test
    AssistantMsgPushLog: assistant_msg_push_log
  type:
    HealthEduArticlePatient: health_edu_article_patient_test
  host: 172.19.103.68
  port: 9200
  tPort: 9300
    AssistantMsgPushLog: assistant_msg_push_log
  host: http://172.19.103.68:9200
  tHost: http://172.19.103.68:9300
  clusterName: jkzl

+ 4 - 3
patient-co/patient-co-doctor-assistant/src/main/resources/application-localtest.yml

@ -91,11 +91,12 @@ pushMes:
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test
    AssistantMsgPushLog: assistant_msg_push_log
  type:
    HealthEduArticlePatient: health_edu_article_patient_test
  host: 172.19.103.68
  port: 9200
  tPort: 9300
    AssistantMsgPushLog: assistant_msg_push_log
  host: http://172.19.103.68:9200
  tHost: http://172.19.103.68:9300
  clusterName: jkzl

+ 11 - 1
patient-co/patient-co-doctor-assistant/src/main/resources/application-prod.yml

@ -85,4 +85,14 @@ pushMes:
# 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription
  redis_prescription_title: redisPrescription
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient
    AssistantMsgPushLog: assistant_msg_push_log
  type:
    HealthEduArticlePatient: health_edu_article_patient
    AssistantMsgPushLog: assistant_msg_push_log
  host: http://59.61.92.90:9065,http://59.61.92.90:9067
  tHost: 59.61.92.90:9066,59.61.92.90:9068
  clusterName: jkzl

+ 4 - 3
patient-co/patient-co-doctor-assistant/src/main/resources/application-test.yml

@ -89,11 +89,12 @@ pushMes:
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test
    AssistantMsgPushLog: assistant_msg_push_log
  type:
    HealthEduArticlePatient: health_edu_article_patient_test
  host: 172.19.103.68
  port: 9200
  tPort: 9300
    AssistantMsgPushLog: assistant_msg_push_log
  host: http://172.19.103.68:9200
  tHost: http://172.19.103.68:9300
  clusterName: jkzl
#消息队列

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

@ -62,6 +62,8 @@ public class CurrentMysqlToEsQuotaJob implements Job {
    private String year;//要统计的年份
    private Date quotaDate;//统计的时间
    private String timeLevel;//1 日 2年
    private String wlyyJobCongId;//指标对象
    private QuartzJobConfig quartzJobConfig;//指标对象
    @Autowired
    private QuartzJobLogDao quartzJobLogDao;//执行日志Dao
@ -80,6 +82,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
    private StringRedisTemplate redisTemplate;
    @Autowired
    private Data2Save data2Save;
    private String incrementInterval;//增量的时间间隔(天)
    public void execute(JobExecutionContext context)
@ -112,7 +115,8 @@ public class CurrentMysqlToEsQuotaJob implements Job {
        //为空默认是统计昨天的数据  统计昨天的数据是从 前天的下午17:00:00 到昨天的下午17:00:00
        //初始化结束时间
        this.endTime = DateUtil.getStringDate("yyyy-MM-dd HH:mm:ss");
        this.startTime = map.getString("startTime");
        this.incrementInterval = map.get("incrementInterval")!=null?String.valueOf(map.get("incrementInterval")):"1";
        //初始化统计年份
        this.year = getNowYearByDate();
        //初始化开始时间
@ -120,11 +124,20 @@ public class CurrentMysqlToEsQuotaJob implements Job {
            //按年度到达量
            startTime = this.year + "-06-30 17:00:00";
        } else {
//            //增量
//            this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
            //增量
            this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
            if (StringUtils.isEmpty(startTime)) {
//                startTime = new LocalDate(new DateTime().minusDays(2)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
                getStartTime();
            } else {
                startTime = startTime + " 17:00:00";
            }
        }
        this.quotaDate = DateUtil.strToDate(endTime, "yyyy-MM-dd");
        this.wlyyJobCongId = map.getString("jobConfig");
        this.quartzJobConfig = quartzJobConfigDao.findById(wlyyJobCongId);
    }
@ -407,4 +420,19 @@ public class CurrentMysqlToEsQuotaJob implements Job {
        SimpleDateFormat s=new SimpleDateFormat("");
        System.out.println(s.format(new Date()));
    }
    public void getStartTime() throws Exception{
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
        if("1".equals(this.incrementInterval)){//日
            startTime = new LocalDate(new DateTime().minusDays(2)).toString("yyyy-MM-dd") + " 17:00:00";
        }else if("2".equals(this.incrementInterval)){//周
            Date monday = DateUtil.getMondayOfThisDayToDate(sf.parse(endTime));
//            startTime =sf.format(monday)+ " 17:00:00";
            startTime =DateUtil.getNextDay(monday,-1)+ " 17:00:00";
        }else if("3".equals(this.incrementInterval)){//月
            Date fristDay = DateUtil.getFristDayOfMonthToDate(sf.parse(endTime));
//            startTime = sf.format(fristDay)+ " 17:00:00";
            startTime =DateUtil.getNextDay(fristDay,-1)+ " 17:00:00";
        }
    }
}

+ 23 - 15
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java

@ -23,9 +23,7 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by chenweida on 2017/9/9.
@ -98,6 +96,12 @@ public class HealthArtListener implements MessageListener {
//            HealthEduArticleES one = (HealthEduArticleES)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticleES.class);
//            logger.info(jo.toString());
//            System.out.printf(healthEduArticleES.toString());
            net.sf.json.JSONArray jsonArray = obj.get("openidSet")!=null?(net.sf.json.JSONArray)obj.get("openidSet"):null;
            Set<String> openidSet = new HashSet<>();
            for(int i=0;i<jsonArray.size();i++){
                openidSet.add(jsonArray.get(i).toString());
            }
            healthEduArticleES.setOpenidSet(openidSet);
            sendWxTemplateAndIM(healthEduArticleES);
            //返回服务器表示消息消费成功
            message.acknowledge();
@ -152,18 +156,22 @@ public class HealthArtListener implements MessageListener {
                        patient.getName(),
                        json);
            }
            //发送代理人
            JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(), one.getOpenidSet());
            if (jsonArray != null && jsonArray.length() > 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    org.json.JSONObject j = jsonArray.getJSONObject(i);
                    Patient member = (Patient) j.get("member");
                    json.remove("toUser");
                    json.put("toUser", member.getCode());
                    json.remove("first");
                    json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.isNull("relation") ? 1 : j.getInt("relation"), patient.getName()));
                    if (StringUtils.isNotBlank(member.getOpenid())) {
                        pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9, member.getOpenid(), patient.getName(), json);
            //如果居民有openid说明有绑定微信,就不需要推送给代理人
            if(!StringUtils.isNotEmpty(patient.getOpenid())){
                //发送代理人
                JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(), one.getOpenidSet());
                if (jsonArray != null && jsonArray.length() > 0) {
                    for (int i = 0; i < jsonArray.length(); i++) {
                        org.json.JSONObject j = jsonArray.getJSONObject(i);
                        Patient member = (Patient) j.get("member");
                        json.remove("toUser");
                        json.put("toUser", member.getCode());
                        json.remove("first");
                        json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.isNull("relation") ? 1 : j.getInt("relation"), patient.getName()));
                        if (StringUtils.isNotBlank(member.getOpenid())) {
                            pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9, member.getOpenid(), patient.getName(), json);
                        }
                    }
                }
            }

+ 1 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/wechat/util/WeiXinOpenIdUtils.java

@ -113,6 +113,7 @@ public class WeiXinOpenIdUtils {
                String memberCode = (String) member.get("family_member");
                if (StringUtils.isNotBlank(memberCode)) {
                    Patient p = patientDao.findByCode(memberCode);
                    if(p==null)continue;
                    if (StringUtils.isNotBlank(p.getOpenid())&&!p.getOpenid().equals(openid)) {
                        if(!map.containsKey(p.getOpenid())){
                            map.put(p.getOpenid(),p.getOpenid());

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

@ -435,6 +435,6 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
    String getHospital(String patient);
    //查看团队内医生签约人数
    @Query("select count(1) from SignFamily a where a.status >= 0 and a.adminTeamId = ?1 and (a.doctor = ?2 or a.doctorHealth = ?2)")
    @Query("select count(1) from SignFamily a where a.status > 0 and a.adminTeamId = ?1 and (a.doctor = ?2 or a.doctorHealth = ?2)")
    int countByAdminTeamId(Long adminTeamId, String doctor);
}

+ 15 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceLogService.java

@ -3,6 +3,8 @@ package com.yihu.wlyy.service.app.device;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.device.PatientDeviceLog;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.repository.patient.PatientDeviceLogDao;
import com.yihu.wlyy.service.BaseService;
@ -32,6 +34,8 @@ public class PatientDeviceLogService extends BaseService {
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PatientDao patientDao;
    /**
     * 绑定和解绑的时候会保存一条数据
@ -58,8 +62,17 @@ public class PatientDeviceLogService extends BaseService {
            patientDeviceLog.setOperatorName(patientDevice.getDoctorName());
            patientDeviceLog.setOperator(patientDevice.getDoctor());
        }else if (role==2){
            patientDeviceLog.setOperatorName(patientDevice.getAgentName());
            patientDeviceLog.setOperator(patientDevice.getAgent());
            if(StringUtils.isEmpty(patientDevice.getAgent())){
                Patient patient = patientDao.findByCode(patientDevice.getUser());
                if (patient!=null){
                    patientDeviceLog.setOperatorName(patient.getName());
                    patientDeviceLog.setOperator(patient.getCode());
                }
            }else {
                patientDeviceLog.setOperatorName(patientDevice.getAgentName());
                patientDeviceLog.setOperator(patientDevice.getAgent());
            }
        }
        patientDeviceLog.setCreateTime(new Date());
        patientDeviceLog.setIsDel(1);

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java

@ -166,6 +166,7 @@ public class CreditLogService {
        object.put("openId",patient.getOpenid());
        object.put("unionId",patient.getUnionid());
        String url =getBaseUrl() + "createCreditsDetail";
        //String url ="http://192.168.5.109:10051/svr-health-bank/createCreditsDetail";
        Map<String,String> params = new HashMap<>();
        params.put("creditsDetail",object.toJSONString());
        try {
@ -775,7 +776,7 @@ public class CreditLogService {
        }
        String url =getBaseUrl()+ "selectByDate";
        //String url = "http://192.168.5.106:10051/svr-health-bank/selectByDate";
        //String url = "http://192.168.5.109:10051/svr-health-bank/selectByDate";
        Map<String,String> params = new HashMap<>();
        params.put("object",object.toJSONString());
        try {

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

@ -2258,6 +2258,7 @@ public class FamilyContractService extends BaseService {
                jo.put("sex", doctor.getSex());//医生性别  1男,2女)
                jo.put("name", doctor.getName());//医生名称
                jo.put("photo", doctor.getPhoto());//医生头像
                jo.put("hosptial", doctor.getHospital());//所属机构
                jo.put("hosptialName", doctor.getHospitalName());//所属机构名称
                jo.put("level", doctor.getLevel());//医生等级1专科医生,2全科医生,3健康管理师
                jo.put("signType", "1");//签约类别 1是三师 2是家庭
@ -2289,6 +2290,7 @@ public class FamilyContractService extends BaseService {
                jo.put("sex", doctor.getSex());
                jo.put("name", doctor.getName());
                jo.put("photo", doctor.getPhoto());
                jo.put("hosptial", doctor.getHospital());//所属机构
                jo.put("hosptialName", doctor.getHospitalName());
                jo.put("level", doctor.getLevel());
                jo.put("signType", "2");//2是家庭
@ -2309,6 +2311,7 @@ public class FamilyContractService extends BaseService {
                jo.put("sex", doctorHealth.getSex());
                jo.put("name", doctorHealth.getName());
                jo.put("photo", doctorHealth.getPhoto());
                jo.put("hosptial", doctor.getHospital());//所属机构
                jo.put("hosptialName", doctorHealth.getHospitalName());
                jo.put("level", doctorHealth.getLevel());
                jo.put("signType", "2");//2是家庭

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

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.app.statisticsES;
import com.yihu.wlyy.config.es.ElasticFactory;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
@ -6130,4 +6131,117 @@ public class StatisticsESService {
        return rsJs;
    }*/
    public JSONArray getDeviceLowLevelTotal(String date, String area, int level, String index, int sort, String lowLevel, String year) throws Exception {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
        List<Map<String, Object>> resultList = new ArrayList<>();
        if (date.compareTo(dateFormat.format(new Date())) >= 0) {
            date = elasticsearchUtil.getQuotaTime();
        }
        List<SaveModel> esModelList = new ArrayList<>();
        if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
            String time = getStatisticsTime();
            String sql ="SELECT" +
                    " pd.doctor team," +
                    " pd.doctor_name teamName," +
                    " COUNT(1) result1" +
                    " FROM" +
                    " wlyy_patient_device pd," +
                    " wlyy_sign_family sf" +
                    " WHERE" +
                    " pd.user_idcard = sf.idcard" +
                    " AND sf.type = 2" +
                    " AND pd.del = 0" +
                    " AND sf. STATUS IN (1, 2)" +
                    " AND pd.czrq < '"+time+"'" +
                    " AND sf.sign_year = '"+year+"'";
            if(level==3){
                sql +=" AND LEFT(sf.hospital,6)= '"+area+"'";
            }else if (level==4){
                sql +=" AND sf.hospital = '"+area+"'";
            }
            sql +=" GROUP BY team,teamName";
            esModelList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SaveModel.class));
        }else {
            esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, low_level);
        }
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult1().intValue());
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
                } else if (low_level.equals("4")) {
                    maps.put("code", one.getHospital());
                    maps.put("name", one.getHospitalName());
                } else if (low_level.equals("5")) {
                    if ( StringUtils.isNotEmpty(one.getTeam()) && StringUtils.isEmpty(one.getTownName())){
                        maps.put("code", one.getTeam());
                        Doctor doctor = doctorDao.findByCode(one.getTeam());
                        if (doctor!=null){
                            maps.put("name", doctor.getName());
                        }
                    }
                    if (StringUtils.isEmpty(one.getTeam())){
                        maps.put("code","0");
                        maps.put("name", "其他");
                    }
                }
                resultList.add(maps);
            }
        }
        // 结果为空时,自建结果集
        if (resultList == null || resultList.size() < 1) {
            resultList = getLowLevelMapKey(level, low_level, area);
        }
        if (resultList != null) {
            DecimalFormat df = new DecimalFormat("0.0000");
            for (Map<String, Object> map : resultList) {
                map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
                if (!low_level.equals("5")) {
                    PopulationBase peopleNum = getPopulationBase(area, year);
                    if (peopleNum != null) {
                        map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
                        map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getTaskNum() * 100));
                        map.put("targetRate", df.format(peopleNum.getTaskNum() * 1.0000 / peopleNum.getNum() * 100));
                        map.put("rateString", map.get("amount") + "/" + peopleNum.getNum());
                        map.put("taskRateString", map.get("amount") + "/" + peopleNum.getTaskNum());
                        map.put("targetRateString", peopleNum.getTaskNum() + "/" + peopleNum.getNum());
                        map.put("num", peopleNum.getNum());
                        map.put("task", peopleNum.getTaskNum());
                    }
                }
            }
            /*if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
                translateTeamLeaderName(resultList);
            }*/
            Collections.sort(resultList, new Comparator<Map<String, Object>>() {
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    long map1value = (long) o1.get("amount");
                    long map2value = (long) o2.get("amount");
                    if (map1value - map2value > 0) {
                        return sort == 1 ? -1 : 1;
                    } else if (map1value - map2value < 0) {
                        return sort == 1 ? 1 : -1;
                    } else {
                        return 0;
                    }
                }
            });
            return new JSONArray(resultList);
        } else {
            return new JSONArray();
        }
    }
}

+ 6 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java

@ -117,7 +117,7 @@ public class AppletsService extends BaseService {
        return list.get(0);
    }
    public Boolean setPatientStep(String patient,Integer step){
    public Boolean setPatientStep(String patient,Integer step) throws Exception{
        String sql = "SELECT " +
                " s.id, " +
                " s.patientcode " +
@ -142,14 +142,11 @@ public class AppletsService extends BaseService {
        }
        //上传步数记录
        try{
            com.alibaba.fastjson.JSONObject json  = new com.alibaba.fastjson.JSONObject();
            json.put("patientId",patient);
            json.put("taskCode","ACTIVITY_STEP");
            taskService.createActiveRecord(json);
        }catch (Exception e){
            logger.info(e.toString());
        }
        com.alibaba.fastjson.JSONObject json  = new com.alibaba.fastjson.JSONObject();
        json.put("patientId",patient);
        json.put("taskCode","ACTIVITY_STEP");
        taskService.createActiveRecord(json);
        return true;
    }

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java

@ -107,8 +107,12 @@ public class BaseController {
                userAgent = request.getHeader("User-Agent");
            }
            JSONObject json = new JSONObject(userAgent);
            return json.getString("lastUid");
            String id = json.getString("lastUid");
            if(StringUtils.isNoneBlank(id)){
                return id;
            }else{
               return json.getString("uid");
            }
        } catch (Exception e) {
            return null;
        }

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

@ -1,11 +1,9 @@
package com.yihu.wlyy.web.common.account;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.login.LoginLog;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.security.TokenDao;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.common.SMSService;
@ -158,8 +156,8 @@ public class LoginController extends BaseController {
                if (loginPassword.equals(doctor.getPassword())) {
                    Token token = tokenService.findDoctorToken(doctor.getCode());
                    if (token != null && platform == 4 && getIMEI().equals(token.getImei())) {
                        //pc版本要做单点登陆 所以如果platform =4 并且 token存在直接返回之前的token
                    if (token != null && platform == 4 && getIMEI().equals(token.getImei())&&token.getTimeout().getTime() > System.currentTimeMillis()) {
                        //pc版本要做单点登陆 所以如果platform =4 并且 token存在直接返回之前的token, --2018-08-09新增判断token是否过期
                    }else {
                        // 用户校验通过,生成token
                        token = tokenService.newToken(doctor.getCode(), getIMEI(), platform);
@ -264,7 +262,7 @@ public class LoginController extends BaseController {
                    loginLog.setUserCode(doctor.getCode());
                    // 用户校验通过,生成token
                    Token token = tokenService.findDoctorToken(doctor.getCode());
                    if (token != null && platform == 4 && getIMEI().equals(token.getImei())) {
                    if (token != null && platform == 4 && getIMEI().equals(token.getImei())&&token.getTimeout().getTime() > System.currentTimeMillis()) {
                        //pc版本要做单点登陆 所以如果platform =4 并且 token存在直接返回之前的token
                    } else {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -517,7 +517,7 @@ public class DataHandingService {
     */
    public List<String> importKitInfo(Integer batch)throws Exception{
        String sql = " select * from wlyy.kit_bind_info_temp where batch="+batch;
        String sql = " select * from wlyy.kit_bind_info_temp where batch="+batch+" and import=0";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        List<String> errorList = new ArrayList<>();
        for(Map<String,Object> one:mapList){

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

@ -383,6 +383,9 @@ public class PatientDeviceController extends BaseController {
                                @ApiParam(name = "device_sn", value = "设备SN码", defaultValue = "15L000002")
                                @RequestParam(value = "device_sn", required = true) String deviceSn) {
        try {
            if (deviceDetailService.findByDeviceSn(deviceSn)==null){
                return write(-1,"设备不存在!");
            }
//            List<Map<String, String>> list = patientDeviceService.getDeviceUser(getUID(), deviceSn, type);
            List<Map<String, String>> list = patientDeviceService.getDeviceUser(getRepUID(), deviceSn, type);
            return write(200, "获取设备绑定信息成功!", "data", list);

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

@ -235,7 +235,7 @@ public class FamilyMemberController extends WeixinBaseController {
    @ApiOperation(value = "家庭成员(有授权)查询")
    public String getAuthorizeFamilyMembers(){
        try {
            JSONArray result = familyMemberService.getAuthorizeMembers(getUID());
            JSONArray result = familyMemberService.getAuthorizeMembers(getLastUid());
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -591,7 +591,9 @@ public class EsStatisticsController extends BaseController {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotalTeamLeader(date, area, level, idx, sort, lowLevel, year));
                    } else if (idx.equals("72")) {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotalOnlineTeamLeader(date, area, level, idx, sort, lowLevel, year, ""));
                    } else {
                    }else if (idx.equals("20")){
                        result.put("index_" + idx, statisticsESService.getDeviceLowLevelTotal(date, area, level, idx, sort, lowLevel, year));
                    }else {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotal(date, area, level, idx, sort, lowLevel, year));
                    }
                }