当前位置: 首页 > news >正文

城阳 网站建设开发网站用那个平台

城阳 网站建设,开发网站用那个平台,互联网建网站,网站悬浮上一章搭建了登录界面的雏形和抽取了登录接口。给多组使用登录和菜单功能提供预留#xff0c;做到不强行入侵别人业务。任何产品只需要按自己表实现登录接口后配置到容器即可共用登录界面和菜单部分。最后自己的用户关联到JRT角色表即可。 登录效果 这次构建菜单体系 首先用…上一章搭建了登录界面的雏形和抽取了登录接口。给多组使用登录和菜单功能提供预留做到不强行入侵别人业务。任何产品只需要按自己表实现登录接口后配置到容器即可共用登录界面和菜单部分。最后自己的用户关联到JRT角色表即可。 登录效果 这次构建菜单体系 首先用dbo.JRTForm描述页面路径资源 用dbo.JRTFormFunction描述页面的控制点 然后用菜单dbo.JRTMenu表描述菜单树 最后用角色和角色菜单把菜单数据通过角色暴露给业务模块 这样业务模块就很自由了可以自由的用自己的用户表自己的用户角色关系。最终只需要有关系对应上JRTRole表就行了在登录接口实现执行角色就能共用整套登录和菜单体系了。比如检验的用户登录的工作组。 登录接口实现类按具体表和菜单暴露的角色表对接JRT开头的表是给大家共用的 效果 JRT提供执行SQL语句的api不到万不得已的时候JRT不鼓励用SQL语句写业务因为一旦用SQL之后跨数据库就成为无稽之谈目前没有发现使用SQL语句的必要性。 系统页面维护后台代码 import JRT.Core.CustomAttributes.Trans; import JRT.Core.Dto.OutValue; import JRT.Core.Util.TxtUtil; import JRTBLLBase.BaseHttpHandlerNoSession; import JRTBLLBase.Helper; import JRT.Core.Dto.HashParam; import JRT.Core.Dto.ParamDto; import JRT.Core.Dto.OutParam; import JRT.Model.Entity.*; import JRT.Core.Util.Convert; import JRT.Core.MultiPlatform.JRTContext;import java.io.File; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List;/*** 界面资源维护的后台代码*/ public class ashJRTForm extends BaseHttpHandlerNoSession {/*** 保存数据,前台按表的属性名提交** return 字符串*/public String SaveJRTForm() throws Exception {JRTForm dto new JRTForm();//主键dto.RowID Helper.ValidParam(JRTContext.GetRequest(Request, RowID), dto.RowID);//名称dto.CName Helper.ValidParam(JRTContext.GetRequest(Request, CName), dto.CName);//序号dto.Sequence Helper.ValidParam(JRTContext.GetRequest(Request, Sequence), dto.Sequence);//激活 {1:true,0:false}dto.Active Helper.ValidParam(JRTContext.GetRequest(Request, Active), dto.Active);//相对路径dto.Path Helper.ValidParam(JRTContext.GetRequest(Request, Path), dto.Path);//说明dto.Remark Helper.ValidParam(JRTContext.GetRequest(Request, Remark), dto.Remark);//帮助信息dto.FormHelp Helper.ValidParam(JRTContext.GetRequest(Request, FormHelp), dto.FormHelp);//宽度dto.HelpWidth Helper.ValidParam(JRTContext.GetRequest(Request, HelpWidth), dto.HelpWidth);//高度dto.HelpHeight Helper.ValidParam(JRTContext.GetRequest(Request, HelpHeight), dto.HelpHeight);//帮助文档路径dto.HelpDoc Helper.ValidParam(JRTContext.GetRequest(Request, HelpDoc), dto.HelpDoc);OutParam out new OutParam();int ret 0;//更新if (dto.RowID 0) {ret EntityManager().Update(dto, null, out, null, null, null);}//插入数据else {ret EntityManager().Save(dto, out);}if (ret 1) {return Helper.Success();} else {return Helper.Error(out);}}/*** 删除数据多个RowID以上尖号分割** return 字符串*/Transpublic String DeleteJRTForm() throws Exception {String RowIDS Helper.ValidParam(JRTContext.GetRequest(Request, RowIDS), );if (RowIDS.isEmpty()) {return Helper.Error(请传入要删除数据的RowID,多个以^分割!);}//分割主键String[] arr RowIDS.split(^);//循环删除数据for (int i 0; i arr.length; i) {int formDR Convert.ToInt32(arr[i]);//删除页面功能点ListJRTFormFunction formFunList EntityManager().FindByColVal(JRTFormFunction.class, FormDR, formDR);if (formFunList ! null formFunList.size() 0) {for (JRTFormFunction f : formFunList) {int ret EntityManager().Remove(f, ErrRet());if (ret ! 1) {throw new Exception(Err.GetString());}}}//删除页面数据int ret EntityManager().RemoveById(JRTForm.class, formDR, ErrRet());if (ret ! 1) {throw new Exception(Err.GetString());}}return Helper.Success();}/*** 查询数据,前台按表的属性名提交** return 字符串*/public String QryJRTForm() throws Exception {//预留的取前台参数代码//参数ListParamDto para new ArrayList();//sql连接符号ListString joiner new ArrayList();//sql比较符号ListString operators new ArrayList();//模糊查询String Filter Helper.ValidParam(JRTContext.GetRequest(Request, Filter), );//预留参数//主键String RowID Helper.ValidParam(JRTContext.GetRequest(Request, RowID), );//名称String CName Helper.ValidParam(JRTContext.GetRequest(Request, CName), );//序号String Sequence Helper.ValidParam(JRTContext.GetRequest(Request, Sequence), );//激活 {1:true,0:false}String Active Helper.ValidParam(JRTContext.GetRequest(Request, Active), );//相对路径String Path Helper.ValidParam(JRTContext.GetRequest(Request, Path), );//说明String Remark Helper.ValidParam(JRTContext.GetRequest(Request, Remark), );//帮助信息String FormHelp Helper.ValidParam(JRTContext.GetRequest(Request, FormHelp), );//宽度String HelpWidth Helper.ValidParam(JRTContext.GetRequest(Request, HelpWidth), );//高度String HelpHeight Helper.ValidParam(JRTContext.GetRequest(Request, HelpHeight), );//帮助文档路径String HelpDoc Helper.ValidParam(JRTContext.GetRequest(Request, HelpDoc), );//模糊查询if (!Filter.isEmpty()) {ParamDto p null;//名称p new ParamDto();p.Key CName;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//相对路径p new ParamDto();p.Key Path;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//说明p new ParamDto();p.Key Remark;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//帮助信息p new ParamDto();p.Key FormHelp;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//帮助文档路径p new ParamDto();p.Key HelpDoc;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);}//调用查询String json EntityManager().QueryAllWithFK(JRTForm.class, para, , true, -1, -1, , joiner, operators);return json;}/*** 得到页面的功能点** return*/public String GetFormFunction() throws Exception {int FormDR Helper.ValidParam(JRTContext.GetRequest(Request, FormDR), 0);ListFormFunctionDto retList GetFunctionList(FormDR);if (retList null || retList.size() 0) {return [{\RowID\:\-2\,\Name\:\ \无功能点控制\ \}];} else {//取功能点名称for (FormFunctionDto one : retList) {if (one.FunctionDR ! null) {JRTFunction fun EntityManager().DolerGet(JRTFunction.class, one.FunctionDR);one.FunctionName fun.CName;}}}return Helper.Object2Json(retList);}/*** 得到页面功能点列表** param formDR 页面主键* return 页面功能点* throws Exception*/private ListFormFunctionDto GetFunctionList(int formDR) throws Exception {ListFormFunctionDto retList new ArrayList();HashParam hs new HashParam();hs.Add(FormDR, formDR);//页面功能点ListFormFunctionDto formFunctions EntityManager().FindAll(FormFunctionDto.class, hs, , -1, -1, , null, null);//读取指定文件中的功能点//基地址String basePath JRTContext.MapPath();//得到页面数据JRTForm form EntityManager().GetById(JRTForm.class, formDR);if (form ! null) {String codeStr GetFormCode(form, basePath);//调用方法读取代码中功能点集合ListString functionCodes GetFunctionCode(codeStr);//功能点JRTFunction functionOne null;//实际页面功能点ListJRTFunction realFunctions new ArrayList();if (functionCodes ! null) {for (String functionCode : functionCodes) {functionOne EntityManager().GetByColVal(JRTFunction.class, Code, functionCode);if (functionOne ! null) {realFunctions.add(functionOne);} else {JRTFunction funcDto new JRTFunction();funcDto.Active true;funcDto.CName functionCode;funcDto.Code functionCode;funcDto.Sequence 1;OutValue key new OutValue();int ret EntityManager().Save(funcDto, key, ErrRet());if (ret 1) {funcDto.RowID key.GetInerger();realFunctions.add(funcDto);}}}}//遍历页面功能点检测页面不提供的功能点数据库有页面没有的功能点for (FormFunctionDto f : formFunctions) {boolean isHas false;for (JRTFunction rf : realFunctions) {if (rf.RowID f.FunctionDR) {isHas true;break;}}if (isHas false) {//应该删除的数据f.FormDR -1;}retList.add(f);}//页面有数据库没有的功能点功能点for (JRTFunction rf1 : realFunctions) {boolean isHas false;for (FormFunctionDto f1 : formFunctions) {if (rf1.RowID f1.FunctionDR) {isHas true;break;}}if (isHas false) {FormFunctionDto dto new FormFunctionDto();//该添加的数据dto.RowID -1;dto.FormDR formDR;dto.FunctionDR rf1.RowID;retList.add(dto);}}return retList;} else {return retList;}}/*** 得到页面的代码** param form 页面* param basePath 根地址* return 页面代码* throws Exception*/private String GetFormCode(JRTForm form, String basePath) throws Exception {String formPath form.Path;formPath formPath.split(\\?)[0];//路径存在if (formPath ! null formPath.length() 1) {formPath formPath.replace(../../, ).replace(../, ).replace(/, (char) 0 );String[] arr formPath.split((char) 0 );String pathR arr[0];for (int i 1; i arr.length; i) {pathR Paths.get(pathR, arr[i]).toString();}formPath Paths.get(basePath, pathR).toString();if (formPath.toLowerCase().contains(.pdf)) {return ;}int index formPath.indexOf(.aspx);formPath formPath.substring(0, index 5);File fi new File(formPath);//如果文件存在,读取文件信息if (fi.exists()) {//读取所有代码String codeStr TxtUtil.ReadTextStr(formPath);return codeStr;}}return ;}/*** 处理功能点的特色字符** param data 数据* return 剔除特殊字符的数据*/public String DealSpChar(String data) {for (int i 0; i 31; i) {data data.replace((char) i , );}data data.replace((char) 127 , );data data.replace(\r\n, );data data.replace(;, );return data;}/*** 得到页面功能点代码** param codeStr 页面代码串* return*/private ListString GetFunctionCode(String codeStr) {ListString codes new ArrayList();int curIndex 0;int startIndex 0;while (curIndex 0) {String funStrFlag1 SYSPageCommonInfo.GetFunction(;curIndex codeStr.indexOf(funStrFlag1, startIndex);if (curIndex 0) {//得到功能点后下标int endIndex codeStr.indexOf(), curIndex funStrFlag1.length() 1);//得到功能点串String funStr codeStr.substring(curIndex funStrFlag1.length() 1, endIndex - 1);funStr DealSpChar(funStr);//没有就添加到集合,有就不要if (!codes.contains(funStr)) {codes.add(funStr);}curIndex 0;startIndex endIndex;continue;}}return codes;}/*** 同步功能点** return* throws Exception*/public String RsyncFun() throws Exception {int formDR Helper.ValidParam(JRTContext.GetRequest(Request, FormDR), 0);ListFormFunctionDto list GetFunctionList(formDR);if (list ! null list.size() 0) {for (FormFunctionDto v : list) {//删除if (v.FormDR -1) {int ret EntityManager().RemoveById(JRTFormFunction.class, v.RowID, ErrRet());}//添加if (v.RowID -1) {int ret EntityManager().Save(v);}}}return Helper.Success();}/*** 页面功能点返回实体*/public static class FormFunctionDto extends JRTFormFunction {/*** 功能点名称*/public String FunctionName;} } 菜单维护的后台代码 import JRT.Core.CustomAttributes.Trans; import JRT.Core.Dto.OutValue; import JRT.Core.Util.TxtUtil; import JRTBLLBase.BaseHttpHandlerNoSession; import JRTBLLBase.Helper; import JRT.Core.Dto.HashParam; import JRT.Core.Dto.ParamDto; import JRT.Core.Dto.OutParam; import JRT.Model.Entity.*; import JRT.Core.Util.Convert; import JRT.Core.MultiPlatform.JRTContext;import java.io.File; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List;/*** 菜单资源维护的后台代码*/ public class ashJRTMenu extends BaseHttpHandlerNoSession {/*** 查询所有页面数据** return* throws Exception*/public String QueryAllForm() throws Exception {//预留的取前台参数代码//参数ListParamDto para new ArrayList();//sql连接符号ListString joiner new ArrayList();//sql比较符号ListString operators new ArrayList();//模糊查询String Filter Helper.ValidParam(JRTContext.GetRequest(Request, Filter), );//预留参数//主键String RowID Helper.ValidParam(JRTContext.GetRequest(Request, RowID), );//名称String CName Helper.ValidParam(JRTContext.GetRequest(Request, CName), );//序号String Sequence Helper.ValidParam(JRTContext.GetRequest(Request, Sequence), );//激活 {1:true,0:false}String Active Helper.ValidParam(JRTContext.GetRequest(Request, Active), );//相对路径String Path Helper.ValidParam(JRTContext.GetRequest(Request, Path), );//说明String Remark Helper.ValidParam(JRTContext.GetRequest(Request, Remark), );//帮助信息String FormHelp Helper.ValidParam(JRTContext.GetRequest(Request, FormHelp), );//宽度String HelpWidth Helper.ValidParam(JRTContext.GetRequest(Request, HelpWidth), );//高度String HelpHeight Helper.ValidParam(JRTContext.GetRequest(Request, HelpHeight), );//帮助文档路径String HelpDoc Helper.ValidParam(JRTContext.GetRequest(Request, HelpDoc), );//模糊查询if (!Filter.isEmpty()) {ParamDto p null;//名称p new ParamDto();p.Key CName;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//相对路径p new ParamDto();p.Key Path;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//说明p new ParamDto();p.Key Remark;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//帮助信息p new ParamDto();p.Key FormHelp;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);//帮助文档路径p new ParamDto();p.Key HelpDoc;p.Value % Filter %;para.add(p);joiner.add(or);operators.add(like);}//调用查询String json EntityManager().QueryAllWithFK(JRTForm.class, para, , false, -1, -1, , joiner, operators);return json;}/*** 查询所有菜单** return* throws Exception*/public String GetAllMenu() throws Exception {String SystemDR Helper.ValidParam(JRTContext.GetRequest(Request, SystemDR), );MenuTreeDto retMenu new MenuTreeDto();retMenu.isFolder 1;retMenu.id 0;retMenu.RowID 0;retMenu.Level 0;HashParam hs new HashParam();if (!SystemDR.isEmpty()) {retMenu.SystemDR Convert.ToInt32(SystemDR);hs.Add(SystemDR, Convert.ToInt32(SystemDR));JRTSystem sysDto EntityManager().DolerGet(JRTSystem.class, Convert.ToInt32(SystemDR));retMenu.text sysDto.SysName;retMenu.CName sysDto.SysName;}//查询角色系统的全部菜单数据ListJRTMenu allMenu EntityManager().FindAll(JRTMenu.class, hs, Sequence asc, , null, null);int seqIndex 0;ListString upCol new ArrayList();upCol.add(Sequence);for (JRTMenu m : allMenu) {//一级菜单if (m.ParentDR null) {seqIndex;//更新序号if (m.Sequence ! seqIndex * 5) {m.Sequence seqIndex * 5;int ret EntityManager().Update(m, ErrRet(), upCol);}MenuTreeDto one MenuToMenuDto(m);one.isFolder 1;one.state closed;one.Level retMenu.Level 1;retMenu.children.add(one);AddChildMenu(one, allMenu);}}return [ Helper.Object2Json(retMenu) ];}/*** 更新菜单序号** return* throws Exception*/public String UpdateSequence() throws Exception {int RowID Helper.ValidParam(JRTContext.GetRequest(Request, RowID), -1);int Sequence Helper.ValidParam(JRTContext.GetRequest(Request, Sequence), -1);JRTMenu curMenu EntityManager().GetById(JRTMenu.class, RowID);if (curMenu null) {return Helper.Error(没有找到菜单数据);}curMenu.Sequence Sequence;ListString upCol new ArrayList();upCol.add(Sequence);int ret EntityManager().Update(curMenu, ErrRet(), upCol);if (ret -1) {return Helper.Error(this.Err);}return Helper.Success();}/*** 粘贴菜单复制的才能只能粘贴到复制级别的上级,或者整个菜单树** return*/Transpublic String PasteMenu() throws Exception {//老节点int OldDR Helper.ValidParam(JRTContext.GetRequest(Request, OldDR), 0);//新节点int NewDR Helper.ValidParam(JRTContext.GetRequest(Request, NewDR), 0);//目标系统int SystemDR Helper.ValidParam(JRTContext.GetRequest(Request, SystemDR), 0);//源头系统int OldSystemDR Helper.ValidParam(JRTContext.GetRequest(Request, OldSystemDR), 0);//复制整个菜单树if (OldDR 0) {HashParam hs new HashParam();hs.Add(SystemDR, OldSystemDR);//查询角色系统的全部菜单数据ListJRTMenu allMenu EntityManager().FindAllSimple(JRTMenu.class, hs);for (JRTMenu one : allMenu) {if (one.ParentDR null) {int oneOldID one.RowID;one.SystemDR SystemDR;OutValue key new OutValue();int ret EntityManager().Save(one, key, ErrRet());if (ret 1) {for (JRTMenu tow : allMenu) {if (tow.ParentDR ! null tow.ParentDR oneOldID) {tow.ParentDR one.RowID;tow.SystemDR SystemDR;int ret1 EntityManager().Save(tow, key, ErrRet());if (ret1 ! 1) {throw new Exception(复制2级菜单异常: ErrRet().GetString());}}}} else {throw new Exception(复制1级菜单异常: ErrRet().GetString());}}}} else {JRTMenu menuOld EntityManager().GetById(JRTMenu.class, OldDR);//复制目录到根节点if (NewDR 0) {HashParam hs new HashParam();hs.Add(ParentDR, OldDR);//查询角色系统的全部菜单数据ListJRTMenu allChildMenu EntityManager().FindAllSimple(JRTMenu.class, hs);menuOld.SystemDR SystemDR;OutValue key new OutValue();int ret EntityManager().Save(menuOld, key, ErrRet());if (ret 1) {for (JRTMenu tow : allChildMenu) {tow.ParentDR menuOld.RowID;tow.SystemDR SystemDR;int ret1 EntityManager().Save(tow, key, ErrRet());if (ret1 ! 1) {throw new Exception(复制2级菜单异常: ErrRet().GetString());}}} else {throw new Exception(复制1级菜单异常: ErrRet().GetString());}}//复制子菜单到目录else {OutValue key new OutValue();menuOld.ParentDR NewDR;menuOld.SystemDR SystemDR;int ret EntityManager().Save(menuOld, key, ErrRet());if (ret ! 1) {throw new Exception(复制1级菜单异常: ErrRet().GetString());}}}return Helper.Success();}/*** 保存数据,前台按表的属性名提交** return 字符串*/public String SaveJRTMenu() throws Exception {JRTMenu dto new JRTMenu();//主键dto.RowID Helper.ValidParam(JRTContext.GetRequest(Request, RowID), dto.RowID);//名称dto.CName Helper.ValidParam(JRTContext.GetRequest(Request, CName), dto.CName);//上级dto.ParentDR Helper.ValidParam(JRTContext.GetRequest(Request, ParentDR), dto.ParentDR);//页面路径dto.FormDR Helper.ValidParam(JRTContext.GetRequest(Request, FormDR), dto.FormDR);//功能描述dto.Description Helper.ValidParam(JRTContext.GetRequest(Request, Description), dto.Description);//图标dto.Icon Helper.ValidParam(JRTContext.GetRequest(Request, Icon), dto.Icon);//序号dto.Sequence Helper.ValidParam(JRTContext.GetRequest(Request, Sequence), dto.Sequence);//激活 {1:true,0:false}dto.Active Helper.ValidParam(JRTContext.GetRequest(Request, Active), dto.Active);//是否置顶显示 {1:true,0:false}dto.IsTop Helper.ValidParam(JRTContext.GetRequest(Request, IsTop), dto.IsTop);//子系统dto.SystemSubDR Helper.ValidParam(JRTContext.GetRequest(Request, SystemSubDR), dto.SystemSubDR);//系统模块dto.SystemDR Helper.ValidParam(JRTContext.GetRequest(Request, SystemDR), dto.SystemDR);//空:在Tab页打印,0弹窗打开,1独立打开dto.OpenModel Helper.ValidParam(JRTContext.GetRequest(Request, OpenModel), dto.OpenModel);//打开宽度dto.OpenWidth Helper.ValidParam(JRTContext.GetRequest(Request, OpenWidth), dto.OpenWidth);//打开高度dto.OpenHeight Helper.ValidParam(JRTContext.GetRequest(Request, OpenHeight), dto.OpenHeight);//根节点if(dto.ParentDR0){dto.ParentDRnull;}OutParam out new OutParam();int ret 0;//更新if (dto.RowID 0) {ret EntityManager().Update(dto, null, out, null, null, null);}//插入数据else {ret EntityManager().Save(dto, out);}if (ret 1) {return Helper.Success();} else {return Helper.Error(out);}}/*** 删除数据多个RowID以上尖号分割** return 字符串*/public String DeleteJRTMenu() throws Exception {String RowIDS Helper.ValidParam(JRTContext.GetRequest(Request, RowIDS), );if (RowIDS.isEmpty()) {return Helper.Error(请传入要删除数据的RowID,多个以^分割!);}//分割主键String[] arr RowIDS.split(^);//out参数OutParam out new OutParam();//循环删除数据for (int i 0; i arr.length; i) {//是否有子菜单ListJRTMenu childEntityManager().FindByColVal(JRTMenu.class,ParentDR,Convert.ToInt32(arr[i]));if(child!nullchild.size()0){return Helper.Error(当前菜单已经有子菜单数据请先删除子项!);}int ret EntityManager().RemoveById(JRTMenu.class, Convert.ToInt32(arr[i]), out);if (ret ! 1) {return Helper.Error(out);}}return Helper.Success();}/*** 添加子菜单** param one 一级菜单* param allMenu 所有菜单*/private void AddChildMenu(MenuTreeDto one, ListJRTMenu allMenu) throws Exception {int seqIndex 0;ListString upCol new ArrayList();upCol.add(Sequence);for (JRTMenu m : allMenu) {if (m.ParentDR ! null one.RowID m.ParentDR) {seqIndex;//更新序号if (m.Sequence ! seqIndex * 5) {m.Sequence seqIndex * 5;int ret EntityManager().Update(m, ErrRet(), upCol);}MenuTreeDto child MenuToMenuDto(m);child.Level one.Level 1;one.children.add(child);AddChildMenu(child, allMenu);}}}/*** 菜单表是实体得到菜单数据的实体** param menu 菜单表数据* return 菜单树数据* throws Exception*/private MenuTreeDto MenuToMenuDto(JRTMenu menu) throws Exception {MenuTreeDto oneMenu new MenuTreeDto();oneMenu.RowID menu.RowID;oneMenu.id String.valueOf(menu.RowID);oneMenu.CName menu.CName;oneMenu.text menu.CName;oneMenu.isFolder 0;oneMenu.FormDR menu.FormDR;//页面路径if(menu.FormDR!null){JRTForm formEntityManager().DolerGet(JRTForm.class,menu.FormDR);oneMenu.FormPathform.Path;}if (menu.ParentDR null) {oneMenu.ParentDR 0;} else {oneMenu.ParentDR menu.ParentDR;}oneMenu.Description menu.Description;oneMenu.Icon menu.Icon;oneMenu.iconCls icon iconfont menu.Icon;oneMenu.Sequence menu.Sequence;oneMenu.Active menu.Active;oneMenu.IsTop menu.IsTop;oneMenu.OpenModel menu.OpenModel;if (menu.OpenWidth null) {oneMenu.OpenWidth ;} else {oneMenu.OpenWidth String.valueOf(menu.OpenWidth);}if (menu.OpenHeight null) {oneMenu.OpenHeight ;} else {oneMenu.OpenHeight String.valueOf(menu.OpenHeight);}oneMenu.SystemDR menu.SystemDR;return oneMenu;}/*** 菜单树实体*/public static class MenuTreeDto {/*** 构造函数*/public MenuTreeDto() {id ;text ;iconCls ;isFolder ;state ;checked ;RowID 0;Level 0;CName ;FormDR null;ParentDR 0;Description ;Icon ;Sequence 0;Active true;IsTop false;OpenModel ;OpenWidth ;OpenHeight ;children new ArrayList();SystemDR 0;FormPath;}/*** 树id*/public String id;/*** 树文本*/public String text;/*** 树图标*/public String iconCls;/*** 是否是文件夹*/public String isFolder;/*** 树的状态*/public String state;/*** 是否选择*/public String checked;/*** 层级*/public int Level;/*** 菜单主键*/public int RowID;/*** 菜单名称*/public String CName;/*** 菜单路径*/public Integer FormDR;/*** 菜单父级*/public int ParentDR;/*** 菜单描述*/public String Description;/*** 菜单图标*/public String Icon;/*** 菜单序号*/public int Sequence;/*** 是否激活*/public Boolean Active;/*** 是否在顶部*/public Boolean IsTop;/*** 打开模式*/public String OpenModel;/*** 打开宽度*/public String OpenWidth;/*** 打开高度*/public String OpenHeight;/*** 子菜单*/public ListMenuTreeDto children;/*** 系统*/public int SystemDR;/*** 页面路径*/public String FormPath;}} 登录界面的后台 import JRT.Core.Dto.HashParam; import JRT.Core.MultiPlatform.JRTConfigurtaion; import JRT.Core.MultiPlatform.JRTContext; import JRT.Core.Util.IPMacUtil; import JRT.Core.Util.Md5Util; import JRT.Core.Util.PassWordUtil; import JRT.Core.Util.TimeParser; import JRT.DAL.ORM.EntityManager.EntityManagerImpl; import JRT.Login.ILogin; import JRT.Login.SelectRoleDto; import JRT.Model.Bussiness.Sessions; import JRT.Model.Entity.JRTUserLog; import JRT.Model.Entity.SYSParameter; import JRTBLLBase.BaseHttpHandlerNoSession; import JRTBLLBase.Helper;import java.util.HashMap; import java.util.List;/*** 作为登录界面的后台实现类实现用户验证和修改密码登为登录构造会话*/ public class ashLogin extends BaseHttpHandlerNoSession {/*** 登录接口*/private ILogin loginnull;/*** 得到登录的实现类* return* throws Exception*/private ILogin Login() throws Exception{//登录类型String LoginTypeHelper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, LoginType), LIS);if(loginnull) {login (ILogin) JRT.Core.Context.ObjectContainer.GetObject(LoginType);}return login;}/*** 得到登录信息* return 常用信息的键值对*/public String GetLoginInfo() throws Exception{HashMap mapnew HashMap();//系统标题map.put(SystemTitle,Login().GetSystemTitle());//系统名称map.put(SystemName,Login().GetSystemName());//模块名称map.put(UrlTitle,Login().GetUrlTitle());//选择的角色名称map.put(RoleTypeName,Login().GetRoleTypeName());//密码级别map.put(SYSPasswordLevel,Login().GetSYSPasswordLevel());//密码长度map.put(SYSPasswordLength,Login().GetSYSPasswordLength());//显示的服务器IPString ServiceShowIP JRTConfigurtaion.Configuration(ServiceShowIP);//密码长度map.put(ServiceShowIP,ServiceShowIP);//密码长度map.put(ClientIP,JRTContext.GetClientIP(Request));return Helper.Object2Json(map);}/*** 校验用户* return*/public String CheckUser() throws Exception{//用户名String UserCode Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, UserCode), );//密码String Password Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, Password), );//解密密码PasswordJRT.Core.Util.RsaUtil.RsaDecrypt(Password);//验证密码boolean retLogin().CheckUser(UserCode,Password);if(retfalse){return Helper.Error(用户名或密码错误!);}else{//用户名加上时间构成时间戳String timeSpanJRT.Core.Util.RsaUtil.RsaEncrypt(JRT.Core.Util.TimeParser.GetNowTime()^UserCode);//得到选择的角色数据ListSelectRoleDto roleListLogin().GetSelectRole(UserCode);HashMap mapnew HashMap();//系统标题map.put(TimeSpan,timeSpan);map.put(RoleList,roleList);return Helper.Success(Helper.Object2Json(map));}}/*** 登录并且构造会话* return*/public String LoginSys() throws Exception{//用户名String UserCode Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, UserCode), );//密码String Password Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, Password), );//角色String RoleJson Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, RoleJson), );//登录类型String LoginTypeHelper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, LoginType), LIS);//解密密码PasswordJRT.Core.Util.RsaUtil.RsaDecrypt(Password);//验证密码boolean retLogin().CheckUser(UserCode,Password);if(retfalse){return Helper.Error(用户名或密码错误!);}//角色对象SelectRoleDto role(SelectRoleDto)Helper.Json2Object(RoleJson,SelectRoleDto.class);//会话IDString SYSSessionID;String SessionKeyJRTUserSession;//取会话对象Sessions sessionJRTContext.GetSession(Session,SessionKey);if(session!null){SYSSessionIDLoginType-role.UserID-role.GroupID-role.RoleDR;SYSSessionID Md5Util.GetMd5Hash(SYSSessionID);SessionKeyJRTUserSession-SYSSessionID;}Sessions sessionNewnew Sessions();sessionNew.IpAddress JRTContext.GetClientIP(Request);sessionNew.UserCoderole.UserCode;sessionNew.UserIDrole.UserID;sessionNew.UserNamerole.UserName;sessionNew.SessionStrrole.SessionStr;sessionNew.GroupIDrole.GroupID;sessionNew.RoleDRrole.RoleDR;sessionNew.RoleNamerole.RoleName;sessionNew.SYSSessionIDSYSSessionID;sessionNew.LoginDateHelper.GetNowDate();sessionNew.LoginTimeHelper.GetNowTime();sessionNew.LoginTypeLoginType;JRTContext.SetSession(Session,SessionKey,sessionNew);return Helper.Success(SYSSessionID);}/*** 修改密码* return*/public String ChangePassword() throws Exception{//用户名String UserCode Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, UserCode), );//密码String Password Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, Password), );//解密密码PasswordJRT.Core.Util.RsaUtil.RsaDecrypt(Password);//新密码String PasswordNew Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, PasswordNew), );//解密密码PasswordNewJRT.Core.Util.RsaUtil.RsaDecrypt(PasswordNew);String retLogin().ChangePassword(UserCode,Password,PasswordNew);if(ret.isEmpty()){//修改密码日志SaveUserLog(UserCode,UP,修改密码);return Helper.Success();}else{return Helper.Error(ret);}}/*** 保存用户日志* param UserCode* param LogType* param Remark* throws Exception*/private void SaveUserLog(String UserCode,String LogType,String Remark) throws Exception{//登录类型String LoginTypeHelper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, LoginType), LIS);JRTUserLog lognew JRTUserLog();log.AddDate Helper.GetNowDate();log.AddTimeHelper.GetNowTime();log.IPAddressHelper.GetClientIP(Request);log.LogTypeLogType;log.RemarkRemark;log.SiteIPMacUtil.GetLocalIPv4Address();log.SysCodeLoginType;log.UserCodeUserCode;EntityManager().Save(log);}/*** 得到修改密码信息* return*/public String GetChangePassInfo() throws Exception{//用户名String UserCode Helper.ValidParam(JRT.Core.MultiPlatform.JRTContext.GetRequest(Request, UserCode), );int changePassDay-1;//查询系统参数SYSParameter dto EntityManager().GetByColVal(SYSParameter.class, Code, SYSChangePassDay);if (dto ! null) {if (dto.ParaValue ! null !dto.ParaValue.isEmpty()) {changePassDayInteger.valueOf(dto.ParaValue);}}//要求定期换密码if(changePassDay0){HashParam hsnew HashParam();hs.Add(UserCode,UserCode);hs.Add(LogType,UP);//按日期倒序取top1ListJRTUserLog logLastEntityManager().FindAllTop(JRTUserLog.class,1,hs,AddDate desc,,null,null);//没日志插入一个if(logLastnull||logLast.size()0){//修改密码日志SaveUserLog(UserCode,UP,修改密码);return ;}//超期没改密码if(TimeParser.DaysBetween(Helper.GetNowDate(),logLast.get(0).AddDate)changePassDay){return 系统已开启密码天数检测:系统检测到您的密码已经超过changePassDay天未修改;}}return ;}} 为了提高效率会用M方法把所有表的实体、后台、前端代码统一生成到Copy目录供开发拷贝表操作和界面的基础逻辑 这些功能在PostGreSql和人大金仓跑起来是一样的因为没使用SQL都是基于ORM的api实现的功能。之所以用IRIS开发是因为表结构来回调整直接k表数据方便效率还是很重要的jrtlis计划的最终目标将以此开发质控系统、鉴定过程、检验系统。
http://www.pierceye.com/news/562582/

