Procházet zdrojové kódy

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

humingfen před 6 roky
rodič
revize
95057a9fdb

+ 7 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/controller/ActiveRecordController.java

@ -42,7 +42,13 @@ public class ActiveRecordController extends EnvelopRestEndpoint {
            Integer originalStatus = object.getInteger("originalStatus");
            Integer currentStatus = object.getInteger("currentStatus");
            String patientId = object.getString("patientId");
            TaskPatientDetailDO taskPatientDetailDO = taskPatientDtailService.selectByPatientId(openId,idCard,unionId,taskCode);
            String taskId = object.getString("taskId");
            TaskPatientDetailDO taskPatientDetailDO = null;
            if (taskCode.equalsIgnoreCase("ACTIVITY_QUESTION")){
                taskPatientDetailDO = taskPatientDtailService.selectByPatientIdAndTaskId(openId,idCard,unionId,taskId);
            }else {
                taskPatientDetailDO = taskPatientDtailService.selectByPatientId(openId,idCard,unionId,taskCode);
            }
            if (taskPatientDetailDO == null){
                return MixEnvelop.getError("尚未报名!");
            }else {

+ 11 - 0
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/TaskPatientDtailService.java

@ -158,6 +158,17 @@ public class TaskPatientDtailService extends BaseJpaService<TaskPatientDetailDO,
    }
    public TaskPatientDetailDO selectByPatientIdAndTaskId(String openId,String idCard,String unionId,String taskId){
        logger.info("openId:"+openId+"idCard:"+idCard+"unionId:"+unionId+"taskCode:"+taskId);
        String sql ="select * from wlyy_health_bank_task_patient_detail where " +
                " (patient_idcard = '"+idCard+"' OR union_id ='"+unionId+"') AND task_id = '"+taskId+"'" ;
        List<TaskPatientDetailDO> taskPatientDetailDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(TaskPatientDetailDO.class));
        logger.info("参与信息:"+taskPatientDetailDOS);
        return taskPatientDetailDOS.get(0);
    }
    /**
     * 获取参与详情
     *

+ 6 - 4
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -122,11 +122,12 @@ public class SpecialistController extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据标签获取居民信息")
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
                                                        @ApiParam(name = "labelType", value = "标签类型") @RequestParam(required = true)String labelType,
                                                        @ApiParam(name = "teamCode", value = "医生当前所在团队") @RequestParam(required = true) String teamCode,
                                                        @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = true)String labelCode,
                                                        @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
                                                        @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size){
        try {
            return specialistService.getPatientByLabel(doctor,labelType,labelCode,page,size);
            return specialistService.getPatientByLabel(doctor,labelType,teamCode,labelCode,page,size);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -139,9 +140,10 @@ public class SpecialistController extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据标签获取居民数量")
    public MixEnvelop<Long, Long> getLabelpatientCount(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
                                                 @ApiParam(name = "labelType", value = "标签类型") @RequestParam(required = true)String labelType,
                                                       @ApiParam(name = "teamCode", value = "医生团队") @RequestParam(required = true)Long teamCode,
                                                 @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = true)String labelCode) {
        try {
            return specialistService.getLabelpatientCount(doctor,labelType,labelCode);
            return specialistService.getLabelpatientCount(doctor,labelType,labelCode,teamCode);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -435,8 +437,8 @@ public class SpecialistController extends EnvelopRestEndpoint {
            if(null==specialistPatientRelationDO.getTeamCode()){
                return failed("医生团队不能为空!",ObjEnvelop.class);
            }
            specialistPatientRelationDO.setDoctor(getUID());
            specialistPatientRelationDO.setDoctorName(getUNAME());
//            specialistPatientRelationDO.setDoctor(getUID());
//            specialistPatientRelationDO.setDoctorName(getUNAME());
            return specialistService.createPatientInSpeciaRelation(specialistPatientRelationDO);
        }catch (Exception e){
            e.printStackTrace();

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

@ -186,7 +186,7 @@ public class SpecialistService{
    }
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType, String labelCode, Integer page, Integer size){
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType,String teamCode, String labelCode, Integer page, Integer size){
        String sql="SELECT " +
                " p. NAME, " +
                " p. CODE, " +
@ -222,9 +222,7 @@ public class SpecialistService{
                " JOIN "+basedb+".wlyy_patient p ON p. CODE = lb.patient " +
                " JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient " +
                " WHERE s.doctor in " +
                " (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') "+
                "  (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
                " AND s.status >=0  AND s.sign_status >0"+
                " LIMIT "+(page-1)*size+","+size;
        System.out.print("日志:"+sql);
@ -247,16 +245,14 @@ public class SpecialistService{
                    " WHERE a.sign_status> 0 AND a.`status`>=0 " +
//                    "AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
                    " AND a.doctor in " +
                    " (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') "+
                    " (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
                    " LIMIT "+(page-1)*size+","+size;
        }
        List<PatientLabelVO> PatientLabelVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientLabelVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,PatientLabelVOs);
    }
    public MixEnvelop<Long, Long> getLabelpatientCount(String doctor, String labelType, String label){
    public MixEnvelop<Long, Long> getLabelpatientCount(String doctor, String labelType, String label,Long teamCode){
        String sql = "SELECT " +
                " COUNT(1) as total " +
                " FROM " +
@ -273,8 +269,10 @@ public class SpecialistService{
                "  AND i.label_type = '"+labelType+"' " +
                "  AND i.`status` = '1' " +
                " AND i.patient in ( " +
                " select patient from  wlyy_specialist_patient_relation  WHERE " +
                "( doctor = '"+doctor+"' OR health_doctor = '"+doctor+"' OR health_assistant='"+doctor+ "' ) AND STATUS >= 0 AND sign_status > 0 )";
                " select patient from  wlyy_specialist_patient_relation  WHERE doctor in" +
                "  (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
               /* "*//*( doctor = '"+doctor+"' OR health_doctor = '"+doctor+"' OR health_assistant='"+doctor+ "' ) *//*" +*/
                " AND STATUS >= 0 AND sign_status > 0 )";
