Jelajahi Sumber

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

huangwenjie 7 tahun lalu
induk
melakukan
c1425c0522

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -113,7 +113,7 @@ public class SpecialistEvaluateSevice extends BaseService {
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成
     */
    public JSONObject sendMessage(Message message,String hospitalCode,String patientCode,Integer time){
    public JSONObject sendMessage(Message message,String hospitalCode,String patientCode,Integer num){
        JSONObject object = new JSONObject();
        try {
            Hospital hospital = null;
@ -130,7 +130,7 @@ public class SpecialistEvaluateSevice extends BaseService {
            }else if (message.getType() == 20){
                message.setType(20);
                message.setTitle("康复计划-待办工作提醒");
                message.setContent("您的"+patient.getName()+"签约居民"+time+"天后计划到"+(hospital!=null?hospital.getName():"")+"复诊,请查看");
                message.setContent("您的"+patient.getName()+"签约居民"+num+"天后计划到"+(hospital!=null?hospital.getName():"")+"复诊,请查看");
            }else if (message.getType() == 21){
                message.setType(21);
                message.setTitle("康复计划-服务进展提醒");
@ -139,6 +139,10 @@ public class SpecialistEvaluateSevice extends BaseService {
                message.setType(22);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient.getName()+"签约居民未完成康复计划今天项目,请尽快处理");
            }else if (message.getType() == 23){
                message.setType(23);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient.getName()+"签约居民今日有"+num+"个康复计划项目待完成,请尽快处理");
            }
            message.setSenderName(sendDoctor.getName());
            message.setCode(getCode());

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

@ -1,12 +1,14 @@
package com.yihu.wlyy.service.specialist.rehabilitation;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
@ -38,6 +40,8 @@ public class RehabilitationManageService extends BaseService {
    private SignFamilyDao signFamilyDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private SpecialistEvaluateSevice specialistEvaluateSevice;
    /************************************************************* start ************************************************************************/
    private String findRehabilitationPlanList = "/svr-specialist/findRehabilitationPlanList";//康复管理-康复计划列表
@ -451,4 +455,45 @@ public class RehabilitationManageService extends BaseService {
        JSONObject result = new JSONObject(response.getContent());
        return  result;
    }
    /**
     * 每天8点,16点的job
     * @param startTime
     * @param endTime
     * @throws Exception
     */
    public void dailyJobSendMessage(String startTime,String endTime,Integer type) throws Exception{
        JSONArray jsonArray = dailyJob(startTime,endTime);
        JSONObject jsonObject = null;
        String doctor = "";
        String patient ="";
        Integer num = null;
        for(int i=0;i<jsonArray.length();i++){
            jsonObject = jsonArray.getJSONObject(i);
            doctor = jsonObject.get("doctor")+"";//执行的医生(接收的医生)
            patient = jsonObject.get("patient")+"";//执行的居民
            num = (Integer)jsonObject.get("num");//需要今日需要执行的项目数
            Message message1 = new Message();
            message1.setSender(null);
            message1.setType(type);
            message1.setReceiver(doctor);
            specialistEvaluateSevice.sendMessage(message1,null,patient,num);
        }
    }
    /**
     * 每天十六点的job
     * @param startTime
     * @param endTime
     * @throws Exception
     */
    public void sixteenDailyJob(String startTime,String endTime) throws Exception{
        JSONArray jsonArray = dailyJob(startTime,endTime);
        JSONObject jsonObject = null;
        for(int i=0;i<jsonArray.length();i++){
            jsonObject = jsonArray.getJSONObject(i);
        }
    }
}

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

@ -0,0 +1,46 @@
package com.yihu.wlyy.web.common.job;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.specialist.rehabilitation.RehabilitationManageService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by 刘文彬 on 2018/9/3.
 */
@RestController
@RequestMapping(value = "/specialist/job")
@Api(description = "专科模块job")
public class SpecialistRehabilitationJob extends BaseController {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @RequestMapping(value = "/dailyJobSendMessage", method = RequestMethod.POST)
    @ApiOperation("康复管理-康复计划每天8点,16点发送服务进展的job")
    @ObserverRequired
    public String dailyJobSendMessage(@ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                      @RequestParam(value = "startTime", required = true)String startTime,
                                      @ApiParam(name = "endTime", value = "结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                      @RequestParam(value = "endTime", required = true)String endTime,
                                      @ApiParam(name = "type", value = "8点:23,16点:22", required = true)
                                      @RequestParam(value = "type", required = true)Integer type){
        try {
            rehabilitationManageService.dailyJobSendMessage(startTime,endTime,type);
            return write(200, "发送成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "发送失败");
        }
    }
}

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

@ -153,7 +153,7 @@ public class DoctorRehabilitationManageController extends BaseController {
        }
    }
    @RequestMapping(value = "planDetailId", method = RequestMethod.GET)
    @RequestMapping(value = "serviceItem", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划服务项目确认详情页")
    @ObserverRequired
    public String serviceItem(@ApiParam(name = "planDetailId", value = "康复计划服务项目id", required = true)
@ -230,10 +230,10 @@ public class DoctorRehabilitationManageController extends BaseController {
    @ObserverRequired
    public String recentPlanDetailRecord(@ApiParam(name = "patientCode", value = "居民code", required = true)
                                         @RequestParam(value = "patientCode", required = true)String patientCode,
                                         @ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "startTime", required = true)String startTime,
                                         @ApiParam(name = "endTime", value = "结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "endTime", required = true)String endTime,
                                         @ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                         @RequestParam(value = "startTime", required = false)String startTime,
                                         @ApiParam(name = "endTime", value = "结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                         @RequestParam(value = "endTime", required = false)String endTime,
                                         @ApiParam(name = "page", value = "第几页,从1开始", required = true)
                                         @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                                         @ApiParam(name = "pageSize", value = "每页分页大小", required = true)

+ 5 - 2
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -47,7 +47,7 @@ healthBank:
#康复计划配置
rehabilitation:
  url: http://localhost:10055/svr-rehabilitation/
  url: http://localhost:10051/svr-wlyy-rehabilitation/
#小程序
applets:
@ -153,8 +153,11 @@ images:
  renew_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/familycontract.png
#sign:
#  check_upload: http://172.19.103.87:8011/wlyy_service
#  check_upload_sign: http://172.19.103.88:8011/wlyy_sign
sign:
  check_upload: http://172.19.103.87:8011/wlyy_service
  check_upload: http://172.19.103.88:8011/wlyy_service
  check_upload_sign: http://172.19.103.88:8011/wlyy_sign
express: