| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.code.BaseGenerator; |
| | | import com.java110.code.back.BaseGenerator; |
| | | import com.java110.code.web.GeneratorStart; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | generatorComponentHtml(data); |
| | | generatorComponentJs(data); |
| | | generatorComponentJava(data); |
| | | genneratorIListSmo(data); |
| | | genneratorListSmoImpl(data); |
| | | // genneratorIListSmo(data); |
| | | // genneratorListSmoImpl(data); |
| | | |
| | | |
| | | genneratorListListener(data); |
| | | // genneratorListListener(data); |
| | | |
| | | genneratorServiceCodeConstant(data); |
| | | // genneratorServiceCodeConstant(data); |
| | | |
| | | |
| | | } |
| | |
| | | JSONObject flow = flows.getJSONObject(flowIndex); |
| | | String showAffirmPage = data.getBoolean("needAffirm") ? " || " + data.getString("templateCode") + "Info.index == " + flows.size() : ""; |
| | | allStep.append("<div v-if=\"" + data.getString("templateCode") + "Info.index == " + flowIndex + showAffirmPage + "\">\n" + |
| | | " <vc:create name=\"" + flow.getString("vcName") + "\"\n" + |
| | | " <vc:create path=\"" + flow.getString("vcName") + "\"\n" + |
| | | " callBackListener=\"" + data.getString("templateCode") + "\"\n" + |
| | | " callBackFunction=\"notify\"\n" + |
| | | " ></vc:create>\n" + |
| | |
| | | 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"); |
| | | |
| | |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/api/listener/" + data.getString("templateCode") + "/Binding" + toUpperCaseFirstOne(data.getString("templateCode")) + "Listener.java"; |
| | | + "out/api/listener/" + data.getString("templateCode") + "/" + toUpperCaseFirstOne(data.getString("templateCode")) + "Binding"+"Listener.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |