瀏覽代碼

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

wangjun 4 年之前
父節點
當前提交
77c892d02b

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java

@ -147,7 +147,7 @@ public class RehabilitationTemplateDetailDO extends UuidIdentityEntityWithOperat
        return expense;
    }
    public void setExpense(String name) {
    public void setExpense(Integer expense) {
        this.expense = expense;
    }
}

+ 21 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/util/TransforSqlUtl.java

@ -10,7 +10,7 @@ public class TransforSqlUtl {
    public static String wlyySpecialistPatientRelationLike(String sql,String ...replaceName){
        for (String tmp :replaceName){
            String str = "AES_DECRYPT(from_base64("+replaceName+"),'jkzl2021ZJXL*#%a')";
            String str = "AES_DECRYPT(from_base64("+tmp+"),'jkzl2021ZJXL*#%a')";
            sql = sql.replaceAll(tmp,str);
        }
        return  sql;
@ -18,7 +18,7 @@ public class TransforSqlUtl {
    public static String wlyySpecialistPatientRelationReplay(String sql,String ...replaceName){
        for (String tmp :replaceName){
            String str = "CAST(AES_DECRYPT(from_base64("+replaceName+"),'jkzl2021ZJXL*#%a') AS CHAR ) ";
            String str = "CAST(AES_DECRYPT(from_base64("+tmp+"),'jkzl2021ZJXL*#%a') AS CHAR ) ";
            sql = sql.replaceAll(tmp,str);
        }
        return  sql;
@ -42,6 +42,20 @@ public class TransforSqlUtl {
        return sql;
    }
    public static String specialistPatientRelationAll2(String sql) {
        String sqlTmp = " *,CAST(AES_DECRYPT(from_base64(r.doctor_name),'jkzl2021ZJXL*#%a')AS CHAR ) AS doctor_name,\n" +
                "CAST( AES_DECRYPT(from_base64(r.patient_name),'jkzl2021ZJXL*#%a')AS CHAR) AS patient_name,\n" +
                "CAST(AES_DECRYPT(from_base64(r.health_assistant_name),'jkzl2021ZJXL*#%a') AS CHAR) AS health_assistant_name,\n" +
                "CAST(AES_DECRYPT(from_base64(r.sign_doctor_name),'jkzl2021ZJXL*#%a') AS CHAR) AS sign_doctor_name,\n" +
                "CAST(AES_DECRYPT(from_base64(r.health_doctor_name),'jkzl2021ZJXL*#%a') AS CHAR) AS health_doctor_name,\n" +
                "CAST(AES_DECRYPT(from_base64(r.create_user_name),'jkzl2021ZJXL*#%a')AS CHAR)AS create_user_name,\n" +
                "CAST(AES_DECRYPT(from_base64(r.update_user_name),'jkzl2021ZJXL*#%a')AS CHAR)AS update_user_name \n" ;
        sql = sql.replace("*", sqlTmp);
        return sql;
    }
    public static String deviceGrantDoctorName(String sql){
        return sql.replaceAll("d.grant_doctor_name","CAST(AES_DECRYPT(from_base64(d.grant_doctor_name),'jkzl2021ZJXL*#%a')AS char)");
    }
@ -80,6 +94,11 @@ public class TransforSqlUtl {
        return sql.replace("*",str);
    }
    public static String wlyy_plan_detail_appointmentAppDoctorName(String sql){
        String str = "CAST(AES_DECRYPT(from_base64(a.doctor_name),'jkzl2021ZJXL*#%a') AS CHAR ) ";
        return sql.replace("a.doctor_name",str);
    }
    public static String wlyy_rehabilitation_operate_recordsDoctorName(String sql){
        String str = "CAST(AES_DECRYPT(from_base64(r.doctor_name),'jkzl2021ZJXL*#%a') AS CHAR ) ";
        return sql.replaceAll("r.doctor_name",str);

+ 8 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -2,6 +2,7 @@ package com.yihu.jw.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dao.SpecialistPatientRelationDao;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -17,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -35,6 +37,8 @@ public class SpecialistController extends EnvelopRestEndpoint {
    private Tracer tracer;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private SpecialistPatientRelationDao specialistPatientRelationDao;
    @PostMapping(value = SpecialistMapping.specialist.createSpecialistRelation)
    @ApiOperation(value = "创建专科医生与患者匹配关系")
@ -462,6 +466,10 @@ public class SpecialistController extends EnvelopRestEndpoint {
            }
//            specialistPatientRelationDO.setDoctor(getUID());
//            specialistPatientRelationDO.setDoctorName(getUNAME());
            List<SpecialistPatientRelationDO> list = specialistPatientRelationDao.findListByTeamAndPatient(specialistPatientRelationDO.getTeamCode(),specialistPatientRelationDO.getPatient());
            if (list.size()>0){
                return ObjEnvelop.getSuccess("success", list.get(0));
            }
            return specialistService.createPatientInSpeciaRelation(specialistPatientRelationDO);
        }catch (Exception e){
            e.printStackTrace();

+ 3 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java

@ -35,4 +35,7 @@ public interface SpecialistPatientRelationDao extends PagingAndSortingRepository
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.doctor=?3 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamCodeAndPatientAndDoctor(Integer teamCode,String patient,String doctor);
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamAndPatient(Integer teamCode,String patient);
}

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

@ -1262,7 +1262,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);
        sql  = TransforSqlUtl.specialistPatientRelationAll2(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;

+ 10 - 7
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.specialistPatientRelationAll(sql);
        sql = TransforSqlUtl.specialistPatientRelationAll2(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.specialistPatientRelationAll(specialistRelationSql);
            specialistRelationSql = TransforSqlUtl.specialistPatientRelationAll2(specialistRelationSql);
            List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
            Map<String,Object> specialistMap = specialistRelationList.get(0);
            resultMap.put("specialistAdminTeamName",specialistMap.get("teamName"));
@ -507,7 +507,7 @@ public class RehabilitationManageService {
            sql+= "and d.status="+status;
        }
        sql +="  order by d.execute_time desc ";
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailAll(sql);
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailAll2(sql);
        List<Map<String,Object>> rehabilitationDetailList = jdbcTemplate.queryForList(sql);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,rehabilitationDetailList);
    }
@ -632,9 +632,9 @@ public class RehabilitationManageService {
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " LEFT JOIN wlyy_specialist.wlyy_plan_detail_appointment a on d.id=.a.rehabilitation_plan_detail_id " +
                " where d.id = '"+planDetailId+"'";
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planName(sql);
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planName2(sql);
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planCreateName(sql);
        sql = TransforSqlUtl.wlyy_plan_detail_appointmentAll(sql);
        sql = TransforSqlUtl.wlyy_plan_detail_appointmentAppDoctorName(sql);
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailDoctorName(sql);
        List<Map<String,Object>> serviceItemList = jdbcTemplate.queryForList(sql);
        if (serviceItemList.size()==0){
@ -730,10 +730,13 @@ public class RehabilitationManageService {
            resultMap.put("recordFlag",temp.getFlag());
            resultMap.put("recordId",temp.getId());
            JSONArray imgs = new JSONArray();
            if (temp.getRelationRecordImg()!=null&&StringUtils.isNotEmpty(temp.getRelationRecordImg())){
                imgs.put(temp.getRelationRecordImg());
                resultMap.put("relationRecordImg",(temp.getRelationRecordImg()!=null&&StringUtils.isNotEmpty(temp.getRelationRecordImg()))?(new JSONArray(temp.getRelationRecordImg())):null);//json格式
            }
            else{
                resultMap.put("relationRecordImg",imgs);
            }
            resultMap.put("relationRecordImg",imgs);
         /*   if(itemType!=1&&itemType!=0){*/
                resultMap.put("relationRecordCode",temp.getRelationRecordCode());
                resultMap.put("completeTimeShort",DateUtil.dateToStr(completeTime,"yyyy/MM/dd"));