/** * 更新模板文件和系统内容设定 * * @return */ @Action( value = "updateTemplatesetT", results = {@Result(name = "json", type = "json")}) public String updateTemplatesetT() { TemplatesetT tst = new TemplatesetT(); tst.setTsid(this.getTsid()); tst.setTemplateurl(this.getTemplateurl()); tst.setSystemcontent(this.getSystemcontent().trim()); tst.setBuildhtmlpath(this.getBuildhtmlpath()); tst.setCreatetime(BaseTools.systemtime()); tst.setCreatorid(BaseTools.adminCreateId()); tst.setSign(this.getSign()); // 获取模板主题和状态 TemplateT tt = new TemplateT(); tt = this.getTemplateTService().findTemplateBysign(this.getSign(), "1"); if (tt != null) { tst.setThemeid(tt.getThemeid()); tst.setThemename(tt.getThemename()); tst.setStatus(tt.getStatus()); } if (this.getTemplatesetTService().updateTemplatesetT(tst) > 0) { this.setSucflag(true); return "json"; } this.setSucflag(false); return "json"; }
/** 获取所有模板文件路径 */ @Action( value = "getAllTemplate", results = {@Result(name = "json", type = "json")}) public String getAllTemplate() { List<TemplateT> list = this.getTemplateTService().findAllTemplateWithNoParam(BaseTools.adminCreateId(), "1"); if (list != null) { this.setTemplatestrs(""); this.setTemplatestrs("<option value='-1'>---请选择---</option>"); for (Iterator<TemplateT> it = list.iterator(); it.hasNext(); ) { TemplateT tt = (TemplateT) it.next(); this.templatestrs += "<option value='" + tt.getUrl() + "," + tt.getSign() + "'>" + tt.getUrl() + "</option>"; } this.setSucflag(true); return "json"; } this.setSucflag(false); return "json"; }