Преглед изворни кода

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 пре 5 година
родитељ
комит
a3415d8219

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java

@ -19,7 +19,7 @@ import java.util.Map;
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1
 * @since
 */
public interface BaseOrgDao extends PagingAndSortingRepository<BaseOrgDO, String>, JpaSpecificationExecutor<BaseOrgDO>  {

+ 0 - 4
common/common-util/pom.xml

@ -82,10 +82,6 @@
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>

+ 7 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -415,7 +415,13 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    public boolean setRolePhth(String loginType, OAuth2AccessToken token, String id, StringRedisTemplate redisTemplate) {
        if (org.apache.commons.lang.StringUtils.isBlank(loginType) || "1".equals(loginType) || "2".equals(loginType) || "3".equals(loginType) || "4".equals(loginType)) { //1或默认查找user表,为平台管理员账号
        if (org.apache.commons.lang.StringUtils.isBlank(loginType) || "1".equals(loginType)) { //1或默认查找user表,为平台管理员账号
            String key = "wlyy2:auth:token:" + token.getValue();
            redisTemplate.opsForValue().set(key, "/**");
            redisTemplate.expire(key, token.getExpiresIn(), TimeUnit.SECONDS);
        } else if ("2".equals(loginType)) {//2.为医生账号
        } else if ("3".equals(loginType) || "4".equals(loginType)) { //3.患者账号
            String key = "wlyy2:auth:token:" + token.getValue();
            redisTemplate.opsForValue().set(key, "/**");
            redisTemplate.expire(key, token.getExpiresIn(), TimeUnit.SECONDS);

+ 1 - 1
server/svr-authentication/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-authentication
    name: svr-authentication-lyx
  cloud:
    config:
      failFast: true

+ 3 - 2
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/dfs/FastDFSController.java

@ -3,7 +3,6 @@ package com.yihu.jw.healthyhouse.controller.dfs;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.fastdfs.config.FastDFSConfig;
import com.yihu.jw.healthyhouse.model.dfs.FileResource;
import com.yihu.jw.healthyhouse.service.dfs.FileResourceService;
import com.yihu.jw.restmodel.web.Envelop;
@ -22,7 +21,9 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.*;
import java.util.Base64;
import java.util.List;
import java.util.Map;
/**
 *文件服务

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital-hwj
    name: svr-internet-hospital-lyx
  cloud:
    config:
      failFast: true

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java

@ -15,8 +15,8 @@ import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.service.FileUploadService;
import com.yihu.jw.service.SpecialistHospitalServiceItemService;
import com.yihu.jw.service.SpecialistService;
import com.yihu.jw.util.HttpClientUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;

+ 24 - 24
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/util/ImUtill.java

@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
public class ImUtill {
    @Autowired
    private HttpClientUtil HttpClientUtil;
    private SpHttpClientUtil SpHttpClientUtil;
    @Value("${im.im_list_get}")
    private String im_host;
@ -75,7 +75,7 @@ public class ImUtill {
        params.put("sender_name", receiverId);
        params.put("content_type", contentType);
        params.put("content", content);
        String response = HttpClientUtil.postBody(imAddr, params);
        String response = SpHttpClientUtil.postBody(imAddr, params);
        return response;
    }
@ -101,7 +101,7 @@ public class ImUtill {
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        String response = SpHttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
@ -110,7 +110,7 @@ public class ImUtill {
        JSONObject params = new JSONObject();
        params.put("topic_id", topicId);
        params.put("data", jsonValue);
        HttpClientUtil.putBody(imAddr, params);
        SpHttpClientUtil.putBody(imAddr, params);
    }
    /**
@ -138,7 +138,7 @@ public class ImUtill {
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        String response = SpHttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
@ -163,7 +163,7 @@ public class ImUtill {
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        String response = SpHttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
@ -198,7 +198,7 @@ public class ImUtill {
        if (endTime != null) {
            imAddr += ("&endTime=" + endTime);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        String response = SpHttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
@ -231,7 +231,7 @@ public class ImUtill {
        if (endTime != null) {
            imAddr += ("&endTime=" + endTime);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        String response = SpHttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
@ -251,7 +251,7 @@ public class ImUtill {
        params.put("content", content);
        params.put("session_id", sessionId);
        params.put("business_type", businessType);
        String response = HttpClientUtil.postBody(imAddr, params);
        String response = SpHttpClientUtil.postBody(imAddr, params);
        return response;
    }
@ -264,7 +264,7 @@ public class ImUtill {
    public String updateSessionStatus(String sessionId, String status) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/status?status=" + status + "&sessionId=" + sessionId;
        JSONObject params = new JSONObject();
        String response = HttpClientUtil.postBody(imAddr, params);
        String response = SpHttpClientUtil.postBody(imAddr, params);
        return response;
    }
@ -277,7 +277,7 @@ public class ImUtill {
    public String updateTopicEvaluate(String sessionId, String status) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/status?status=" + status + "&sessionId=" + sessionId;
        JSONObject params = new JSONObject();
        String response = HttpClientUtil.postBody(imAddr, params);
        String response = SpHttpClientUtil.postBody(imAddr, params);
        return response;
    }
@ -298,7 +298,7 @@ public class ImUtill {
        params.put("content", content);
        params.put("topic_id", topicId);
        params.put("agent", agent);
        String response = HttpClientUtil.postBody(url, params);
        String response = SpHttpClientUtil.postBody(url, params);
        return response;
    }
@ -318,7 +318,7 @@ public class ImUtill {
        params.put("into_user", intoUser);
        params.put("into_user_name", intoUserName);
        params.put("content", content);
        String response = HttpClientUtil.postBody(url, params);
        String response = SpHttpClientUtil.postBody(url, params);
        return response;
    }
@ -337,7 +337,7 @@ public class ImUtill {
        params.put("end_user", endUser);
        params.put("end_user_name", endUserName);
        params.put("topic_id", topicId);
        String ret = HttpClientUtil.postBody(imAddr, params);
        String ret = SpHttpClientUtil.postBody(imAddr, params);
        JSONObject obj = null;
        try {
            obj = new JSONObject(ret);
@ -358,7 +358,7 @@ public class ImUtill {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/participants/" + user;
        JSONObject params = new JSONObject();
        params.put("user", user + ":" + 0);
        HttpClientUtil.putBody(imAddr, params);
        SpHttpClientUtil.putBody(imAddr, params);
    }
    /**
@ -377,7 +377,7 @@ public class ImUtill {
        params.put("messages", messages.toString());
        params.put("session_id", sessionId);
        params.put("session_type", sessionType);
        String ret = HttpClientUtil.postBody(imAddr, params);
        String ret = SpHttpClientUtil.postBody(imAddr, params);
        JSONObject obj = null;
        try {
            obj = new JSONObject(ret);
@ -394,7 +394,7 @@ public class ImUtill {
        Boolean re = false;
        String url = im_host + "api/v2/sessions/isExist?session_id="+sessionId;
        JSONObject params = new JSONObject();
        String ret = HttpClientUtil.get(url, "UTF-8");
        String ret = SpHttpClientUtil.get(url, "UTF-8");
        JSONObject obj = null;
        try {
            obj = new JSONObject(ret);
@ -417,7 +417,7 @@ public class ImUtill {
        params.put("session_name", sessionName);
        params.put("session_type", sessionType);
        params.put("session_id", sessionId);
        String ret = HttpClientUtil.postBody(imAddr, params);
        String ret = SpHttpClientUtil.postBody(imAddr, params);
        JSONObject obj = null;
        try {
            obj = new JSONObject(ret);
@ -454,7 +454,7 @@ public class ImUtill {
                + "api/v2/sessions/topic/" + topicId + "/messages?topic_id=" + topicId + "&end=" + startMsgId
                + "&start=" + (endMsgId == null ? "" : endMsgId) + "&page=" + page + "&pagesize=" + pagesize + "&user=" + uid;
        try {
            String ret = HttpClientUtil.get(url, "UTF-8");
            String ret = SpHttpClientUtil.get(url, "UTF-8");
            JSONObject obj = new JSONObject(ret);
            if (obj.getInt("status") == -1) {
                throw new RuntimeException(obj.getString("message"));
@ -470,7 +470,7 @@ public class ImUtill {
    public JSONArray getSessionMessage(String sessionId, String startMsgId, String endMsgId, int page, int pagesize, String uid) {
        String url = im_host + "api/v2/sessions/" + sessionId + "/messages?session_id=" + sessionId + "&user=" + uid + "&start_message_id=" + startMsgId + "&end_message_id=" + endMsgId + "&page=" + page + "&pagesize=" + pagesize;
        try {
            String ret = HttpClientUtil.get(url, "UTF-8");
            String ret = SpHttpClientUtil.get(url, "UTF-8");
            JSONArray obj = new JSONArray(ret);
            return obj;
        } catch (Exception e) {
@ -494,7 +494,7 @@ public class ImUtill {
            params.put("user_id", userId);
            params.put("old_user_id", oldUserId);
            params.put("session_id", sessionId);
            String ret = HttpClientUtil.postBody(url, params);
            String ret = SpHttpClientUtil.postBody(url, params);
            JSONObject obj = new JSONObject(ret);
            if (obj.getInt("status") == -1) {
                throw new RuntimeException("人员更换失败!");
@ -516,7 +516,7 @@ public class ImUtill {
    public JSONObject getTopic(String topicId) throws Exception {
        String url = im_host + "api/v2/sessions/topics/" + topicId + "?topic_id=" + topicId;
        try {
            String ret = HttpClientUtil.get(url, "utf-8");
            String ret = SpHttpClientUtil.get(url, "utf-8");
            JSONObject obj = new JSONObject(ret);
            if (obj.getInt("status") == -1) {
                throw new RuntimeException("获取议题失败!");
@ -538,7 +538,7 @@ public class ImUtill {
    public JSONArray getParticipants(String sessionId) {
        String url = im_host + "api/v2/sessions/" + sessionId + "/participants?session_id=" + sessionId;
        try {
            String ret = HttpClientUtil.get(url, "utf-8");
            String ret = SpHttpClientUtil.get(url, "utf-8");
            return new JSONArray(ret);
        } catch (Exception e) {
            throw new RuntimeException("获取议题失败!");
@ -555,7 +555,7 @@ public class ImUtill {
    public JSONArray getSessions(String sessionId) {
        String url = im_host + "api/v2/sessions/" + sessionId + "/participants?session_id=" + sessionId;
        try {
            String ret = HttpClientUtil.get(url, "utf-8");
            String ret = SpHttpClientUtil.get(url, "utf-8");
            return new JSONArray(ret);
        } catch (Exception e) {
            throw new RuntimeException("获取议题失败!");

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/util/HttpClientUtil.java

@ -20,7 +20,7 @@ import java.io.IOException;
 * Created by hmf on 2018/9/3.
 */
@Component
public class HttpClientUtil {
public class SpHttpClientUtil {
    public String postBody(String url, JSONObject params) {
        RestTemplate restTemplate = new RestTemplate();

+ 1 - 1
svr/svr-wlyy-specialist/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-wlyy-specialist
    name: svr-wlyy-specialist-lyx
  cloud:
    config:
      failFast: true