Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

Conflicts:
	common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java
yeshijie 4 years ago
parent
commit
fedbd86684

+ 2 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistServiceItemDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.specialist;/**
 */
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.UuidIdentityEntityWithOperatorAES;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -17,7 +18,7 @@ import java.io.Serializable;
 **/
@Entity
@Table(name = "wlyy_service_item")
public class SpecialistServiceItemDO extends UuidIdentityEntityWithOperator implements Serializable {
public class SpecialistServiceItemDO extends UuidIdentityEntityWithOperatorAES implements Serializable {
    @Column(name = "saas_id")
    private String saasId; // saasId

+ 2 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistServiceItemOperateLogDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.specialist;/**
 */
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.UuidIdentityEntityWithOperatorAES;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -16,7 +17,7 @@ import java.io.Serializable;
 **/
@Entity
@Table(name = "wlyy_service_item_operate_log")
public class SpecialistServiceItemOperateLogDO extends UuidIdentityEntityWithOperator implements Serializable {
public class SpecialistServiceItemOperateLogDO extends UuidIdentityEntityWithOperatorAES implements Serializable {
    @Column(name = "saas_id")
    private String saasId;

+ 26 - 22
common/common-entity/src/main/java/com/yihu/jw/entity/util/TransforSqlUtl.java

@ -10,33 +10,37 @@ import java.util.List;
 */
public class TransforSqlUtl {
    public static String sqlColumnReplay(String sql, List<String> encryptColumnList, List<String> decryptColumnList){
        if (encryptColumnList!=null){
            for (String tmp:encryptColumnList){
                sql = sql.replaceAll(tmp,"to_base64(AES_ENCRYPT("+tmp+",'jkzl2021ZJXL*#%a'))");
            }
        }
        if (decryptColumnList !=null){
            for (String tmp:decryptColumnList){
                sql = sql.replaceAll(tmp,"AES_DECRYPT(from_base64("+tmp+"),'jkzl2021ZJXL*#%a')");
            }
    public static String wlyySpecialistPatientRelationLike(String sql,String ...replaceName){
        for (String tmp :replaceName){
            String str = "AES_DECRYPT(from_base64("+replaceName+"),'jkzl2021ZJXL*#%a')";
            sql = sql.replaceAll(tmp,str);
        }
        return  sql;
    }
    public static String wlyySpecialistPatientRelationReplay(String sql,String ...replaceName){
        for (String tmp :replaceName){
            String str = "CAST(AES_DECRYPT(from_base64("+replaceName+"),'jkzl2021ZJXL*#%a') AS CHAR ) ";
            sql = sql.replaceAll(tmp,str);
        }
        return  sql;
    }
    public static String wlyy_service_itemAll(String sql){
        String sqlTmp = " *,CAST(AES_DECRYPT(from_base64(create_user_name),'jkzl2021ZJXL*#%a')AS CHAR ) AS create_user_name,\n" +
                "CAST( AES_DECRYPT(from_base64(update_user_name),'jkzl2021ZJXL*#%a')AS CHAR) AS update_user_name\n";
        sql = sql.replace("*", sqlTmp);
        return sql;
    }
    public static String specialistPatientRelation(String sql,String replaceString) {
        String sqlTmp = " id,saas_id,discharge_record,doctor,AES_DECRYPT(from_base64(doctor_name),'jkzl2021ZJXL*#%a') doctor_name,patient,\n" +
                "AES_DECRYPT(from_base64(patient_name),'jkzl2021ZJXL*#%a') patient_name,\n" +
                "health_assistant,AES_DECRYPT(from_base64(health_assistant_name),'jkzl2021ZJXL*#%a') health_assistant_name,team_code,disease,disease_name,\n" +
                "sign_status,`status`,remark,pk_code,sign_code,sign_doctor,\n" +
                "AES_DECRYPT(from_base64(sign_doctor_name),'jkzl2021ZJXL*#%a') sign_doctor_name,\n" +
                "health_doctor,AES_DECRYPT(from_base64(health_doctor_name),'jkzl2021ZJXL*#%a') health_doctor_name,\n" +
                "sign_year,sign_date,create_time,create_user,AES_DECRYPT(from_base64(create_user_name),'jkzl2021ZJXL*#%a') create_user_name,\n" +
                "update_time,update_user,AES_DECRYPT(from_base64(update_user_name),'jkzl2021ZJXL*#%a') update_user_name,\n" +
                "health_status_code,disease_code,sign_certificate,is_manage,manage_user,\n" +
                "manage_time,remind_time ";
        sql = sql.replace(replaceString, sqlTmp);
    public static String specialistPatientRelationAll(String sql) {
        String sqlTmp = " *,CAST(AES_DECRYPT(from_base64(doctor_name),'jkzl2021ZJXL*#%a')AS CHAR ) AS doctor_name,\n" +
                "CAST( AES_DECRYPT(from_base64(patient_name),'jkzl2021ZJXL*#%a')AS CHAR) AS patient_name,\n" +
                "CAST(AES_DECRYPT(from_base64(health_assistant_name),'jkzl2021ZJXL*#%a') AS CHAR) AS health_assistant_name,\n" +
                "CAST(AES_DECRYPT(from_base64(sign_doctor_name),'jkzl2021ZJXL*#%a') AS CHAR) AS sign_doctor_name,\n" +
                "CAST(AES_DECRYPT(from_base64(health_doctor_name),'jkzl2021ZJXL*#%a') AS CHAR) AS health_doctor_name,\n" +
                "CAST(AES_DECRYPT(from_base64(create_user_name),'jkzl2021ZJXL*#%a')AS CHAR)AS create_user_name,\n" +
                "CAST(AES_DECRYPT(from_base64(update_user_name),'jkzl2021ZJXL*#%a')AS CHAR)AS update_user_name \n" ;
        sql = sql.replace("*", sqlTmp);
        return sql;
    }

+ 68 - 79
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -88,12 +88,7 @@ public class SpecialistService{
                "WHERE " +
                " r.doctor = '"+doctor+"' AND r.status >=0  AND r.sign_status >0 ORDER BY r.create_time DESC LIMIT "+(page-1)*size+","+size;
        List<String> tmpDeList = new ArrayList<>();
        tmpDeList.add("r.doctor_name");
        tmpDeList.add("r.patient_name");
        tmpDeList.add("r.health_doctor_name");
        tmpDeList.add("r.sign_doctor_name");
        sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.doctor_name","r.patient_name","r.health_doctor_name","r.sign_doctor_name");
        List<SpecialistPatientRelationVO> specialistPatientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationVO.class));
        String sqlcount = "SELECT count(1) AS total " +
@ -158,9 +153,8 @@ public class SpecialistService{
                "   i.label_type = '7' AND " +
                "   i.status = 1 " +
                " )";
        List<String> tmpDeList = new ArrayList<>();
        tmpDeList.add("r.patient_name");
        sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
@ -203,9 +197,7 @@ public class SpecialistService{
                "  r.doctor = '"+doctor+"' AND r.status >=0  AND r.sign_status >0 "+
                " AND r.health_assistant = '"+assistant+"' LIMIT "+(page-1)*size+","+size;
        List<String> tmpDeList = new ArrayList<>();
        tmpDeList.add("r.patient_name");
        sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
@ -248,10 +240,7 @@ public class SpecialistService{
                " ) lb " +
                " JOIN "+basedb+".wlyy_patient p ON p. CODE = lb.patient " +
                " JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient ";
        List<String> tmpDeList = new ArrayList<>();
        tmpDeList.add("s.patient_name");
        tmpDeList.add("s.health_assistant_name");
        sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"s.patient_name","s.health_assistant_name");
        if(StringUtils.isNotBlank(shareDoctor)){
            sql = sql + " JOIN "+basedb+".wlyy_doctor_special_share sp ON s.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
        }
@ -284,10 +273,7 @@ public class SpecialistService{
//                    "AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
                    " AND a.team_code ='" +teamCode+"' "+
                    " LIMIT "+(page-1)*size+","+size;
            tmpDeList = new ArrayList<>();
            tmpDeList.add("a.patient_name");
            tmpDeList.add("a.health_assistant_name");
            sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
            sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"a.patient_name","a.health_assistant_name");
        }
        
        if("pending".equals(labelType)){
@ -305,10 +291,7 @@ public class SpecialistService{
                    " WHERE a.sign_status> 0 AND a.`status`>=0 AND (a.is_manage = 0 or a.is_manage is null)" +
                    " AND a.team_code ='" +teamCode+"' "+
                    " LIMIT "+(page-1)*size+","+size;
            tmpDeList = new ArrayList<>();
            tmpDeList.add("a.patient_name");
            tmpDeList.add("a.health_assistant_name");
            sql = TransforSqlUtl.sqlColumnReplay(sql,new ArrayList<>(),tmpDeList);
            sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"a.patient_name","a.health_assistant_name");
        }
        List<PatientLabelVO> PatientLabelVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientLabelVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,PatientLabelVOs);
@ -358,7 +341,7 @@ public class SpecialistService{
    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByName(String doctor, String nameKey,String teamCode, Integer page, Integer size){
        String sql ="SELECT " +
                " p.code AS patient,r.patient_name as patientName,  " +
                " p.code AS patient,r.patient_name as patientName  " +
//                " p.`name` AS patientName, " +
                " ,p.photo, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
@ -374,8 +357,9 @@ public class SpecialistService{
                "  t.label_name, " +
                "  t.patient " +
                " FROM " +
                "  "+basedb+".wlyy_sign_patient_label_info t " +
                " WHERE " +
                "  "+basedb+".wlyy_sign_patient_label_info t ";
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
        String tmpSql = " WHERE " +
                "  t.label_type = '8' " +
                " AND t.`status` = '1' " +
                " ) h ON h.patient = r.patient " +
@ -383,9 +367,10 @@ public class SpecialistService{
                " r.doctor IN ( SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+
                "' ) " +
                " AND r.status >=0  AND r.sign_status >0 " +
                " AND " + AesEncryptUtils.decryptMysqlNo("r.patient_name") + " LIKE '%"+nameKey+"%' "+
                " AND " + "r.patient_name" + " LIKE '%"+nameKey+"%' "+
                " LIMIT "+(page-1)*size+","+size;
        tmpSql = TransforSqlUtl.wlyySpecialistPatientRelationLike(tmpSql,"r.patient_name");
        sql = sql+tmpSql;
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
@ -394,8 +379,7 @@ public class SpecialistService{
    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByNameOrIdCard(String doctor, String filter,String teamCode, Integer page, Integer size){
        String sql ="SELECT " +
                " p.code AS code " +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " p.code AS code,r.patient_name as patientName " +
//                " p.`name` AS name, " +
                " ,p.photo, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
@ -412,8 +396,9 @@ public class SpecialistService{
                "  t.label_name, " +
                "  t.patient " +
                " FROM " +
                "  "+basedb+".wlyy_sign_patient_label_info t " +
                " WHERE " +
                "  "+basedb+".wlyy_sign_patient_label_info t " ;
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
        String sqlTmp=  " WHERE " +
                "  t.label_type = '8' " +
                " AND t.`status` = '1' " +
                " ) h ON h.patient = r.patient " +
@ -421,9 +406,10 @@ public class SpecialistService{
                " r.doctor IN ( SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+
                "' ) " +
                " AND r.status >=0  AND r.sign_status >0 " +
                " AND (" +  AesEncryptUtils.decryptMysqlNo("r.patient_name")  + " LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+
                " AND (" +  "r.patient_name"  + " LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+
                " LIMIT "+(page-1)*size+","+size;
        sqlTmp = TransforSqlUtl.wlyySpecialistPatientRelationLike(sqlTmp,"r.patient_name");
        sql = sql+sqlTmp;
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
@ -460,8 +446,8 @@ public class SpecialistService{
        }
        String sql ="SELECT " +
                " p.code AS patient " +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " p.code AS patient ,r.patient_name as patientName" +
                //AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
//                " p.`name` AS patientName, " +
                " ,p.photo, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
@ -487,6 +473,7 @@ public class SpecialistService{
                " AND r.status >=0  AND r.sign_status >0 " +
                " AND r.health_assistant IS NULL "+
                " LIMIT "+(page-1)*size+","+size;
        sql  = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class));
        return MixEnvelop.getSuccessList(SpecialistMapping.api_success,patientRelationVOs,total.intValue());
@ -498,14 +485,14 @@ public class SpecialistService{
        //1.查询该居民是否已经与该专科医生签约
        String checkDoctorSql = "SELECT " +
                " r.id AS relationCode," +
                " r.patient " +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " r.patient ,r.patient_name as patientName " +
                //AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
//                " r.patient_name AS patientName, " +
                " ,r.team_code AS teamCode, " +
                " t.`name`, " +
                " d.photo ," +
                " d.code AS doctor" +
                AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
                " d.code AS doctor, r.doctor_name as doctorName" +
               // AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
//                " d.name AS doctorName" +
                " FROM " +
                " wlyy_specialist_patient_relation r " +
@ -517,6 +504,7 @@ public class SpecialistService{
                " AND r.`status` >= 0 " +
                " AND r.sign_status >=0 " +
                " AND t.available = '1' ";
        checkDoctorSql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(checkDoctorSql,"r.patient_name","r.doctor_name");
        List<SpecialistTeamVO> specialistTeamVOs = jdbcTemplate.query(checkDoctorSql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
        if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){
@ -531,8 +519,8 @@ public class SpecialistService{
        //验证团队是否已经签约
        String checkTeamSql = "SELECT " +
                " r.id AS relationCode," +
                " r.patient " +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " r.patient ,r.patient_name as patientName" +
                //AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
//                " r.patient_name AS patientName, " +
                " ,r.team_code AS teamCode, " +
                " t.`name`, " +
@ -547,6 +535,7 @@ public class SpecialistService{
                " AND r.`status` >=0 " +
                " AND r.sign_status >=0 " +
                " AND t.available = '1' ";
        checkTeamSql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(checkTeamSql,"r.patient_name");
        List<SpecialistTeamVO> teamVOs = jdbcTemplate.query(checkTeamSql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
        if(teamVOs!=null&&teamVOs.size()>0){
@ -612,11 +601,11 @@ public class SpecialistService{
    public MixEnvelop<PatientSignInfoVO, PatientSignInfoVO> findPatientSigninfo(String code){
        String sql = "SELECT " +
                " r.patient " +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " r.patient ,r.patient_name as patientName" +
               // AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
//                " r.patient_name AS patientName, " +
                " ,r.doctor " +
                AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
                " ,r.doctor ,r.doctor_name as doctorName" +
                //AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
//                " r.doctor_name AS doctorName, " +
                " ,d.hospital, " +
                " d.hospital_name AS hospitalName, " +
@ -635,6 +624,7 @@ public class SpecialistService{
                " JOIN "+basedb+".wlyy_admin_team t ON t.id = r.team_code " +
                " WHERE " +
                " r.id = '"+code+"'";
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name","r.doctor_name");
        List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql, new BeanPropertyRowMapper(PatientSignInfoVO.class));
        PatientSignInfoVO patientSignInfoVO = (null != patientSignInfoVOs && patientSignInfoVOs.size() > 0 ? patientSignInfoVOs.get(0) : new PatientSignInfoVO());
        return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientSignInfoVO);
@ -643,14 +633,14 @@ public class SpecialistService{
    public MixEnvelop<SpecialistTeamVO, SpecialistTeamVO> findPatientTeamList(String patient){
        String sql = "SELECT " +
                " r.id AS relationCode, " +
                " r.patient " +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " r.patient r.patient_name as patientName" +
               // AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
//                " r.patient_name AS patientName, " +
                " ,r.team_code,r.sign_date , " +
                " t.`name` AS name," +
                " d.photo," +
                " md.code AS doctor" +
                AesEncryptUtils.decryptMysql("md.name","doctorName") +
                " md.code AS doctor,md.name as doctorName" +
              //  AesEncryptUtils.decryptMysql("md.name","doctorName") +
//                " md.name AS doctorName," +
                ",d.hospital,d.hospital_name " +
                " FROM " +
@ -662,6 +652,7 @@ public class SpecialistService{
                " r.patient = '"+patient+"' " +
                " AND r.`status` >=0  " +
                " AND r.sign_status >0";
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
        List<SpecialistTeamVO> specialistTeamVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistTeamVO.class));
        if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){
@ -677,11 +668,12 @@ public class SpecialistService{
        String sql = "SELECT " +
                " r.id AS relationCode, " +
                " r.patient, " +
                " r.team_code AS teamCode" +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " r.team_code AS teamCode,r.patient_name as patientName" +
               // AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
//                " r.patient_name AS patientName, " +
//                " d.name AS doctorName, " +
                AesEncryptUtils.decryptMysql("d.name","doctorName") +
                ",d.name as doctorName"+
               // AesEncryptUtils.decryptMysql("d.name","doctorName") +
                " ,d.code AS doctor, " +
                " d.photo, " +
                " d.dept, " +
@ -698,6 +690,7 @@ public class SpecialistService{
                " r.patient ='"+patient+"' " +
                " AND r.`status`>=0 " +
                " AND r.sign_status >0";
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name");
        List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs);
    }
@ -709,15 +702,13 @@ public class SpecialistService{
                "(SELECT " +
                " r.id AS relationCode," +
                " r.patient, " +
                " r.team_code AS teamCode" +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
//                " r.patient_name AS patientName, " +
                " ,r.health_assistant AS healthAssistant" +
                AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") +
//                " r.health_assistant_name AS healthAssistantName," +
                " ,r.create_time AS createTime" +
                AesEncryptUtils.decryptMysql("d.name","doctorName") +
//                " d.name AS doctorName, " +
                " r.team_code AS teamCode,r.patient_name as patientName" +
               // AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                " ,r.health_assistant AS healthAssistant,r.health_assistant_name as healthAssistantName" +
                //AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") +
                " ,r.create_time AS createTime," +
//                AesEncryptUtils.decryptMysql("d.name","doctorName") +
                " d.name AS doctorName, " +
                " ,d.code AS doctor, " +
                " d.photo, " +
                " d.dept, " +
@ -737,6 +728,7 @@ public class SpecialistService{
                "  WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctor+"') AND  m.available='1')" +
//                " AND r.`status`>=0 " +
                " AND r.sign_status >0 ) r join "+basedb+".wlyy_patient p on r.patient = p.code order by p.czrq DESC ";
        sql = TransforSqlUtl.wlyySpecialistPatientRelationReplay(sql,"r.patient_name","r.health_assistant_name");
        List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
        PatientSignInfoVO patientSignInfoVO = (null != patientSignInfoVOs && patientSignInfoVOs.size() > 0 )? patientSignInfoVOs.get(0):null;
        return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientSignInfoVO);
@ -749,8 +741,8 @@ public class SpecialistService{
        if(StringUtils.isNotBlank(name)){
            sql = "SELECT " +
                    "doctor.CODE AS CODE" +
                    AesEncryptUtils.decryptMysql("doctor.name","name") +
//                    "doctor.NAME AS NAME," +
//                    AesEncryptUtils.decryptMysql("doctor.name","name") +
                    ",doctor.NAME AS NAME" +
                    ",doctor.sex AS sex," +
                    "doctor.birthday AS birthday," +
                    "doctor.photo AS photo," +
@ -774,12 +766,12 @@ public class SpecialistService{
                    "SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " +
                    ") " +
                    "t ON doctor.CODE=t.doctorcode and " + AesEncryptUtils.decryptMysqlNo("doctor.name")  + "  like '%"+name+"%'";
                    "t ON doctor.CODE=t.doctorcode and doctor.NAME like '%"+name+"%'";
        }else{
            sql = "SELECT " +
                    "doctor.CODE AS CODE" +
                    AesEncryptUtils.decryptMysql("doctor.name","name") +
//                    "doctor.NAME AS NAME," +
//                    AesEncryptUtils.decryptMysql("doctor.name","name") +
                    ",doctor.NAME AS NAME" +
                    ",doctor.sex AS sex," +
                    "doctor.birthday AS birthday," +
                    "doctor.photo AS photo," +
@ -829,8 +821,8 @@ public class SpecialistService{
    public MixEnvelop<PatientRelationVO,PatientRelationVO> getSpecialistSignFamilyPatientByName(String specialdoctor, String familydoctor, String nameKey, Integer page, Integer size) {
        String sql ="SELECT " +
                "p.CODE AS patient" +
                AesEncryptUtils.decryptMysql("p.name","patientName") +
//                "p.`name` AS patientName," +
//                AesEncryptUtils.decryptMysql("p.name","patientName") +
                ",p.`name` AS patientName" +
                ",p.photo," +
                "IFNULL(YEAR (from_days(datediff(now(),p.birthday))),'未知') age," +
                "p.sex " +
@ -841,8 +833,8 @@ public class SpecialistService{
                "  AND doctor='"+specialdoctor+"') " +
                "  AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') ";
        if(StringUtils.isNotBlank(nameKey)){
            sql= sql + " AND " + AesEncryptUtils.decryptMysqlNo("a.name") + " LIKE '%"+nameKey+"%' ";
            sql= sql + " AND  a.name LIKE '%"+nameKey+"%' ";
//            sql= sql + " AND " + AesEncryptUtils.decryptMysqlNo("a.name") + " LIKE '%"+nameKey+"%' ";
        }
        sql= sql +" AND a.`status`=1 AND a.expenses_status=1) s ON p.CODE=s.patient" +
                " LIMIT "+(page-1)*size+","+size;
@ -859,7 +851,8 @@ public class SpecialistService{
                "IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                "p.birthday, " +
                "p.photo " +
                "FROM (SELECT s.disease,s.disease_name,s.patient" + AesEncryptUtils.decryptMysql("s.patient_name","patient_name") + ",r.team_code from " +
//                "FROM (SELECT s.disease,s.disease_name,s.patient" + AesEncryptUtils.decryptMysql("s.patient_name","patient_name") + ",r.team_code from " +
                "FROM (SELECT s.disease,s.disease_name,s.patient s.patient_name,r.team_code from " +
                "(SELECT id, team_code FROM wlyy_specialist_patient_relation WHERE doctor='" + doctor + "' and sign_status > 0 and `status` >= 0) r " +
                "JOIN "+basedb+".wlyy_patient_disease_server s on r.id = s.specialist_relation_code WHERE s.del = 1) s " +
                "JOIN "+basedb+".wlyy_patient p on s.patient = p.`code` where p.`status` >0 ";
@ -1186,13 +1179,8 @@ public class SpecialistService{
    public List<SpecialistPatientRelationDO> selectByAssistant(String patient,String doctor){
        String sql = "select *" +
                AesEncryptUtils.decryptMysql("r.patient_name","patientName") +
                AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") +
                AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") +
                AesEncryptUtils.decryptMysql("r.health_doctor_name","healthDoctorName") +
                AesEncryptUtils.decryptMysql("r.sign_doctor_name","signDoctorName") +
                AesEncryptUtils.decryptMysql("r.create_user_name","createUserName") +
                " from wlyy_specialist_patient_relation r where r.health_assistant = '"+doctor+"' and r.patient = '"+patient+"' ";
        sql = TransforSqlUtl.specialistPatientRelationAll(sql);
        List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
        return relationDOS;
    }
@ -1279,6 +1267,7 @@ public class SpecialistService{
                " SELECT m.doctor_code  FROM wlyy.wlyy_admin_team_member m " +
                " WHERE  m.team_id IN ( SELECT dt.id  FROM  wlyy.wlyy_admin_team dt LEFT JOIN wlyy.wlyy_admin_team_member watm ON dt.id = watm.team_id   WHERE " +
                " dt.available = '1' AND watm.available = '1'  AND watm.doctor_code = '"+doctor+"') AND m.available = '1'  ) and r.patient = '"+patient+"' and r.sign_status=0";
        sql  = TransforSqlUtl.specialistPatientRelationAll(sql);
        List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
        SpecialistPatientRelationDO specialistPatientRelationDO=null!=relationDOS&&relationDOS.size()>0?relationDOS.get(0):new SpecialistPatientRelationDO();
        return specialistPatientRelationDO;

+ 2 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistServiceItemService.java

@ -10,6 +10,7 @@ import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.SpecialistEvaluateDO;
import com.yihu.jw.entity.specialist.SpecialistServiceItemDO;
import com.yihu.jw.entity.specialist.SpecialistServiceItemOperateLogDO;
import com.yihu.jw.entity.util.TransforSqlUtl;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.health.bank.HealthBankMapping;
import com.yihu.jw.util.ISqlUtils;
@ -168,6 +169,7 @@ public class SpecialistServiceItemService {
    public MixEnvelop<SpecialistServiceItemDO,SpecialistServiceItemDO> selectByHospital(String hospital){
        MixEnvelop<SpecialistServiceItemDO,SpecialistServiceItemDO> envelop = new MixEnvelop<>();
        String sql = "select * from wlyy_service_item where status = 1 AND imediate = 1 ";
        sql = TransforSqlUtl.wlyy_service_itemAll(sql);
        List<SpecialistServiceItemDO> specialistServiceItemDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistServiceItemDO.class));
        List<SpecialistServiceItemDO> specialistServiceItemDOList = new ArrayList<>();
        for (int i =0;i<specialistServiceItemDOS.size();i++){

+ 2 - 2
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -200,7 +200,7 @@ public class RehabilitationManageService {
     */
    public ObjEnvelop findRehabilitationPlanDetailList(String currentDoctorCode,String patientCode) throws Exception{
        String sql = " select DISTINCT r.* from wlyy_specialist.wlyy_specialist_patient_relation r join wlyy_patient_rehabilitation_plan p on r.patient=p.patient where r.sign_status ='1' and r.status in('0','1') and r.patient='"+patientCode+"' ";
        sql = TransforSqlUtl.specialistPatientRelation(sql,"r.*");
        sql = TransforSqlUtl.specialistPatientRelationAll(sql);
        List<Map<String,Object>> specialistPatientRelationList = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> resultList = new ArrayList<>();
        for(Map<String,Object> temp: specialistPatientRelationList){
@ -216,7 +216,7 @@ public class RehabilitationManageService {
            resultMap.put("healthyConditionType",healthyConditionType);
            //专科医生
            String specialistRelationSql = "select r.*,t.name as teamName,h.name as specialistHospitalName from wlyy_specialist.wlyy_specialist_patient_relation r left join "+basedb+".wlyy_admin_team t on r.team_code=t.id left join "+basedb+".dm_hospital h on t.org_code=h.code where r.sign_status ='1' and r.status in('0','1') and r.patient='"+patientCode+"' and r.doctor='"+doctorCode+"'";
            specialistRelationSql = TransforSqlUtl.specialistPatientRelation(specialistRelationSql,"r.*");
            specialistRelationSql = TransforSqlUtl.specialistPatientRelationAll(specialistRelationSql);
            List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
            Map<String,Object> specialistMap = specialistRelationList.get(0);
            resultMap.put("specialistAdminTeamName",specialistMap.get("teamName"));