Przeglądaj źródła

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

wangzhinan 7 lat temu
rodzic
commit
9c658624aa
14 zmienionych plików z 308 dodań i 124 usunięć
  1. 20 17
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  2. 16 11
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java
  3. 40 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistHospitalItemService.java
  4. 26 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java
  5. 5 20
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/RehabilitationPlanService.java
  6. 7 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java
  7. 18 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemDataRedis.java
  8. 57 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java
  9. 8 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java
  10. 17 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/HospitalServiceItemController.java
  11. 4 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/DoctorRehabilitationManageController.java
  12. 27 39
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/specialist/ThirdRehabilitationPlanController.java
  13. 56 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/rehabilitation/PatientRehabilitationManageController.java
  14. 7 4
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

+ 20 - 17
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -307,25 +307,28 @@ public class PatientHealthIndexService extends BaseService {
        // 查询病人家庭签约的健康管理师
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patientCode);
        String healthDoctorFamily = "";
        String doctotFamily = "";
        String doctorFamily = "";
        /*String doctorName = "";
        String doctorOpenID = "";*/
        if (signFamily != null) {
            healthDoctorFamily = signFamily.getDoctorHealth();
            doctotFamily = signFamily.getDoctor();
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
            doctorFamily = signFamily.getDoctor();
            if (StringUtils.isNotEmpty(healthDoctorFamily) && StringUtils.isNotEmpty(doctorFamily)){
                // 添加到消息接收人列表
                if (doctorFamily.equals(healthDoctorFamily)){
                    System.out.println("-------------健管师和家医同一个人-------------");
                    receivers.add(healthDoctorFamily);
                }else {
                    System.out.println("-------------健管师和家医不是同一个人-------------");
                    receivers.add(healthDoctorFamily);
                    receivers.add(doctorFamily);
                }
            }else if (StringUtils.isNotEmpty(healthDoctorFamily) && StringUtils.isEmpty(doctorFamily)){
                System.out.println("-------------家医为空-------------");
                receivers.add(healthDoctorFamily);
               /* Doctor doctor = doctorDao.findByCode(healthDoctorFamily);
                doctorName = doctor.getName();
                doctorOpenID = doctor.getOpenid();*/
            }
            if (StringUtils.isNotEmpty(doctotFamily)){
                // 添加到消息接收人列表
                receivers.add(signFamily.getDoctor());
                /*Doctor doctor = doctorDao.findByCode(signFamily.getDoctor());
                doctorName = doctor.getName();
                doctorOpenID = doctor.getOpenid();*/
            }else if (StringUtils.isNotEmpty(doctorFamily) && StringUtils.isEmpty(healthDoctorFamily)){
                System.out.println("-------------健管师为空-------------");
                receivers.add(doctorFamily);
            }
        }
@ -338,9 +341,9 @@ public class PatientHealthIndexService extends BaseService {
                // 添加到消息接收人列表
                receivers.add(healthDoctorTeam);
            }
            if (StringUtils.isNotEmpty(signFamilySS.getDoctor()) && !StringUtils.equals(doctotFamily, signFamilySS.getDoctor())) {
            if (StringUtils.isNotEmpty(signFamilySS.getDoctor()) && !StringUtils.equals(doctorFamily, signFamilySS.getDoctor())) {
                // 添加到消息接收人列表
                receivers.add(doctotFamily);
                receivers.add(doctorFamily);
            }
        }
        List<Message> messages = new ArrayList<Message>();
@ -573,9 +576,9 @@ public class PatientHealthIndexService extends BaseService {
            } else { //餐前
                if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueBefore, minValueBefore)) {
                    oldMsgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
                    if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==1){
                    if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueBefore ,minValueBefore)==1){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏高</span>";
                    }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==2){
                    }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueBefore ,minValueBefore)==2){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏低</span>";
                    }
                    updateStatus(data);

+ 16 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java

@ -303,18 +303,23 @@ public class TaskService {
    public JSONObject createActiveRecord(JSONObject object) throws Exception {
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        object.put("unionId",patient.getUnionid());
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientOpenid",patient.getOpenid());
        String url =getBaseUrl() + "createActiveRecord";
        //String url = "http://localhost:10051/svr-health-bank/createActiveRecord";
        try {
            response = httpClientUtil.iotPostBody(url,object.toString());
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        if (patient!=null){
            object.put("unionId",patient.getUnionid());
            object.put("patientIdcard",patient.getIdcard());
            object.put("patientOpenid",patient.getOpenid());
            String url =getBaseUrl() + "createActiveRecord";
            //String url = "http://localhost:10051/svr-health-bank/createActiveRecord";
            try {
                response = httpClientUtil.iotPostBody(url,object.toString());
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.getMessage());
            }
            return JSONObject.parseObject(response);
        }else {
            return null;
        }
        return JSONObject.parseObject(response);
    }

+ 40 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistHospitalItemService.java

@ -4,10 +4,15 @@ package com.yihu.wlyy.service.specialist;/**
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.family.FamilyService;
import com.yihu.wlyy.service.common.account.DoctorService;
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;
@ -34,6 +39,10 @@ public class SpecialistHospitalItemService extends BaseService {
    private HttpClientUtil httpClientUtil;
    @Value("${specialist.url}")
    private String specialistUrl;
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private FamilyService familyService;
    public List<Hospital> selectHospital(){
        List<Hospital> hospitals = hospitalDao.findAllHospital();
@ -45,16 +54,16 @@ public class SpecialistHospitalItemService extends BaseService {
     * @param hospitals
     * @return
     */
    public JSONObject selectByHospital(String hospitals){
    public JSONArray selectByHospital(String hospitals){
        String response = null;
        JSONObject object = new JSONObject();
        JSONArray array = new JSONArray();
        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");
            JSONObject object = JSONObject.parseObject(response);
            array = object.getJSONArray("detailModelList");
            for (int i = 0;i<array.size();i++){
                JSONObject jsonObject = array.getJSONObject(i);
                String hospital = jsonObject.getString("hospital");
@ -65,7 +74,7 @@ public class SpecialistHospitalItemService extends BaseService {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return object;
        return array;
    }
@ -75,16 +84,16 @@ public class SpecialistHospitalItemService extends BaseService {
     * @param ids
     * @return
     */
    public JSONObject selectByIds(String ids){
    public JSONArray selectByIds(String ids){
        String response = null;
        JSONObject object = new JSONObject();
        JSONArray array = new JSONArray();
        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");
            JSONObject object = JSONObject.parseObject(response);
            array = object.getJSONArray("detailModelList");
            for (int i = 0;i<array.size();i++){
                JSONObject jsonObject = array.getJSONObject(i);
                String hospital = jsonObject.getString("hospital");
@ -95,6 +104,27 @@ public class SpecialistHospitalItemService extends BaseService {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return object;
        return array;
    }
    public JSONArray getHospital(String doctor, String patient, String serviceItemName) throws Exception{
        String response = null;
        JSONObject object = new JSONObject();
        String url =specialistUrl + "svr-specialist/selectByHospital1";
        Map<String,String> params = new HashMap<>();
        SignFamily signFamily = new SignFamily();
        Doctor d = doctorService.findDoctorByCode(doctor);
        params.put("docHospital",d.getHospital());
        if(StringUtils.isNotBlank(patient)) {
            signFamily = familyService.findByPatient(patient);
            params.put("hospital", signFamily.getHospital());
        }
        if(StringUtils.isNotBlank(serviceItemName)) {
            params.put("serviceItemName", serviceItemName);
        }
        response = httpClientUtil.httpPost(url, params);
        object = JSONObject.parseObject(response);
        JSONArray array = object.getJSONArray("detailModelList");
        return array;
    }
}

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

@ -195,8 +195,21 @@ public class RehabilitationManageService extends BaseService {
        param.put("planDetailIds", planDetailIds);
        HttpResponse response = HttpUtils.doGet(specialistUrl + serviceItemList, param);
        JSONObject result = new JSONObject(response.getContent());
        JSONArray jsonArray = null;
        if(result.getInt("status")==200){
            return result.getJSONArray("obj");
            jsonArray = result.getJSONArray("obj");
            for(int i=0;i<jsonArray.length();i++){
                String patient = jsonArray.getJSONObject(i).get("patient")+"";
                List<SignFamily> list = signFamilyDao.findByPatientAndExpensesStatusAndStatus(patient,"1",1);
                if(list.size()>0){
                    jsonArray.getJSONObject(i).put("familyDoctorCode",list.get(0).getDoctor());
                    jsonArray.getJSONObject(i).put("familyDoctorName",list.get(0).getDoctorName());
                }else{
                    jsonArray.getJSONObject(i).put("familyDoctorCode","");
                    jsonArray.getJSONObject(i).put("familyDoctorName","");
                }
            }
            return jsonArray;
        }
        throw new Exception("请求微服务失败!");
    }
@ -230,19 +243,18 @@ public class RehabilitationManageService extends BaseService {
    /**
     * 康复管理-保存指导留言
     * @param messageId
     * @param patientCode
     * @param doctorCode
     * @param content
     * @param planDetailId
     * @return
     * @throws Exception
     */
    public void saveGuidanceMessage(String messageId,String patientCode,String doctorCode,String content,String planDetailId) throws Exception{
    public void saveGuidanceMessage(String messageId,String doctorCode,String content,String planDetailId) throws Exception{
        Doctor doctor = doctorDao.findByCode(doctorCode);
        Integer doctorType = doctor.getLevel();
        Map<String, Object> param = new HashedMap();
        param.put("messageId", messageId);
        param.put("patientCode", patientCode);
//        param.put("patientCode", patientCode);
        param.put("doctorCode", doctorCode);
        param.put("doctorType", doctorType);
        param.put("content", content);
@ -448,7 +460,16 @@ public class RehabilitationManageService extends BaseService {
    public JSONObject saveRehabilitationOperateRecodr(String dataJson) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("dataJson", dataJson);
        JSONObject json = new JSONObject(dataJson);
        if(json.has("patientCode")){
            Patient patient = patientDao.findByCode(json.get("patientCode")+"");
            json.put("patientName",patient!=null?patient.getName():"");
        }
        if(json.has("doctorCode")){
            Doctor doctor = doctorDao.findByCode(json.get("doctorCode")+"");
            json.put("doctorName",doctor!=null?doctor.getName():"");
        }
        param.put("dataJson", json.toString());
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + saveRehabilitationOperateRecodr, param);
        JSONObject result = new JSONObject(response.getContent());

+ 5 - 20
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/RehabilitationPlanService.java

@ -1,10 +1,11 @@
package com.yihu.wlyy.service.specialist;
package com.yihu.wlyy.service.specialist.rehabilitation;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
@ -66,7 +67,7 @@ public class RehabilitationPlanService extends BaseService {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        if ("success".equals(rs.getString("message"))) {
        if (rs.getInt("status") == 200) {
            return rs.getJSONArray("detailModelList");
        }
        throw new Exception("请求获取模板明细列表失败!");
@ -133,23 +134,6 @@ public class RehabilitationPlanService extends BaseService {
        return rs.getString("message");
    }
    public JSONArray findServiceItemsByHospital(String doctorHospital, String signHospital) throws Exception {
        Map<String, Object> param = new HashedMap();
        param.put("doctorHospital", doctorHospital);
        param.put("signHospital", signHospital);
        HttpResponse response = null;
        try {
            response = HttpUtils.doGet(specialistUrl + "svr-specialist/findServiceItemsByHospital", param);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("detailModelList");
        }
        throw new Exception("请求获取机构服务项目列表失败!");
    }
    public String createRehabilitationPlan(String json, Doctor doctor) {
        JSONObject object = new JSONObject(json);
        String patient = object.getString("patient");
@ -167,7 +151,7 @@ public class RehabilitationPlanService extends BaseService {
        JSONArray detailModelList = (JSONArray) rs.get("detailModelList");
        //康复计划创建完给执行者发送消息
        for (Object obj : detailModelList){
            JSONObject detail = new JSONObject(obj);
            JSONObject detail = (JSONObject) obj;
            Message message = new Message();
            message.setSender(doctor.getCode());
            message.setType(19);
@ -207,4 +191,5 @@ public class RehabilitationPlanService extends BaseService {
            throw new Exception("请求微服务失败!");
        }
    }
}

+ 7 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -72,12 +72,12 @@ public class DoctorTeamGuidanceService extends BaseService {
    public String saveTeamGuidance(String doctor, String title, JSONArray teams, String content, String images,String labelCode) throws Exception {
        String templateCode = getCode();
        Date nowDate = new Date();
        String image = "";
        if (StringUtils.isNotEmpty(images)) {
//            只限本地路径上传到FastDFS
            image = CommonUtil.copyTempImage(images);
            System.out.println("images =====>" + image);
        }
//        String image = "";
//        if (StringUtils.isNotEmpty(images)) {
////            只限本地路径上传到FastDFS
//            image = CommonUtil.copyTempImage(images);
//            System.out.println("images =====>" + image);
//        }
        //指导标签
        DoctorGuidanceTempLabel doctorGuidanceTempLable =  doctorGuidanceTempLableDao.findByCode(labelCode);
        String labelName = "未分组";
@ -118,7 +118,7 @@ public class DoctorTeamGuidanceService extends BaseService {
        doctorTeamGuidanceDetail.setContent(content);
        doctorTeamGuidanceDetail.setCreateTime(nowDate);
        doctorTeamGuidanceDetail.setCzrq(nowDate);
        doctorTeamGuidanceDetail.setImagesUrl(image);
        doctorTeamGuidanceDetail.setImagesUrl(images);
        doctorTeamGuidanceDetailDao.save(doctorTeamGuidanceDetail);

+ 18 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemDataRedis.java

@ -2,6 +2,9 @@ package com.yihu.wlyy.util;
import com.yihu.wlyy.entity.security.Token;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
@ -15,6 +18,8 @@ import java.util.Set;
@Component
public class SystemDataRedis {
    private static Logger logger = LoggerFactory.getLogger(SystemDataRedis.class);
    @Autowired
    private StringRedisTemplate redisTemplate;
@ -98,9 +103,19 @@ public class SystemDataRedis {
     * @return
     */
    public Token getToken(String tokenTypeName,String uid) {
        String tokenJosn = redisTemplate.opsForValue().get("token:" + tokenTypeName + ":" + uid);
        Token token = (Token)JSONObject.toBean(JSONObject.fromObject(tokenJosn),Token.class);
        return token;
        try{
            //获取token
            String tokenJosn = redisTemplate.opsForValue().get("token:" + tokenTypeName + ":" + uid);
            if(StringUtils.isNotBlank(tokenJosn)){
                Token token = (Token)JSONObject.toBean(JSONObject.fromObject(tokenJosn),Token.class);
                return token;
            }
            return null;
        }catch (Exception e){
            logger.info("getToken:"+e.getMessage());
        }
        return null;
    }
    /**

+ 57 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -21,6 +21,7 @@ import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.device.DeviceDetailService;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.util.*;
import net.sf.json.JSONArray;
import org.apache.commons.collections.map.HashedMap;
@ -72,6 +73,8 @@ public class DataHandingService {
    private DeviceDetailDao deviceDetailDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private TaskService taskService;
    @Transactional
    public String producePatientAndDoctorPassword() {
@ -689,4 +692,58 @@ public class DataHandingService {
        sqlStr = sqlList.toArray(sqlStr);
        jdbcTemplate.batchUpdate(sqlStr);
    }
    @Transactional(rollbackFor = Exception.class)
    public int addHealthActivitRecord()throws Exception{
        String creditsSql ="SELECT" +
                " cd.patient_id," +
                " bt.title," +
                " bt.task_code" +
                " FROM" +
                " wlyy_health_bank.wlyy_health_bank_credits_detail cd" +
                " LEFT JOIN wlyy_health_bank.wlyy_health_bank_task bt ON cd.transaction_id = bt.id" +
                " WHERE" +
                " (" +
                "  bt.task_code = 'GLU_BIND'" +
                "  OR task_code = 'BP_BIND'" +
                " )" +
                " AND cd.`status` = 1" +
                " GROUP BY cd.patient_id";
        List<Map<String,Object>> creditsRecordList = jdbcTemplate.queryForList(creditsSql);
        String activitSql ="SELECT" +
                " bar.patient_id,bt.title,bt.task_code" +
                " FROM" +
                " wlyy_health_bank.wlyy_health_bank_active_record bar" +
                " LEFT JOIN wlyy_health_bank.wlyy_health_bank_task bt ON bar.task_id = bt.id" +
                " WHERE" +
                " (" +
                "  bt.task_code = 'GLU_BIND'" +
                "  OR task_code = 'BP_BIND'" +
                " )" +
                " GROUP BY bar.patient_id ";
        List<Map<String,Object>> activitRecordList = jdbcTemplate.queryForList(activitSql);
        int result =0;
        for (Map<String,Object> creditMap : creditsRecordList){
            String creditPatient = String.valueOf(creditMap.get("patient_id"));
            int i =0;
            for (Map<String,Object> activitMap : activitRecordList){
                String acPatient = String.valueOf(activitMap.get("patient_id"));
                if (creditPatient.equals(acPatient)){
                    i++;
                }
            }
            if (i==0){
                com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
                jsonObject.put("patientId",creditPatient);
                jsonObject.put("taskCode",String.valueOf(creditMap.get("task_code")));
                com.alibaba.fastjson.JSONObject resultJson = taskService.createActiveRecord(jsonObject);
                if(resultJson!=null && resultJson.getInteger("status")==200){
                    result++;
                }
            }
        }
        return result;
    }
}

+ 8 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java

@ -380,7 +380,14 @@ public class DataHandlingController extends BaseController {
    @ResponseBody
    @ApiOperation("将之前没有增加的首绑活动积分完善")
    public String addHealthActivitRecord(){
        return  "";
        try{
            int result = dataHandingService.addHealthActivitRecord();
            return write(200,"清洗数据成功","data",result);
        }catch (Exception e){
            System.out.println(e.getMessage());
            e.printStackTrace();
            return write(-1,"清洗数据失败!");
        }
    }
}

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

@ -60,4 +60,21 @@ public class HospitalServiceItemController extends BaseController {
            return write(-1,"获取失败!");
        }
    }
    @RequestMapping(value = "/findServiceItemsByHospital", method = RequestMethod.GET)
    @ApiOperation(value = "获取机构服务项目列表")
    public String findServiceItemsByHospital(@ApiParam(name = "doctor", value = "医生标识")
                                             @RequestParam(required = true)String doctor,
                                             @ApiParam(name = "patient", value = "居民标识")
                                             @RequestParam(required = false)String patient,
                                             @ApiParam(name = "serviceItemName", value = "服务项目名称")
                                             @RequestParam(required = false)String serviceItemName){
        try {
            return write(200, "获取成功", "data", specialistHospitalItemService.getHospital(doctor, patient, serviceItemName));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

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

@ -1,10 +1,9 @@
package com.yihu.wlyy.web.doctor.specialist.rehabilitation;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.service.specialist.RehabilitationPlanService;
import com.yihu.wlyy.service.specialist.rehabilitation.RehabilitationPlanService;
import org.json.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
import com.yihu.wlyy.service.specialist.rehabilitation.RehabilitationManageService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
@ -19,8 +18,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/8/30.
 */
@ -176,8 +173,8 @@ public class DoctorRehabilitationManageController extends BaseController {
    @ObserverRequired
    public String saveGuidanceMessage(@ApiParam(name = "messageId", value = "消息id", required = true)
                                      @RequestParam(value = "messageId", required = true)String messageId,
                                      @ApiParam(name = "patientCode", value = "居民code", required = true)
                                      @RequestParam(value = "patientCode", required = true)String patientCode,
//                                      @ApiParam(name = "patientCode", value = "居民code", required = true)
//                                      @RequestParam(value = "patientCode", required = true)String patientCode,
//                                      @ApiParam(name = "doctorCode", value = "医生code", required = true)
//                                      @RequestParam(value = "doctorCode", required = true)String doctorCode,
//                                      @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
@ -188,7 +185,7 @@ public class DoctorRehabilitationManageController extends BaseController {
                                      @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            rehabilitationManageService.saveGuidanceMessage(messageId,patientCode,getRepUID(),content,planDetailId);
            rehabilitationManageService.saveGuidanceMessage(messageId,getRepUID(),content,planDetailId);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);

+ 27 - 39
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/specialist/ThirdRehabilitationPlanController.java

@ -1,12 +1,10 @@
package com.yihu.wlyy.web.third.specialist;
package com.yihu.wlyy.web.doctor.specialist.rehabilitation;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.service.app.family.FamilyService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.specialist.RehabilitationPlanService;
import com.yihu.wlyy.service.specialist.rehabilitation.RehabilitationPlanService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -23,9 +21,9 @@ import org.springframework.web.bind.annotation.RestController;
 * Created by humingfen on 2018/8/22.
 */
@RestController
@RequestMapping(value = "/third/rehabilitaionPlan",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "康复服务套餐管理")
public class ThirdRehabilitationPlanController extends BaseController {
@RequestMapping(value = "/doctor/specialist/rehabilitationPlan",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-康复服务套餐管理")
public class DoctorRehabilitationPlanController extends BaseController {
    @Autowired
    private RehabilitationPlanService rehabilitationPlanService;
@ -33,17 +31,17 @@ public class ThirdRehabilitationPlanController extends BaseController {
    private AdminTeamService teamService;
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private FamilyService familyService;
    @RequestMapping(value = "/findTemplateList", method = RequestMethod.GET)
    @ApiOperation(value = "获取康复服务套餐模板列表")
    public String templateList(@ApiParam(name = "doctor", value = "医生标识")
                                   @RequestParam(required = true)String doctor,
                               @RequestParam(required = false)String doctor,
                               @ApiParam(name = "patient", value = "居民标识")
                                   @RequestParam(required = false)String patient){
                               @RequestParam(required = false)String patient){
        try {
            if(!StringUtils.isNotBlank(doctor)){
                doctor = getUID();
            }
            return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo(doctor, patient));
        } catch (Exception e) {
            error(e);
@ -54,7 +52,7 @@ public class ThirdRehabilitationPlanController extends BaseController {
    @RequestMapping(value = "/findTemplateDetail", method = RequestMethod.GET)
    @ApiOperation(value = "获取康复服务套餐模板明细")
    public String findTemplateDetail(@ApiParam(name = "templateId", value = "模板id")
                                         @RequestParam(required = true)String templateId){
                                     @RequestParam(required = true)String templateId){
        try {
            return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateDetailInfo(templateId));
        } catch (Exception e) {
@ -66,10 +64,13 @@ public class ThirdRehabilitationPlanController extends BaseController {
    @RequestMapping(value = "/createTemplate", method = RequestMethod.POST)
    @ApiOperation(value = "创建康复服务套餐模板")
    public String createTemplate(@ApiParam(name = "doctor", value = "医生标识")
                                     @RequestParam(required = true)String doctor,
                                 @RequestParam(required = false)String doctor,
                                 @ApiParam(name = "title", value = "康复服务模板名称")
                                    @RequestParam(required = true) String title){
                                 @RequestParam(required = true) String title){
        try {
            if(!StringUtils.isNotBlank(doctor)){
                doctor = getUID();
            }
            AdminTeam team = teamService.findByLeaderCode(doctor);
            Doctor d = doctorService.findDoctorByCode(doctor);
            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,d,team.getId()));
@ -82,12 +83,15 @@ public class ThirdRehabilitationPlanController extends BaseController {
    @RequestMapping(value = "/createTemplateDetail", method = RequestMethod.POST)
    @ApiOperation(value = "创建康复服务套餐模板明细")
    public String createTemplateDetail(@ApiParam(name = "doctor", value = "医生标识")
                                           @RequestParam(required = true)String doctor,
                                       @RequestParam(required = false)String doctor,
                                       @ApiParam(name = "json", value = "康复服务模板明细")
                                            @RequestParam(required = true) String json,
                                       @RequestParam(required = true) String json,
                                       @ApiParam(name = "type", value = "create或者edit")
                                            @RequestParam(required = true) String type){
                                       @RequestParam(required = true) String type){
        try {
            if(!StringUtils.isNotBlank(doctor)){
                doctor = getUID();
            }
            Doctor d = doctorService.findDoctorByCode(doctor);
            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplateDetail(json, type, d));
        } catch (Exception e) {
@ -108,32 +112,16 @@ public class ThirdRehabilitationPlanController extends BaseController {
        }
    }
    @RequestMapping(value = "/findServiceItemsByHospital", method = RequestMethod.GET)
    @ApiOperation(value = "获取机构服务项目列表")
    public String findServiceItemsByHospital(@ApiParam(name = "doctor", value = "医生标识")
                                                 @RequestParam(required = true)String doctor,
                                             @ApiParam(name = "patient", value = "居民标识")
                                                 @RequestParam(required = false)String patient){
        try {
            SignFamily signFamily = new SignFamily();
            Doctor d = doctorService.findDoctorByCode(doctor);
            if(StringUtils.isNotBlank(patient)) {
                signFamily = familyService.findByPatient(patient);
            }
            return write(200, "获取成功", "data", rehabilitationPlanService.findServiceItemsByHospital(d.getHospital(), signFamily.getHospital()));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "/createRehabilitationPlan", method = RequestMethod.POST)
    @ApiOperation(value = "创建居民康复计划")
    public String createRehabilitationPlan(@ApiParam(name = "doctor", value = "医生标识")
                                               @RequestParam(required = true)String doctor,
                                           @RequestParam(required = false)String doctor,
                                           @ApiParam(name = "json", value = "康复计划json")
                                               @RequestParam(required = true) String json){
                                           @RequestParam(required = true) String json){
        try {
            if(!StringUtils.isNotBlank(doctor)){
                doctor = getUID();
            }
            Doctor d = doctorService.findDoctorByCode(doctor);
            return write(200, "获取成功", "data", rehabilitationPlanService.createRehabilitationPlan(json,d));
        } catch (Exception e) {

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

@ -134,4 +134,60 @@ public class PatientRehabilitationManageController extends BaseController {
            return error(-1, "验证失败");
        }
    }
    @RequestMapping(value = "recentPlanDetailRecord", method = RequestMethod.GET)
    @ApiOperation("康复管理-近期康复相关记录")
    @ObserverRequired
    public String recentPlanDetailRecord(@ApiParam(name = "patientCode", value = "居民code", required = false)
                                         @RequestParam(value = "patientCode", required = false)String patientCode,
                                         @ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                         @RequestParam(value = "startTime", required = false)String startTime,
                                         @ApiParam(name = "endTime", value = "结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                         @RequestParam(value = "endTime", required = false)String endTime,
                                         @ApiParam(name = "page", value = "第几页,从1开始", required = true)
                                         @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                                         @ApiParam(name = "pageSize", value = "每页分页大小", required = true)
                                         @RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize){
        try {
            if(!StringUtils.isNotEmpty(patientCode)){
                patientCode = getUID();
            }
            JSONObject result = rehabilitationManageService.recentPlanDetailRecord(patientCode,startTime,endTime,page,pageSize);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "serviceItemList", method = RequestMethod.GET)
    @ApiOperation("康复管理-多个康复计划服务项目内容列表")
    @ObserverRequired
    public String serviceItemList(@ApiParam(name = "planDetailIds", value = "康复计划多个服务项目id(多个‘,’分隔)", required = true)
                                  @RequestParam(value = "planDetailIds", required = true)String planDetailIds){
        try {
            JSONArray result = rehabilitationManageService.serviceItemList(planDetailIds);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "serviceItem", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划服务项目确认详情页")
    @ObserverRequired
    public String serviceItem(@ApiParam(name = "planDetailId", value = "康复计划服务项目id", required = true)
                              @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            JSONObject result = rehabilitationManageService.serviceItem(planDetailId);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 7 - 4
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -191,22 +191,25 @@ es:
#集美宣教居民端健康文章
jkEdu:
  web:
    #articleBaseUrl: http://172.19.103.87:9088/
    articleBaseUrl: http://192.168.131.131:8088/
    articleBaseUrl: http://172.19.103.87:9088/
#    articleBaseUrl: http://192.168.131.131:8088/
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
    deviceMeasurementRemindingQueue : deviceMeasurementChannel_dev #设备测量提醒
#    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
#    deviceMeasurementRemindingQueue : deviceMeasurementChannel_dev #设备测量提醒
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
    deviceMeasurementRemindingQueue : deviceMeasurementChannel_test #设备测量提醒
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  #wlyy: http://59.61.92.90:8072/wlyy
  wlyy: http://172.19.103.54:22122/
  #wlyy: http://192.168.131.130:8080/
#系统中使用的双层对称加密使用到的KEY
Riva: