Prechádzať zdrojové kódy

Merge branch 'dev' of liuwenbin/patient-co-management into dev

huangwenjie 7 rokov pred
rodič
commit
9a42affe22

+ 31 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java

@ -78,6 +78,7 @@ public class RehabilitationManageService extends BaseService {
    private String saveRehabilitationOperateRecord ="/svr-specialist/saveRehabilitationOperateRecord";//新增operateRecodr
    private String updateNoteAndImageRehabilitationOperate ="/svr-specialist/updateNoteAndImageRehabilitationOperate";//康复计划完成时更新服务完成笔记和图片接口;
    private String updatePlanDetailStatusById = "/svr-specialist/updatePlanDetailStatusById";//康复管理-更新康复计划服务项目状态
    private String planSchedule = "/svr-specialist/planSchedule";//康复管理-计划总进度
    /************************************************************* end ************************************************************************/
    /**
@ -145,7 +146,10 @@ public class RehabilitationManageService extends BaseService {
        HttpResponse response = HttpUtils.doGet(specialistUrl + findRehabilitationPlanDetailList, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
            JSONObject jsonObject = result.getJSONObject("obj");
            Patient p = patientDao.findByCode(patientCode);
            jsonObject.put("patientPhoto",p.getPhoto());
            return jsonObject;
        }
        throw new Exception("请求微服务失败!");
    }
@ -598,4 +602,30 @@ public class RehabilitationManageService extends BaseService {
            throw new Exception("请求微服务失败!");
        }
    }
    /**
     * 康复管理-计划总进度
     * @param planId
     * @return
     * @throws Exception
     */
    public JSONObject planSchedule(String planId,String patientCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planId", planId);
        HttpResponse response = HttpUtils.doGet(specialistUrl + planSchedule, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            JSONObject json = result.getJSONObject("obj");
            Patient p = patientDao.findByCode(patientCode);
            Integer age = IdCardUtil.getAgeForIdcard(p.getIdcard());
            String sex = IdCardUtil.getSexForIdcard_new(p.getIdcard());
            json.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
            json.put("age",age);
            json.put("patientPhoto",p.getPhoto());
            json.put("patientName",p.getName());
            json.put("patientCode",p.getCode());
            return json;
        }
        throw new Exception("请求微服务失败!");
    }
}

+ 17 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/DoctorRehabilitationManageController.java

@ -389,4 +389,21 @@ public class DoctorRehabilitationManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "planSchedule", method = RequestMethod.GET)
    @ApiOperation("康复管理-计划总进度")
    @ObserverRequired
    public String planSchedule(@ApiParam(name = "planId", value = "计划id", required = true)
                               @RequestParam(value = "planId", required = true)String planId,
                               @ApiParam(name = "patientCode", value = "居民code", required = true)
                               @RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            JSONObject result = rehabilitationManageService.planSchedule(planId,patientCode);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 13 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.template;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
@ -265,12 +266,22 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
            String accessToken = getAccessToken();
            String doctor = getUID();
            JSONArray teams = new JSONArray(teamId);
            List<PatientHealthGuidance> list = new ArrayList<>();
            for (Object team : teams) {
                JSONObject teamJson = new JSONObject(team.toString());
                int teamCode = teamJson.getInt("teamId");
                doctorTeamGuidanceService.sendTeamGuidance(accessToken, doctor, patient, content, guidanceCode, images,teamCode,tzCode);
                list.add(doctorTeamGuidanceService.sendTeamGuidance(accessToken, doctor, patient, content, guidanceCode, images,teamCode,tzCode));
            }
            return write(200, "发送成功!");
            PatientHealthGuidance p = null;
            for(PatientHealthGuidance one:list){
                if(one!=null){
                    p=one;
                    break;
                }
            }
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("id",p.getId());
            return write(200, "发送成功!","data",jsonObject);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());
        }