Browse Source

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

Airhead 8 years ago
parent
commit
8561430978

+ 2 - 2
hos-broker/src/main/java/com/yihu/hos/common/compiler/CamelCompiler.java

@ -35,7 +35,6 @@ public class CamelCompiler {
     */
    public static String compiler(String filePath,String packageName,String oldClassName,String newClassName,String newCron) throws IOException {
        String classPath = CamelCompiler.class.getProtectionDomain().getCodeSource().getLocation().getPath() ;
        classPath = classPath.substring(1);
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        // 建立DiagnosticCollector对象
        DiagnosticCollector diagnostics = new DiagnosticCollector();
@ -60,6 +59,7 @@ public class CamelCompiler {
                return null;
            }else {
                String className = file.getName().replace(".java", ".class");
                classPath = classPath.substring(1);
                return classPath  + packageName  + className;
            }
        }
@ -69,7 +69,6 @@ public class CamelCompiler {
    public static String copyProcess (String filePath,String packageName,String oldClassName) throws IOException {
        String classPath = CamelCompiler.class.getProtectionDomain().getCodeSource().getLocation().getPath() ;
        classPath = classPath.substring(1);
        String newPath = String.format(classPathTemplate, packageName, oldClassName);
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
@ -101,6 +100,7 @@ public class CamelCompiler {
                    return null;
                }else {
                    String resultPath = toFIle.getName().replace(".java", ".class");
                    classPath = classPath.substring(1);
                    return classPath + packageName  + resultPath;
                }
            }else {

+ 1 - 1
hos-broker/src/main/java/com/yihu/hos/controllers/ESBCamelController.java

@ -120,7 +120,7 @@ public class ESBCamelController {
    }
    @RequestMapping(value = "/genCamelFile", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
    @RequestMapping(value = "/genCamelFile", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "生成新的camel文件", produces = "application/json", notes = "生成新的camel文件")
    public Result genCamelFile(

+ 4 - 4
hos-core/src/main/java/com/yihu/hos/core/datatype/ClassFileUtil.java

@ -75,9 +75,9 @@ public class ClassFileUtil {
            }
            out.close();
            in.close();
            return false;
        } catch (Exception e) {
            return true;
        } catch (Exception e) {
            return false;
        }
    }
@ -88,9 +88,9 @@ public class ClassFileUtil {
            if (file.isFile() && file.exists()) {
                file.delete();
            }
            return false;
        } catch (Exception e) {
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

+ 4 - 0
src/main/java/com/yihu/hos/system/service/FlowManager.java

@ -380,6 +380,7 @@ public class FlowManager implements IFlowManage {
                processClass.setFlowId(newFlow.getId());
                processClass.setType(Constants.FLOW_TYPE_PROCESSOR);
                flowClassDao.saveEntity(processClass);
                processClass.setIsUpdate("1");
                sendUpdateMessage(newFlow.getCode(), processClass, Constants.FLOW_OP_ADD);
//                copyProcessor(process.getClassPath(),proPath.toString(),process.getClassName());
@ -413,6 +414,7 @@ public class FlowManager implements IFlowManage {
            newFlowClass.setFlowId(newFlow.getId());
            newFlowClass.setType(Constants.FLOW_TYPE_ROUTE);
            flowClassDao.saveEntity(newFlowClass);
            newFlowClass.setIsUpdate("1");
            sendUpdateMessage(newFlow.getCode(), newFlowClass, Constants.FLOW_OP_ADD);
//            genNewRoutefile(flowTemp.getClassPath(),basePath.toString(),flowTemp.getClassName(),newClassName,newCron);
@ -451,6 +453,7 @@ public class FlowManager implements IFlowManage {
            }
            Map<String,String> params  = new HashMap<>();
            params.put("type",Constants.FLOW_TYPE_ROUTE);
            params.put("filePath", flowTemp.getClassPath());
            params.put("packageName", basePath.toString());
            params.put("oldClassName", flowTemp.getClassName());
@ -462,6 +465,7 @@ public class FlowManager implements IFlowManage {
                boolean succ = (boolean) body.get("successFlg");
                if (succ){
                    //route文件生成成功,发送消息
                    flowClass.setIsUpdate("1");
                    sendUpdateMessage(flow.getCode(), flowClass, Constants.FLOW_OP_UPDATE);
                    return flowId;
                }else {

+ 1 - 0
src/main/webapp/WEB-INF/ehr/jsp/system/flow/editorFlow.jsp

@ -144,4 +144,5 @@
    .content{height:100%;padding-top:10px;position:absolute;z-index:1;width:100%;overflow-x:hidden;}
    .m-form-bottom{position:absolute;z-index:2;bottom:0;left:0;width:100%;background:#f5f8fa;padding:0; height: auto;}
    .flows{    border: 1px solid deepskyblue;margin-bottom: 10px;width: 550px;}
    .btnIconGrayUp.required{border: #FF7777 1px solid; float: left;}
</style>

+ 9 - 2
src/main/webapp/WEB-INF/ehr/jsp/system/flow/editorFlowJs.jsp

@ -66,7 +66,8 @@
            $("#div_info_form").ligerAutoForm({
                data:data,
                validate:{
                    name:"required"
                    name:"required",
                    code:"required"
                },
            });
@ -113,10 +114,16 @@
            $(".m-form-bottom").on("click","#btnSave",function () {
                fileType =liger.get("fileType").selectedValue;
                if($("#iconUrl").val()=="") {
                    $("#iconUrl").addClass("required");
                    if(!$("#div_info_form").ligerAutoForm("validate")){
                        return;
                    }
                    return;
                }
                if(!$("#div_info_form").ligerAutoForm("validate")){
                    return;
                }
                var index =newMaxFormIndex();
                debugger
                for (var i = index; i > 0; i--) {