Browse Source

Merge branch 'master' of http://192.168.1.220:10080/esb/esb

zhenglingfeng 8 years ago
parent
commit
440a99a11f

+ 5 - 1
hos-arbiter/src/main/java/com/yihu/hos/arbiter/configuration/ArbiterServerConfiguration.java

@ -54,7 +54,11 @@ public class ArbiterServerConfiguration {
    @Bean
    public ZbusBroker getZbusBroker() {
        try {
            zbusBroker = new ZbusBroker(this.centralUrl);
            if (isCentral()){
                zbusBroker = new ZbusBroker(this.terminalUrl);
            }else {
                zbusBroker = new ZbusBroker(this.centralUrl);
            }
            return zbusBroker;
        } catch (IOException e) {
            e.printStackTrace();

+ 14 - 3
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ProxyService.java

@ -1,5 +1,6 @@
package com.yihu.hos.arbiter.services;
import com.yihu.hos.arbiter.configuration.ArbiterServerConfiguration;
import com.yihu.hos.core.log.Logger;
import com.yihu.hos.core.log.LoggerFactory;
import com.yihu.hos.web.framework.constant.ServiceFlowConstant;
@ -22,9 +23,9 @@ import java.util.Map;
@Service
public class ProxyService {
    private static final Logger logger = LoggerFactory.getLogger(ProxyService.class);
    @Autowired
    private CamelContext camelContext;
    private CamelContext camelContext;
    private ArbiterServerConfiguration configuration;
    private ZbusBroker zbusBroker;
    private Consumer consumer;
@ -43,7 +44,7 @@ public class ProxyService {
            return;
        }
        consumer = new Consumer(zbusBroker, ServiceFlowConstant.SSH);
        consumer = new Consumer(zbusBroker, ServiceFlowConstant.SSH + "@" + configuration.getTenant());
        try {
            consumer.start(this::proxy);
        } catch (IOException e) {
@ -58,6 +59,16 @@ public class ProxyService {
        this.zbusBroker = zbusBroker;
    }
    @Autowired
    public void setCamelContext(CamelContext camelContext) {
        this.camelContext = camelContext;
    }
    @Autowired
    public void setConfiguration(ArbiterServerConfiguration configuration) {
        this.configuration = configuration;
    }
    @Override
    protected void finalize() throws Throwable {
        consumer.close();

+ 4 - 2
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ServiceFlowService.java

@ -354,10 +354,12 @@ public class ServiceFlowService {
        }
        try {
            Producer producer = new Producer(zbusBroker, ServiceFlowConstant.SSH);
            Producer producer = new Producer(zbusBroker, ServiceFlowConstant.SSH + "@" + header.get("tenant"));
            producer.createMQ();    //确定为创建消息队列需要显示调用
            Message message = new Message();
            message.setHead(header);
            message.setHead("event", header.get("event"));
            message.setHead("tenant", header.get("tenant"));
//            message.setHead(header);
            message.setMethod("POST");
            message.setBody(msg);
            message = producer.sendSync(message);

+ 3 - 1
hos-arbiter/src/main/resources/application.yml

@ -23,8 +23,10 @@ arbiter:
      period: 10000
  central:
    url:
    port: 15555
    store: ./store
  terminal:
    url: http://192.168.131.119:10135
    url: 192.168.131.119:15555
  tenant:
    name: jkzl
---

+ 3 - 0
hos-web-framework/src/main/java/com/yihu/hos/web/framework/util/GridFSUtil.java

@ -77,6 +77,7 @@ public class GridFSUtil {
     */
    public static String uploadFile(String filePath,String saveFileName, Map<String, Object> params) {
        //自定义字段
        Document metaDocument = new Document();
        if (params != null && params.size() > 0) {
            for (Map.Entry<String, Object> entry : params.entrySet()) {
@ -89,6 +90,7 @@ public class GridFSUtil {
        try {
            File readFile = new File(filePath);
            fileInputStream = new FileInputStream(readFile);
            gridFsOperations.delete(Query.query(GridFsCriteria.where("filename").is(saveFileName)));//删除原来的文件,保证唯一
            com.mongodb.gridfs.GridFSFile gridFSFile = gridFsOperations.store(fileInputStream,saveFileName,"",metaDocument);
            if (gridFSFile != null) {
                return saveFileName;
@ -287,6 +289,7 @@ public class GridFSUtil {
        }
        try {
            gridFsOperations.delete(Query.query(GridFsCriteria.where("filename").is(saveFileName)));//删除原来的文件,保证唯一
            com.mongodb.gridfs.GridFSFile gridFSFile = gridFsOperations.store(inputStream, saveFileName, "", metaDocument);
            if (gridFSFile != null) {
                return saveFileName;

+ 1 - 2
src/main/webapp/WEB-INF/ehr/jsp/common/indexJs.jsp

@ -62,7 +62,7 @@
            $(".l-layout-left").css({background: "#dce6f0"})
            var tenantManager ;
            var tenantManager = {} ;
            var userRole = localStorage.getItem("userRole");
            if(userRole=="admin"){
                //是管理中心用户,则添加租户管理模块
@ -105,7 +105,6 @@
                {id: 37, pid: 3, text: '维度类别配置', url: '${contextRoot}/dimension/dimensioncatetory'},
                //用户安全中心
                {id: 7, text: '用户安全', icon: '${staticRoot}/images/index/menu5_icon.png'},
                tenantManager,
                {id: 71, pid: 7, text: '机构管理', url: '${contextRoot}/org/initial'},
                {id: 72, pid: 7, text: '用户管理', url: '${contextRoot}/user/initial'},
                {id: 73, pid: 7, text: '角色管理', url: '${contextRoot}/role/initial'},