//                +" ) lb ";
        System.out.print("日志:"+sql);
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
@ -531,8 +529,9 @@ public class SpecialistService{
                " JOIN "+basedb+".wlyy_admin_team t ON t.id = r.team_code " +
                " WHERE " +
                " r.id = '"+code+"'";
        List<PatientSignInfoVO> patientSignInfoVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientSignInfoVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientSignInfoVOs.get(0));
        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);
    }
    public MixEnvelop<SpecialistTeamVO, SpecialistTeamVO> findPatientTeamList(String patient){
@ -931,6 +930,7 @@ public class SpecialistService{
            specialistPatientRelationDO = selectByDoctorAndPatient(doctorCode, patientCode);
        }
        jsonObject.put("specialistPatientRelationId", null == specialistPatientRelationDO ? null : specialistPatientRelationDO.getId());
        jsonObject.put("signCertificate", null == specialistPatientRelationDO ? null : specialistPatientRelationDO.getSignCertificate());
        //1、获取居民基础信息
        String preSql = "SELECT p.name as name, p.photo as photo,p.idcard as idcard,p.mobile as mobile,p.medicare_number as medicareNumber,p.ssc as ssc," +
                " CASE  WHEN wd.name is null THEN '无' ELSE wd.name END as doctorName,CASE  WHEN wd.hospital_name is NULL THEN '无' ELSE wd.hospital_name END as hospitalName,CASE  WHEN wd.mobile is NULL THEN '无' ELSE wd.mobile END as doctorMobole ";
@ -958,10 +958,10 @@ public class SpecialistService{
            doctorSql="SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM " + basedb + ".wlyy_doctor wd WHERE wd.code='" + specialistPatientRelationDO.getDoctor() + "'";
        }
        Map<String,Object> result =jdbcTemplate.queryForMap(doctorSql);
        if(doctorCode.equals(specialistPatientRelationDO.getDoctor())){
        if ("0".equals(signStatus) && !(doctorCode.equals(specialistPatientRelationDO.getDoctor()))) {
            result.put("buttonShowFlag", false);
        } else {
            result.put("buttonShowFlag",true);
        }else{
            result.put("buttonShowFlag",false);
        }
        jsonObject.put("doctorInfo", result);
@ -1016,9 +1016,12 @@ public class SpecialistService{
        //康复情况标签
        String labelSql = "SELECT wspl.label_code,wspl.label_name from  wlyy.wlyy_sign_patient_label wspl WHERE wspl.label_type='8' AND status='1'";
        List<Map<String, Object>> signPatientLabelList = jdbcTemplate.queryForList(labelSql);
        //居民的康复情况
        String patientLabelSql = "SELECT wspl.label from  wlyy.wlyy_sign_patient_label_info wspl WHERE wspl.patient='"+patientCode+"' and  wspl.label_type='8' AND status='1'";
        List<String> patientLabelList = jdbcTemplate.queryForList(patientLabelSql,String.class);
        List<String> patientLabelList = new ArrayList<>();
        if("0".equals(signStatus) ){
            //居民的康复情况
            String patientLabelSql = "SELECT wspl.label from  wlyy.wlyy_sign_patient_label_info wspl WHERE wspl.patient='"+patientCode+"' and  wspl.label_type='8' AND status='1'";
            patientLabelList = jdbcTemplate.queryForList(patientLabelSql,String.class);
        }
        Set<String> patientLabelSet =new HashSet<>(patientLabelList);
        signPatientLabelList.stream().forEach(item->{
            item.put("status",patientLabelSet.contains(item.get("label_code").toString())?1:0) ;

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

@ -483,7 +483,7 @@ public class RehabilitationManageService {
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_specialist.wlyy_service_item i on i.id = h.service_item_id " +
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " where d.id in ("+planDetailResult+")";
                " where d.id in ("+planDetailResult+") order BY d.execute_time ASC ";
        List<Map<String,Object>> serviceItemList = jdbcTemplate.queryForList(sql);
//        if(serviceItemList.size()>0){
//            Map<String,Object> serviceItem = serviceItemList.get(0);
@ -1122,7 +1122,7 @@ public class RehabilitationManageService {
     * @return
     */
    public ObjEnvelop dailyByJob(String startTime,String endTime){
        String sql = "select d.doctor,p.patient,h.service_item_name AS serviceItemName,d.time_type AS timeType from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id left join wlyy_hospital_service_item h ON h.id=d.hospital_service_item_id where d.status!=1 and p.status=1 and d.execute_time>='"+startTime+"' and d.execute_time<='"+endTime+"' GROUP BY d.doctor,p.patient";
        String sql = "select d.doctor,p.patient,h.service_item_name AS serviceItemName,d.time_type AS timeType from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id left join wlyy_hospital_service_item h ON h.id=d.hospital_service_item_id where d.status!=1 and p.status=1 and d.execute_time>='"+startTime+"' and d.execute_time<='"+endTime+"' GROUP BY d.doctor,p.patient,d.execute_time";
//        List<Object> list = rehabilitationDetailDao.dailyJob(startTime,endTime);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
         String doctorCode = "";