相关文章:

  • 自己做网站服务器要多少钱特殊字体
  • 网站建设合同 协议书网站建设工具有哪些
  • 网站建设的基本条件网站建设策划案怎么写
  • 知乎网站开发用的语言郑州建设网站哪家好
  • 企业官网建站费用长沙做无痛肠镜东大医院l网站
  • 建网站资料wordpress 读书模板
  • 网站建设初学者教程成华区微信网站建设公司
  • 沈阳网站建设-中国互联商城页面
  • 成交型网站倡导公司进贤南昌网站建设公司
  • 网站跟软件有什么区别是什么点击器原理
  • 网站建设项目策划书范文杭州 网站开发公司
  • 酒店网站建设设计企业营销型网站策划
  • 用dw怎么做登录页面的网站成都微信网站建设推
  • 合肥网站建设案例美丽说网站模板
  • 大学网站建设管理办法手机网站如何推广
  • 本网站正在建设升级中常用的软件开发平台
  • 招标网站开发文档上海免费网站建站模板
  • 备案系统网站wordpress 条件查询
  • 网站建设的两个方面有网站源码如何搭建自己的网站
  • 网站建设的十点优势智慧团建电脑版登录入口官网
  • 重庆专业网站排名团队wordpress标签页模板
  • 网站模板安卓郑州网站建设氵汉狮网络
  • 想学做网站学那个软件好哪些网站可以做设计赚钱
  • 公司网站模板中英文苏州网站建设套餐
  • 威海外贸网站建设可拖拽html网页编辑器
  • 西乡塘网站建设企业vi形象设计是什么意思
  • 做服装到哪个网站拿货品质好广告软文小故事200字
  • 廊坊网站建设设计wordpress上传后如何访问
  • 禅城网站制作网站推广优化技巧大全
  • xampp做的网站能搜索吗广州外贸公司集中地