浏览代码

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

yeshijie 7 年之前
父节点
当前提交
80ebf27088

+ 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);
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -63,7 +63,7 @@ public class ImUtill {
     * 发送消息
     * @param senderId 发送者的code
     * @param receiverId 接受者code
     * @param contentType 消息类型
     * @param contentType 消息类型 1二维码内容
     * @param content 消息内容
     * @return
     */

+ 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, "发送失败");
        }
    }
}

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

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.specialist.rehabilitation;
import com.yihu.wlyy.util.ImUtill;
import org.json.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
@ -29,6 +30,8 @@ public class DoctorRehabilitationManageController extends BaseController {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private ImUtill imUtill;
    @RequestMapping(value = "findRehabilitationPlanList", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划列表")
@ -150,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)
@ -227,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)
@ -259,21 +262,6 @@ public class DoctorRehabilitationManageController extends BaseController {
        }
    }
    @RequestMapping(value = "checkAfterQrCode", method = RequestMethod.POST)
    @ApiOperation("康复管理-居民扫码后验证是否是关联的居民扫码")
    @ObserverRequired
    public String checkAfterQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                      @ApiParam(name = "patientCode", value = "居民端登录的居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            JSONObject result = rehabilitationManageService.checkAfterQrCode(planDetailId,patientCode);
            return write(200, String.valueOf(result.get("message")), "data", result.get("obj"));
        } catch (Exception e) {
            error(e);
            return error(-1, "验证失败");
        }
    }
    @RequestMapping(value = "serviceDoctorList", method = RequestMethod.GET)
    @ApiOperation("康复管理-医生端居民详情服务医生列表")
    @ObserverRequired
@ -321,7 +309,7 @@ public class DoctorRehabilitationManageController extends BaseController {
            if(result.getInt("status")==200){
                return write(200, "新增康复计划日志成功!", "data", result.getJSONObject("obj"));
            }else {
                return error(-1, "新增康复计划日志失败!");
                return error(-1, result.getString("message"));
            }
        } catch (Exception e) {
            error(e);

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

@ -6,6 +6,7 @@ package com.yihu.wlyy.web.patient.specialist.rehabilitation;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.specialist.rehabilitation.RehabilitationManageService;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -30,6 +31,8 @@ public class PatientRehabilitationManageController extends BaseController {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private ImUtill imUtill;
    @RequestMapping(value = "patientRehabilitationDetail", method = RequestMethod.GET)
    @ApiOperation("康复管理-微信端-居民详情页")
@ -100,4 +103,35 @@ public class PatientRehabilitationManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "sendMessageIm", method = RequestMethod.POST)
    @ApiOperation("康复管理-扫描二维码发送消息")
    @ObserverRequired
    public String sendMessageIm(@ApiParam(name = "sendId", value = "发送者id")@RequestParam(value = "sendId", required = true)String sendId,
                                @ApiParam(name = "receiverId", value = "接受者id", required = true)@RequestParam(value = "receiverId", required = true)String receiverId,
                                @ApiParam(name = "content", value = "内容", required = true)@RequestParam(value = "content", required = true)String content){
        try {
            imUtill.sendMessage(sendId,receiverId,"1",content);
            return write(200,"发送成功!");
        } catch (Exception e) {
            error(e);
            return error(-1, "发送失败!");
        }
    }
    @RequestMapping(value = "checkAfterQrCode", method = RequestMethod.POST)
    @ApiOperation("康复管理-居民扫码后验证是否是关联的居民扫码")
    @ObserverRequired
    public String checkAfterQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                   @ApiParam(name = "patientCode", value = "居民端登录的居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            JSONObject result = rehabilitationManageService.checkAfterQrCode(planDetailId,patientCode);
            return write(200, String.valueOf(result.get("message")), "data", result.get("obj"));
        } catch (Exception e) {
            error(e);
            return error(-1, "验证失败");
        }
    }
}

+ 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: