소스 검색

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

zd_123 6 년 전
부모
커밋
ca43833032
20개의 변경된 파일534개의 추가작업 그리고 106개의 파일을 삭제
  1. 39 15
      common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/survey/SurveyQuestionResult.java
  2. 88 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java
  3. 42 20
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/survey/SurveyQuestionResult.java
  4. 2 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/UserDao.java
  5. 9 5
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/survey/SurveyTemplateDao.java
  6. 4 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerDao.java
  7. 17 12
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java
  8. 4 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/ScreenResultManageService.java
  9. 134 18
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
  10. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyWorkorderServicerLogService.java
  11. 2 0
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/PatientHealthIndexDao.java
  12. 0 10
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/JMController.java
  13. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DevicePatientHealthIndexDao.java
  14. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  15. 4 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java
  16. 7 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java
  17. 13 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
  18. 26 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java
  19. 136 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/synergy/SynergyManagerController.java
  20. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml

+ 39 - 15
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/survey/SurveyQuestionResult.java

@ -18,9 +18,13 @@ public class SurveyQuestionResult extends IdEntity implements Serializable {
    //唯一标识
    private String code;
    //模板编码
    private String templateCode;
    private String surveyCode;
    //模板标题
    private  String templateTitle;
    private  String surveyTitle;
    //派发问卷的医生code
    private String doctor;
    //派发问卷的医生名称
    private String doctorName;
    //居民code
    private String patientCode;
    //居民名字
@ -37,10 +41,12 @@ public class SurveyQuestionResult extends IdEntity implements Serializable {
    public SurveyQuestionResult() {
    }
    public SurveyQuestionResult(String code, String templateCode, String templateTitle, String patientCode, String patientName, Integer type, String createUser, String createUserName, Date createTime) {
    public SurveyQuestionResult(String code, String surveyCode, String surveyTitle, String doctor, String doctorName, String patientCode, String patientName, Integer type, String createUser, String createUserName, Date createTime) {
        this.code = code;
        this.templateCode = templateCode;
        this.templateTitle = templateTitle;
        this.surveyCode = surveyCode;
        this.surveyTitle = surveyTitle;
        this.doctor = doctor;
        this.doctorName = doctorName;
        this.patientCode = patientCode;
        this.patientName = patientName;
        this.type = type;
@ -58,22 +64,40 @@ public class SurveyQuestionResult extends IdEntity implements Serializable {
        this.code = code;
    }
    @Column(name = "template_code")
    public String getTemplateCode() {
        return templateCode;
    @Column(name = "survey_code")
    public String getSurveyCode() {
        return surveyCode;
    }
    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    public void setSurveyCode(String surveyCode) {
        this.surveyCode = surveyCode;
    }
    @Column(name = "template_title")
    public String getTemplateTitle() {
        return templateTitle;
    @Column(name = "survey_title")
    public String getSurveyTitle() {
        return surveyTitle;
    }
    public void setTemplateTitle(String templateTitle) {
        this.templateTitle = templateTitle;
    public void setSurveyTitle(String surveyTitle) {
        this.surveyTitle = surveyTitle;
    }
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Column(name = "patient_code")

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

@ -84,6 +84,19 @@ public class CustomerSynergyManageController extends BaseController {
    }
    @RequestMapping(value = "/getCustomers", method = RequestMethod.GET)
    @ApiOperation(value = "获取客服列表")
    public String getCustomers(){
        try {
            List<User> list = synergyManageService.getCustomers();
            return write(200,"保存成功", "data", list);
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");
        }
    }
    @RequestMapping(value = "/labels", method = RequestMethod.GET)
    @ApiOperation("根据分组类型查找标签")
    public String labels(
@ -337,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)
@ -368,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);
@ -505,8 +589,8 @@ public class CustomerSynergyManageController extends BaseController {
    public String uploadAccessory(@ApiParam(name="workorderCode",value="协同服务工单code",required = true)
                                  @RequestParam(required = true)String workorderCode,HttpServletRequest request){
        try{
            ManageSynergyAccessoryDO manageSynergyAccessoryDO = synergyManageService.uploadAccessory(workorderCode,request);
            return write(200,"获取成功!","data",manageSynergyAccessoryDO);
            Map<String,Object> map = synergyManageService.uploadAccessory(workorderCode,request);
            return write(200,"获取成功!","data",map);
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"获取失败!");

+ 42 - 20
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/survey/SurveyQuestionResult.java

@ -18,9 +18,13 @@ public class SurveyQuestionResult extends IdEntity implements Serializable {
    //唯一标识
    private String code;
    //模板编码
    private String templateCode;
    private String surveyCode;
    //模板标题
    private  String templateTitle;
    private  String surveyTitle;
    //派发问卷的医生code
    private String doctor;
    //派发问卷的医生名称
    private String doctorName;
    //居民code
    private String patientCode;
    //居民名字
@ -43,24 +47,6 @@ public class SurveyQuestionResult extends IdEntity implements Serializable {
        this.code = code;
    }
    @Column(name = "template_code")
    public String getTemplateCode() {
        return templateCode;
    }
    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }
    @Column(name = "template_title")
    public String getTemplateTitle() {
        return templateTitle;
    }
    public void setTemplateTitle(String templateTitle) {
        this.templateTitle = templateTitle;
    }
    @Column(name = "patient_code")
    public String getPatientCode() {
        return patientCode;
@ -114,4 +100,40 @@ public class SurveyQuestionResult extends IdEntity implements Serializable {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "survey_code")
    public String getSurveyCode() {
        return surveyCode;
    }
    public void setSurveyCode(String surveyCode) {
        this.surveyCode = surveyCode;
    }
    @Column(name = "survey_title")
    public String getSurveyTitle() {
        return surveyTitle;
    }
    public void setSurveyTitle(String surveyTitle) {
        this.surveyTitle = surveyTitle;
    }
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
}

+ 2 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/UserDao.java

@ -40,4 +40,6 @@ public interface UserDao extends PagingAndSortingRepository<User, Long>, JpaSpec
	List<User> findByType(int type);
	@Query("from User u where u.type = 4")
    List<User> findAllCustomer();
}

+ 9 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/survey/SurveyTemplateDao.java

@ -10,9 +10,13 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * Created by yeshijie on 2017/3/7.
 */
public interface SurveyTemplateDao extends PagingAndSortingRepository<SurveyTemplate,Long>,JpaSpecificationExecutor<SurveyTemplate> {
        @Query("from SurveyTemplate where title=?1 and del = 1")
        SurveyTemplate findByTitle(String title);
        @Query("update SurveyTemplate set del = 0 where id=?1 and del = 1")
        @Modifying
        void deleteById(Long id);
    @Query("from SurveyTemplate where title=?1 and del = 1")
    SurveyTemplate findByTitle(String title);
    @Query("update SurveyTemplate set del = 0 where id=?1 and del = 1")
    @Modifying
    void deleteById(Long id);
    @Query("select t.diseaseType from SurveyTemplate t where t.code = ?1")
    String findByCode(String code);
}

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

+ 17 - 12
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java

@ -11,7 +11,6 @@ import com.yihu.wlyy.repository.synergy.ManageSynergyWorkOrderDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
@ -97,8 +96,12 @@ public class QuestionnaireManageService extends BaseJpaService {
     * @param jsonData
     * @param serviceCode
     */
    public String saveResultAndAnswer(String patientCode, Integer labelType, String customerCode, Integer source, String jsonData, String serviceCode) {
    public String saveResultAndAnswer(String patientCode, Integer labelType, String customerCode, Integer source, String jsonData, String serviceCode) throws Exception {
        String url = wlyyUrl + "third/synergy/questionnaire/saveResultAndAnswer";
        //查找发放问卷的医生
        String sql = "SELECT w.create_user from manage_synergy_workorder_servicer s, manage_synergy_workorder w " +
                "where s.workorder_code = w.`code` and s.`code`= '" + serviceCode + "'";
        String doctor = jdbcTemplate.queryForObject(sql, String.class);
        String response = "";
        Map<String, Object> params = new HashMap<>();
        params.put("labelType", labelType);
@ -107,17 +110,19 @@ public class QuestionnaireManageService extends BaseJpaService {
        params.put("customerCode", customerCode);
        params.put("source", source);
        params.put("isAgain", 0);
        params.put("doctor", doctor);
        try {
            response = httpClientUtil.post(url, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject object = JSONObject.parseObject(response);
        String questionResultCode = object.getString("data");
        if(StringUtils.isNotBlank(questionResultCode)) {
        if(object.getInteger("status") == 200) {
            String questionResultCode = object.getString("data");
            workorderServicerDao.updateRelationCodeByCode(serviceCode, questionResultCode);
            return questionResultCode;
        }
        return questionResultCode;
        throw new Exception("保存失败");
    }
    /**
@ -125,14 +130,14 @@ public class QuestionnaireManageService extends BaseJpaService {
     * @param surveyCode
     * @return
     */
    public JSONObject getAnswers(String surveyCode) {
    public JSONObject getAnswers(String surveyCode) throws Exception {
        String url = wlyyUrl + "third/synergy/questionnaire/getAnswers?id=" + surveyCode;
        String  response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getInteger("status") == 200){
            return JSONObject.parseObject(jsonObject.getString("data"));
        }
        return JSONObject.parseObject(response);
        throw new Exception("请求失败");
    }
    /**
@ -145,13 +150,13 @@ public class QuestionnaireManageService extends BaseJpaService {
        //查找问卷结果信息
        SurveyQuestionResult questionResult = questionResultDao.findByCode(code);
        String patient = questionResult.getPatientCode();
        String templateCode = questionResult.getTemplateCode();
        String surverCode = questionResult.getSurveyCode();
        //获取模板问题
        List<SurveyQuestionnaire> questionList = surveyQuestionnaireDao.findBySurveyCode(templateCode);
        List<SurveyQuestionnaire> questionList = surveyQuestionnaireDao.findBySurveyCode(surverCode);
        //查找选项和答案
        Map<String, Object> answerMap = new HashMap<>();
        String sql = "SELECT soa.*, sqo.content FROM wlyy_survey_option_answers soa LEFT JOIN wlyy_survey_questions_options sqo ON soa.options_code= sqo.code WHERE soa.screen_result_code = ? AND soa.patient=? AND soa.survey_code=?";
        List<Map<String, Object>> optionAnswersList = jdbcTemplate.queryForList(sql, new Object[]{code, patient, templateCode});
        List<Map<String, Object>> optionAnswersList = jdbcTemplate.queryForList(sql, new Object[]{code, patient, surverCode});
        for (SurveyQuestionnaire question : questionList) {
            List<Map<String, Object>> optionList = new ArrayList<>();
            Map<String, Object> map = new HashMap<>();
@ -169,13 +174,13 @@ public class QuestionnaireManageService extends BaseJpaService {
        return json;
    }
    public JSONObject getQuestionnaireDetail(String surveyCode) {
    public JSONObject getQuestionnaireDetail(String surveyCode) throws Exception {
        String url = wlyyUrl + "third/synergy/questionnaire/getQuestionnaireDetail?id=" + surveyCode;
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getInteger("status") == 200){
            return JSONObject.parseObject(jsonObject.getString("data"));
        }
        return JSONObject.parseObject(response);
        throw new Exception("请求失败");
    }
}

+ 4 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/ScreenResultManageService.java

@ -24,14 +24,14 @@ public class ScreenResultManageService {
     * @param code
     * @return
     */
    public JSONObject getScreenResultDetail(String code) {
    public JSONObject getScreenResultDetail(String code) throws Exception {
        String url = wlyyUrl + "third/synergy/screen/getScreenResultDetail?code=" + code;
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getInteger("status") == 200){
            return JSONObject.parseObject(jsonObject.getString("data"));
        }
        return JSONObject.parseObject(response);
        throw new Exception("请求失败");
    }
    /**
@ -39,13 +39,13 @@ public class ScreenResultManageService {
     * @param templateCode
     * @return
     */
    public JSONObject getScreenDetail(String templateCode) {
    public JSONObject getScreenDetail(String templateCode) throws Exception {
        String url = wlyyUrl + "third/synergy/questionnaire/getAllQuestions?surveyTemplateCode=" + templateCode;
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = JSONObject.parseObject(response);
        if(jsonObject.getInteger("status") == 200){
            return JSONObject.parseObject(jsonObject.getString("data"));
        }
        return JSONObject.parseObject(response);
        throw new Exception("请求失败");
    }
}

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

@ -1,15 +1,15 @@
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.*;
import com.yihu.wlyy.repository.*;
import com.yihu.wlyy.repository.survey.SurveyTemplateDao;
import com.yihu.wlyy.repository.synergy.*;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import com.yihu.wlyy.util.http.HttpUtils;
import com.yihu.wlyy.util.query.BaseJpaService;
import jxl.Workbook;
import jxl.write.*;
@ -40,8 +40,6 @@ import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
import static org.springframework.util.ResourceUtils.getFile;
/**
 * Created by 刘文彬 on 2018/9/27.
 */
@ -78,11 +76,7 @@ public class SynergyManageService extends BaseJpaService {
    @Autowired
    private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
    @Autowired
    private TownDao townDao;
    @Autowired
    private FastDFSUtil fastDFSUtil;
    @Autowired
    private ManageCustomerOnlineRecordDao manageCustomerOnlineRecordDao;
    private SurveyTemplateDao surveyTemplateDao;
    @Autowired
    private ManageSynergyAccessoryDao manageSynergyAccessoryDao;
@ -356,6 +350,7 @@ public class SynergyManageService extends BaseJpaService {
        map.put("serviceTime", s.format(workorderDO.getServiceTime()));
        map.put("status", status);
        map.put("title", workorderDO.getRelationCodeName());
        map.put("relationCode", workorderDO.getRelationCode());
        map.put("remark", workorderDO.getRemark());
        map.put("createTime", sdf.format(workorderDO.getCreateTime()));
        map.put("createUserName", workorderDO.getCreateUserName());
@ -378,6 +373,16 @@ public class SynergyManageService extends BaseJpaService {
            map.put("servicerKey", workorderDO.getServicerKey());
            map.put("servicerCount", workorderDO.getServicerCount());
        }
        //如果是随访,查出对象的信息
        if(workorderDO.getType() == 3){
            List<ManageSynergyWorkorderServicerDO> workorderServicerDO = workorderServicerDao.findByWorkorderCode(workorderCode);
            map.put("patientName", workorderServicerDO.get(0).getServicePatientName());
            map.put("idcard", workorderServicerDO.get(0).getIdcard());
            map.put("ssc", workorderServicerDO.get(0).getSsc());
        }else if(workorderDO.getType() == 5) {
            String diseaseType = surveyTemplateDao.findByCode(workorderDO.getRelationCode());
            map.put("diseaseType", diseaseType);
        }
        //超时标签
        map.put("delayStatus", this.isServiceOverTime(workorderDO.getServiceTime()));
@ -529,6 +534,7 @@ public class SynergyManageService extends BaseJpaService {
            resultMap.put("doctorCode",workorderMap.get("create_user"));//创建人(医生)code
            //获取提交记录
            String servicerCode = workorderMap.get("servicerCode")+"";
            resultMap.put("servicerCode", servicerCode);
            List<ManageSynergyWorkorderServicerLogDO> list = manageSynergyWorkorderServicerLogDao.findByWorkorderServiceCode(servicerCode);
            if(list.size()>0){
                ManageSynergyWorkorderServicerLogDO log = list.get(0);
@ -614,7 +620,7 @@ public class SynergyManageService extends BaseJpaService {
     * @param type
     */
    public void sendMessage(ManageSynergyWorkorderDO workorderDO, User user, Integer type){
        String url = wlyyUrl + "doctor/message/sendMessage";
        String url = wlyyUrl + "third/synergy/sendMessage";
        //组装message内容
        JSONObject message = new JSONObject();
        if(type == 24){
@ -911,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;
    }
    /**
     * 添加随访计划
@ -925,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);
@ -945,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);
@ -1472,22 +1569,38 @@ public class SynergyManageService extends BaseJpaService {
//    }
    @Transactional
    public ManageSynergyAccessoryDO uploadAccessory(String workorderCode, HttpServletRequest request) throws Exception{
    public Map<String,Object> uploadAccessory(String workorderCode, HttpServletRequest request) throws Exception{
        Map<String,Object> map = new HashMap<>();
        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
        MultipartFile multipartFile = multipartRequest.getFile("file");
        long size = multipartFile.getSize();
        if(size<=0){
            map.put("uploadStatus",1);//size小于0
            map.put("accessory",null);//
            return map;
        }
        String fileName = multipartFile.getOriginalFilename();
        String type = fileName.split(".")[1];
        if(!("doc".equals(type)||"docx".equals(type)||"xls".equals(type)||"xlsx".equals(type))){
            map.put("uploadStatus",2);//文件类型不对
            map.put("accessory",null);//
            return map;
        }
        String response = request(wlyyUrl + "/upload/chat", multipartFile, null);
        JSONObject rs = new JSONObject(response);
        Integer status =(Integer)rs.get("status");
        if(status==200){
            String url = rs.get("urls")+"";
            String fileName = multipartFile.getOriginalFilename();
            ManageSynergyAccessoryDO manageSynergyAccessoryDO = new ManageSynergyAccessoryDO();
            manageSynergyAccessoryDO.setCode(getCode());
            manageSynergyAccessoryDO.setDel(0);
            manageSynergyAccessoryDO.setName(fileName);
            manageSynergyAccessoryDO.setUrl(url);
            manageSynergyAccessoryDO.setWorkorderCode(workorderCode);
            return manageSynergyAccessoryDao.save(manageSynergyAccessoryDO);
            ManageSynergyAccessoryDO accessoryDO = manageSynergyAccessoryDao.save(manageSynergyAccessoryDO);
            map.put("uploadStatus",0);//文件类型正确
            map.put("accessory",accessoryDO);//
            return map;
        }
        throw new Exception();
    }
@ -1763,4 +1876,7 @@ public class SynergyManageService extends BaseJpaService {
        return resultList;
    }
    public List<User> getCustomers() {
        return userDao.findAllCustomer();
    }
}

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

+ 4 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -193,7 +193,10 @@ public class SpecialistEvaluateSevice extends BaseService {
            if(StringUtils.isNotEmpty(hospitalCode)){
                hospital = hospitalDao.findByCode(hospitalCode);
            }
            Patient patient = patientDao.findByCode(patientCode);
            Patient patient = null;
            if (StringUtils.isNoneBlank(patientCode)){
                patient  = patientDao.findByCode(patientCode);
            }
//            Doctor sendDoctor = doctorDao.findByCode(message.getSender());
            Doctor receiverDoctor = doctorDao.findByCode(message.getReceiver());
            if (message.getType() == 19 ){

+ 7 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java

@ -1915,21 +1915,25 @@ public class ManagerQuestionnaireService extends BaseService {
     * @param jsonData
     * @param patientCode
     * @param customerCode
     * @param doctor
     * @return
     * @throws Exception
     */
    public String saveQuestionResultAndAnswer(JSONObject jsonData, String patientCode, String customerCode) throws Exception {
    public String saveQuestionResultAndAnswer(JSONObject jsonData, String patientCode, String customerCode, String doctor) throws Exception {
        String surveyCode = jsonData.get("surveyCode").toString();
        Survey survey = surveyDao.findById(surveyCode);
        Patient patient = patientDao.findByCode(patientCode);
        User user = userDao.findByCode(customerCode);
        Doctor d = doctorDao.findByCode(doctor);
        SurveyQuestionResult questionResult =  new SurveyQuestionResult();
        String code = getCode();
        questionResult.setCode(code);
        questionResult.setTemplateCode(survey.getCode());
        questionResult.setTemplateTitle(survey.getTitle());
        questionResult.setSurveyCode(survey.getCode());
        questionResult.setSurveyTitle(survey.getTitle());
        questionResult.setPatientCode(patient.getCode());
        questionResult.setPatientName(patient.getName());
        questionResult.setDoctor(doctor);
        questionResult.setDoctorName(d.getName());
        questionResult.setType(1);
        questionResult.setCreateUser(customerCode);
        questionResult.setCreateUserName(user.getName());

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

+ 136 - 9
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,26 +105,99 @@ 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);
            Map<String,Object> followupDrugs =  followupDrugsService.getFollowupDrugs(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("followupDrugs",followupDrugs);
            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 = "保存用户问卷答案")
    public String saveResultAndAnswer( @ApiParam(name = "jsonData", value = "问题和答案字符串")@RequestParam(value = "jsonData") String jsonData,
                                       @ApiParam(name = "patientCode", value = "居民code")@RequestParam(value = "patientCode")String patientCode,
                                       @ApiParam(name = "doctor", value = "医生code")@RequestParam(value = "doctor")String doctor,
                                       @ApiParam(name = "customerCode", value = "客服code")@RequestParam(value = "customerCode")String customerCode,
                                       @ApiParam(name = "labelType", value = "问卷标签")@RequestParam(value = "labelType")Integer labelType,
                                       @ApiParam(name = "isAgain", value = "筛查入口(labelType=5时要填),0是第一次筛查 1是再次评估")@RequestParam(value = "isAgain", required = false)int isAgain,
@ -116,9 +206,9 @@ public class SynergyManagerController extends BaseController{
            JSONObject json = new JSONObject(jsonData);
            if (labelType == 5){
                return  write(200, "保存成功!","data",surveyScreenResultService.saveScreenResultAndAnswer(patientCode, customerCode, isAgain, source, json));
                return  write(200, "保存成功!","data",surveyScreenResultService.saveScreenResultAndAnswer(patientCode, doctor, isAgain, source, json));
            }else {
                return write(200, "保存成功!", "data", managerQuestionnaireService.saveQuestionResultAndAnswer(json, patientCode, customerCode));
                return write(200, "保存成功!", "data", managerQuestionnaireService.saveQuestionResultAndAnswer(json, patientCode, customerCode, doctor));
            }
        } catch (Exception e) {
            e.printStackTrace();
@ -195,4 +285,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 = false)
                              @RequestParam(value = "patient",required = false)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
   #设备绑定结果通知