| | |
| | | |
| | | genneratorListListener(data); |
| | | |
| | | //genneratorServiceCodeConstant(data); |
| | | genneratorServiceCodeConstant(data); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + toUpperCaseFirstOne(_currentObj.getString("templateCode")) + "View.html"; |
| | | + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + _currentObj.getString("templateCode") + "View.html"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + toUpperCaseFirstOne(_currentObj.getString("templateCode")) + "View.js"; |
| | | + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + _currentObj.getString("templateCode") + "View.js"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | |
| | | * @param data |
| | | */ |
| | | private void genneratorServiceCodeConstant(JSONObject data) { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/constant/ServiceCodeConstant.java").getFile()); |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/relationship/constant/ServiceCodeConstant.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | fileContext = super.replaceBindingTemplateContext(fileContext, data); |
| | | |
| | | String variable = data.getString("package").indexOf("Package") >0 ? |
| | | data.getString("package").replace("Package","") : |
| | | data.getString("package"); |
| | | variable += ("." + data.getString("templateCode")); |
| | | fileContext = fileContext.replace("@@constantVariable@@", variable); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/constant/" + data.getString("templateCode") + "/ServiceCode" + toUpperCaseFirstOne(data.getString("templateCode")) + "Constant.java"; |
| | | + "out/relationship/constant/" + data.getString("templateCode") + "/ServiceCode" + toUpperCaseFirstOne(data.getString("templateCode")) + "Constant.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | |
| | | } |
| | | |
| | | |
| | | validateInfo.append("vc.emit('" + flow.getString("vcName") + "', 'onIndex', vc.component.serviceBindingInfo.index);\n"); |
| | | validateInfo.append("vc.emit('" + flow.getString("vcName") + "', 'onIndex', vc.component."+data.getString("templateCode")+"Info.index);\n"); |
| | | |
| | | //如果相应组件不存在,则根据组件配置自动生成 |
| | | if (!flow.getBoolean("existsComponent")) { |
| | |
| | | fileContext = fileContext.replace("@@jumpUrl@@", data.getString("successUrl")); |
| | | |
| | | // 替换 数据校验部分代码 |
| | | |
| | | String needCheckCurrentData = "var _currentData = vc.component."+data.getString("templateCode")+"Info.infos[vc.component."+data.getString("templateCode")+"Info.index];\n" + |
| | | " if( _currentData == null || _currentData == undefined){\n" + |
| | | " vc.message(\"请选择或填写必选信息\");\n" + |
| | | " return ;\n" + |
| | | " }"; |
| | | |
| | | if(data.getBoolean("needAffirm")){ |
| | | fileContext = fileContext.replace("@@needCheckCurrentData@@", ""); |
| | | }else{ |
| | | fileContext = fileContext.replace("@@needCheckCurrentData@@", needCheckCurrentData); |
| | | } |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | |
| | | ifCode.append("" + |
| | | " if(!hasKey("+vcName+", \"" + flowObj.getString("flowKey") + "\")){\n" + |
| | | " "+vcName+".put(\"" + flowObj.getString("flowKey") + "\", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_" + flowObj.getString("flowKey") + "));\n" + |
| | | " "+vcName+".put(\"userId\", context.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID));\n" + |
| | | " businesses.add(add" + toUpperCaseFirstOne(flowObj.getString("businessName")) + "("+vcName+", context));\n" + |
| | | " }\n"); |
| | | |