liuwenbin 7 лет назад
Родитель
Сommit
312fb7dea3

+ 2 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/specialist/EightSpecialistJob.java

@ -34,6 +34,7 @@ public class EightSpecialistJob implements Job {
    @Autowired
    private HttpClientUtil httpClientUtil;
    private String dailyJobSendMessage = "/specialist/job/dailyJobSendMessage";//康复管理-每天推送项目进展
    private String dailyJobReserve = "/specialist/job/dailyJobReserve";//康复管理-10天、7天、5天、当天康复服务预约复诊通知
    @Transactional
@ -52,7 +53,7 @@ public class EightSpecialistJob implements Job {
            param.put("endTime", endTime);
            param.put("type", 23);
            HttpResponse response = HttpUtils.doPost(serverUrl + dailyJobSendMessage, param);
            HttpUtils.doPost(serverUrl + dailyJobReserve,  new HashedMap());
        }catch (Exception e){
            //保存日志
            quartzJobLog.setJobEndTime(new Date());

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

@ -12,6 +12,7 @@ import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
@ -75,11 +76,13 @@ public class RehabilitationManageService extends BaseService {
    private String serviceDoctorList = "/svr-specialist/serviceDoctorList";//康复管理-医生端居民详情服务医生列表
    private String appCalendarPlanDetailList = "/svr-specialist/appCalendarPlanDetailList";//康复管理-app端、微信端计划的服务项目列表
    private String dailyJob = "/svr-specialist/dailyJob";//每日康复服务通知
    private String dailyJobReserve = "/svr-specialist/dailyJobReserve";//10天、7天、5天、当天康复服务预约复诊通知
    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";//康复管理-计划总进度
    private String planListByPatient = "/svr-specialist/planListByPatient";//康复管理-根据居民获取康复计划
    private String patientCount = "/svr-specialist/patientCount";//康复管理-医生已计划数,已完成计划数(居民数)
    /************************************************************* end ************************************************************************/
    /**
@ -488,6 +491,18 @@ public class RehabilitationManageService extends BaseService {
        throw new Exception("请求微服务失败!");
    }
    public JSONArray dailyJobReserve(String startTime, String endTime) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("startTime", startTime);
        param.put("endTime", endTime);
        HttpResponse response = HttpUtils.doGet(specialistUrl + dailyJobReserve, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONArray("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    public JSONObject saveRehabilitationOperateRecord(String dataJson) throws Exception{
        Map<String, Object> param = new HashedMap();
@ -649,4 +664,40 @@ public class RehabilitationManageService extends BaseService {
        }
        throw new Exception("请求微服务失败!");
    }
    public JSONObject patientCount(String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("doctorCode", doctorCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + patientCount, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    public void dailyJobReserve(Integer num,Integer type) throws Exception{
        Long time = num*24*60*60*1000L;
        String startTime = DateUtil.dateToStrShort(new Date(new Date().getTime()+time))+" "+"00:00:00";
        String endTime = DateUtil.dateToStrShort(new Date(new Date().getTime()+time))+" "+"23:59:59";
        JSONArray jsonArray = dailyJobReserve(startTime,endTime);
        JSONObject jsonObject = null;
        String doctor = "";
        String patient ="";
        String hospital ="";
        String planDetailIds = null;
        for(int i=0;i<jsonArray.length();i++){
            jsonObject = jsonArray.getJSONObject(i);
            doctor = jsonObject.get("doctor")+"";//执行的医生(接收的医生)
            patient = jsonObject.get("patient")+"";//执行的居民
            hospital = jsonObject.get("hospital")+"";//医院
            planDetailIds = jsonObject.get("planDetailIds")+"";
            Message message1 = new Message();
//            message1.setSender(patient);
            message1.setType(type);
            message1.setReceiver(doctor);
            message1.setRelationCode(planDetailIds);
            specialistEvaluateSevice.sendMessage(message1,hospital,patient,num);
        }
    }
}

+ 22 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/job/SpecialistRehabilitationJob.java

@ -43,4 +43,26 @@ public class SpecialistRehabilitationJob extends BaseController {
            return error(-1, "发送失败");
        }
    }
    @RequestMapping(value = "/dailyJobReserve", method = RequestMethod.POST)
    @ApiOperation("康复管理-10天、7天、5天、当天(0)康复服务预约复诊通知")
    @ObserverRequired
    public String dailyJobReserve(@ApiParam(name = "num", value = "10天、7天、5天、当天康复服务预约复诊通知", required = false)
                      @RequestParam(value = "num", required = false)Integer num){
        try {
            if(num!=null){
                rehabilitationManageService.dailyJobReserve(num,20);
            }else{
                Integer[] days = {10,7,5,0};
                for(Integer one : days){
                    rehabilitationManageService.dailyJobReserve(one,20);
                }
            }
            return write(200, "发送成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "发送失败");
        }
    }
}

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

@ -416,4 +416,22 @@ public class DoctorRehabilitationManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "patientCount", method = RequestMethod.GET)
    @ApiOperation("医生已计划数,已完成计划数(居民数)")
    @ObserverRequired
    public String patientCount(@ApiParam(name = "doctorCode", value = "医生code", required = false)
                                                   @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.patientCount(doctorCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 20 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/rehabilitation/PatientRehabilitationManageController.java

@ -202,4 +202,24 @@ public class PatientRehabilitationManageController 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 = false)
                               @RequestParam(value = "patientCode", required = false)String patientCode){
        try {
            if(!StringUtils.isNotEmpty(patientCode)){
                patientCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.planSchedule(planId,patientCode);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}