소스 검색

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

zd_123 7 년 전
부모
커밋
94ada1972e

BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class


+ 12 - 12
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -746,23 +746,23 @@ public class ArticleDao {
		StringBuffer param = new StringBuffer();
		StringBuffer pageParam = new StringBuffer();
		if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
			param.append(" and FirstLevelCategoryId = ? ");
			param.append(" and m.FirstLevelCategoryId = ? ");
			sql.addParamValue(vo.getFirstLevelCategoryId());
		}
		if (StringUtil.isNotEmpty(vo.getSecondLevelCategoryId())) {
			param.append(" and SecondLevelCategoryId = ? ");
			param.append(" and m.SecondLevelCategoryId = ? ");
			sql.addParamValue(vo.getSecondLevelCategoryId());
		}
		if (StringUtil.isNotEmpty(vo.getStartTime())) {
			param.append(" and InsertTime >= ? ");
			param.append(" and m.InsertTime >= ? ");
			sql.addParamValue(vo.getStartTime());
		}
		if (StringUtil.isNotEmpty(vo.getEndTime())) {
			param.append(" and InsertTime <= ? ");
			param.append(" and m.InsertTime <= ? ");
			sql.addParamValue(vo.getEndTime());
		}
		if (StringUtil.isNotEmpty(vo.getArticlelevel())) {
			param.append(" and Articlelevel = ? ");
			param.append(" and m.Articlelevel = ? ");
			sql.addParamValue(vo.getArticlelevel());
		}
		if (vo.getIsAuthentication() != null ) {
@ -791,27 +791,27 @@ public class ArticleDao {
		StringBuffer param2 = new StringBuffer();
        StringBuffer pageParam = new StringBuffer();
        if (StringUtil.isNotEmpty(vo.getFirstLevelCategoryId())) {
            param.append(" and FirstLevelCategoryId = ? ");
            param.append(" and m.FirstLevelCategoryId = ? ");
            sql.addParamValue(vo.getFirstLevelCategoryId());
        }
        if (StringUtil.isNotEmpty(vo.getSecondLevelCategoryId())) {
            param.append(" and SecondLevelCategoryId = ? ");
            param.append(" and m.SecondLevelCategoryId = ? ");
            sql.addParamValue(vo.getSecondLevelCategoryId());
        }
        if (StringUtil.isNotEmpty(vo.getStartTime())) {
            param.append(" and InsertTime >= ? ");
            param.append(" and m.InsertTime >= ? ");
            sql.addParamValue(vo.getStartTime());
        }
        if (StringUtil.isNotEmpty(vo.getEndTime())) {
            param.append(" and InsertTime <= ? ");
            param.append(" and m.InsertTime <= ? ");
            sql.addParamValue(vo.getEndTime());
        }
        if (vo.getIsAuthentication() != null ) {
            param.append(" and IsAuthentication = ? ");
            param.append(" and m.IsAuthentication = ? ");
            sql.addParamValue(vo.getIsAuthentication());
        }
        if (StringUtil.isNotEmpty(vo.getOperatorRoleLevel())) {
            param.append(" and OperatorRoleLevel = ? ");
            param.append(" and m.OperatorRoleLevel = ? ");
            sql.addParamValue(vo.getOperatorRoleLevel());
        }
		if (StringUtil.isNotEmpty(vo.getArticleTitle())) {
@ -819,7 +819,7 @@ public class ArticleDao {
			sql.addParamValue("%"+vo.getArticleTitle()+"%");
		}
        if (StringUtil.isNotEmpty(vo.getOperatorRoleCode())) {
            param.append(" and OperatorRoleCode ='"+vo.getOperatorRoleCode()+"' ");
            param.append(" and m.OperatorRoleCode ='"+vo.getOperatorRoleCode()+"' ");
        }
        sql.addVar("@Condition", param.toString());
        sql.addVar("@PageParam", pageParam.toString());

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

@ -1310,24 +1310,16 @@ public class DoctorSchemeService extends BaseService{
            rs.put("dbPresCount",0);
        }
        //餐前达标数量
        List<Map<String,Object>> cqXT = jdbcTemplate.queryForList(getXTSql( doctor , teamCode, startDate, endDate, "0"));
        Long cqtotal;
        //血糖达标数量
        List<Map<String,Object>> cqXT = jdbcTemplate.queryForList(getXTAimSQL( doctor , teamCode, startDate, endDate));
        Long dbSuggerCount;
        if(cqXT!=null&&cqXT.size()>0){
            cqtotal = (Long)cqXT.get(0).get("dbCount");
            dbSuggerCount = (Long)cqXT.get(0).get("total");
        }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;
            dbSuggerCount = 0L;
        }
        rs.put("dbSuggerCount",chtotal+cqtotal);
        rs.put("dbSuggerCount",dbSuggerCount);
        return rs;
    }
@ -1338,17 +1330,21 @@ public class DoctorSchemeService extends BaseService{
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param state 0 餐前,1餐后
     * @param state 0 餐前,1餐_后
     * @return
     */
    public String getXTSql(String doctor ,Long teamCode,String startDate,String endDate,String state){
        String value1 ="cast(p.fbg as SIGNED INTEGER)";
        String value1min ="cast(p.fbg_min as SIGNED INTEGER)";
        String value2 ="1,3,5,7";
        if("1".equals(state)){
            value2 = "2,4,6";
            value1 = "cast(p.hpg AS SIGNED INTEGER)";
            value1min ="cast(p.hpg_min AS SIGNED INTEGER)";
        }
        //餐前血糖达标数
        String xtSql = "SELECT " +
                " COUNT(1) AS dbCount " +
                " tt.`user` " +
                " FROM " +
                " ( " +
                "  SELECT " +
@ -1362,6 +1358,7 @@ public class DoctorSchemeService extends BaseService{
                "     SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.del='1' AND p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
                "    ) " +
                "  AND i.del ='1' " +
                "  AND i.value2 in("+value2+") " +
                "  AND i.type = 1  " +
                "  AND i.record_date >= '"+startDate+"' " +
                "  AND i.record_date <= '"+endDate+"' " +
@ -1382,9 +1379,9 @@ public class DoctorSchemeService extends BaseService{
                "     SELECT p.patient_code AS `user` FROM wlyy_track_patient p WHERE p.del='1' AND p.doctor_code='"+doctor+"' AND p.team_code =" +teamCode+
                "    ) " +
                "  AND " +
                "  i.value1 <= cast(p.fbg as SIGNED INTEGER)  " +
                "  i.value1 <= " +value1+
                "  AND  " +
                "  i.value1 >= cast(p.fbg_min as SIGNED INTEGER) " +
                "  i.value1 >= " +value1min +
                "  AND i.value2 in("+value2+") " +
                "  AND i.del ='1'  " +
                "  AND i.type = 1   " +
@ -1397,6 +1394,95 @@ public class DoctorSchemeService extends BaseService{
        return xtSql;
    }
    public String getXTAimSQL(String doctor ,Long teamCode,String startDate,String endDate){
        String sql = "SELECT " +
                " COUNT(1) total " +
                " 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.del = '1' " +
                "    AND 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.del = '1' " +
                "   AND p.doctor_code = '"+doctor+"' " +
                "   AND p.team_code = " +teamCode+
                "  ) " +
                " AND i.value1 <= cast(p.fbg AS SIGNED INTEGER) " +
                " AND i.value1 >= cast(p.fbg_min AS SIGNED INTEGER) " +
                " AND i.value2 IN (1,3,5,7)  " +
                " 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`  " +
                " 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.del = '1' " +
                "   AND p.doctor_code = '"+doctor+"' " +
                "   AND p.team_code =  " +teamCode +
                "  ) " +
                " AND i.value1 <= cast(p.hpg AS SIGNED INTEGER) " +
                " AND i.value1 >= cast(p.hpg_min AS SIGNED INTEGER) " +
                " AND i.value2 IN (2,4,6)  " +
                " AND i.del = '1' " +
                " AND i.type = 1 " +
                " AND i.record_date >= '"+startDate+"' " +
                " AND i.record_date <= '"+endDate+"' " +
                " GROUP BY " +
                "  i.`user` " +
                " ) cht ON tt.`user` = cht.`user` " +
                " WHERE " +
                " (IFNULL(dbt.dbtotal,0)+IFNULL(cht.dbtotal,0))/ tt.total > 0.7";
        return sql;
    }
    public Map<String,Object> getDeviceStateByTeam(String doctor ,Long teamCode){
        String sql ="SELECT " +
                " COUNT(1) AS total " +

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

@ -131,7 +131,7 @@ public class JMJkEduArticleService extends BaseService {
//        sql2.append(" and currentUserRoleCode ="+currentUserRole);
//        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
        if(!StringUtils.isEmpty(articleTitle)){
            sql2.append(" and articleTitle like'%"+articleTitle+"%'");
            sql2.append(" and articleTitle like '%"+articleTitle+"%'");
        }
        if(!StringUtils.isEmpty(sendTimeStart)){
            sendTimeStart = elasticsearchUtil.changeTime(sendTimeStart);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/questionnaire/QuestionnaireService.java

@ -227,7 +227,7 @@ public class QuestionnaireService extends BaseService {
	private QuestionnaireWinningESDO doToESDO(QuestionnaireWinning questionnaireWinning){
		QuestionnaireWinningESDO questionnaireWinningESDO = new QuestionnaireWinningESDO();
		questionnaireWinningESDO.setCode(questionnaireWinning.getCode());
		questionnaireWinningESDO.setAddress(questionnaireWinning.getCode());
		questionnaireWinningESDO.setAddress(questionnaireWinning.getAddress());
		questionnaireWinningESDO.setCreate_time(questionnaireWinning.getCreateTime());
		questionnaireWinningESDO.setUpdate_time(questionnaireWinning.getUpdateTime());
		questionnaireWinningESDO.setDel(questionnaireWinning.getDel());

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

@ -7,6 +7,7 @@ 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;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.PatientService;
@ -73,6 +74,8 @@ public class LoginController extends BaseController {
    private LoginLogService loginLogService;
    @Autowired
    private RSAUtils rsaUtils;
    @Autowired
    private DoctorInfoService doctorInfoService;
    /**
@ -191,7 +194,12 @@ public class LoginController extends BaseController {
                        one.put("name", doctor.getHospitalName());
                        one.put("areas", "");
                        one.put("level","4");
                        one.put("authOperate", "0");
                        List<Map<String, Object>> list = doctorInfoService.getDoctorManagerRole(doctor.getCode(),"Manage_Article_Authentication");
                        if(list.size()>0&&!org.springframework.util.StringUtils.isEmpty(list.get(0).get("code"))){
                            one.put("authOperate", "1");
                        }else{
                            one.put("authOperate", "0");
                        }
                        map.put("currentUserRole", one);
                    }
                    if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
@ -272,6 +280,7 @@ public class LoginController extends BaseController {
                    //获取医生角色和区域权限
                    List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
                    map.put("userRole", roleMap);
                    //医生当前登录的角色
                     if(roleMap.size()>0){
@ -285,13 +294,18 @@ public class LoginController extends BaseController {
                        }
                    }else{
                        Map<String, String> one = new HashMap<>();
                         one.put("isManage","0");
                         one.put("code", doctor.getHospital());
                         one.put("name", doctor.getHospitalName());
                         one.put("areas", "");
                         one.put("level","4");
                         one.put("authOperate", "0");
                         map.put("currentUserRole", one);
                        one.put("isManage","0");
                        one.put("code", doctor.getHospital());
                        one.put("name", doctor.getHospitalName());
                        one.put("areas", "");
                        one.put("level","4");
                        List<Map<String, Object>> list = doctorInfoService.getDoctorManagerRole(doctor.getCode(),"Manage_Article_Authentication");
                        if(list.size()>0&&!org.springframework.util.StringUtils.isEmpty(list.get(0).get("code"))){
                            one.put("authOperate", "1");
                        }else{
                            one.put("authOperate", "0");
                        }
                        map.put("currentUserRole", one);
                    }
                    if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
                        errorMessage = "改用户没有管理员权限";

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -529,8 +529,8 @@ public class WeiXinEventProcess {
        picUrlConsult = picUrlConsult.replace("{server}", serverUrl);
        articleConsult.put("Url", urlConsult);
        articleConsult.put("Title", "健康宣传回访,电影票等你来拿~");
        articleConsult.put("Description", "外来流动人口健康宣传回访,快来参加抽取电影票~");
        articleConsult.put("Title", "把健康带回家,流动人口网上回访问卷赢电影票");
        articleConsult.put("Description", "把健康带回家,流动人口网上回访问卷赢电影票");
        articleConsult.put("PicUrl", picUrlConsult);
        articles.add(articleConsult);

BIN
patient-co/patient-co-wlyy/src/main/webapp/images/banner01.png