| | |
| | | genneratorListSmoImpl(data); |
| | | genneratorListListener(data); |
| | | |
| | | genneratorServiceCodeConstant(data); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 生成常量类 |
| | | * @param data |
| | | */ |
| | | private void genneratorServiceCodeConstant(JSONObject data) { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/constant/ServiceCodeConstant.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/constant/" + data.getString("templateCode") + "/ServiceCode" + toUpperCaseFirstOne(data.getString("templateCode")) + "Constant.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | |
| | | } |
| | | |
| | |
| | | JSONArray columns = data.getJSONArray("columns"); |
| | | for (int columnIndex = 0; columnIndex < columns.size(); columnIndex++) { |
| | | JSONObject column = columns.getJSONObject(columnIndex); |
| | | if (column.getBoolean("hasDefaultValue")) { |
| | | if ("none".equals(column.getString("inputType"))) { |
| | | continue; |
| | | } |
| | | String required = column.getBoolean("required") ? "必填" : "选填"; |
| | |
| | | " <option selected disabled value=\"\">"+ required + ",请选择" + column.getString("cnCode") + "</option>\n" + |
| | | " " +option+ |
| | | " </select>"; |
| | | } else { |
| | | } else if("textarea".equals(column.getString("inputType"))){ |
| | | inputStr = "<textarea placeholder=\"" + required + ",请填写" + column.getString("cnCode") + "\" class=\"form-control\""+ |
| | | " v-model=\"add" + toUpperCaseFirstOne(data.getString("templateCode")) + "Info."+column.getString("code")+"\">"+ |
| | | "</textarea>"; |
| | | }else { |
| | | inputStr = " <input v-model=\"add" + toUpperCaseFirstOne(data.getString("templateCode")) + "Info."+column.getString("code")+"\" " + |
| | | " type=\"text\" placeholder=\"" + required + ",请填写" + column.getString("cnCode") + "\" class=\"form-control\">\n"; |
| | | } |
| | |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/component/add-" + data.getString("templateCode") + "/add" + toUpperCaseFirstOne(data.getString("templateCode")) + ".html"; |
| | | + "out/web/component/"+data.getString("templateCode")+"Package/add-" + data.getString("templateCode") + "/add" + toUpperCaseFirstOne(data.getString("templateCode")) + ".html"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/component/add-" + data.getString("templateCode") + "/add" + toUpperCaseFirstOne(data.getString("templateCode")) + ".js"; |
| | | + "out/web/component/"+data.getString("templateCode")+"Package/add-" + data.getString("templateCode") + "/add" + toUpperCaseFirstOne(data.getString("templateCode")) + ".js"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |