Selaa lähdekoodia

康复计划代码提交

liuwenbin 7 vuotta sitten
vanhempi
commit
335f73826e
21 muutettua tiedostoa jossa 401 lisäystä ja 114 poistoa
  1. 11 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/Hospital.java
  2. 56 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/ServiceItemService.java
  3. 13 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/HttpClientUtil.java
  4. 7 7
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java
  5. 1 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java
  6. 1 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/JMService.java
  7. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  8. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java
  9. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyService.java
  10. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java
  11. 20 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  12. 2 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  13. 61 15
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/RehabilitationPlanService.java
  14. 27 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java
  15. 19 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java
  16. 19 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java
  17. 26 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  18. 50 28
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/DoctorRehabilitationManageController.java
  19. 5 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java
  20. 12 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  21. 62 38
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/specialist/ThirdRehabilitationPlanController.java

+ 11 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/Hospital.java

@ -38,6 +38,8 @@ public class Hospital extends IdEntity {
	private String townName;
	//级别,1医院,2社区医院
	private int level;
	//医院等级
	private int grade;
	//医院详细地址
	private String address;
	//医院简介
@ -169,6 +171,13 @@ public class Hospital extends IdEntity {
	public void setPhoto(String photo) {
		this.photo = photo;
	}
	
	
	public int getGrade() {
		return grade;
	}
	public void setGrade(int grade) {
		this.grade = grade;
	}
}

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

@ -140,4 +140,60 @@ public class ServiceItemService extends BaseService {
        }
        return JSONObject.parseObject(response);
    }
    /*public JSONObject importData(HttpServletRequest request) throws Exception {
        String response = null;
        String url =getBaseUrl() + "importData";
        JSONObject object =
        try {
            response = httpClientUtil.po;
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }*/
   /* public boolean importData(Workbook workbook) {
        Sheet[] sheets = workbook.getSheets();
        Sheet sheet = sheets[0];
        int rows = ReadExcelUtil.getRightRows(sheet);
        for (int row = 1; row < rows; row++) {  //索引从0开始,第一行为标题
            Hospital hospital = new Hospital();
            Map<Integer, ExcelData> mapping = mapping(hospital);
            int finalRow = row;
            mapping.forEach((index, excelData) -> {
                String value = sheet.getCell(index, finalRow).getContents().trim();
                excelData.transform(value);
            });
            //Additional Handel
            String hospitalExist = this.isNameExist(hospital.getName());
            if (hospitalExist.equals("true")) {//机构存在,但是未判断wlyyRole是否存在
                hospital = hospitalDao.findByName(hospital.getName());
                WlyyRole wlyyRole = new WlyyRole();
                WlyyRole wlyyRole1 = wlyyRoleDao.findByName(hospital.getName());
                if(wlyyRole1==null){//不存在则保存
                    wlyyRole.setName(hospital.getName());
                    wlyyRole.setCode(hospital.getCode());
                    wlyyRole.setCzrq(new Date());
                    wlyyRoleDao.save(wlyyRole);
                }
                continue;
            }
            //机构不存在,先保存机构,在判断wlyyRole是否存在
            hospital.setDel("1");
            hospital = hospitalDao.save(hospital);
            WlyyRole wlyyRole = new WlyyRole();
            WlyyRole wlyyRole1 = wlyyRoleDao.findByName(hospital.getName());
            if(wlyyRole1==null){//不存在则保存
                wlyyRole.setName(hospital.getName());
                wlyyRole.setCode(hospital.getCode());
                wlyyRole.setCzrq(new Date());
                wlyyRoleDao.save(wlyyRole);
            }
        }
        return true;
    }*/
}

+ 13 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/HttpClientUtil.java

@ -170,4 +170,17 @@ public class HttpClientUtil {
		restTemplate.put(url, formEntity, String.class);
	}
	public static String postBody(String url){
		RestTemplate restTemplate = new RestTemplate();
		HttpHeaders headers = new HttpHeaders();
		MediaType type = MediaType.parseMediaType("application/json;charset=UTF-8");
		headers.setContentType(type);
		headers.add("Accept", MediaType.APPLICATION_JSON.toString());
		org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(headers);
		String ret = restTemplate.postForObject(url, formEntity, String.class);
		return ret;
	}
}

+ 7 - 7
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java

@ -617,17 +617,17 @@ public class AsyncService extends BaseService{
                //判断今天是否加过体征积分
                String urlSearch = wlyyService + "healthBank/selectByDate";
                List<NameValuePair> paramsSearch1 = new ArrayList<>();
                paramsSearch1.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\"BP_MEASURE\",\"startTime\":\""+uploadTime+"\",\"endTime\":\""+uploadTime+"\",\"patientId\":\""+patientCode+"\"}"));
                paramsSearch1.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\""+flagStr+"\",\"startTime\":\""+uploadTime+"\",\"endTime\":\""+uploadTime+"\",\"patientId\":\""+patientCode+"\"}"));
                String responseSearch1 = HttpClientUtil.post(urlSearch, paramsSearch1, "UTF-8");
                List<NameValuePair> paramsSearch2 = new ArrayList<>();
               /* List<NameValuePair> paramsSearch2 = new ArrayList<>();
                paramsSearch2.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\"GLU_MEASURE\",\"startTime\":\""+uploadTime+"\",\"endTime\":\""+uploadTime+"\",\"patientId\":\""+patientCode+"\"}"));
                String responseSearch2 = HttpClientUtil.post(urlSearch, paramsSearch2, "UTF-8");
                String responseSearch2 = HttpClientUtil.post(urlSearch, paramsSearch2, "UTF-8");*/
                com.alibaba.fastjson.JSONObject object1 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch1);
                com.alibaba.fastjson.JSONObject object2 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch2);
                if(object1!=null && object2!=null){
                //com.alibaba.fastjson.JSONObject object2 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch2);
                if(object1!=null){
                    com.alibaba.fastjson.JSONObject jsonObject1 = (com.alibaba.fastjson.JSONObject) object1.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    com.alibaba.fastjson.JSONObject jsonObject2 = (com.alibaba.fastjson.JSONObject) object2.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    if (jsonObject1.getJSONArray("creditsDetailDOS").size()==0 && jsonObject2.getJSONArray("creditsDetailDOS").size()==0){
                    //com.alibaba.fastjson.JSONObject jsonObject2 = (com.alibaba.fastjson.JSONObject) object2.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    if (jsonObject1.getJSONArray("creditsDetailDOS").size()==0){
                        dataUoloadCount = false;
                    }
                }

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

@ -427,7 +427,7 @@ public class DeviceService extends BaseService{
                String patientCode = result.getUser();
                Patient patient = patientDao.findByCode(patientCode);
                asyncService.addIntegral(deviceSn,type,userType,patientCode,deviceType);
                asyncService.addIntegral(deviceSn,type,userType,patientCode,deviceType,uploadTime);
                //血糖、血压数据需校验,如果超标,需要发送消息给医生
	            if (1 == deviceType || 2 == deviceType) {
                    asyncService.verifyHealthIndex(result);

+ 1 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/JMService.java

@ -442,7 +442,7 @@ public class JMService {
        return re;
    }
    private String apiString = "Action";
    private String apiString = "";
    /**
     * 获取口令,4小时有效,465439011

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

@ -87,6 +87,8 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Modifying
    int setMessageReaded(String doctor, Integer type);
    @Query("update Message a set a.read = 0,a.over = '0' where a.receiver = ?1 and a.type not in (1,2,6,7)")
    @Modifying
    int setSysMessageReaded(String doctor);
@ -133,7 +135,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type = 18 order by a.czrq desc")
    List<Message> getFamilySign(String receiver);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type in(18,19,20,21,22) and a.read = 1")
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type in(18,19,20,21,22)")
    List<Message> selectFamilySign(String receiver,Pageable pageableRequest);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type = 17 order by a.czrq desc")

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

@ -444,4 +444,7 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
    //根据居民获取有效的签约
    List<SignFamily> findByPatientAndExpensesStatusAndStatus(String patient,String expensesStatus,Integer status);
    //根据居民找出居民签约团队
    @Query("select a from SignFamily a where a.patient = ?1 and a.status = 1 and a.expensesStatus = '1'")
    SignFamily findSignFamilyByPatient(String patient);
}

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

@ -451,7 +451,7 @@ public class FamilyService {
        System.out.println(MD5.GetMD5Code(password+salt));
    }
    public SignFamily findByPatientAndDoctor(String patient, String doctor) {
        return signFamilyDao.findSignFamilyByPatientAndDoctor(patient, doctor);
    public SignFamily findByPatient(String patient) {
        return signFamilyDao.findSignFamilyByPatient(patient);
    }
}

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

@ -307,6 +307,7 @@ public class TaskService {
        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){

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

@ -582,6 +582,26 @@ public class MessageService extends BaseService {
        }
    }
    /**
     * 家医设置专科消息一键已读
     *
     * @param doctor
     */
    public String setMessageReaded(String doctor,List<Integer> types) {
        StringBuffer buffer = new StringBuffer();
        buffer.append("type in (");
        for (int i = 0;i<types.size();i++){
            buffer.append(types.get(i)+",");
        }
        buffer.deleteCharAt(buffer.length()-1);
        buffer.append(")");
        String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = ?1 and "+buffer;
        int i = jdbcTemplate.update(sql);
        return Integer.toString(i);
    }
    /**
     * 获取消息提醒设置
     * @param user

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -6353,12 +6353,11 @@ public class StatisticsESService {
                sql +=" AND d.grant_admin_team IN(SELECT id FROM wlyy_admin_team WHERE available = 1)";
            }
            sqlList = jdbcTemplate.queryForList(sql);
            esModelList = getDeviceBindToTeam(sqlList);
        }else {
            esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(year+"-07-01",date, area, level, index, SaveModel.timeLevel_ZL, low_level);
            esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, low_level);
        }
        esModelList = getDeviceBindToTeam(sqlList);
        //到绑定人的封装数据
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {

+ 61 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/RehabilitationPlanService.java

@ -1,22 +1,24 @@
package com.yihu.wlyy.service.specialist;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2018/8/22.
 * Created by humingfen on 2018/8/22.
 */
@Service
@Transactional
@ -24,10 +26,20 @@ public class RehabilitationPlanService extends BaseService {
    @Value("${specialist.url}")
    private String specialistUrl;
    @Autowired
    private AdminTeamService teamService;
    public JSONObject findTemplateInfo(Long teamId) {
    public JSONObject findTemplateInfo(String doctor, String patient) {
        Map<String, Object> param = new HashedMap();
        param.put("adminTeamCode", teamId);
        Long adminTeamId = null;
        AdminTeam team = teamService.findByLeaderCode(doctor);
        if(StringUtils.isBlank(patient)){
            adminTeamId = team.getId();
            param.put("adminTeamCode", adminTeamId);
        }else {
            param.put("doctor", doctor);
            param.put("patient", patient);
        }
        HttpResponse response = null;
        try {
            response = HttpUtils.doGet(specialistUrl + "svr-specialist/findRehabilitationPlanTemplate", param);
@ -78,9 +90,9 @@ public class RehabilitationPlanService extends BaseService {
        JSONObject object = new JSONObject(json);
        JSONArray details = new JSONArray();
        String templateId = object.get("templateId").toString();
        String serviceItemIds = object.get("hospitalServiceItemIds").toString();
        if(serviceItemIds.contains(",")) {
            String [] itemIds = serviceItemIds.split(",");
        String hospitalServiceItemIds = object.get("hospitalServiceItemId").toString();
        if(hospitalServiceItemIds.contains(",")) {
            String [] itemIds = hospitalServiceItemIds.split(",");
            int len = itemIds.length;
            while (len > 0){
                len --;
@ -91,6 +103,10 @@ public class RehabilitationPlanService extends BaseService {
                j.put("createUserName", doctor.getName());
                details.put(len, j);
            }
        }else {
            object.put("createUser", doctor.getCode());
            object.put("createUserName", doctor.getName());
            details.put(object);
        }
        Map<String, Object> param = new HashedMap();
        param.put("rehabilitationTemplateDetail", details.toString());
@ -108,15 +124,13 @@ public class RehabilitationPlanService extends BaseService {
        return rs.getString("message");
    }
    public JSONObject findServiceItemsByHospital(SignFamily signFamily, Doctor doctor) {
        List<String> hospitals = null;
        hospitals.add(doctor.getHospital());
        hospitals.add(signFamily.getHospital());
    public JSONObject findServiceItemsByHospital(String doctorHospital, String signHospital) {
        Map<String, Object> param = new HashedMap();
        param.put("hospitals", hospitals);
        param.put("doctorHospital", doctorHospital);
        param.put("signHospital", signHospital);
        HttpResponse response = null;
        try {
            response = HttpUtils.doPost(specialistUrl + "svr-specialist/", param);
            response = HttpUtils.doGet(specialistUrl + "svr-specialist/findServiceItemsByHospital", param);
        } catch (Exception e) {
            e.printStackTrace();
        }
@ -129,7 +143,7 @@ public class RehabilitationPlanService extends BaseService {
        object.put("createUser", doctor.getCode());
        object.put("createUserName", doctor.getName());
        Map<String, Object> param = new HashedMap();
        param.put("rehabilitationPlan", json.toString());
        param.put("rehabilitationPlan", object.toString());
        HttpResponse response = null;
        try {
            response = HttpUtils.doPost(specialistUrl + "svr-specialist/createPatientRehabilitationPlan", param);
@ -139,4 +153,36 @@ public class RehabilitationPlanService extends BaseService {
        JSONObject rs = new JSONObject(response.getContent());
        return rs.getString("message");
    }
    public String deleteTemplate(String templateId) {
        Map<String, Object> param = new HashedMap();
        param.put("id", templateId);
        HttpResponse response = null;
        try {
            response = HttpUtils.doPost(specialistUrl + "svr-specialist/deleteRehabilitationPlanTemplate", param);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        return rs.getString("message");
    }
    /**
     * 根据医生code获取签约居民信息
     * @param doctor
     * @return
     */
    public JSONObject getPatientInfoByDoctor(String doctor, String patientInfo) {
        Map<String, Object> param = new HashedMap();
        param.put("doctor", doctor);
        param.put("patientInfo", patientInfo);
        HttpResponse response = null;
        try {
            response = HttpUtils.doGet(specialistUrl + "svr-specialist/getPatientAndDiseaseByDoctor", param);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        return rs;
    }
}

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

@ -50,6 +50,8 @@ public class RehabilitationManageService extends BaseService {
    private String updateStatusRehabilitationOperate = "/svr-specialist/updateStatusRehabilitationOperate";//康复管理-服务项目-完成项目内容信息
    private String patientRehabilitationDetail = "/svr-specialist/patientRehabilitationDetail";//康复管理-居民详情页
    private String recentPlanDetailRecord = "/svr-specialist/recentPlanDetailRecord";//居民康复计划详情页-近期康复相关记录
    private String createServiceQrCode ="/svr-specialist/createServiceQrCode";//根据康复计划明细id和对话sessionId生成服务码
    private String checkAfterQrCode="/svr-specialist/checkAfterQrCode";//居民扫码后验证是否是关联的居民扫码
    private String serviceDoctorList = "/svr-specialist/serviceDoctorList";//康复管理-医生端居民详情服务医生列表
    private String appCalendarPlanDetailList = "/svr-specialist/appCalendarPlanDetailList";//康复管理-app端、微信端计划的服务项目列表
    private String dailyJob = "/svr-specialist/dailyJob";//每日康复服务通知
@ -200,7 +202,7 @@ public class RehabilitationManageService extends BaseService {
     */
    public JSONObject serviceItem(String planDetailId) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailId", planDetailId);
        param.put("planDetailIds", planDetailId);
        HttpResponse response = HttpUtils.doGet(specialistUrl + serviceItem, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
@ -333,6 +335,30 @@ public class RehabilitationManageService extends BaseService {
        throw new Exception("请求微服务失败!");
    }
    public String createServiceQrCode(String planDetailId,String sessionId) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailId", planDetailId);
        param.put("sessionId", sessionId);
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + createServiceQrCode, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return String.valueOf(result.get("obj"));
        }
        throw new Exception("获取二维码失败!");
    }
    public JSONObject checkAfterQrCode(String planDetailId,String patientCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailId", planDetailId);
        param.put("patientCode", patientCode);
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + checkAfterQrCode, param);
        JSONObject result = new JSONObject(response.getContent());
        return  result;
    }
    /**
     * 康复管理-app端、居民端-服务医生列表
     * @param patientCode

+ 19 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -59,6 +59,25 @@ public class ImUtill {
        }
    }
    /**
     * 发送消息
     * @param senderId 发送者的code
     * @param receiverId 接受者code
     * @param contentType 消息类型
     * @param content 消息内容
     * @return
     */
    public String sendMessage(String senderId,String receiverId,String contentType,String content){
        String imAddr = im_host + "api/v2/message/send";
        JSONObject params = new JSONObject();
        params.put("sender_id", senderId);
        params.put("sender_name", receiverId);
        params.put("content_type", contentType);
        params.put("content", content);
        String response = HttpClientUtil.postBody(imAddr, params);
        return response;
    }
    /**
     * 获取医生统计数据
     * status reply 为空值是是该医生总咨询量

+ 19 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java

@ -136,6 +136,20 @@ public class DoctorDeviceController extends BaseController {
			//修改设备表中{"1":"0", "2":"0"}绑定次数 和其他绑定信息,
			deviceDetailService.updateAfterBinding(device,new Date(),flag);
			String flagStr ="";
			if ("1".equals(device.getCategoryCode())){
				flagStr="GLU_BIND";
			}else if ("2".equals(device.getCategoryCode())){
				flagStr="BP_BIND";
			}
			Patient patient = patientDao.findByCode(device.getUser());
			//活动的活跃度
			if (flag){
				JSONObject jsonObject = new JSONObject();
				jsonObject.put("patientId",patient.getCode());
				jsonObject.put("taskCode",flagStr);
				taskService.createActiveRecord(jsonObject);
			}
			return success("设备保存成功!");
		}
		catch (Exception ex) {
@ -178,12 +192,12 @@ public class DoctorDeviceController extends BaseController {
			SignFamily signFamily = signFamilyDao.findSignByPatient(patient.getCode(),2);
			//调用增加积分接口  海沧区的居民才能添加积分
			String flagStr ="";
			if ("1".equals(device.getCategoryCode())){
				flagStr="GLU_BIND";
			}else if ("2".equals(device.getCategoryCode())){
				flagStr="BP_BIND";
			}
			if (flag && "350205".equals(signFamily.getHospital().substring(0,6))){
				if ("1".equals(device.getCategoryCode())){
					flagStr="GLU_BIND";
				}else if ("2".equals(device.getCategoryCode())){
					flagStr="BP_BIND";
				}
				String creditDetail = "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+device.getUser()+"\",\"hospital\":\""+patient.getTown()+"\"}";
				JSONObject jsonObject = JSONObject.parseObject(creditDetail);
				JSONObject response = creditLogService.insert(jsonObject);

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

@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -621,4 +622,29 @@ public class DoctorMessageController extends BaseController {
        }
    }
    /**
     * 一键已读
     *
     * @param types
     * @return
     */
    @RequestMapping(value = "setMessageReads",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("专科医生待处理消息")
    public String setMessageRead(@ApiParam(name = "types",value = "消息集合")
                                     @RequestParam(value = "types")String types) {
        try {
            com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(types);
            List<Integer> typeList = new ArrayList<>();
            for (int i=0;i<array.size();i++){
                typeList.add(array.getInteger(i));
            }
            return write(200, "获取消息总数成功!", "data", messageService.setMessageReaded(getUID(),typeList));
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

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

@ -25,7 +25,7 @@ import java.util.List;
@RestController
@RequestMapping(value = "/doctor/specialist/rehabilitation", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-康复管理")
public class DoctorRehabilitationManageController extends BaseController {
public class RehabilitationManageController extends BaseController {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
@ -150,7 +150,7 @@ public class DoctorRehabilitationManageController extends BaseController {
        }
    }
    @RequestMapping(value = "serviceItem", method = RequestMethod.GET)
    @RequestMapping(value = "planDetailId", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划服务项目确认详情页")
    @ObserverRequired
    public String serviceItem(@ApiParam(name = "planDetailId", value = "康复计划服务项目id", required = true)
@ -172,8 +172,8 @@ public class DoctorRehabilitationManageController extends BaseController {
                                      @RequestParam(value = "messageId", required = true)String messageId,
                                      @ApiParam(name = "patientCode", value = "居民code", required = true)
                                      @RequestParam(value = "patientCode", required = true)String patientCode,
                                      @ApiParam(name = "doctorCode", value = "医生code", required = false)
                                      @RequestParam(value = "doctorCode", required = false)String doctorCode,
//                                      @ApiParam(name = "doctorCode", value = "医生code", required = true)
//                                      @RequestParam(value = "doctorCode", required = true)String doctorCode,
//                                      @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
//                                      @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                      @ApiParam(name = "content", value = "聊天内容", required = true)
@ -182,10 +182,7 @@ public class DoctorRehabilitationManageController extends BaseController {
                                      @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            rehabilitationManageService.saveGuidanceMessage(messageId,patientCode,doctorCode,content,planDetailId);
            rehabilitationManageService.saveGuidanceMessage(messageId,patientCode,getRepUID(),content,planDetailId);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
@ -226,21 +223,17 @@ public class DoctorRehabilitationManageController extends BaseController {
    }
    @RequestMapping(value = "recentPlanDetailRecord", method = RequestMethod.GET)
    @ApiOperation("康复管理-近期康复相关记录")
    @ApiOperation("康复管理-居民详情页")
    @ObserverRequired
    public String recentPlanDetailRecord(@ApiParam(name = "patientCode", value = "居民code", required = true)
                                         @RequestParam(value = "patientCode", required = true)String patientCode,
                                         @ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = 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){
                                         @ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "startTime", required = true)String startTime,
                                         @ApiParam(name = "endTime", value = "结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "endTime", required = true)String endTime){
        try {
            JSONObject result = rehabilitationManageService.recentPlanDetailRecord(patientCode,startTime,endTime,page,pageSize);
            JSONObject result = rehabilitationManageService.recentPlanDetailRecord(patientCode,startTime,endTime);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            error(e);
@ -248,11 +241,40 @@ public class DoctorRehabilitationManageController extends BaseController {
        }
    }
    @RequestMapping(value = "createServiceQrCode", method = RequestMethod.POST)
    @ApiOperation("康复管理-根据康复计划明细id和对话sessionId生成服务码")
    @ObserverRequired
    public String createServiceQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                      @ApiParam(name = "sessionId", value = "IM对话sessionId")@RequestParam(value = "sessionId", required = true)String sessionId){
        try {
            return write(200, "获取二维码成功!", "data", rehabilitationManageService.createServiceQrCode(planDetailId,sessionId));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求二维码失败");
        }
    }
    @RequestMapping(value = "checkAfterQrCode", method = RequestMethod.POST)
    @ApiOperation("康复管理-居民扫码后验证是否是关联的居民扫码")
    @ObserverRequired
    public String checkAfterQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                      @ApiParam(name = "patientCode", value = "居民端登录的居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            JSONObject result = rehabilitationManageService.checkAfterQrCode(planDetailId,patientCode);
            return write(200, String.valueOf(result.get("message")), "data", result.get("obj"));
        } catch (Exception e) {
            error(e);
            return error(-1, "验证失败");
        }
    }
    @RequestMapping(value = "serviceDoctorList", method = RequestMethod.GET)
    @ApiOperation("康复管理-医生端居民详情服务医生列表")
    @ObserverRequired
    public String serviceDoctorList(@ApiParam(name = "patientCode", value = "居民code", required = true)
                                              @RequestParam(value = "patientCode", required = true)String patientCode){
                                    @RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            JSONArray result = rehabilitationManageService.serviceDoctorList(patientCode);
@ -267,15 +289,15 @@ public class DoctorRehabilitationManageController extends BaseController {
    @ApiOperation("康复管理-app端、微信端计划的服务项目列表")
    @ObserverRequired
    public String appCalendarPlanDetailList(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                         @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                         @ApiParam(name = "planId", value = "计划id", required = true)
                                         @RequestParam(value = "planId", required = true)String planId,
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                         @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                         @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                         @RequestParam(value = "status", required = false)Integer status){
                                            @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                            @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                            @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                            @ApiParam(name = "planId", value = "计划id", required = true)
                                            @RequestParam(value = "planId", required = true)String planId,
                                            @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                            @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                            @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                            @RequestParam(value = "status", required = false)Integer status){
        try {
            JSONObject result = rehabilitationManageService.appCalendarPlanDetailList(executeStartTime,executeEndTime,planId,searchTask,status);
            return write(200, "获取成功", "data", result);

+ 5 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java

@ -253,12 +253,12 @@ public class PatientDeviceController extends BaseController {
            deviceDetailService.updateAfterBinding(device,new Date(),flag);
            SignFamily signFamily = signFamilyDao.findSignByPatient(patient.getCode());
            String flagStr ="";
            if ("1".equals(device.getCategoryCode())){
                flagStr="GLU_BIND";
            }else if ("2".equals(device.getCategoryCode())){
                flagStr="BP_BIND";
            }
            if (flag && "350205".equals(signFamily.getHospital().substring(0,6))){
                if ("1".equals(device.getCategoryCode())){
                    flagStr="GLU_BIND";
                }else if ("2".equals(device.getCategoryCode())){
                    flagStr="BP_BIND";
                }
                String creditDetail = "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+device.getUser()+"\",\"hospital\":\""+patient.getTown()+"\"}";
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(creditDetail);
                com.alibaba.fastjson.JSONObject response = creditLogService.insert(jsonObject);

+ 12 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -519,10 +519,13 @@ public class EsStatisticsController extends BaseController {
                    }
                    //20指标一个键绑定一条数据 2018年开始所以改用86指标. 2018-08-27 zd
                    String thisYear = Constant.getNowYearByDate(endDate);
                    JSONObject json = new JSONObject();
                    if ("20".equals(idx) && Integer.valueOf(thisYear)>=2018){
                        idx="86";
                        //@TODO idx="86";1.5.0版本返回前端改为index_86
                        json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, "86", lowCode, year,SaveModel.timeLevel_DDL);
                    }else {
                        json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year,SaveModel.timeLevel_DDL);
                    }
                    JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year,SaveModel.timeLevel_DDL);
                    result.put("index_" + idx, json);
                }
            }
@ -598,7 +601,8 @@ public class EsStatisticsController extends BaseController {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotalOnlineTeamLeader(date, area, level, idx, sort, lowLevel, year, ""));
                    }else if (idx.equals("20") && Integer.valueOf(year)>=2018){
                        //20指标是一个键绑定一条数据 所以2018年开始使用86指标 2018-08-27 zd
                        result.put("index_" + idx, statisticsESService.getDeviceLowLevelTotal(date, area, level, "86", sort, lowLevel, year));
                        //@TODO idx="86";
                        result.put("index_" + idx, statisticsESService.getDeviceLowLevelTotal(date, area, level,"86", sort, lowLevel, year));
                    }else {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotal(date, area, level, idx, sort, lowLevel, year));
                    }
@ -665,10 +669,13 @@ public class EsStatisticsController extends BaseController {
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
                Long total= 0L;
                if ("20".equals(idx) && Integer.valueOf(year)>=2018){
                    idx = "86";
                    //@TODO idx = "86",1.5.0版本改成返回前端改成index_86;
                    total = statisticsESService.getIndexTotal(endDate, area, level, "86", "2");
                }else {
                    total = statisticsESService.getIndexTotal(endDate, area, level, idx, "2");
                }
                Long total=statisticsESService.getIndexTotal(endDate, area, level, idx, "2");
                result.put("index_" + idx, total);
            }

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

@ -38,19 +38,13 @@ public class ThirdRehabilitationPlanController extends BaseController {
    @RequestMapping(value = "/findTemplateList", method = RequestMethod.GET)
    @ApiOperation(value = "获取康复服务套餐模板列表")
    public String templateList(@ApiParam(name = "patient", value = "居民标识")
    public String templateList(@ApiParam(name = "doctor", value = "医生标识")
                                   @RequestParam(required = true)String doctor,
                               @ApiParam(name = "patient", value = "居民标识")
                                   @RequestParam(required = false)String patient){
        try {
            Long adminTeamId = null;
            if(StringUtils.isNotBlank(patient)) {
                SignFamily signFamily = familyService.findByPatientAndDoctor(patient, getUID());
                adminTeamId = signFamily.getAdminTeamId();
            }else {
                AdminTeam team = teamService.findByLeaderCode(getUID());
                adminTeamId = team.getId();
            }
            return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo(adminTeamId));
//            return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo((long) 646));
            return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo(doctor, patient));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
@ -63,7 +57,6 @@ public class ThirdRehabilitationPlanController extends BaseController {
                                         @RequestParam(required = true)String templateId){
        try {
            return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateDetailInfo(templateId));
//            return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo((long) 646));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
@ -72,14 +65,14 @@ public class ThirdRehabilitationPlanController extends BaseController {
    @RequestMapping(value = "/createTemplate", method = RequestMethod.POST)
    @ApiOperation(value = "创建康复服务套餐模板")
    public String createTemplate(@ApiParam(name = "title", value = "康复服务模板名称")
                                 @RequestParam(required = true) String title){
    public String createTemplate(@ApiParam(name = "doctor", value = "医生标识")
                                     @RequestParam(required = true)String doctor,
                                 @ApiParam(name = "title", value = "康复服务模板名称")
                                    @RequestParam(required = true) String title){
        try {
            AdminTeam team = teamService.findByLeaderCode(getUID());
            Doctor doctor = doctorService.findDoctorByCode(getUID());
            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,doctor,team.getId()));
//            Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
//            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,doctor,(long) 646));
            AdminTeam team = teamService.findByLeaderCode(doctor);
            Doctor d = doctorService.findDoctorByCode(doctor);
            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,d,team.getId()));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
@ -88,15 +81,27 @@ public class ThirdRehabilitationPlanController extends BaseController {
    @RequestMapping(value = "/createTemplateDetail", method = RequestMethod.POST)
    @ApiOperation(value = "创建康复服务套餐模板明细")
    public String createTemplateDetail(@ApiParam(name = "json", value = "康复服务模板明细")
                                 @RequestParam(required = true) String json,
    public String createTemplateDetail(@ApiParam(name = "doctor", value = "医生标识")
                                           @RequestParam(required = true)String doctor,
                                       @ApiParam(name = "json", value = "康复服务模板明细")
                                            @RequestParam(required = true) String json,
                                       @ApiParam(name = "type", value = "create或者edit")
                                       @RequestParam(required = true) String type){
                                            @RequestParam(required = true) String type){
        try {
            Doctor d = doctorService.findDoctorByCode(doctor);
            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplateDetail(json, type, d));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "/deleteTemplate", method = RequestMethod.POST)
    @ApiOperation(value = "删除康复服务套餐模板")
    public String deleteTemplate(@ApiParam(name = "templateId", value = "模板id")
                                 @RequestParam(required = true)String templateId){
        try {
//            Doctor doctor = doctorService.findDoctorByCode(getUID());
//            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,doctor,team.getId()));
            Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
            return write(200, "获取成功", "data", rehabilitationPlanService.createTemplateDetail(json,type,doctor));
            return write(200, "获取成功", "data", rehabilitationPlanService.deleteTemplate(templateId));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
@ -104,14 +109,18 @@ public class ThirdRehabilitationPlanController extends BaseController {
    }
    @RequestMapping(value = "/findServiceItemsByHospital", method = RequestMethod.GET)
    @ApiOperation(value = "根据机构查找服务项目列表")
    public String findServiceItemsByHospital(@ApiParam(name = "patient", value = "居民标识")
                                                 @RequestParam(required = true)String patient){
    @ApiOperation(value = "获取机构服务项目列表")
    public String findServiceItemsByHospital(@ApiParam(name = "doctor", value = "医生标识")
                                                 @RequestParam(required = true)String doctor,
                                             @ApiParam(name = "patient", value = "居民标识")
                                                 @RequestParam(required = false)String patient){
        try {
//            Doctor doctor = doctorService.findDoctorByCode(getUID());
            SignFamily signFamily = familyService.findByPatientAndDoctor(patient, getUID());
            Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
            return write(200, "获取成功", "data", rehabilitationPlanService.findServiceItemsByHospital(signFamily,doctor));
            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, "请求失败");
@ -120,12 +129,27 @@ public class ThirdRehabilitationPlanController extends BaseController {
    @RequestMapping(value = "/createRehabilitationPlan", method = RequestMethod.POST)
    @ApiOperation(value = "创建居民康复计划")
    public String createRehabilitationPlan(@ApiParam(name = "json", value = "康复计划json")
                                 @RequestParam(required = true) String json){
    public String createRehabilitationPlan(@ApiParam(name = "doctor", value = "医生标识")
                                               @RequestParam(required = true)String doctor,
                                           @ApiParam(name = "json", value = "康复计划json")
                                               @RequestParam(required = true) String json){
        try {
            Doctor d = doctorService.findDoctorByCode(doctor);
            return write(200, "获取成功", "data", rehabilitationPlanService.createRehabilitationPlan(json,d));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "/getPatientInfoByDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "根据医生code获取签约居民信息")
    public String getPatientInfoByDoctor(@ApiParam(name = "doctor", value = "医生标识")
                                         @RequestParam(required = true)String doctor,
                                         @ApiParam(name = "patientInfo", value = "居民信息")
                                         @RequestParam(required = false)String patientInfo){
        try {
//            Doctor doctor = doctorService.findDoctorByCode(getUID());
            Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
            return write(200, "获取成功", "data", rehabilitationPlanService.createRehabilitationPlan(json,doctor));
            return write(200, "获取成功", "data", rehabilitationPlanService.getPatientInfoByDoctor(doctor, patientInfo));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");