Prechádzať zdrojové kódy

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

chenweida 8 rokov pred
rodič
commit
4c44c12922

+ 1 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/Patient.java

@ -174,6 +174,7 @@ public class Patient extends IdEntity implements Serializable {
		this.ssc = ssc;
	}
	@Column(name = "photo", insertable = false)
	public String getPhoto() {
		return photo;
	}

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -239,11 +239,11 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	Page<ConsultTeam> findFamousDoctorIngNoTitleList(String uid, Pageable pageRequest);
	//三师家庭咨询 -全部 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.id < ?2 and a.status = 0 and  b.reply = 1 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.id < ?2 and a.status = 0 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findDoctorIngNoTitleList(String uid, long id, Pageable pageRequest);
	//三师家庭咨询 -全部 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.status = 0 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findDoctorIngNoTitleList(String uid, Pageable pageRequest);
    // 更新超过24小时未回复的项目,多加一分钟,防止过于频繁更新

+ 1 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/SignPatientLabelInfoDao.java

@ -62,6 +62,7 @@ public interface SignPatientLabelInfoDao extends
    int deleteByPatientAndLabelTypeAndStatus(String patient, String labelType, Integer status);
    @Modifying
    @Query("update SignPatientLabelInfo set status = 0 where label = ?1 and status = 1")
    int deleteByLabel(String labelCode);
    /**

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

@ -222,7 +222,7 @@ public class SignPatientLabelInfoService extends BaseService {
                        " FROM " +
                        "    wlyy_sign_family t1 " +
                        " left join " +
                        "    (select repl.patient,repl.label,repl.label_type,repl.label_name from wlyy_sign_family repf left join wlyy_sign_patient_label_info repl on repf.patient = repl.patient where repf.repdoctor = '" + doctor + "' and repf.status > 0 and repl.label_type = ?) t2 " +
                        "    (select repl.patient,repl.label,repl.label_type,repl.label_name from wlyy_sign_family repf left join wlyy_sign_patient_label_info repl on repf.patient = repl.patient where repf.repdoctor = '" + doctor + "' and repf.status > 0 and repl.label_type = ? and repl.status = 1) t2 " +
                        " on t1.patient = t2.patient " +
                        " WHERE " +
                        "    t2.patient is null " +
@ -592,7 +592,7 @@ public class SignPatientLabelInfoService extends BaseService {
                                " FROM" +
                                "     wlyy_sign_family t1 " +
                                " left join " +
                                "    (select repl.patient,repl.label,repl.label_type,repl.label_name from wlyy_sign_family repf left join wlyy_sign_patient_label_info repl on repf.patient = repl.patient where  repf.repdoctor = '" + doctor + "' and repf.status > 0 and repl.label_type = ?) t2 " +
                                "    (select repl.patient,repl.label,repl.label_type,repl.label_name from wlyy_sign_family repf left join wlyy_sign_patient_label_info repl on repf.patient = repl.patient where  repf.repdoctor = '" + doctor + "' and repf.status > 0 and repl.label_type = ? and repl.status = 1) t2 " +
                                " on t1.patient = t2.patient " +
                                " WHERE" +
                                "     t2.patient is null " +
@ -746,7 +746,7 @@ public class SignPatientLabelInfoService extends BaseService {
                                " FROM" +
                                "     wlyy_sign_family t1 " +
                                " left join " +
                                "    (select repl.patient,repl.label,repl.label_type,repl.label_name from wlyy_sign_family repf left join wlyy_sign_patient_label_info repl on repf.patient = repl.patient where  repf.status > 0 and repl.label_type = ?) t2 " +
                                "    (select repl.patient,repl.label,repl.label_type,repl.label_name from wlyy_sign_family repf left join wlyy_sign_patient_label_info repl on repf.patient = repl.patient where  repf.status > 0 and repl.label_type = ? and repl.status = 1) t2 " +
                                " on t1.patient = t2.patient " +
                                " WHERE" +
                                "     t2.patient is null " +
@ -1475,7 +1475,9 @@ public class SignPatientLabelInfoService extends BaseService {
            return -1;
        }
        labelInfoDao.delete(labelInfo);
        labelInfo.setStatus(0);
        labelInfoDao.save(labelInfo);
        return 1;
    }

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

@ -325,7 +325,7 @@ public class StatisticsAllService extends BaseService {
        String redisNum = "";
        try {
            redisNum = redisTemplate.opsForValue().get("people:num:" + area);
        }catch (Exception e){
        } catch (Exception e) {
            redisNum = "";
        }
        if (StringUtils.isEmpty(redisNum)) {
@ -365,12 +365,12 @@ public class StatisticsAllService extends BaseService {
        signRate.put("sign", total);
        signRate.put("people", num);
        signRate.put("rate", df.format((total * 1.0000) / num * 100));
        json.put("signRate",signRate);
        json.put("signRate", signRate);
        JSONObject signTaskRate = new JSONObject();
        signTaskRate.put("sign", total);
        signTaskRate.put("people", taskNum);
        signTaskRate.put("rate", df.format((total * 1.0000) / taskNum * 100));
        json.put("signTaskRate",signTaskRate);
        json.put("signTaskRate", signTaskRate);
        return json;
    }
@ -412,7 +412,7 @@ public class StatisticsAllService extends BaseService {
                    String redisNum = "";
                    try {
                        redisNum = redisTemplate.opsForValue().get("people:num:" + map.get("code").toString());
                    }catch (Exception e){
                    } catch (Exception e) {
                        redisNum = "";
                    }
                    if (StringUtils.isEmpty(redisNum)) {
@ -521,7 +521,7 @@ public class StatisticsAllService extends BaseService {
                    String redisNum = "";
                    try {
                        redisNum = redisTemplate.opsForValue().get("people:num:" + map.get("code").toString());
                    }catch (Exception e){
                    } catch (Exception e) {
                        redisNum = "";
                    }
                    if (StringUtils.isEmpty(redisNum)) {
@ -567,6 +567,64 @@ public class StatisticsAllService extends BaseService {
        }
    }
    public JSONArray getLowLevelTotalSpecial(String date, String area, int level, String index, int sort, String lowLevel) throws Exception {
        JSONArray result = new JSONArray();
        List<Map<String, Object>> resultList = new ArrayList<>();
        String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
        String areaField = "";
        String lowLevelField = "";
        String lowLevelName = "";
        if (level == 4) {
            // 市级别
            areaField = "city";
        } else if (level == 3) {
            // 区、城镇级别
            areaField = "town";
        } else if (level == 2) {
            // 机构级别
            areaField = "org_code";
        } else if (level == 1) {
            throw new Exception("param level error");
        }
        if (low_level.equals("3")) {
            lowLevelField = "town";
            lowLevelName = "town_name";
        } else if (low_level.equals("2")) {
            lowLevelField = "org_code";
            lowLevelName = "org_name";
        } else if (low_level.equals("1")) {
            lowLevelField = "qkdoctor_code";
            lowLevelName = "qkdoctor_name";
        } else {
            throw new Exception("param lowLevel error");
        }
        // 查询语句
        String sql = " select " +
                "     ifnull(" + lowLevelField + ",'') code " +
                "     ,ifnull(" + lowLevelName + ",'') 'name' " +
                "     ,ifnull(result,'0/0') amount" +
                " from  " +
                "     wlyy_quota_result " +
                " where " +
                "     quato_code = '" + index + "' " +
                "   and level1_type = ? and del = '1'" +
                "   and quota_date = ? " +
                "   and " + areaField + " = ? ";
        resultList = jdbcTemplate.queryForList(sql, new Object[]{low_level, date, area});
        if (resultList == null || resultList.size() < 1) {
            resultList = getLowLevelMapKey(level, low_level, area);
        }
        return result;
    }
    /**
     * 获取过去某个日期某个区域一级指标的下级统计
     *
@ -1430,7 +1488,7 @@ public class StatisticsAllService extends BaseService {
            String redisNum = "";
            try {
                redisNum = redisTemplate.opsForValue().get("people:num:" + area);
            }catch (Exception e){
            } catch (Exception e) {
                redisNum = "";
            }
@ -1450,7 +1508,7 @@ public class StatisticsAllService extends BaseService {
            String redisNum = "";
            try {
                redisNum = redisTemplate.opsForValue().get("people:num:" + area);
            }catch (Exception e){
            } catch (Exception e) {
                redisNum = "";
            }
            if (StringUtils.isEmpty(redisNum)) {

+ 36 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelController.java

@ -1,7 +1,9 @@
package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
import com.yihu.wlyy.service.app.label.SignPatientLabelService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.web.BaseController;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -9,8 +11,10 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
@ -24,6 +28,8 @@ public class SignPatientLabelController extends BaseController {
    @Autowired
    SignPatientLabelService labelService;
    @Autowired
    AdminTeamService teamService;
    /**
     * 添加标签
@ -236,4 +242,34 @@ public class SignPatientLabelController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value = "/patient_teams")
    public String getTeamsLabelsByPatient(@RequestParam String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "居民不能为空");
            }
            JSONArray teams = teamService.findPatientDoctorTeam(patient, getUID());
            if(teams != null && teams.length() > 0){
                for(int i = 0; i < teams.length(); i++){
                    JSONObject team = teams.getJSONObject(i);
                    List<SignPatientLabel> labels = labelService.getLabelsByTypeAndTeam("4", String.valueOf(team.getLong("id")));
                    if(labels != null){
                        team.put("labels",new JSONArray(labels));
                    } else {
                        team.put("labels",new JSONArray());
                    }
                }
            }
            return write(200, "查询成功", "data", teams);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

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

@ -64,7 +64,7 @@ wechat_token=27eb3bb24f149a7760cf1bb154b08040
#是否签约检查和签约数据上传
sign_check_upload=http://172.19.103.87:8011/wlyy_service
#im一对一列表获取
im_list_get=http://localhost:3000/
im_list_get=http://172.19.103.76:3000/
#-------------测试------------#
#server_ip=ehr.yihu.com