Просмотр исходного кода

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 7 лет назад
Родитель
Сommit
1be501f5cd

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

@ -14,7 +14,7 @@ public class PatientDevice extends IdEntity {
	// 设备ID
	// 设备ID
	private Long deviceId;
	private Long deviceId;
	// 设备标识
	// 设备标识 1血糖仪,2.血压计
	private String deviceSn;
	private String deviceSn;
	//sim卡号
	//sim卡号
	private String sim;
	private String sim;

+ 6 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimBloodPressure.java

@ -1,9 +1,11 @@
package com.yihu.wlyy.entity.patient;
package com.yihu.wlyy.entity.patient;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import javax.persistence.*;
import java.sql.Timestamp;
import java.sql.Timestamp;
import java.util.Date;
/**
/**
 * 患者监测目标-血压
 * 患者监测目标-血压
@ -20,7 +22,7 @@ public class PatientAimBloodPressure extends IdEntity {
    private String sbpMin;
    private String sbpMin;
    private String dbpMin;
    private String dbpMin;
    private String unit;
    private String unit;
    private Timestamp createTime;
    private Date createTime;
    @Basic
    @Basic
    @Column(name = "code")
    @Column(name = "code")
@ -94,11 +96,12 @@ public class PatientAimBloodPressure extends IdEntity {
    @Basic
    @Basic
    @Column(name = "create_time")
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
        return createTime;
    }
    }
    public void setCreateTime(Timestamp createTime) {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
        this.createTime = createTime;
    }
    }

+ 6 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimBloodSugger.java

@ -1,9 +1,11 @@
package com.yihu.wlyy.entity.patient;
package com.yihu.wlyy.entity.patient;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import javax.persistence.*;
import java.sql.Timestamp;
import java.sql.Timestamp;
import java.util.Date;
/**
/**
 * 患者监测目标-血糖
 * 患者监测目标-血糖
@ -19,7 +21,7 @@ public class PatientAimBloodSugger extends IdEntity {
    private String hpg;
    private String hpg;
    private String minimum;
    private String minimum;
    private String unit;
    private String unit;
    private Timestamp createTime;
    private Date createTime;
    @Basic
    @Basic
    @Column(name = "code")
    @Column(name = "code")
@ -83,11 +85,12 @@ public class PatientAimBloodSugger extends IdEntity {
    @Basic
    @Basic
    @Column(name = "create_time")
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
        return createTime;
    }
    }
    public void setCreateTime(Timestamp createTime) {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
        this.createTime = createTime;
    }
    }

+ 10 - 0
edu-article/JkEdu/src/com/yihu/jk/action/ArticleAction.java

@ -20,6 +20,16 @@ public class ArticleAction {
	private ArticleDao dao = new ArticleDao();
	private ArticleDao dao = new ArticleDao();
	@RequestMapping("ArticleAction")
	@RequestMapping("ArticleAction")
	@ResponseBody
	@ResponseBody
	public String ArticleAction(HttpServletRequest request) {
	public String ArticleAction(HttpServletRequest request) {
		try {
		try {

+ 6 - 6
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApiTest.java

@ -70,15 +70,15 @@ public class ArticleApiTest {
//		obj.put("articleTitle","我是");
//		obj.put("articleTitle","我是");
//		obj.put("userCode","0de7295862dd11e69faffa163e8aee56");
//		obj.put("userCode","0de7295862dd11e69faffa163e8aee56");
		obj.put("currentUserRole","350200");
		obj.put("currentUserRole","3502110400");
		obj.put("userCode","37959ddf86f211e6b394fa163e424525");//ylp201703150222
		obj.put("roleType",1);
		obj.put("userCode","b7f68412638e11e69616fa163e424525");//ylp201703150222
		//obj.put("roleType",1);
		obj.put("isMyArticle",true);
		obj.put("isMyArticle",true);
		obj.put("page","0");
		obj.put("page","0");
		obj.put("pageSize","9");
		obj.put("currentUserRoleLevel",2);//
		obj.put("sEcho","1");
		obj.put("pageSize","3");
		obj.put("currentUserRoleLevel",4);//
		//obj.put("sEcho","1");
//		obj.put("articleTitle","健管师");
//		obj.put("articleTitle","健管师");
		im.setParam(obj.toString());
		im.setParam(obj.toString());
		initDB();
		initDB();

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

@ -303,7 +303,7 @@ public class SignPatientLabelInfoService extends BaseService {
     */
     */
    public JSONArray getPatientByLabel(String doctor, String labelCode, String labelType,
    public JSONArray getPatientByLabel(String doctor, String labelCode, String labelType,
                                       Long teamCode, int page, int pagesize, boolean isSlowDisease,
                                       Long teamCode, int page, int pagesize, boolean isSlowDisease,
                                       String diseaseCondition,boolean isFollowWeChat) throws Exception {
                                       String diseaseCondition,boolean isFollowWeChat,String trackFlag) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        Doctor doc = doctorDao.findByCode(doctor);
        if (doc == null) {
        if (doc == null) {
@ -384,6 +384,9 @@ public class SignPatientLabelInfoService extends BaseService {
                    "  FROM  wlyy_sign_family t1 " +
                    "  FROM  wlyy_sign_family t1 " +
                    "  LEFT JOIN wlyy_patient p on p.code = t1.patient  "+
                    "  LEFT JOIN wlyy_patient p on p.code = t1.patient  "+
                    "  RIGHT JOIN wlyy_sign_patient_label_info t2 on t2.patient = t1.patient ";
                    "  RIGHT JOIN wlyy_sign_patient_label_info t2 on t2.patient = t1.patient ";
            if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
                sql = sql +" JOIN wlyy_track_patient tp WHERE tp.patient_code = p.code";
            }
            sql = sql + " WHERE t2.label = ?";
            sql = sql + " WHERE t2.label = ?";
            if(StringUtils.isNotBlank(diseaseCondition)) {
            if(StringUtils.isNotBlank(diseaseCondition)) {
@ -400,6 +403,9 @@ public class SignPatientLabelInfoService extends BaseService {
            if(isFollowWeChat){
            if(isFollowWeChat){
                sql += "  AND p.openid IS NOT NULL AND p.openid <>'' ";
                sql += "  AND p.openid IS NOT NULL AND p.openid <>'' ";
            }
            }
            if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
                sql = sql + " AND tp.doctor_code ='"+doctor+"' AND tp.team_code"+teamCode;
            }
    
    
            sql = sql + " order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
            sql = sql + " order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
            if(StringUtils.isNotBlank(diseaseCondition)) {
            if(StringUtils.isNotBlank(diseaseCondition)) {
@ -1099,7 +1105,7 @@ public class SignPatientLabelInfoService extends BaseService {
     * @param teamCode  标签类型为4时,不能为空
     * @param teamCode  标签类型为4时,不能为空
     * @return
     * @return
     */
     */
    public JSONArray getPatientAmountByLabelType(String doctor, String labelType, Long teamCode, boolean isSlowDisease, String diseaseCondition) throws Exception {
    public JSONArray getPatientAmountByLabelType(String doctor, String labelType, Long teamCode, boolean isSlowDisease, String diseaseCondition,String trackFlag) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        Doctor doc = doctorDao.findByCode(doctor);
        if (doc == null) {
        if (doc == null) {
@ -1177,8 +1183,12 @@ public class SignPatientLabelInfoService extends BaseService {
                                "     count(DISTINCT t1.patient) count" +
                                "     count(DISTINCT t1.patient) count" +
                                " FROM wlyy_sign_family t1 " +
                                " FROM wlyy_sign_family t1 " +
                                " RIGHT JOIN wlyy_sign_patient_label_info t2 ON t1.patient = t2.patient and t2.status=1 " +
                                " RIGHT JOIN wlyy_sign_patient_label_info t2 ON t1.patient = t2.patient and t2.status=1 " +
                                " JOIN wlyy_patient t3 ON t1.patient = t3.code " +
                                " WHERE" +
                                " JOIN wlyy_patient t3 ON t1.patient = t3.code " ;
                                //1.4.2新增重点居民跟踪过滤
                                if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
                                     sql = sql +" JOIN wlyy_track_patient tp ON tp.patient_code = t3.code";
                                }
                        sql = sql +" WHERE" +
                                "     t1.patient = t2.patient " +
                                "     t1.patient = t2.patient " +
                                "     AND t1.patient = t3.code "+
                                "     AND t1.patient = t3.code "+
                                "     AND t2.label = ? " +
                                "     AND t2.label = ? " +
@ -1188,6 +1198,10 @@ public class SignPatientLabelInfoService extends BaseService {
                                "     AND t1.status > 0 " +
                                "     AND t1.status > 0 " +
                                (teamCode > 0 ? "    AND t1.admin_team_code = ? " : "")+
                                (teamCode > 0 ? "    AND t1.admin_team_code = ? " : "")+
                                "     AND t3.disease_condition = ? ";
                                "     AND t3.disease_condition = ? ";
                                //1.4.2新增重点居民跟踪过滤
                                if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
                                    sql = sql + " AND tp.doctor_code='"+doctor+"' AND tp.team_code ="+teamCode;
                                }
                        if (teamCode > 0) {
                        if (teamCode > 0) {
                            args = new Object[]{label.getLabelCode(), labelType, doctor, doctor, teamCode,diseaseCondition};
                            args = new Object[]{label.getLabelCode(), labelType, doctor, doctor, teamCode,diseaseCondition};

+ 209 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java

@ -17,9 +17,11 @@ import com.yihu.wlyy.repository.doctor.*;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.TrackPatientDao;
import com.yihu.wlyy.repository.patient.TrackPatientDao;
import com.yihu.wlyy.repository.patient.scheme.PatientSchemeListDao;
import com.yihu.wlyy.repository.patient.scheme.PatientSchemeListDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
@ -41,7 +43,7 @@ import java.util.*;
 * @date 2017/9/13 15:46
 * @date 2017/9/13 15:46
 */
 */
@Service
@Service
public class DoctorSchemeService {
public class DoctorSchemeService extends BaseService{
    private static Logger logger = LoggerFactory.getLogger(DoctorSchemeService.class);
    private static Logger logger = LoggerFactory.getLogger(DoctorSchemeService.class);
    @Autowired
    @Autowired
@ -91,10 +93,15 @@ public class DoctorSchemeService {
     * @date 2017/9/13 16:23
     * @date 2017/9/13 16:23
     * @return
     * @return
     */
     */
    public List<String> getPatientsByDiseaseConditionDiseaseDeviceType(String teamCode, Integer disease, String diseaseCondition, Integer deviceType,String doctorcode) throws Exception{
    public List<String> getPatientsByDiseaseConditionDiseaseDeviceType(String teamCode, Integer disease, String diseaseCondition, Integer deviceType,String doctorcode,String trackFlag) throws Exception{
        String sql = "select DISTINCT p.code from wlyy_patient p ";
        String sql = "select DISTINCT p.code from wlyy_patient p ";
        //1.4.2加入跟踪居民过滤
        if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
            sql = sql + " JOIN wlyy_track_patient tp ON tp.patientCode = p.code ";
        }
        if(-1 != deviceType){
        if(-1 != deviceType){
            sql = sql + " LEFT JOIN wlyy_patient_device dev on dev.user = p.code ";
            sql = sql + " LEFT JOIN wlyy_patient_device dev on dev.user = p.code ";
        }
        }
@ -127,6 +134,12 @@ public class DoctorSchemeService {
        sql = sql + " and p.status > 0 and sp.label_type = 3 and sf.status > 0 ";
        sql = sql + " and p.status > 0 and sp.label_type = 3 and sf.status > 0 ";
        //1.4.2加入跟踪居民过滤
        if(StringUtils.isNotBlank(trackFlag)&&"1".equals(trackFlag)){
            sql = sql + " AND pt.doctor_code = '"+doctorcode+"' AND pt.teamCode = "+teamCode;
        }
        List<String> result = jdbcTemplate.queryForList(sql,new Object[]{},String.class);
        List<String> result = jdbcTemplate.queryForList(sql,new Object[]{},String.class);
@ -1213,4 +1226,198 @@ public class DoctorSchemeService {
        }
        }
        return (Long)reviewedCount.get("reviewedCount");
        return (Long)reviewedCount.get("reviewedCount");
    }
    }
    public Map<String,Object> getTrackPatientAimByteam(String doctor ,Long teamCode,String startDate,String endDate){
        startDate = startDate +" 00:00:00";
        endDate = endDate +" 23:59:59";
        String presSql="SELECT " +
                " COUNT(1) AS dbCount " +
                " FROM " +
                " ( " +
                "  SELECT " +
                "   i.`user`, " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "    WHERE  " +
                "   i.`user` in  " +
                "    ( " +
                "     SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
                "    ) " +
                "  AND i.del ='1' " +
                "  AND i.type = 2  " +
                "  AND i.record_date >= '"+startDate+"' " +
                "  AND i.record_date <= '"+endDate+"' " +
                "  GROUP BY " +
                "   i.`user` " +
                " ) tt " +
                " LEFT JOIN  " +
                " ( " +
                " SELECT " +
                "  i.`user`, " +
                "  COUNT(1) AS dbtotal " +
                " FROM " +
                "  device.wlyy_patient_health_index i " +
                " JOIN wlyy_patient_aim_blood_pressure p ON p.patientcode = i.`user` " +
                " WHERE " +
                "  i.`user` in  " +
                "    ( " +
                "     SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
                "    ) " +
                "  AND " +
                "  i.value1 <= p.sbp  " +
                "  AND  " +
                "  i.value1 >= p.sbp_min  " +
                "  AND i.del ='1'  " +
                "  AND i.type = 2   " +
                "  AND i.record_date >= '"+startDate+"' " +
                "  AND i.record_date <= '"+endDate+"' " +
                " GROUP BY " +
                "  i.`user` " +
                " ) dbt ON tt.`user`=dbt.`user` " +
                " WHERE dbt.dbtotal/tt.total > 0.7";
        Map<String,Object> rs = new HashedMap();
        List<Map<String,Object>> presTotal = jdbcTemplate.queryForList(presSql);
        if(presTotal!=null&&presTotal.size()>0){
            rs.put("dbPresCount",presTotal.get(0).get("dbCount"));
        }else {
            rs.put("dbPresCount",0);
        }
        //餐前达标数量
        List<Map<String,Object>> cqXT = jdbcTemplate.queryForList(getXTSql( doctor , teamCode, startDate, endDate, "0"));
        Long cqtotal;
        if(cqXT!=null&&cqXT.size()>0){
            cqtotal = (Long)cqXT.get(0).get("dbCount");
        }else{
            cqtotal = 0L;
        }
        //餐后达标数量
        List<Map<String,Object>> chXT = jdbcTemplate.queryForList(getXTSql( doctor , teamCode, startDate, endDate, "1"));
        Long chtotal;
        if(chXT!=null&&chXT.size()>0){
            chtotal = (Long)chXT.get(0).get("dbCount");
        }else{
            chtotal = 0L;
        }
        rs.put("dbSuggerCount",chtotal+cqtotal);
        return rs;
    }
    /**
     *
     * @param doctor
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param state 0 餐前,1餐后
     * @return
     */
    public String getXTSql(String doctor ,Long teamCode,String startDate,String endDate,String state){
        String value2 ="1,3,5,7";
        if("1".equals(state)){
            value2 = "2,4,6";
        }
        //餐前血糖达标数
        String xtSql = "SELECT " +
                " COUNT(1) AS dbCount " +
                " FROM " +
                " ( " +
                "  SELECT " +
                "   i.`user`, " +
                "   COUNT(1) AS total " +
                "  FROM " +
                "   device.wlyy_patient_health_index i " +
                "    WHERE  " +
                "   i.`user` in  " +
                "    ( " +
                "     SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
                "    ) " +
                "  AND i.del ='1' " +
                "  AND i.type = 1  " +
                "  AND i.record_date >= '"+startDate+"' " +
                "  AND i.record_date <= '"+endDate+"' " +
                "  GROUP BY " +
                "   i.`user` " +
                " ) tt " +
                " LEFT JOIN  " +
                " ( " +
                " SELECT " +
                "  i.`user`, " +
                "  COUNT(1) AS dbtotal " +
                " FROM " +
                "  device.wlyy_patient_health_index i " +
                " JOIN wlyy_patient_aim_blood_sugger p ON p.patientcode = i.`user` " +
                " WHERE " +
                "  i.`user` in  " +
                "    ( " +
                "     SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
                "    ) " +
                "  AND " +
                "  i.value1 <= p.fbg  " +
                "  AND  " +
                "  i.value1 >= p.fbg_min  " +
                "  AND i.value2 in("+value2+") " +
                "  AND i.del ='1'  " +
                "  AND i.type = 1   " +
                "  AND i.record_date >= '"+startDate+"' " +
                "  AND i.record_date <= '"+endDate+"' " +
                " GROUP BY " +
                "  i.`user` " +
                " ) dbt ON tt.`user`=dbt.`user` " +
                " WHERE dbt.dbtotal/tt.total > 0.7";
        return xtSql;
    }
    public Map<String,Object> getDeviceStateByTeam(String doctor ,Long teamCode){
        String sql ="SELECT " +
                " COUNT(1) AS total " +
                " FROM " +
                " wlyy_patient_device d JOIN  " +
                " wlyy_track_patient t ON t.patient_code = d.`user` " +
                " WHERE  " +
                " d.category_code = ? " +
                " AND t.doctor_code = '"+doctor+"' " +
                " AND t.team_code = "+teamCode;
        Map<String,Object> rs = new HashedMap();
        //血糖仪
        List<Map<String,Object>> xt = jdbcTemplate.queryForList(sql,new Object[]{"1"});
        if(xt!=null&&xt.size()>0){
            rs.put("suggerDevCount",xt.get(0).get("total"));
        }else{
            rs.put("suggerDevCount",0);
        }
        //血压计
        List<Map<String,Object>> xh = jdbcTemplate.queryForList(sql,new Object[]{"2"});
        if(xh!=null&&xh.size()>0){
            rs.put("presDevCount",xh.get(0).get("total"));
        }else{
            rs.put("presDevCount",0);
        }
        return rs;
    }
    public String setPatientAim(String patients ,String suggerJson,String presJson){
        if(StringUtils.isNotBlank(patients)){
            String[] patient = patients.split(",");
            for(String p : patient){
                net.sf.json.JSONObject sj  = net.sf.json.JSONObject.fromObject(suggerJson);
                net.sf.json.JSONObject pj  = net.sf.json.JSONObject.fromObject(presJson);
                PatientAimBloodSugger patientAimBloodSugger = (PatientAimBloodSugger)net.sf.json.JSONObject.toBean(sj,PatientAimBloodSugger.class);
                PatientAimBloodPressure patientAimBloodPressure = (PatientAimBloodPressure)net.sf.json.JSONObject.toBean(pj,PatientAimBloodPressure.class);
                patientAimBloodSugger.setCode(getCode());
                patientAimBloodSugger.setCreateTime(new Date());
                patientAimBloodSuggerDao.save(patientAimBloodSugger);
                patientAimBloodPressure.setCode(getCode());
                patientAimBloodPressure.setCreateTime(new Date());
                patientAimBloodPressureDao.save(patientAimBloodPressure);
            }
        }
        return "0";
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -938,7 +938,7 @@ public class JMJkEduArticleService extends BaseService {
    }
    }
    private void getPatientByGroup(String userCode,String labelCode, String labelType, Long teamCode, Set<String> patientSet, int page, int pagesize) throws Exception {
    private void getPatientByGroup(String userCode,String labelCode, String labelType, Long teamCode, Set<String> patientSet, int page, int pagesize) throws Exception {
        org.json.JSONArray result = signPatientLabelInfoService.getPatientByLabel(userCode, labelCode, labelType, teamCode, page, pagesize, false, "",true);
        org.json.JSONArray result = signPatientLabelInfoService.getPatientByLabel(userCode, labelCode, labelType, teamCode, page, pagesize, false, "",true,null);
        for (Object o : result) {
        for (Object o : result) {
            org.json.JSONObject json = (org.json.JSONObject) o;
            org.json.JSONObject json = (org.json.JSONObject) o;
            String patient = (String) json.get("code");
            String patient = (String) json.get("code");

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

@ -512,7 +512,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    }
    }
    private void getPatientByGroup(String labelCode, String labelType, Long teamCode, Set<String> patientSet, int page, int pagesize) throws Exception {
    private void getPatientByGroup(String labelCode, String labelType, Long teamCode, Set<String> patientSet, int page, int pagesize) throws Exception {
        JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize, false, "",false);
        JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize, false, "",false,null);
        for (Object o : result) {
        for (Object o : result) {
            JSONObject json = (JSONObject) o;
            JSONObject json = (JSONObject) o;
            String patient = (String) json.get("code");
            String patient = (String) json.get("code");

+ 6 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -171,7 +171,8 @@ public class SignPatientLabelInfoController extends BaseController {
                                        @RequestParam(required = false) int pagesize,
                                        @RequestParam(required = false) int pagesize,
                                        @RequestParam(required = false) String diseaseCondition,
                                        @RequestParam(required = false) String diseaseCondition,
                                        @RequestParam(required = false) boolean isSlowDisease,
                                        @RequestParam(required = false) boolean isSlowDisease,
                                        @RequestParam(required = false) boolean isFollowWeChat) {
                                        @RequestParam(required = false) boolean isFollowWeChat,
                                        @RequestParam(required = false) String trackFlag) {
        try {
        try {
            if (StringUtils.isEmpty(labelCode)) {
            if (StringUtils.isEmpty(labelCode)) {
                return error(-1, "标签cdoe不能为空");
                return error(-1, "标签cdoe不能为空");
@ -192,7 +193,7 @@ public class SignPatientLabelInfoController extends BaseController {
                return write(200, "查询成功", "data", jsonObject);
                return write(200, "查询成功", "data", jsonObject);
            }
            }
            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat);
            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat,trackFlag);
//            JSONArray result = labelInfoService.getPatientByLabel("xy201703150222", labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat);
//            JSONArray result = labelInfoService.getPatientByLabel("xy201703150222", labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat);
            return write(200, "查询成功", "data", result);
            return write(200, "查询成功", "data", result);
@ -309,7 +310,8 @@ public class SignPatientLabelInfoController extends BaseController {
            @RequestParam(required = false) String labelType,
            @RequestParam(required = false) String labelType,
            @RequestParam(required = false) Long teamCode,
            @RequestParam(required = false) Long teamCode,
            @RequestParam(required = false) boolean isSlowDisease,
            @RequestParam(required = false) boolean isSlowDisease,
            @RequestParam(required = false) String diseaseCondition) {
            @RequestParam(required = false) String diseaseCondition,
            @RequestParam(required = false)String trackFlag) {
        try {
        try {
            if (StringUtils.isEmpty(labelType)) {
            if (StringUtils.isEmpty(labelType)) {
                return error(-1, "标签类型不能为空");
                return error(-1, "标签类型不能为空");
@ -331,7 +333,7 @@ public class SignPatientLabelInfoController extends BaseController {
                return write(200, "查询成功", "data", r);
                return write(200, "查询成功", "data", r);
            }
            }
            JSONArray result = labelInfoService.getPatientAmountByLabelType(getUID(), labelType, teamCode,isSlowDisease,diseaseCondition);
            JSONArray result = labelInfoService.getPatientAmountByLabelType(getUID(), labelType, teamCode,isSlowDisease,diseaseCondition,trackFlag);
            return write(200, "查询成功", "data", result);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
        } catch (Exception e) {

+ 42 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/scheme/DoctroSchemeController.java

@ -36,11 +36,12 @@ public class DoctroSchemeController extends BaseController {
            @ApiParam(name="teamCode", value="团队CODE") @RequestParam(value = "teamCode",required = true,defaultValue = "642") String teamCode,
            @ApiParam(name="teamCode", value="团队CODE") @RequestParam(value = "teamCode",required = true,defaultValue = "642") String teamCode,
            @ApiParam(name="disease", value="疾病类型,-1全部,0健康,1高血压,2糖尿病,3高血压+糖尿病",defaultValue = "-1") @RequestParam(value = "disease",required = true) Integer disease,
            @ApiParam(name="disease", value="疾病类型,-1全部,0健康,1高血压,2糖尿病,3高血压+糖尿病",defaultValue = "-1") @RequestParam(value = "disease",required = true) Integer disease,
            @ApiParam(name="diseaseCondition", value="居民标签:0绿标,1黄标,2红标",defaultValue = "0,1,2") @RequestParam(value = "diseaseCondition",required = true) String diseaseCondition,
            @ApiParam(name="diseaseCondition", value="居民标签:0绿标,1黄标,2红标",defaultValue = "0,1,2") @RequestParam(value = "diseaseCondition",required = true) String diseaseCondition,
            @ApiParam(name="deviceType", value="设备类型:-1全部,0未绑定,1已绑定",defaultValue = "-1") @RequestParam(value = "deviceType",required = true) Integer deviceType
            @ApiParam(name="deviceType", value="设备类型:-1全部,0未绑定,1已绑定",defaultValue = "-1") @RequestParam(value = "deviceType",required = true) Integer deviceType,
            @ApiParam(name="trackFlag", value="过滤跟踪居民:1为过滤跟踪,不传或其他值为不过滤",defaultValue = "-1") @RequestParam(value = "trackFlag",required = false)String trackFlag
            ){
            ){
        try {
        try {
            List<String> result = doctorSchemeService.getPatientsByDiseaseConditionDiseaseDeviceType(teamCode,disease,diseaseCondition,deviceType,getUID());
            List<String> result = doctorSchemeService.getPatientsByDiseaseConditionDiseaseDeviceType(teamCode,disease,diseaseCondition,deviceType,getUID(),trackFlag);
            return write(200, "查询成功", "data", result);
            return write(200, "查询成功", "data", result);
        }catch (Exception e){
        }catch (Exception e){
@ -210,6 +211,7 @@ public class DoctroSchemeController extends BaseController {
    }
    }
    @RequestMapping(value="setDoctorSwitchTrackPatient",method = RequestMethod.GET)
    @RequestMapping(value="setDoctorSwitchTrackPatient",method = RequestMethod.GET)
    @ApiOperation("医生跟踪预警居民开关接口")
    @ApiOperation("医生跟踪预警居民开关接口")
    @ObserverRequired
    public String setDoctorSwitchTrackPatient(@ApiParam(name="state", value="0不自动跟踪居民,1自动跟踪预警居民") @RequestParam(value = "state",required = true)String state){
    public String setDoctorSwitchTrackPatient(@ApiParam(name="state", value="0不自动跟踪居民,1自动跟踪预警居民") @RequestParam(value = "state",required = true)String state){
        try {
        try {
            return write(200, "操作成功", "data",doctorSchemeService.setDoctorSwitchTrackPatient(getUID(),state));
            return write(200, "操作成功", "data",doctorSchemeService.setDoctorSwitchTrackPatient(getUID(),state));
@ -278,6 +280,44 @@ public class DoctroSchemeController extends BaseController {
        }
        }
    }
    }
    @RequestMapping(value="getTrackPatientAimByteam",method = RequestMethod.GET)
    @ApiOperation(" 获取团队医生下,居民近一周控制目标情况")
    public String getTrackPatientAimByteam( @ApiParam(name="teamCode", value="团队Code") @RequestParam(value = "teamCode",required = true)Long teamCode,
                                           @ApiParam(name="startDate", value="开始时间,YYYY-MM-dd") @RequestParam(value = "startDate",required = true)String startDate,
                                           @ApiParam(name="endDate", value="结束时间,YYYY-MM-dd") @RequestParam(value = "endDate",required = true)String endDate){
        try {
            return write(200, "查询成功", "data",doctorSchemeService.getTrackPatientAimByteam(getUID(),teamCode,startDate,endDate));
        }catch (Exception e){
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value="getDeviceStateByTeam",method = RequestMethod.GET)
    @ApiOperation("获取团队医生下,居民设备绑定情况")
    public String getDeviceStateByTeam(@ApiParam(name="teamCode", value="团队Code") @RequestParam(value = "teamCode",required = true)Long teamCode){
        try {
            return write(200, "查询成功", "data",doctorSchemeService.getDeviceStateByTeam(getUID(),teamCode));
        }catch (Exception e){
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value="setPatientAim",method = RequestMethod.GET)
    @ApiOperation("批量控制目标设置")
    public String setPatientAim(@ApiParam(name="patient", value="患者code,用“,”分割") @RequestParam(value = "patient",required = true)String patient,
                                @ApiParam(name="suggerJson", value="血糖目标实体") @RequestParam(value = "suggerJson",required = true)String suggerJson,
                                @ApiParam(name="pressureJson", value="血压目标实体") @RequestParam(value = "pressureJson",required = true)String pressureJson){
        try {
            return write(200, "操作成功", "data",doctorSchemeService.setPatientAim(patient,suggerJson,pressureJson));
        }catch (Exception e){
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "操作失败");
        }
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcLableController.java

@ -101,7 +101,7 @@ public class GcLableController extends BaseController {
            @ApiParam(name = "isFollowWeChat", value = "是否过滤微信关注居民", required = false) @RequestParam(value="isFollowWeChat",required = false,defaultValue = "false") boolean isFollowWeChat
            @ApiParam(name = "isFollowWeChat", value = "是否过滤微信关注居民", required = false) @RequestParam(value="isFollowWeChat",required = false,defaultValue = "false") boolean isFollowWeChat
    ) {
    ) {
        try {
        try {
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "",isFollowWeChat);
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "",isFollowWeChat,null);
            List<PatientModel> patientLabelModels = new ArrayList<>();
            List<PatientModel> patientLabelModels = new ArrayList<>();
            for (int i = 0; i < result.length(); i++) {
            for (int i = 0; i < result.length(); i++) {
                JSONObject jo = result.getJSONObject(i);
                JSONObject jo = result.getJSONObject(i);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduLableController.java

@ -100,7 +100,7 @@ public class EduLableController extends BaseController {
            @ApiParam(name = "isFollowWeChat", value = "是否过滤微信关注居民", required = true) @RequestParam(value="isFollowWeChat",required = false,defaultValue = "false") boolean isFollowWeChat
            @ApiParam(name = "isFollowWeChat", value = "是否过滤微信关注居民", required = true) @RequestParam(value="isFollowWeChat",required = false,defaultValue = "false") boolean isFollowWeChat
    ) {
    ) {
        try {
        try {
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "",isFollowWeChat);
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "",isFollowWeChat,null);
            List<PatientModel> patientLabelModels = new ArrayList<>();
            List<PatientModel> patientLabelModels = new ArrayList<>();
            for (int i = 0; i < result.length(); i++) {
            for (int i = 0; i < result.length(); i++) {
                JSONObject jo = result.getJSONObject(i);
                JSONObject jo = result.getJSONObject(i);