Pārlūkot izejas kodu

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

zd_123 7 gadi atpakaļ
vecāks
revīzija
ccfb908670
24 mainītis faili ar 1433 papildinājumiem un 12 dzēšanām
  1. 1 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java
  2. 86 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/HopsitalServiceItemController.java
  3. 3 3
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/ServiceItemController.java
  4. 3 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/HospitalDao.java
  5. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/ServiceItemService.java
  6. 81 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/SpecialistHospitalItemService.java
  7. 21 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp
  8. 7 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/index_js.jsp
  9. 2 0
      patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js
  10. 225 0
      patient-co-manage/wlyy-manage/src/main/webapp/static/specialty/css/index.css
  11. 10 0
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientHealthIndex.java
  12. 1 0
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java
  13. 1 1
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/FamilyLianQianService.java
  14. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  15. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java
  16. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java
  17. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  18. 158 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java
  19. 100 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistHospitalItemService.java
  20. 294 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java
  21. 37 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  22. 62 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/HospitalServiceItemController.java
  23. 243 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/RehabilitationManageController.java
  24. 88 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/SpecialistEvaluateController.java

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java

@ -30,7 +30,7 @@ public class Message extends IdEntity {
	/** type
	 *  消息类型(1.是家庭签约信息  2.体征消息  3分配健管师 4.随访提醒 5.咨询回复提醒,6.续方咨询待审核提醒,7.续方消息待取药
	 *  8.续方支付成功后团队长分配健管师,9线下调整完成,10意见反馈 11账号申诉,12.协同服务 13.孕检提醒 14.文章提交审核消息  15、健康文章审核结果
	 *  16.专科医生申请签约消息,17、家庭医生转诊预约消息
	 *  16.专科医生申请签约消息,17、家庭医生转诊预约消息,18、专科医生共管通知,19、
	 *  101患者申请取消签约、102患者同意取消签约、103患者拒绝取消签约、104患者填写了血糖记录、105患者填写了血压记录、106患者填写了体重记录、
	 *  107患者填写了腰围记录、108患者填写了运动记录、109患者填写了用药记录、110患者填写了饮食记录、111患者提交了问卷随访、112请求添加好友消息、
	 *  113入群消息、114群解散消息、115踢出群消息、116新的网络咨询、117网络咨询追问、

+ 86 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/HopsitalServiceItemController.java

@ -0,0 +1,86 @@
package com.yihu.wlyy.controller.manager.specialist;/**
 * Created by nature of king on 2018/8/29.
 */
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.manager.specialist.SpecialistHospitalItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.ResponseBody;
/**
 * @author wangzhinan
 * @create 2018-08-29 1:48
 * @desc 机构服务项目
 **/
@Controller
@RequestMapping(value="/admin/specialist/hospitalServiceItem")
public class HopsitalServiceItemController extends BaseController {
    @Autowired
    private SpecialistHospitalItemService specialistHospitalItemService;
    @RequestMapping(value = "initial")
    public String listInit() {
        return "desizenMan/new-institutional-projects";
    }
    @RequestMapping(value = "initial1")
    public String listInit1() {
        return "desizenMan/new-institutional-projects";
    }
    /**
     * 添加机构服务项目
     *
     * @param hospitalServiceItem
     * @return
     */
    @RequestMapping(value = "createHospitalServiceItem", method = RequestMethod.POST)
    @ResponseBody
    public String insert(@RequestParam(name = "hospitalServiceItem") String hospitalServiceItem){
        try {
            return write(200, "操作成功", "data",specialistHospitalItemService.insert(hospitalServiceItem));
        } catch (Exception ex) {
            error(ex);
            return error(-1, "操作失败");
        }
    }
    /**
     * 获取机构
     * @return
     */
    @RequestMapping(value = "selectByHospital", method = RequestMethod.POST)
    @ResponseBody
    public String selectHospitals(){
        try {
            return write(200, "查询成功", "data",specialistHospitalItemService.selectHospital());
        } catch (Exception ex) {
            error(ex);
            return error(-1, "查询失败");
        }
    }
    /**
     *
     * @param hospital
     * @return
     */
    @RequestMapping(value = "selectByHospital", method = RequestMethod.POST)
    @ResponseBody
    public String selectByHospital(@RequestParam(name = "hospital") String hospital){
        try {
            return write(200, "查询成功", "data",specialistHospitalItemService.selectItemByHospital(hospital));
        } catch (Exception ex) {
            error(ex);
            return error(-1, "查询失败");
        }
    }
}

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/ServiceItemController.java

@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 * @desc 服务项目
 **/
@Controller
@RequestMapping(value="admin/specialist/")
@RequestMapping(value="/admin/specialist/serviceItem")
public class ServiceItemController  extends BaseController {
    @Autowired
    private ServiceItemService serviceItemService;
@ -72,9 +72,9 @@ public class ServiceItemController  extends BaseController {
     * @param pageSize
     * @return
     */
    @RequestMapping(value = "updateServiceItem", method = RequestMethod.POST)
    @RequestMapping(value = "selectServiceItem", method = RequestMethod.POST)
    @ResponseBody
    public String updateServiceItem(@RequestParam(name = "serviceItem") String serviceItem,
    public String selectServiceItem(@RequestParam(name = "serviceItem") String serviceItem,
                                    @RequestParam(name = "page",defaultValue = "1")Integer page,
                                    @RequestParam(name = "pageSize",defaultValue = "10")Integer pageSize){
        try {

+ 3 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/HospitalDao.java

@ -47,4 +47,7 @@ public interface HospitalDao extends PagingAndSortingRepository<Hospital, Long>,
    @Query("select p from Hospital p where p.code like ?1 order by p.code desc ")
    List<Hospital> findByCodePrefix(String codePrefix);
    @Query("select p from Hospital p where p.del = 1 and p.level in (1,2) ")
    List<Hospital> findAllHospital();
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/ServiceItemService.java

@ -59,7 +59,7 @@ public class ServiceItemService extends BaseService {
     */
    public JSONObject createServiceItem(String serviceItem) throws Exception {
        String response = null;
        String url =getBaseUrl() + "createActiveRecord";
        String url =getBaseUrl() + "createServiceItem";
        Map<String,String> params = new HashMap<>();
        params.put("serviceItem",serviceItem);
        try {

+ 81 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/SpecialistHospitalItemService.java

@ -0,0 +1,81 @@
package com.yihu.wlyy.service.manager.specialist;/**
 * Created by nature of king on 2018/8/28.
 */
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.Hospital;
import com.yihu.wlyy.repository.HospitalDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpClientUtil;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author wangzhinan
 * @create 2018-08-28 20:40
 * @desc 机构服务项目
 **/
@Service
@Transactional
public class SpecialistHospitalItemService extends BaseService {
    private static org.slf4j.Logger logger = LoggerFactory.getLogger(SpecialistHospitalItemService.class);
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Value("${specialist.url}")
    private String specialistUrl;
    /**
     *
     * @return
     */
    public List<Hospital> selectHospital(){
        List<Hospital> hospitals = hospitalDao.findAllHospital();
        return hospitals;
    }
    public JSONObject insert(String hospitalServiceItem){
        String response = null;
        String url =specialistUrl + "svr-specialist/createHospitalServiceItem";
        Map<String,String> params = new HashMap<>();
        params.put("hospitalServiceItem",hospitalServiceItem);
        try {
            response = httpClientUtil.httpPost(url,params);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
    /**
     * 根据医院code获取服务项目
     *
     * @param hospital
     * @return
     */
    public JSONObject selectItemByHospital(String hospital){
        String response = null;
        String url =specialistUrl + "svr-specialist/selectItemByHospital";
        Map<String,String> params = new HashMap<>();
        params.put("hospital",hospital);
        try {
            response = httpClientUtil.httpPost(url,params);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
}

+ 21 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp

@ -44,7 +44,7 @@
            <div class="aMenus">
				<%-- 基础信息管理中心 --%>
				<sec:authorize url="/admin/baseInfo/center">
				<sec:authorize url="admin/baseInfo/center">
				<div class="a-divider"></div>
                <div class="a-menu">
					<div class="a-menu-tit"><i class="icons icons-aside-2 icons-24 mr15"></i>基础信息管理</div>
@ -197,6 +197,26 @@
					</div>
				</div>
				</sec:authorize>
				<%-- 服务项目管理--%>
				<sec:authorize url="/admin/specialist/center">
				<div class="a-divider"></div>
				<div class="a-menu">
					<div class="a-menu-tit"><i class="icons icons-aside-2 icons-24 mr15"></i>服务项目管理</div>
					<div class="a-menu-list c-hide">
						<ul>
							</sec:authorize>
							<sec:authorize url="/admin/specialist/initial">
								<li><a href="javascript:locationMenu('specialist');">项目表</a></li>
							</sec:authorize>
							<sec:authorize url="/admin/surveyTemplate/initial">
								<li><a href="javascript:locationMenu('surveyTemplate');">机构服务项目管理</a></li>
							</sec:authorize>
								<sec:authorize url="/admin/specialist/center">
						</ul>
					</div>
				</div>
				</sec:authorize>
				<%-- 安全管理中心--%>
				<sec:authorize url="/admin/security/center">
				<div class="a-divider"></div>

+ 7 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/index_js.jsp

@ -0,0 +1,7 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
    $(function () {
    });
</script>

+ 2 - 0
patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js

@ -62,6 +62,8 @@ var menu = {
    //基础数据导入
    "basedata": "/admin/basedata/initial",//问题管理界面
    //服务项目管理
    "specialist":"/admin/specialist/initial", //项目表
}
$(".a-menu-list a").bind("click", function () {

+ 225 - 0
patient-co-manage/wlyy-manage/src/main/webapp/static/specialty/css/index.css

@ -0,0 +1,225 @@
.flex{
    display:-webkit-box;
    display:-webkit-flex;
    display:flex;
}
.flex-sp-b{
    justify-content: space-between;
    -webkit-justify-content: space-between;
}
.flex-sp-a{
    justify-content: space-around;
    -webkit-justify-content: space-around;
}
.flex-sp-c{
    justify-content: center;
    -webkit-justify-content: center;
}
.flex-sp-end{
    justify-content: flex-end;
    -webkit-justify-content: flex-end;
}
.flex-cz-c{
    -webkit-align-items:center;
    align-items:center;
}
#maingrid{
    margin-top: 20px;margin-bottom: 35px;
}
.icon-search:before{
    display: none;
}
.icon {
    width: 20px;
    height: 20px;
    vertical-align: sub;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: inline-block;
}
.icon15 {
    width: 15px;
    height: 15px;
}
.icon30 {
    width: 34px;
    height: 34px;
}
.icon-search {
    background-image: url(../images/sousuo_btn.png);
    background-size: 100% 100%;
}
.icon-delete {
    background-image: url(../images/delete.png);
    background-size: 100% 100%;
}
.input-group-addon {
    width: 34px !important;
    height: 34px;
    padding: 0;
    background-color: #f0f5f7;
    border: none !important;
}
.font-12 {
    font-size: 12px;
}
.btn-hover-none {
    background-color: #fff;
}
.btn-hover-none:hover {
    background-color: #fff;
}
.btn-radius-none {
    border-radius: 0px;
}
.w130 {
    width: 130px;
}
.h30 {
    height: 30px;
    line-height: 30px;
    padding: 0;
}
.w30 {
    width: 30px;
}
.w320 {
    width: 320px;
}
.ml40{
    margin-left: 40px!important;
}
.btn-group {
    margin-left: 20px;
}
.content {
    padding-top: 20px;
}
.text-align-left {
    text-align: left;
    text-indent: 1em;
}
.btn {
    font-size: 12px;
}
.search {
    display: inline-block;
    margin-left: 20px;
}
.search .btn {
    width: 90px;
    margin-left: 20px;
}
.pull-right .btn {
    margin-right: 20px;
}
.l-grid1 .l-grid-header .l-grid-header-table{
    height: 75px;
}
.l-grid-header{
    height: 75px !important;
    background-color: #edf6fa!important;
    background-image: none!important;
}
.l-grid2 .l-grid-header-table .l-grid-hd-row:nth-child(2) .l-grid-hd-cell:nth-child(3) .l-grid-hd-cell-inner{
    height: auto !important;
}
.l-selected .l-grid-row-cell, .l-selected{
    background-color: rgb(220, 248, 168);
}
.l-grid-hd-cell-text{
    font-weight: bold;
}
.l-panel-bar{
    position: fixed;bottom: 0;left: 0;width: 100%;
}
.l-grid-row{
    height: 80px;
}
.l-grid-row-cell-last div{
    height: 79px!important;box-sizing: border-box;
    padding-top:20px;
}
.l-grid-row-cell-last input{
    background-color: transparent;border: none;
    width: 32%;font-size: 12px;color: #2d9bd2;
}
.l-grid-row-cell-last input.delete{
    color: #eb4b3c;
}
.lay{
    width: 680px;
}
.lay .title{
    width: 680px;height: 40px;line-height: 40px;background-color: #fff;background-color: #2d9bd2;
    font-size: 14px;color: #fff;padding-left: 20px;padding-right: 10px;
}
.lay .info{
    overflow: hidden;
}
.lay .info .info-title{
    font-size: 14px;color: #333;font-weight: bold;padding: 20px;
}
.lay .info .info-left{
    width: 360px;float: left;
}
.lay .info .info-right{
    width: 320px;float: right;padding-right: 45px;height: 553px;
}
.lay .info .input{
    text-align: right;margin-bottom: 10px;
}
.lay .info .input label{
    font-size: 12px;color: #323232;
}
.lay .info .info-left .input input{
    width: 267px;height: 30px;
}
.lay .info .info-right .input input{
    width: 180px;height: 30px;
}
.lay .info .info-left .input textarea{
    width: 267px;height: 100px;resize:none
}
.lay .info .info-right .input textarea{
    width: 180px;height: 116px;resize:none
}
.layui-form-label{
    font-size: 12px!important;color: #323232!important;font-weight: bold!important;
    padding: 0;height: 36px;line-height: 40px;margin-left: 9px;
}
.layui-input-block{
    margin-left: 95px;
}
.lay .info .info-right .info-right-title{
    font-size: 12px;color: #323232;font-weight: bold;padding-left: 40px;margin-bottom: 10px;
}
.lay .info .info-bottom{
    text-align: center;
}
.lay .info .info-bottom .layui-btn{
    box-sizing: border-box;width: 100px;color: #fff;
}
.layui-form-checkbox[lay-skin=primary]{
    height: 30px!important;
}

+ 10 - 0
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientHealthIndex.java

@ -48,6 +48,8 @@ public class PatientHealthIndex extends IdEntity {
	//设备编号
	private String deviceSn;
	private String button;//按键号
	private Integer status;//状态:0为标准,1为异常
	private Integer manageResult;//异常数据处理 0未干预 1异常有效干预 2异常无效干预
@ -203,4 +205,12 @@ public class PatientHealthIndex extends IdEntity {
	public void setManageResult(Integer manageResult) {
		this.manageResult = manageResult;
	}
	public String getButton() {
		return button;
	}
	public void setButton(String button) {
		this.button = button;
	}
}

+ 1 - 0
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java

@ -506,6 +506,7 @@ public class DeviceService extends BaseService{
            String user = device.getUser();
            obj.setUser(user);
            obj.setButton(userType);
            obj.setIdcard(device.getUserIdcard());
            obj.setStatus(0);
            //  1血糖 2血压 3体重 4腰围

+ 1 - 1
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/FamilyLianQianService.java

@ -59,7 +59,7 @@ public class FamilyLianQianService {
                if (demographicInfo != null) {
                    logger.info("personId"+demographicInfo.getPersonid().toString());
                    List<ResidenceInfo> residenceInfo = residenceInfoDao.findByPersonIdAndState(demographicInfo.getPersonid());
                    if (residenceInfo == null){
                    if (residenceInfo == null || residenceInfo.size() == 0){
                        continue;
                    }
                    List<ResidenceInfo> residenceInfoList = residenceInfoDao.findByFamilyIdAndLeave(residenceInfo.get(0).getFamilystateid());

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -133,14 +133,14 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type = 18 order by a.czrq desc")
    List<Message> getFamilySign(String receiver);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type = 18 and a.read = 1")
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type in(18,19,20,21,22) and a.read = 1")
    List<Message> selectFamilySign(String receiver,Pageable pageableRequest);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type = 17 order by a.czrq desc")
    List<Message> getFamilyTransferReadAndOver(String receiver,Integer read,String over);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type = ?4 order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,Integer read,String over,Pageable pageable,Integer type);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (16,19,20,21,22) order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,Integer read,String over,Pageable pageable);
    @Query("select a from Message a where a.code = ?1")
    Message findByCode(String code);

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -441,4 +441,7 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
    //根据居民和医生找出居民签约团队
    @Query("select f from SignFamily f where f.status > 0 and f.patient = ?1 and ( f.doctor = ?2 or doctorHealth = ?2  )")
    SignFamily findSignFamilyByPatientAndDoctor(String patient, String doctor);
    //根据居民获取有效的签约
    List<SignFamily> findByPatientAndExpensesStatusAndStatus(String patient,String expensesStatus,Integer status);
}

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -804,6 +804,8 @@ public class FamilyMemberService extends BaseService {
        switch (relation) {
            case 1:
                relationTrans = 1;
                break;
            case 2:
                if (patient.getSex() == 1) {
                    relationTrans = 5;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -897,7 +897,7 @@ public class MessageService extends BaseService {
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.getSpecialistUntreated(message.getReceiver(),message.getRead(),message.getOver(),pageRequest,message.getType());
        return messageDao.getSpecialistUntreated(message.getReceiver(),message.getRead(),message.getOver(),pageRequest);
    }

+ 158 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -0,0 +1,158 @@
package com.yihu.wlyy.service.specialist;/**
 * Created by nature of king on 2018/8/28.
 */
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * @author wangzhinan
 * @create 2018-08-28 9:09
 * @desc 服务项目评论
 **/
@Service
@Transactional
public class SpecialistEvaluateSevice extends BaseService {
    private static org.slf4j.Logger logger = LoggerFactory.getLogger(SpecialistEvaluateSevice.class);
    @Autowired
    private MessageDao messageDao;
    @Value("${specialist.url}")
    private String specialistUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private DoctorDao doctorDao;
    /**
     * 添加评论
     *
     * @param object
     * @return
     */
    public JSONObject insert(JSONObject object){
        String response = null;
        String url =specialistUrl + "svr-specialist/createEvaluate";
        Map<String,String> params = new HashMap<>();
        params.put("evaluate",object.toJSONString());
        try {
            response = httpClientUtil.httpPost(url,params);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
    /**
     * 更新评论
     *
     * @param object
     * @return
     */
    public JSONObject update(JSONObject object){
        String response = null;
        String url =specialistUrl + "svr-specialist/updateEvaluate";
        Map<String,String> params = new HashMap<>();
        params.put("evaluate",object.toJSONString());
        try {
            response = httpClientUtil.httpPost(url,params);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
    /**
     * 获取评论
     *
     * @param object
     * @return
     */
    public JSONObject select(JSONObject object){
        String response = null;
        String url =specialistUrl + "svr-specialist/getEvaluate";
        Map<String,String> params = new HashMap<>();
        params.put("evaluate",object.toJSONString());
        try {
            response = httpClientUtil.httpPost(url,params);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成
     */
    public JSONObject sendMessage(Message message,String hospital,String patient,Integer time){
        JSONObject object = new JSONObject();
        try {
            Patient patient1 = patientDao.findByCode(patient);
            Hospital hospital1 = hospitalDao.findByCode(hospital);
            Doctor doctor = doctorDao.findByCode(message.getSender());
            Doctor doctor1 = doctorDao.findByCode(message.getReceiver());
            if (message.getType() == 19 && StringUtils.isNoneBlank(hospital)){
                message.setType(19);
                message.setTitle("康复计划-受理提醒");
                message.setContent("您的"+patient1.getName()+"签约居民,刚刚出院,"+hospital1.getName()+"已完成康复计划的制定,请查看");
            }else if (message.getType() == 20){
                message.setType(20);
                message.setTitle("康复计划-待办工作提醒");
                message.setContent("您的"+patient1.getName()+"签约居民"+time+"天后计划到"+hospital1.getName()+"复诊,请查看");
            }else if (message.getType() == 21){
                message.setType(21);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient1.getName()+"签约居民已完成康复计划今日项目,请查看");
            }else if (message.getType() == 22){
                message.setType(22);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient1.getName()+"签约居民未完成康复计划今天项目,请尽快处理");
            }
            message.setSenderName(doctor.getName());
            message.setCode(getCode());
            message.setSenderPhoto(doctor.getPhoto());
            message.setReadonly(1);//是否只读消息
            message.setSex(doctor.getSex());
            message.setOver("1");//未处理
            message.setDel("1");
            message.setState(1);
            message.setCzrq(new Date());
            message.setReceiverName(doctor1.getName());
            messageDao.save(message);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return object;
    }
}

+ 100 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistHospitalItemService.java

@ -0,0 +1,100 @@
package com.yihu.wlyy.service.specialist;/**
 * Created by nature of king on 2018/8/28.
 */
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpClientUtil;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author wangzhinan
 * @create 2018-08-28 20:40
 * @desc 机构服务项目
 **/
@Service
@Transactional
public class SpecialistHospitalItemService extends BaseService {
    private static org.slf4j.Logger logger = LoggerFactory.getLogger(SpecialistHospitalItemService.class);
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Value("${specialist.url}")
    private String specialistUrl;
    public List<Hospital> selectHospital(){
        List<Hospital> hospitals = hospitalDao.findAllHospital();
        return hospitals;
    }
    /**
     * 获取服务项目
     * @param hospitals
     * @return
     */
    public JSONObject selectByHospital(String hospitals){
        String response = null;
        JSONObject object = new JSONObject();
        String url =specialistUrl + "svr-specialist/selectByHospital";
        Map<String,String> params = new HashMap<>();
        params.put("hospitals",hospitals);
        try {
            response = httpClientUtil.httpPost(url,params);
            object = JSONObject.parseObject(response);
            JSONArray array = object.getJSONArray("detailModelList");
            for (int i = 0;i<array.size();i++){
                JSONObject jsonObject = array.getJSONObject(i);
                String hospital = jsonObject.getString("hospital");
                Hospital hospital1 = hospitalDao.findByCode(hospital);
                jsonObject.put("hospitalDo",hospital1);
            }
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return object;
    }
    /**
     * 根据服务项目ids获取数据
     *
     * @param ids
     * @return
     */
    public JSONObject selectByIds(String ids){
        String response = null;
        JSONObject object = new JSONObject();
        String url =specialistUrl + "svr-specialist/selectById";
        Map<String,String> params = new HashMap<>();
        params.put("ids",ids);
        try {
            response = httpClientUtil.httpPost(url,params);
            object = JSONObject.parseObject(response);
            JSONArray array = object.getJSONArray("detailModelList");
            for (int i = 0;i<array.size();i++){
                JSONObject jsonObject = array.getJSONObject(i);
                String hospital = jsonObject.getString("hospital");
                Hospital hospital1 = hospitalDao.findByCode(hospital);
                jsonObject.put("hospitalDo",hospital1);
            }
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return object;
    }
}

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

@ -0,0 +1,294 @@
package com.yihu.wlyy.service.specialist.rehabilitation;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
 * Created by 刘文彬 on 2018/8/29.
 */
@Service
@Transactional
public class RehabilitationManageService extends BaseService {
    @Value("${specialist.url}")
    private String specialistUrl;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    /************************************************************* start ************************************************************************/
    private String findRehabilitationPlanList = "/svr-specialist/findRehabilitationPlanList";//康复管理-康复计划列表
    private String findRehabilitationPlanDetailList = "/svr-specialist/findRehabilitationPlanDetailList";//康复管理-康复计划详情列表
    private String calendarPlanDetail = "/svr-specialist/calendarPlanDetail";//康复管理-康复计划按日历展示
    private String calendarPlanDetailList = "/svr-specialist/calendarPlanDetailList";//康复管理-康复计划按列表展示
    private String serviceItemList = "/svr-specialist/serviceItemList";//康复管理-服务项目内容列表
    private String serviceItem = "/svr-specialist/serviceItem";//康复管理-服务项目-完成项目内容信息
    private String saveGuidanceMessage = "/svr-specialist/saveGuidanceMessage";//康复管理-保存指导留言
    private String updateStatusRehabilitationOperate = "/svr-specialist/updateStatusRehabilitationOperate";//康复管理-服务项目-完成项目内容信息
    private String patientRehabilitationDetail = "/svr-specialist/patientRehabilitationDetail";//康复管理-居民详情页
    private String recentPlanDetailRecord = "/svr-specialist/recentPlanDetailRecord";//居民康复计划详情页-近期康复相关记录
    /************************************************************* end ************************************************************************/
    /**
     * 康复管理-康复计划列表
     * @param doctorCode
     * @param patientCondition
     * @param diseaseCode
     * @param planType
     * @param todaybacklog
     * @param page
     * @param pageSize
     * @return
     * @throws Exception
     */
    public JSONObject findRehabilitationPlanList(String doctorCode,String patientCondition,
                                                 String diseaseCode,Integer planType,Integer todaybacklog,Integer page,Integer pageSize) throws Exception{
        Integer doctorType = null;
        Doctor doctor = doctorDao.findByCode(doctorCode);
        if(doctor.getLevel()==1){
            doctorType = 1;
        }else{
            doctorType = 2;
        }
        Map<String, Object> param = new HashedMap();
        param.put("doctorType", doctorType);//医生类型(1、专科医生,2、家庭医生)
        param.put("doctorCode", doctorCode);//医生code
        param.put("patientCondition", patientCondition);//居民条件,可以按身份证或者居民名称模糊匹配
        param.put("diseaseCode", diseaseCode);//疾病类型code
        param.put("planType", planType);//安排类型(1康复计划,2转社区医院,3转家庭病床)
        param.put("todaybacklog", todaybacklog);//今日待办(1、今日待办,2、全部)
        param.put("page", page);//第几页,从1开始
        param.put("pageSize", pageSize);//每页分页大小
        HttpResponse response = HttpUtils.doGet(specialistUrl + findRehabilitationPlanList, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result;
        }
        throw new Exception("请求微服务失败!");
    }
    /**
     * 康复管理-康复计划详情列表
     * @param doctorCode
     * @param patientCode
     * @return
     * @throws Exception
     */
    public JSONObject findRehabilitationPlanDetailList(String doctorCode,String patientCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("doctorCode", doctorCode);
        param.put("patientCode", patientCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + findRehabilitationPlanDetailList, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    /**
     * 康复管理-康复计划按日历展示
     * @param executeStartTime
     * @param executeEndTime
     * @param planId
     * @param searchTask
     * @param status
     * @param doctorCode
     * @return
     * @throws Exception
     */
    public JSONObject calendarPlanDetail(String executeStartTime,String executeEndTime,String planId,Integer searchTask,Integer status,String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("executeStartTime", executeStartTime);
        param.put("executeEndTime", executeEndTime);
        param.put("planId", planId);
        param.put("searchTask", searchTask);
        param.put("status", status);
        param.put("doctorCode", doctorCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + calendarPlanDetail, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    /**
     * 康复管理-康复计划按列表展示
     * @param executeStartTime
     * @param executeEndTime
     * @param planId
     * @param searchTask
     * @param status
     * @param doctorCode
     * @return
     * @throws Exception
     */
    public JSONArray calendarPlanDetailList(String executeStartTime, String executeEndTime, String planId, Integer searchTask, Integer status, String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("executeStartTime", executeStartTime);
        param.put("executeEndTime", executeEndTime);
        param.put("planId", planId);
        param.put("searchTask", searchTask);
        param.put("status", status);
        param.put("doctorCode", doctorCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + calendarPlanDetailList, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONArray("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    /**
     * 康复管理-多个康复计划服务项目内容列表
     * @param planDetailIds
     * @return
     * @throws Exception
     */
    public JSONArray serviceItemList(String planDetailIds) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailIds", planDetailIds);
        HttpResponse response = HttpUtils.doGet(specialistUrl + serviceItemList, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONArray("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    /**
     * 康复管理-康复计划服务项目确认详情页
     * @param planDetailId
     * @return
     * @throws Exception
     */
    public JSONObject serviceItem(String planDetailId) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailIds", planDetailId);
        HttpResponse response = HttpUtils.doGet(specialistUrl + serviceItem, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    /**
     * 康复管理-保存指导留言
     * @param messageId
     * @param patientCode
     * @param doctorCode
     * @param doctorType
     * @param content
     * @param planDetailId
     * @return
     * @throws Exception
     */
    public void saveGuidanceMessage(String messageId,String patientCode,String doctorCode,String content,String planDetailId) throws Exception{
        Doctor doctor = doctorDao.findByCode(doctorCode);
        Integer doctorType = doctor.getLevel();
        Map<String, Object> param = new HashedMap();
        param.put("messageId", messageId);
        param.put("patientCode", patientCode);
        param.put("doctorCode", doctorCode);
        param.put("doctorType", doctorType);
        param.put("content", content);
        param.put("planDetailIds", planDetailId);
        HttpResponse response = HttpUtils.doPost(specialistUrl + saveGuidanceMessage, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){
            throw new Exception("请求微服务失败!");
        }
    }
    /**
     * 康复管理-更新康复计划操作完成日志状态
     * @param planDetailId
     * @param status
     * @throws Exception
     */
    public void updateStatusRehabilitationOperate(String planDetailId,Integer status) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailId", planDetailId);
        param.put("status", status);
        HttpResponse response = HttpUtils.doPost(specialistUrl + updateStatusRehabilitationOperate, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){
            throw new Exception("请求微服务失败!");
        }
    }
    /**
     * 康复管理-居民详情页
     * @param patientCode
     * @return
     * @throws Exception
     */
    public JSONObject patientRehabilitationDetail(String patientCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        List<SignFamily> list = signFamilyDao.findByPatientAndExpensesStatusAndStatus(patientCode,"1",1);
        String healthDoctor = null;
        String healthDoctorName =null;
        String generalDoctor = null;
        String generalDoctorName = null;
        if(list.size()>0){
            SignFamily signFamily = list.get(0);
            healthDoctor = signFamily.getDoctorHealth();
            healthDoctorName = signFamily.getDoctorHealthName();
            generalDoctor = signFamily.getDoctor();
            generalDoctorName = signFamily.getDoctorName();
        }
        param.put("patientCode", patientCode);
        param.put("healthDoctor", healthDoctor);
        param.put("healthDoctorName", healthDoctorName);
        param.put("generalDoctor", generalDoctor);
        param.put("generalDoctorName", generalDoctorName);
        HttpResponse response = HttpUtils.doGet(specialistUrl + patientRehabilitationDetail, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    /**
     * 居民康复计划详情页-近期康复相关记录
     * @param patientCode
     * @param startTime
     * @param endTime
     * @return
     * @throws Exception
     */
    public JSONObject recentPlanDetailRecord(String patientCode,String startTime,String endTime) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("patientCode", patientCode);
        param.put("startTime", startTime);
        param.put("endTime", endTime);
        HttpResponse response = HttpUtils.doGet(specialistUrl + recentPlanDetailRecord, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
        }
        throw new Exception("请求微服务失败!");
    }
}

+ 37 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -8,6 +8,7 @@ import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.MessageNoticeSetting;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
@ -43,6 +44,8 @@ public class DoctorMessageController extends BaseController {
    private MessageDao messageDao;
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    @Autowired
    private SpecialistEvaluateSevice specialistEvaluateSevice;
    @RequestMapping(value = "messages")
    @ResponseBody
@ -573,7 +576,6 @@ public class DoctorMessageController extends BaseController {
        }
        Message message1 = new Message();
        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
        message1.setType(object.getInteger("type"));
        message1.setOver(object.getString("over"));
        message1.setRead(object.getInteger("read"));
        message1.setReceiver(getUID());
@ -585,4 +587,38 @@ public class DoctorMessageController extends BaseController {
        }
    }
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成
     *  message{sender:"",receiver:"",relationCode:""}
     * @param message
     * @param hospital
     * @param patient
     * @param time
     * @return
     */
    @RequestMapping(value = "sendMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("发送消息")
    public String sendMessage(@ApiParam(name = "message",value = "消息对象")
                              @RequestParam(value = "message")String message,
                              @ApiParam(name = "hospital",value = "医院code")
                              @RequestParam(value = "hospital")String hospital,
                              @ApiParam(name = "patient",value = "居民code")
                              @RequestParam(value = "patient")String patient,
                              @ApiParam(name = "time",value = "时间")
                              @RequestParam(value = "time",required = false)Integer time) {
        try {
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(message);
            Message message1 = new Message();
            message1.setSender(object.getString("sender"));
            message1.setType(object.getInteger("type"));
            message1.setReceiver(object.getString("receiver"));
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient,time));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取消息失败!");
        }
    }
}

+ 62 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/HospitalServiceItemController.java

@ -0,0 +1,62 @@
package com.yihu.wlyy.web.doctor.specialist;/**
 * Created by nature of king on 2018/8/29.
 */
import com.yihu.wlyy.service.specialist.SpecialistHospitalItemService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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;
/**
 * @author wangzhinan
 * @create 2018-08-29 1:58
 * @desc 机构服务项目
 **/
@RestController
@RequestMapping(value = "/doctor/specialist/hospitalServiceItem", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "专科医生-机构服务项目管理")
public class HospitalServiceItemController extends BaseController {
    @Autowired
    private SpecialistHospitalItemService specialistHospitalItemService;
    /**
     *根据医院code获取服务项目
     *
     * @param hospitals
     * @return
     */
    @RequestMapping(value = "/selectByHospital",method = RequestMethod.GET)
    @ApiOperation(value = "根据医院code获取服务项目")
    public String selectByHospital(@ApiParam(name = "hospitals", value = "医院code")@RequestParam(value = "hospitals")String hospitals){
        try {
            return write(200,"获取成功!","data",specialistHospitalItemService.selectByHospital(hospitals));
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"获取失败!");
        }
    }
    /**
     * 根据机构id获取服务项目
     * @param ids
     * @return
     */
    @RequestMapping(value = "/selectByIds",method = RequestMethod.GET)
    @ApiOperation(value = "根据机构id获取服务项目")
    public String selectByIds(@ApiParam(name = "ids", value = "机构服务项目id")@RequestParam(value = "hospitals")String ids){
        try {
            return write(200,"获取成功!","data",specialistHospitalItemService.selectByIds(ids));
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"获取失败!");
        }
    }
}

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

@ -0,0 +1,243 @@
package com.yihu.wlyy.web.doctor.specialist.rehabilitation;
import org.json.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
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.http.MediaType;
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;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/8/30.
 */
@RestController
@RequestMapping(value = "/doctor/specialist/rehabilitation", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-康复管理")
public class RehabilitationManageController extends BaseController {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @RequestMapping(value = "findRehabilitationPlanList", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划列表")
    @ObserverRequired
    public String findRehabilitationPlanList(@ApiParam(name = "doctorCode", value = "医生code", required = true)
                                             @RequestParam(value = "doctorCode", required = false)String doctorCode,
//                                             @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
//                                             @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                             @ApiParam(name = "patientCondition", value = "居民条件,可以按身份证或者居民名称模糊匹配", required = false)
                                             @RequestParam(value = "patientCondition", required = false)String patientCondition,
                                             @ApiParam(name = "diseaseCode", value = "疾病类型code", required = false)
                                             @RequestParam(value = "diseaseCode", required = false)String diseaseCode,
                                             @ApiParam(name = "planType", value = "安排类型(1康复计划,2转社区医院,3转家庭病床)", required = false)
                                             @RequestParam(value = "planType", required = false)Integer planType,
                                             @ApiParam(name = "todaybacklog", value = "今日待办(1、今日待办,2、全部)", required = false)
                                             @RequestParam(value = "todaybacklog", required = false,defaultValue = "1")Integer todaybacklog,
                                             @ApiParam(name = "page", value = "第几页,从1开始", required = true)
                                             @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                                             @ApiParam(name = "pageSize", value = "每页分页大小", required = true)
                                             @RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize) {
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.findRehabilitationPlanList(doctorCode,patientCondition,diseaseCode,planType,todaybacklog,page,pageSize);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "findRehabilitationPlanDetailList", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划详情列表")
    @ObserverRequired
    public String findRehabilitationPlanDetailList(@ApiParam(name = "doctorCode", value = "医生code", required = false)
                                                   @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                                   @ApiParam(name = "patientCode", value = "居民code", required = true)
                                                   @RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.findRehabilitationPlanDetailList(doctorCode,patientCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "calendarPlanDetail", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划按日历展示")
    @ObserverRequired
    public String calendarPlanDetail(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                     @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                     @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                     @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                     @ApiParam(name = "planId", value = "计划id", required = true)
                                     @RequestParam(value = "planId", required = true)String planId,
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                     @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                     @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                     @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                     @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                     @RequestParam(value = "status", required = false)Integer status){
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "calendarPlanDetailList", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划按列表展示")
    @ObserverRequired
    public String calendarPlanDetailList(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                     @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                     @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                     @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                     @ApiParam(name = "planId", value = "计划id", required = true)
                                     @RequestParam(value = "planId", required = true)String planId,
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                     @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                     @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                     @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                     @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                     @RequestParam(value = "status", required = false)Integer status){
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONArray result = rehabilitationManageService.calendarPlanDetailList(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "serviceItemList", method = RequestMethod.GET)
    @ApiOperation("康复管理-多个康复计划服务项目内容列表")
    @ObserverRequired
    public String serviceItemList(@ApiParam(name = "planDetailIds", value = "康复计划多个服务项目id(多个‘,’分隔)", required = true)
                                                   @RequestParam(value = "planDetailIds", required = true)String planDetailIds){
        try {
            JSONArray result = rehabilitationManageService.serviceItemList(planDetailIds);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "planDetailId", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划服务项目确认详情页")
    @ObserverRequired
    public String serviceItem(@ApiParam(name = "planDetailId", value = "康复计划服务项目id", required = true)
                                  @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            JSONObject result = rehabilitationManageService.serviceItem(planDetailId);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "saveGuidanceMessage", method = RequestMethod.POST)
    @ApiOperation("康复管理-保存指导留言")
    @ObserverRequired
    public String saveGuidanceMessage(@ApiParam(name = "messageId", value = "消息id", required = true)
                                      @RequestParam(value = "messageId", required = true)String messageId,
                                      @ApiParam(name = "patientCode", value = "居民code", required = true)
                                      @RequestParam(value = "patientCode", required = true)String patientCode,
//                                      @ApiParam(name = "doctorCode", value = "医生code", required = true)
//                                      @RequestParam(value = "doctorCode", required = true)String doctorCode,
//                                      @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
//                                      @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                      @ApiParam(name = "content", value = "聊天内容", required = true)
                                      @RequestParam(value = "content", required = true)String content,
                                      @ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                      @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            rehabilitationManageService.saveGuidanceMessage(messageId,patientCode,getRepUID(),content,planDetailId);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "updateStatusRehabilitationOperate", method = RequestMethod.POST)
    @ApiOperation("康复管理-更新康复计划操作完成日志状态")
    @ObserverRequired
    public String updateStatusRehabilitationOperate(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                                    @RequestParam(value = "planDetailId", required = true)String planDetailId,
                                                    @ApiParam(name = "status", value = "状态", required = true)
                                                    @RequestParam(value = "status", required = true)Integer status){
        try {
            rehabilitationManageService.updateStatusRehabilitationOperate(planDetailId,status);
            return write(200, "更新成功!");
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "patientRehabilitationDetail", method = RequestMethod.GET)
    @ApiOperation("康复管理-居民详情页")
    @ObserverRequired
    public String patientRehabilitationDetail(@ApiParam(name = "patientCode", value = "居民code", required = true)
                                              @RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            JSONObject result = rehabilitationManageService.patientRehabilitationDetail(patientCode);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "recentPlanDetailRecord", method = RequestMethod.GET)
    @ApiOperation("康复管理-居民详情页")
    @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){
        try {
            JSONObject result = rehabilitationManageService.recentPlanDetailRecord(patientCode,startTime,endTime);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 88 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/SpecialistEvaluateController.java

@ -0,0 +1,88 @@
package com.yihu.wlyy.web.patient.specialist;/**
 * Created by nature of king on 2018/8/28.
 */
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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;
/**
 * @author wangzhinan
 * @create 2018-08-28 9:34
 * @desc 评价
 **/
@RestController
@RequestMapping(value = "/patient/specialist", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "患者端-评价管理")
public class SpecialistEvaluateController extends WeixinBaseController {
    @Autowired
    private SpecialistEvaluateSevice specialistEvaluateSevice;
    /**
     * 服务项目评价添加
     * @param evaluates
     * @return
     */
    @RequestMapping(value = "/createEvaluate",method = RequestMethod.POST)
    @ApiOperation("服务项目评价添加")
    public String insert(@ApiParam(name = "evaluates",value = "服务项目评价")
                             @RequestParam(name = "evaluates")String evaluates){
        try {
            JSONObject object = JSONObject.parseObject(evaluates);
            object.put("patient",getUID());
            return write(200,"提交成功","data",specialistEvaluateSevice.insert(object));
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
    /**
     * 更新服务项目评价
     * @param evaluates
     * @return
     */
    @RequestMapping(value = "/updateEvaluate",method = RequestMethod.POST)
    @ApiOperation("更新服务项目评价")
    public String update(@ApiParam(name = "evaluates",value = "服务项目评价")
                             @RequestParam(name = "evaluates")String evaluates){
        try {
            JSONObject object = JSONObject.parseObject(evaluates);
            object.put("patient",getUID());
            return write(200,"提交成功","data",specialistEvaluateSevice.update(object));
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
    /**
     *  获取服务项目评价
     * @param evaluate
     * @return
     */
    @RequestMapping(value = "/selectEvaluate",method = RequestMethod.POST)
    @ApiOperation("获取服务项目评价")
    public String select(@ApiParam(name = "evaluate",value = "服务项目评价")
                         @RequestParam(name = "evaluate")String evaluate){
        try {
            JSONObject object = JSONObject.parseObject(evaluate);
            object.put("patient",getUID());
            return write(200,"提交成功","data",specialistEvaluateSevice.select(object));
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}