소스 검색

康复管理代码提交

liuwenbin 6 년 전
부모
커밋
5408eb287b

+ 8 - 4
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -121,9 +121,11 @@ public class RehabilitationManageController {
    @GetMapping(value = SpecialistMapping.rehabilitation.serviceItemList)
    @ApiOperation(value = "康复管理-多个康复计划服务项目内容信息列表")
    public ObjEnvelop serviceItemList(@ApiParam(name = "planDetailIds", value = "多个服务项目id用‘,’分隔", required = true)
                                             @RequestParam(value = "planDetailIds", required = true)String planDetailIds){
                                             @RequestParam(value = "planDetailIds", required = true)String planDetailIds,
                                      @ApiParam(name = "doctorCode", value = "医生code", required = false)
                                      @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            return rehabilitationManageService.serviceItemList(planDetailIds);
            return rehabilitationManageService.serviceItemList(planDetailIds,doctorCode);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -134,9 +136,11 @@ public class RehabilitationManageController {
    @GetMapping(value = SpecialistMapping.rehabilitation.serviceItem)
    @ApiOperation(value = "康复管理-康复计划服务项目确认详情页")
    public ObjEnvelop serviceItem(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                   @RequestParam(value = "planDetailId", required = true)String planDetailId){
                                  @RequestParam(value = "planDetailId", required = true)String planDetailId,
                                  @ApiParam(name = "doctorCode", value = "医生code", required = false)
                                  @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            return rehabilitationManageService.serviceItem(planDetailId);
            return rehabilitationManageService.serviceItem(planDetailId,doctorCode);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

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

@ -67,10 +67,13 @@ public class RehabilitationManageService {
     */
    public MixEnvelop<Map<String,Object>, Map<String,Object>> findRehabilitationPlan(Integer doctorType,String doctorCode, String diseaseCode, Integer planType,Integer todaybacklog, String patientCondition,Integer page, Integer pageSize) throws Exception{
        String leftSql =" left join "+basedb+".wlyy_sign_family f on f.patient=p.patient and f.expenses_status='1' and f.status=1 ";
        String leftSql =" join "+basedb+".wlyy_sign_family f on f.patient=p.patient and f.expenses_status='1' and f.status=1 ";
//        if(StringUtils.isNotEmpty(diseaseCode)){
//            leftSql += " left join "+basedb+".wlyy_patient_disease_server s on p.patient=s.patient and s.del=1 and s.disease ='"+diseaseCode+"'" ;
//        }
        if(doctorType==2){//家医是根据签约关系过滤
            leftSql+=" and f.doctor='"+doctorCode+"' ";
        }
        String sql = " select p.*,f.idcard,f.hospital_name from wlyy_specialist.wlyy_patient_rehabilitation_plan p  " +leftSql+
                " where 1=1 " ;
        if(doctorType==1){//专科医生是根据计划的创建者字段过滤
@ -92,14 +95,12 @@ public class RehabilitationManageService {
        String todayStart = DateUtil.getStringDateShort()+" "+"00:00:00";
        String todayEnd = DateUtil.getStringDateShort()+" "+"23:59:59";
        String condition ="";
        if(doctorType==2){//家医是根据计划详情表的执行者字段过滤
            condition+=" and doctor='"+doctorCode+"' ";
        }
        if(todaybacklog!=null&&todaybacklog==1){
            condition += " and execute_time>='"+todayStart+"' and execute_time<='"+todayEnd+"'";
        }
        finalSql =" select DISTINCT b.* from (select DISTINCT plan_id from wlyy_specialist.wlyy_rehabilitation_plan_detail where  1=1 "+condition+") a " +
                " right JOIN ("+sql+") b on a.plan_id=b.id ";
                " JOIN ("+sql+") b on a.plan_id=b.id ";
//        if(todaybacklog!=null&&todaybacklog==1){
//            finalSql = " select DISTINCT b.* from (select DISTINCT plan_id from wlyy_specialist.wlyy_rehabilitation_plan_detail where execute_time>='"+todayStart+"' and execute_time<='"+todayEnd+"') a "+
//                    "LEFT JOIN ("+sql+") b on a.plan_id=b.id";
@ -482,7 +483,7 @@ public class RehabilitationManageService {
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.content,i.title from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_service_item i on i.id = h.service_item_id " +
                " where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' order by d.execute_time desc" ;
                " where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' " ;
        if(searchTask!=null){
            if(searchTask==1){
                sql+="and d.doctor='"+doctorCode+"' ";
@ -493,6 +494,7 @@ public class RehabilitationManageService {
        if(status!=null){
            sql+= "and d.status="+status;
        }
        sql +="  order by d.execute_time desc ";
        List<Map<String,Object>> rehabilitationDetailList = jdbcTemplate.queryForList(sql);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,rehabilitationDetailList);
    }
@ -503,7 +505,7 @@ public class RehabilitationManageService {
     * @return
     * @throws Exception
     */
    public ObjEnvelop serviceItemList(String planDetailIds) throws Exception{
    public ObjEnvelop serviceItemList(String planDetailIds,String doctorCode) throws Exception{
        String[] s = planDetailIds.split(",");
        String planDetailList = "";
        for(String one:s){
@ -524,6 +526,11 @@ public class RehabilitationManageService {
        for(Map<String,Object> one:serviceItemList){
            Map<String,Object> resultMap = new HashMap<>();
            List<String> executeDoctorList = new ArrayList<>();
            Integer isMyTask = 0;
            if(StringUtils.isNotEmpty(doctorCode)&&doctorCode.equals(one.get("specialistDoctor")+"")){
                isMyTask=1;
            }
            resultMap.put("isMyTask",isMyTask);//0不是自己的任务,1是自己的任务
            if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
                executeDoctorList.add(one.get("create_user_name")+"");
            }
@ -585,7 +592,7 @@ public class RehabilitationManageService {
     * @throws Exception
     *
     */
    public ObjEnvelop serviceItem(String planDetailId) throws Exception{
    public ObjEnvelop serviceItem(String planDetailId,String doctorCode) throws Exception{
        String sql = "select i.title,i.content,i.type as itemType,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor, " +
                " d.doctor_name as specialistDoctorName,p.patient ,p.name as patientName,p.create_user ,p.create_user_name " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
@ -597,6 +604,11 @@ public class RehabilitationManageService {
        Map<String,Object> one = serviceItemList.get(0);
        Map<String,Object> resultMap = new HashMap<>();
        List<String> executeDoctorList = new ArrayList<>();
        Integer isMyTask = 0;
        if(StringUtils.isNotEmpty(doctorCode)&&doctorCode.equals(one.get("specialistDoctor")+"")){
            isMyTask=1;
        }
        resultMap.put("isMyTask",isMyTask);//0不是自己的任务,1是自己的任务
        if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
            executeDoctorList.add(one.get("create_user_name")+"");
        }