فهرست منبع

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

humingfen 6 سال پیش
والد
کامیت
aa75c33ac8

+ 73 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java

@ -350,6 +350,75 @@ public class CustomerSynergyManageController extends BaseController {
    }
    @ApiOperation("查询体征数据")
    @RequestMapping(value = "/findByPatient", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public String findByPatient(@ApiParam(name="patient",value="随访记录ID",defaultValue = "")
                                @RequestParam(value="patient",required = true) String patient)
    {
        try {
            return write(200, "查询成功","data",synergyManageService.findByPatient(patient));
        } catch (Exception e) {
            return invalidUserException(e, -1, "查询失败"+e.getMessage());
        }
    }
    @ApiOperation("获取随访数据")
    @RequestMapping(value = "/getFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public String getFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
                                         @RequestParam(value = "id", required = true) String id,
                                         @ApiParam(name = "followupProject", value = "随访项目", defaultValue = "2")
                                         @RequestParam(value = "followupProject", required = true) String followupProject) {
        try {
            return write(200, "获取随访项目数据成功!", "data", synergyManageService.getFollowupProjectData(id,followupProject));
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取随访项目数据失败!" + e.getMessage());
        }
    }
    /**
     * 药品列表
     * @param name
     * @param isinsulin
     * @return
     */
    @RequestMapping(value = "/findDictByName", method = RequestMethod.GET)
    @ApiOperation(value = "药品列表")
    public String findDictByName(@ApiParam(name = "name", value = "药品名称(中文或拼音首字母查询)", defaultValue = "胰岛素")
                                 @RequestParam(value = "name", required = false) String name,
                                 @ApiParam(name = "isinsulin", value = "是否过滤胰岛素:1非胰岛素,2胰岛素", defaultValue = "")
                                 @RequestParam(value = "isinsulin", required = false) String isinsulin,
                                 @ApiParam(name = "doctor", value = "医生code", defaultValue = "")
                                     @RequestParam(value = "doctor", required = false) String doctor) {
        try {
//            return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName("e3b3bfb3644011e69616fa163e424525",name,isinsulin));
            return write(200, "操作成功!", "data",synergyManageService.findDictByName(name,isinsulin,doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @ApiOperation("保存面访用药数据")
    @RequestMapping(value = "/saveFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public String saveFollowupDrugs(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
                                    @RequestParam(value="id",required = true) String id,
                                    @ApiParam(name="drugsData",value="面访用药数据",defaultValue = "[]")
                                    @RequestParam(value="drugsData",required = true) String drugsData)
    {
        try {
            synergyManageService.saveFollowupDrugs(id,drugsData);
            return write(200, "保存面访用药数据成功!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "保存面访用药数据失败!"+e.getMessage());
        }
    }
    @ApiOperation("新增临时随访记录(返回ID)")
    @RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
@ -381,10 +450,12 @@ public class CustomerSynergyManageController extends BaseController {
    @ApiOperation("保存随访项目数据")
    @RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public String saveFollowupProjectData(@ApiParam(name = "followup", value = "随访项目对象")
    public String saveFollowupProjectData(@ApiParam(name = "id", value = "随访记录id")
                                              @RequestParam(value = "id", required = true)String id,
                                          @ApiParam(name = "followup", value = "随访项目对象")
                                          @RequestParam(value = "followup", required = true)String followup ) {
        try {
            synergyManageService.saveFollowupProjectData(followup);
            synergyManageService.saveFollowupProjectData(id,followup);
            return write(200, "保存随访项目数据成功!");
        } catch (Exception e) {
            error(e);

+ 4 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerDao.java

@ -21,6 +21,10 @@ public interface ManageSynergyWorkorderServicerDao extends PagingAndSortingRepos
    @Query("select s from ManageSynergyWorkorderServicerDO s where s.workorderCode = ?1 and s.servicePatientCode = ?2 and s.status = 3")
    ManageSynergyWorkorderServicerDO findByWorkOrderCodeAndPatientCode(String workorderCode, String patient);
    //根据工单code和居民code获取未完成的服务对象信息
    @Query("select s from ManageSynergyWorkorderServicerDO s where s.workorderCode = ?1 and s.servicePatientCode = ?2")
    ManageSynergyWorkorderServicerDO findByWorkOrderCodeAndPatientCode1(String workorderCode, String patient);
    @Query("select count(1) from ManageSynergyWorkorderServicerDO s where s.workorderCode=?1 and s.executorCode=?2 and s.status=?3")
    Integer countByWorkorderCodeAndExecutorCodeAndStatus(String workorderCode,String executorCode,Integer status);

+ 97 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.synergy;
import com.alibaba.fastjson.JSON;
import com.yihu.wlyy.entity.*;
import com.yihu.wlyy.entity.call.CallRecord;
import com.yihu.wlyy.entity.synergy.*;
@ -916,6 +917,97 @@ public class SynergyManageService extends BaseJpaService {
        }
    }
    public String findByPatient(String patient){
        String response = null;
        String url = wlyyUrl + "third/synergy/findByPatient";
        Map<String,String> params = new HashMap<>();
        params.put("patient",patient);
        try {
            response = httpClientUtil.httpPost(url, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return response;
    }
    /**
     * 获取随访数据
     *
     * @param id
     * @param followupProject
     * @return
     */
    public String getFollowupProjectData(String id,String followupProject){
        String response = null;
        String url = wlyyUrl + "third/synergy/getFollowupProjectData";
        Map<String,String> params = new HashMap<>();
        params.put("id",id);
        params.put("followupProject",followupProject);
        String data = null;
        try {
            response = httpClientUtil.httpPost(url, params);
            com.alibaba.fastjson.JSONObject object = JSON.parseObject(response);
            if(object.getInteger("status")==200){
                data = object.getJSONObject("data").toJSONString();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
    }
    /**
     * 药品列表
     *
     * @param name
     * @param isinsulin
     * @return
     */
    public String findDictByName(String name,String isinsulin,String doctor){
        String response = null;
        String url = wlyyUrl + "third/synergy/findDictByName";
        Map<String,String> params = new HashMap<>();
        params.put("name",name);
        params.put("isinsulin",isinsulin);
        params.put("doctor",doctor);
        String data = null;
        try {
            response = httpClientUtil.httpPost(url, params);
            com.alibaba.fastjson.JSONObject object = JSON.parseObject(response);
            if(object.getInteger("status")==200){
                data = object.getJSONArray("data").toJSONString();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
    }
    /**
     * 保存药品
     *
     * @param id
     * @param drugsData
     * @return
     */
    public String saveFollowupDrugs(String id,String drugsData){
        String response = null;
        String url = wlyyUrl + "third/synergy/saveFollowupDrugs";
        Map<String,String> params = new HashMap<>();
        params.put("id",id);
        params.put("drugsData",drugsData);
        String data = null;
        try {
            response = httpClientUtil.httpPost(url, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
    }
    /**
     * 添加随访计划
@ -930,14 +1022,13 @@ public class SynergyManageService extends BaseJpaService {
     */
    public String addFollowup(String doctor,String patient, String date, String followupType,String followupClass,String followupManagerStatus,String plandate){
        String response = null;
        String url = wlyyUrl + "followup/addFollowup";
        String url = wlyyUrl + "third/synergy/addFollowup";
        Map<String, Object> params = new HashMap<>();
        params.put("doctor",doctor);
        params.put("patient",patient);
        params.put("date",date);
        params.put("followupType",followupType);
        params.put("followupClass",followupClass);
        params.put("followupManagerStatus",followupManagerStatus);
        params.put("plandate",plandate);
        try {
            response = httpClientUtil.post(url, params);
@ -950,14 +1041,15 @@ public class SynergyManageService extends BaseJpaService {
    /**
     * 保存随访数据
     *
     * @param id
     * @param followup
     * @return
     */
    public String saveFollowupProjectData(String followup){
    public String saveFollowupProjectData(String id,String followup){
        String response = null;
        String url = wlyyUrl + "followup/saveFollowupProjectData";
        String url = wlyyUrl + "third/synergy/saveFollowupProjectData";
        Map<String, Object> params = new HashMap<>();
        params.put("id",id);
        params.put("followup",followup);
        try {
            response = httpClientUtil.post(url, params);

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyWorkorderServicerLogService.java

@ -52,7 +52,7 @@ public class SynergyWorkorderServicerLogService extends BaseJpaService {
    public void create(ManageSynergyWorkorderServicerLogDO synergyWorkorderServicerLogDO){
        synergyWorkorderServicerLogDO.setCreateTime(new Date());
        ManageSynergyWorkorderServicerLogDO workorderServicerLogDO = manageSynergyWorkorderServicerLogDao.save(synergyWorkorderServicerLogDO);
        ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByWorkOrderCodeAndPatientCode(workorderServicerLogDO.getWorkorderCode(),workorderServicerLogDO.getWorkorderServiceCode());
        ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByWorkOrderCodeAndPatientCode1(workorderServicerLogDO.getWorkorderCode(),workorderServicerLogDO.getWorkorderServiceCode());
        workorderServicerDO.setStatus(3);
        workorderServicerDao.save(workorderServicerDO);
        String sql = "select * from manage_synergy_workorder_servicer where workorder_code = '"+workorderServicerLogDO.getWorkorderCode()+"' and status IN(1,2)";

+ 2 - 0
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/PatientHealthIndexDao.java

@ -60,4 +60,6 @@ public interface PatientHealthIndexDao
	@Query(value="select * from device.wlyy_patient_health_index where user = ?1 and type = ?2 ORDER BY record_date desc limit 0 ,5",nativeQuery = true)
	List<PatientHealthIndex> findByPatientAndTypeByPage(String patientCode, int type);
}

+ 0 - 10
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/JMController.java

@ -1,11 +1,7 @@
package com.yihu.wlyy.service.controller;
import com.google.gson.JsonObject;
import com.yihu.wlyy.service.common.model.Result;
import com.yihu.wlyy.service.entity.PatientReservation;
import com.yihu.wlyy.service.service.JMService;
import com.yihu.wlyy.service.service.guahao.GuahaoDoctor;
import com.yihu.wlyy.service.service.guahao.GuahaoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -17,12 +13,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 计划免疫接口

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

@ -112,4 +112,7 @@ public interface DevicePatientHealthIndexDao
	@Query("select count(a) from DevicePatientHealthIndex a where a.recordDate >= ?1 and a.recordDate <= ?2 and a.type in (1,2) and a.status = ?3 and a.del = '1' and user = ?4")
	int getCountByTimeAndStatus(Date start, Date end, int status, String patientCode);
}

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

@ -279,6 +279,7 @@ public class MessageService extends BaseService {
            specialistMesJson.put("amount", 0);
        }
        //系统服务
        List<Message> synergyList = new ArrayList<>();
        synergyList = messageDao.getSynergyService(doctor);
        JSONObject synergyMesJson = new JSONObject();
@ -287,7 +288,7 @@ public class MessageService extends BaseService {
            JSONObject  synergyJson = new JSONObject();
            synergyJson.put("title", synergyList.get(0).getTitle());
            synergyJson.put("type", synergyList.get(0).getType());
            synergyJson.put("msg", "您有"+synergyList.size()+"个专科服务消息,请查看!");
            synergyJson.put("msg", "您有"+synergyList.size()+"个协同服务消息,请查看!");
            synergyJson.put("msgTime", DateUtil.dateToStrLong(synergyList.get(0).getCreateTime()));
            synergyMesJson.put("lastMessage", synergyJson);
        }else{

+ 13 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -3,11 +3,13 @@ package com.yihu.wlyy.service.synergy;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.entity.organization.Hospital;
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.education.HealthEduArticleDao;
import com.yihu.wlyy.repository.followup.FollowUpDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.patient.PatientDao;
@ -50,6 +52,8 @@ public class SynergyManageService extends BaseService {
    private FollowUpDao followUpDao;
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private HealthEduArticleDao healthEduArticleDao;
    public JSONObject getWorkOrderInfo(String workorderCode, String patient, Integer role) throws Exception {
        Map<String, Object> param = new HashedMap();
@ -127,10 +131,17 @@ public class SynergyManageService extends BaseService {
            followup.setCreateTime(new Date());
            followup = followUpDao.save(followup);
            object.put("relationCode",followup.getId());
            object.put("relationCodeName","随访");
            if (followupClass.equals("1")){
                object.put("relationCodeName","高血压");
            }else if (followupClass.equals("1")){
                object.put("relationCodeName","糖尿病");
            }
        }else if (type == 1){
            object.put("relationCode",objectId);
            object.put("relationCodeName","健康教育");
            HealthEduArticle healthEduArticle = healthEduArticleDao.findByCode(objectId);
            if (healthEduArticle != null){
                object.put("relationCodeName",healthEduArticle.getTitle());
            }
        }else if (type == 5){
            object.put("relationCode",objectId);
            object.put("relationCodeName","疾病筛查");

+ 26 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java

@ -1,8 +1,10 @@
package com.yihu.wlyy.service.third.jw;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.zydict.ZyIvPhysicDict;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.repository.doctor.DoctorMappingDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
@ -11,10 +13,14 @@ import com.yihu.wlyy.repository.zydict.ZyIvPhysicDictDao;
import com.yihu.wlyy.repository.zydict.ZyZoneDictDao;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -39,6 +45,8 @@ public class ZyDictService {
    private ZyCommonDictDao zyCommonDictDao;
    @Autowired
    private ZyZoneDictDao zyZoneDictDao;
    @Autowired
    private DevicePatientHealthIndexDao patientHealthIndexDao;
    @Transactional
    public void synchronousDict(String dictName) {
@ -312,4 +320,22 @@ public class ZyDictService {
    }
    public List<DevicePatientHealthIndex> findByPatient(String patient){
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date();
        String sql = "select * from wlyy_patient_health_index a where a.user = '"+patient+"' and a.type = 3";
        String sql1 = "select * from wlyy_patient_health_index a where a.user = '"+patient+"' and a.type = 2 and DATE_FORMAT(a.czrq, '%Y-%m-%d') = '"+formatter.format(date)+"'";
        List<DevicePatientHealthIndex> devicePatientHealthIndices = jdbcTemplate.query(sql,new BeanPropertyRowMapper(DevicePatientHealthIndex.class));
        List<DevicePatientHealthIndex> devicePatientHealthIndices1 = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(DevicePatientHealthIndex.class));
        List<DevicePatientHealthIndex> devicePatientHealthIndices2 = new ArrayList<>();
        for (DevicePatientHealthIndex devicePatientHealthIndex:devicePatientHealthIndices){
            devicePatientHealthIndices2.add(devicePatientHealthIndex);
        }
        for (DevicePatientHealthIndex devicePatientHealthIndex:devicePatientHealthIndices1){
            devicePatientHealthIndices2.add(devicePatientHealthIndex);
        }
        return devicePatientHealthIndices2;
    }
}

+ 131 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/synergy/SynergyManagerController.java

@ -2,11 +2,17 @@ package com.yihu.wlyy.web.third.synergy;/**
 * Created by nature of king on 2018/10/8.
 */
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yihu.es.entity.FollowupContentESDO;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.service.app.followup.FollowUpService;
import com.yihu.wlyy.service.app.followup.FollowupDrugsService;
import com.yihu.wlyy.service.app.survey.SurveyScreenResultService;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.service.survey.ManagerQuestionnaireService;
import com.yihu.wlyy.service.third.jw.ZyDictService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -16,6 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @author wangzhinan
 * @create 2018-10-08 13:56
@ -31,6 +41,12 @@ public class SynergyManagerController extends BaseController{
    private ManagerQuestionnaireService managerQuestionnaireService;
    @Autowired
    private SurveyScreenResultService surveyScreenResultService;
    @Autowired
    private ZyDictService zyDictService;
    @Autowired
    private FollowupDrugsService followupDrugsService;
    @Autowired
    private SpecialistEvaluateSevice specialistEvaluateSevice;
    @ApiOperation("新增临时随访记录(返回ID)")
    @RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
@ -68,14 +84,15 @@ public class SynergyManagerController extends BaseController{
    @RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String saveFollowupProjectData(@ApiParam(name = "followup", value = "随访项目对象")
    public String saveFollowupProjectData(@ApiParam(name = "id", value = "随访记录id")
                                              @RequestParam(value = "id", required = true)String id,
                                          @ApiParam(name = "followup", value = "随访项目对象")
                                          @RequestParam(value = "followup", required = true)String followup ) {
        try {
            JSONArray array = JSONArray.parseArray(followup);
//            followUpService.saveFollowupProjectData(id, followupProject, followupProjectData);
            //修改为通过ES查询---2017.11.01--huangwenjie
            for (int i =0;i<array.size();i++){
                String id = array.getJSONObject(i).getString("id");
                String followupProject = array.getJSONObject(i).getString("followupProject");
                String followupProjectData = array.getJSONObject(i).getString("followupProjectData");
                followUpService.esSaveFollowupProjectData(id, followupProject, followupProjectData);
@ -88,21 +105,91 @@ public class SynergyManagerController extends BaseController{
    }
  /*  @RequestMapping(value = "/findDictByName", method = RequestMethod.GET)
    /**
     * 获取药品
     *
     * @param name
     * @param isinsulin
     * @return
     */
    @RequestMapping(value = "/findDictByName", method = RequestMethod.POST)
    @ApiOperation(value = "药品列表")
    public String findDictByName(@ApiParam(name = "name", value = "药品名称(中文或拼音首字母查询)", defaultValue = "胰岛素")
                                 @RequestParam(value = "name", required = false) String name,
                                 @ApiParam(name = "isinsulin", value = "是否过滤胰岛素:1非胰岛素,2胰岛素", defaultValue = "")
                                 @RequestParam(value = "isinsulin", required = false) String isinsulin) {
                                 @RequestParam(value = "isinsulin", required = false) String isinsulin,
                                 @ApiParam(name = "doctor", value = "医生code", defaultValue = "")
                                     @RequestParam(value = "doctor", required = false) String doctor) {
        try {
//            return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName("e3b3bfb3644011e69616fa163e424525",name,isinsulin));
            return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName(getUID(), name,isinsulin));
            return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName(doctor, name,isinsulin));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }*/
    }
    @ApiOperation("保存面访用药数据")
    @RequestMapping(value = "/saveFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String saveFollowupDrugs(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
                                    @RequestParam(value="id",required = true) String id,
                                    @ApiParam(name="drugsData",value="面访用药数据",defaultValue = "[]")
                                    @RequestParam(value="drugsData",required = true) String drugsData)
    {
        try {
            followupDrugsService.saveFollowupDrugs(id,drugsData);
            return write(200, "保存面访用药数据成功!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "保存面访用药数据失败!"+e.getMessage());
        }
    }
    @ApiOperation("查询体征数据")
    @RequestMapping(value = "/findByPatient", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String findByPatient(@ApiParam(name="patient",value="居民code",defaultValue = "")
                                    @RequestParam(value="patient",required = true) String patient)
    {
        try {
            return write(200, "查询成功","data",zyDictService.findByPatient(patient));
        } catch (Exception e) {
            return invalidUserException(e, -1, "查询失败"+e.getMessage());
        }
    }
    @ApiOperation("获取随访数据")
    @RequestMapping(value = "/getFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public String getFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
                                         @RequestParam(value = "id", required = true) String id,
                                         @ApiParam(name = "followupProject", value = "随访项目", defaultValue = "2")
                                         @RequestParam(value = "followupProject", required = true) String followupProject) {
        try {
//            Map<String, String> response = followUpService.getFollowupProjectData(id, followupProject);
            //修改为通过ES查询---2017.11.01--huangwenjie
            Map<String, String> response = followUpService.getFollowup(id);
            JSONArray array = JSON.parseArray(followupProject);
            List<FollowupContentESDO> followupContentESDOS = new ArrayList<>();
            for (int i =0;i<array.size();i++){
                FollowupContentESDO followupContentESDO = followUpService.esGetFollowupProjectData(id, array.getString(i));
                followupContentESDOS.add(followupContentESDO);
            }
            JSONObject object = new JSONObject();
            object.put("followup",response);
            object.put("followupContent",followupContentESDOS);
            return write(200, "获取随访项目数据成功!", "data", object);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取随访项目数据失败!" + e.getMessage());
        }
    }
    @RequestMapping(value = "/questionnaire/saveResultAndAnswer", method = RequestMethod.POST)
    @ApiOperation(value = "保存用户问卷答案")
@ -196,4 +283,41 @@ public class SynergyManagerController 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 = "消息对象(如:{'sender':'','receiver':'','relationCode':'','type':19})",required = true)
                              @RequestParam(value = "message",required = true)String message,
                              @ApiParam(name = "hospital",value = "医院code",required = false)
                              @RequestParam(value = "hospital",required = false)String hospital,
                              @ApiParam(name = "patient",value = "居民code",required = true)
                              @RequestParam(value = "patient",required = true)String patient,
                              @ApiParam(name = "time",value = "时间",required = false)
                              @RequestParam(value = "time",required = false)Integer time,
                              @ApiParam(name = "jsonObject",value = "参数",required = false)
                              @RequestParam(value = "jsonObject",required = false) String jsonObject){
        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"));
            message1.setRelationCode(object.getString("relationCode"));
            com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(jsonObject);
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient,time,jsonObject1));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取消息失败!");
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -86,7 +86,7 @@ wechat:
   #服务结果通知
   template_doctor_service:  2hEhp2bLfmM-7Goc6rJ3EE4a4wvuhyndKufruYTk6A0
   #体检报告提醒
   template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM·
   template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
   #处理结果通知
   template_deal_with:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
   #设备绑定结果通知