Explorar o código

[CMT]后台管理系统新功能开发

wangzhinan %!s(int64=7) %!d(string=hai) anos
pai
achega
a8a602e099

+ 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网络咨询追问、

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

@ -0,0 +1,60 @@
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";
    }
    /**
     * 添加机构服务项目
     *
     * @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
     */
    public String selectHospitals(){
        try {
            return write(200, "查询成功", "data",specialistHospitalItemService.selectHospital());
        } catch (Exception ex) {
            error(ex);
            return error(-1, "查询失败");
        }
    }
}

+ 1 - 1
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;

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

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

@ -0,0 +1,56 @@
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;
    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);
    }
}

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

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

@ -0,0 +1,156 @@
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){
        JSONObject object = new JSONObject();
        try {
            Patient patient1 = patientDao.findByCode(patient);
            Hospital hospital1 = hospitalDao.findByCode(hospital);
            Doctor doctor = doctorDao.findByCode(message.getSender());
            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()+"签约居民10天后计划到"+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());
            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;
    }
}

+ 26 - 0
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
@ -585,4 +588,27 @@ public class DoctorMessageController extends BaseController {
        }
    }
    @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) {
        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));
        } 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,"获取失败!");
        }
    }
}

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