标签:
根据我前2篇项目,又做了更新,把3tab页面合成一个页面,主要用到easyui 页面布局
配置文件
1 <?xml version="1.0" encoding="UTF-8"?> 2 <xp-web> 3 <modules> 4 <!-- 第三方APP服务端 --> 5 <module path="/web/plugins/bs/yygl/bz/extapp" form="" scope="request" action="plugins.bs.yygl.bz.ExtappAction" defaultPage=""> 6 <page name="fpqxTab" url="/web/plugins/bs/yygl/bz/extapp/fpqxTab.html" type="template"/> 7 <page name="extappAdd" url="/web/plugins/bs/yygl/bz/extapp/extappAdd.html" type="template"/> 8 <page name="extappUpdate" url="/web/plugins/bs/yygl/bz/extapp/extappUpdate.html" type="template"/> 9 <page name="chooseuser" url="/web/plugins/bs/yygl/bz/extapp/chooseuser.html" type="template"/> 10 <page name="chooserole" url="/web/plugins/bs/yygl/bz/extapp/chooserole.html" type="template"/> 11 <page name="jsonxml" url="/web/common/page/JsonXml.html" type="template"/> 12 <page name="cjListPage" url="/web/plugins/bs/yygl/bz/extapp/cjList.html" type="template"/> 13 <page name="jsonxml" url="/web/common/page/JsonXml.html" type="template"/> 14 </module> 15 16 <!-- 每三方App手机端--> 17 <module path="/app/plugins/bui/extapp/bz" form="" scope="request" action="plugins.bs.yygl.bz.ExtAppPhoneAction" defaultPage=""> 18 <page name="jsonxml" url="/web/common/page/JsonXml.html" type="template"/> 19 </module> 20 <!-- 插件管理 --> 21 <module path="/web/plugins/bs/yygl/dz/g00000000/cjgl" form="" scope="request" action="plugins.bs.yygl.dz.g00000000.cjgl.CjglAction" defaultPage=""> 22 <page name="cjList" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjList.html" type="template"/> 23 <page name="cjAdd" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjAdd.html" type="template"/> 24 <page name="cjUpdate" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjUpdate.html" type="template"/> 25 <page name="cjOnline" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjOnline.html" type="template"/> 26 <page name="cjDict" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjDict.html" type="template"/> 27 28 <page name="cjRoleList" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjRoleList.html" type="template"/> 29 <page name="cjRoleAdd" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjRoleAdd.html" type="template"/> 30 <page name="cjRoleUpdate" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjRoleUpdate.html" type="template"/> 31 <page name="cjRoleDel" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjRoleDel.html" type="template"/> 32 <page name="cjMenuAdd" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjMenuAdd.html" type="template"/> 33 <page name="cjMenuUpdate" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjMenuUpdate.html" type="template"/> 34 <page name="cjMenuDel" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjMenuDel.html" type="template"/> 35 <page name="cjlbTab" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/cjlbTab.html" type="template"/> 36 37 <page name="jsonxml" url="/web/common/page/JsonXml.html" type="template"/> 38 39 <page name="toUpload" url="/web/plugins/bs/yygl/dz/g00000000/cjgl/toUpload.html" type="template"/> 40 41 </module> 42 43 <!--集团开户插件--> 44 <module path="/web/plugins/bs/yygl/dz/g00000000/jtkt" form="" scope="request" action="plugins.bs.yygl.dz.g00000000.jtkt.JtktAction" defaultPage=""> 45 <page name="jtktList" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/jtktList.html" type="template"/> 46 <page name="jtktAdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/jtktAdd.html" type="template"/> 47 <page name="jtktUpdate" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/jtktUpdate.html" type="template"/> 48 <page name="jtktDetail" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/jtktDetail.html" type="template"/> 49 <page name="jtktmcUpdate" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/jtktmcUpdate.html" type="template"/> 50 51 <page name="dywslList" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/dywslList.html" type="template"/> 52 <page name="dywslAdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/dywslAdd.html" type="template"/> 53 <page name="dywslTab" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/dywslTab.html" type="template"/> 54 <page name="dywslUpdatejbxx" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/dywslUpdatejbxx.html" type="template"/> 55 <page name="dywslUpdategncj" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/dywslUpdategncj.html" type="template"/> 56 <page name="dywslUpdatezd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/dywslUpdatezd.html" type="template"/> 57 <page name="gncjAdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/gncjAdd.html" type="template"/> 58 <page name="gncjUpdate" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/gncjUpdate.html" type="template"/> 59 <page name="gnsqAdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/gnsqAdd.html" type="template"/> 60 <page name="zdAdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/zdAdd.html" type="template"/> 61 <page name="zdUpdate" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/zdUpdate.html" type="template"/> 62 <page name="jsonxml" url="/web/common/page/JsonXml.html" type="template"/> 63 64 65 66 <page name="cjslAdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/cjslAdd.html" type="template"/> 67 68 69 70 <page name="toAddCd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toAddCd.html" type="template"/> 71 <page name="toUpdateCd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toUpdateCd.html" type="template"/> 72 73 74 <page name="toAddJs" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toAddJs.html" type="template"/> 75 <page name="toUpdateJs" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toUpdateJs.html" type="template"/> 76 77 <page name="todywslUpdatecj" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/todywslUpdatecj.html" type="template"/> 78 <page name="todAddCd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/todAddCd.html" type="template"/> 79 <page name="todAddJs" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/todAddJs.html" type="template"/> 80 <page name="toUpdateCdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toUpdateCdd.html" type="template"/> 81 <page name="toUpdateJsd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toUpdateJsd.html" type="template"/> 82 83 </module> 84 85 <!-- 能力平台配置 --> 86 <module path="/web/plugins/bs/yygl/dz/g00000000/nlpt" form="" scope="request" action="plugins.bs.yygl.dz.g00000000.nlpt.NlptAction" defaultPage=""> 87 <page name="nlptList" url="/web/plugins/bs/yygl/dz/g00000000/nlpt/nlptList.html" type="template" /> 88 <page name="nlptDate" url="/web/plugins/bs/yygl/dz/g00000000/nlpt/nlptDate.html" type="template" /> 89 </module> 90 </modules> 91 </xp-web>
后台代码
1 package plugins.bs.yygl.dz.g00000000.jtkt; 2 3 import java.io.File; 4 import java.sql.Connection; 5 import java.util.ArrayList; 6 import java.util.Arrays; 7 import java.util.HashSet; 8 import java.util.Hashtable; 9 import java.util.List; 10 import java.util.Map; 11 import java.util.Set; 12 13 import javax.servlet.http.HttpServletResponse; 14 15 import plugins.bs.yygl.dz.g00000000.cjgl.CjglMemo; 16 import plugins.sys.admin.bz.T_sys_user; 17 import common.function.BhGenerator; 18 import common.function.comUtil; 19 import framework.db.DBConnector; 20 import framework.db.ObjectCtl; 21 import framework.sys.ActionContext; 22 import framework.sys.ConverPinyin2; 23 import framework.sys.Globals; 24 import framework.sys.IWebAction; 25 import framework.sys.Module; 26 import framework.sys.Page; 27 import framework.sys.WebForm; 28 import framework.tools.DateT; 29 import framework.util.DateUtil; 30 import framework.util.StringUtil; 31 import framework.xfJDBC.DBHelper; 32 import framework.xfJDBC.beanUtilsExtend.DBean; 33 34 public class JtktAction implements IWebAction 35 { 36 public Page execute(WebForm form, Module module) throws Exception 37 { 38 String method=form.get("doAction")==null?"":form.get("doAction").toString(); 39 T_sys_user user = (T_sys_user) ActionContext.getContext().getSession().getAttribute("userSession"); 40 41 /** 42 * 安全检查,如不需要只要将下面的IF语句屏蔽即可 43 */ 44 if (user == null) 45 { 46 form.addResult("msg", "您没有登录或者是超时,请重登录!"); 47 return new Page("noLoin","/"+ Globals.APP_BASE_NAME+"/private/login.xp", "html"); 48 } 49 50 Page forward=null; 51 52 if(method.equals(""))//无动作时列表页面可根据具体情况修改默认页面 53 { 54 forward =jtktList(form, module, user); 55 } 56 else if(method.equals("toJtktAdd")) //转到新增页面 57 { 58 forward =toJtktAdd(form, module, user); 59 } 60 else if(method.equals("jtktAdd")) //执行新增操作 61 { 62 forward =jtktAdd(form, module, user); 63 } 64 else if (method.equals("jtktDetail")) //转到详情页面 65 { 66 forward =jtktDetail(form, module, user); 67 }else if(method.equals("jtktListJson")){//easyUI列表 68 69 forward = jtktListJson(form, module, user); 70 71 }else if(method.equals("pluginListJson")){//插件列表 72 73 forward = pluginListJson(form, module, user); 74 75 }else if(method.equals("toJtktUpdate")){//许可授权页面 76 77 forward = toJtktUpdate(form, module, user); 78 79 }else if(method.equals("jtktUpdate")){//许可授权 80 81 forward = jtktUpdate(form, module, user); 82 83 }else if(method.equals("jtktDelete")){//集团注销 84 85 forward = jtktDelete(form, module, user); 86 87 }else if(method.equals("Addcjsl")){//插件实例添加页面(添加菜单列表与角色列表) 2016/1/4 liujunfeng 88 89 forward = Addcjsl(form, module, user); 90 91 }else if(method.equals("cjslAdd")){//插件实例信息保存 92 93 forward = cjslAdd(form, module, user); 94 95 }else if(method.equals("iscjsl")){//判断是否已经生成过实例插件 96 97 forward = iscjsl(form, module, user); 98 99 }else if(method.equals("delcjsl")){//勾选取消插件实例 100 101 forward = delcjsl(form, module, user); 102 103 } 104 else if(method.equals("toJtktmcUpdate")){//修改集团名称页面 105 106 forward = toJtktmcUpdate(form, module, user); 107 108 }else if(method.equals("jtktmcUpdate")) {//修改集团名称方法 109 110 forward = jtktmcUpdate(form, module, user); 111 112 }else if(method.equals("checkClassCode")){//检查类别代码是否有重 113 114 forward = checkClassCode(form, module, user); 115 116 } 117 else if(method.equals("checkFullname")){//检查集团全称是否有重 118 forward = checkFullname(form, module, user); 119 120 }else if(method.equals("gnsqAdd")){//功能授权插件添加跳转 121 forward = gnsqAdd(form, module, user); 122 } 123 else if(method.equals("pluginListJson1")){ 124 forward = pluginListJson1(form, module, user); 125 }else if(method.equals("pluginListJson2")){ 126 forward = pluginListJson2(form, module, user); 127 }else if(method.equals("plugincjbcAdd")){ 128 forward = plugincjbcAdd(form, module, user); 129 }else if(method.equals("deletecj")){ 130 forward = deletecj(form, module, user); 131 } 132 else if(method.equals("dywslList")){//转到多业务实例列表页面 133 forward = dywslList(form, module, user); 134 } 135 else if(method.equals("dywslListJson")){//多业务实例列表数据 136 forward = dywslListJson(form, module, user); 137 } 138 else if(method.equals("toAddSl")){//转到添加多业务实例页面 139 forward = toAddSl(form, module, user); 140 } 141 else if(method.equals("addDywsl")){//执行多业务实例添加操作 142 forward = addDywsl(form, module, user); 143 } 144 else if(method.equals("deleteSl")){//删除实例 145 forward = deleteSl(form, module, user); 146 } 147 else if(method.equals("toUpdateSl")){//转到实例修改页面 148 forward = toUpdateSl(form, module, user); 149 } 150 else if(method.equals("todywslUpdatejbxx")){//转到实例基本信息修改页面 151 forward = todywslUpdatejbxx(form, module, user); 152 } 153 else if(method.equals("dywslUpdatejbxx")){//执行实例基本信息修改操作 154 forward = dywslUpdatejbxx(form, module, user); 155 } 156 else if(method.equals("todywslUpdategncj")){//转到实例功能插件修改页面 157 forward = todywslUpdategncj(form, module, user); 158 } 159 else if(method.equals("gncjListJson")){//功能插件列表数据 160 forward = gncjListJson(form, module, user); 161 } 162 else if(method.equals("toaddGncj")){//转到功能插件添加页面 163 forward = toaddGncj(form, module, user); 164 } 165 else if(method.equals("cjListJson")){//系统功能插件 166 forward = cjListJson(form, module, user); 167 } 168 else if(method.equals("cjAdd")){//系统功能添加操作 169 forward = cjAdd(form, module, user); 170 } 171 else if(method.equals("deleteGncj")){//系统功能插件删除操作 172 forward = deleteGncj(form, module, user); 173 } 174 else if(method.equals("toUpdateGncj")){//转到功能插件修改页面 175 forward = toUpdateGncj(form, module, user); 176 } 177 else if(method.equals("updateGncj")){//执行功能插件修改操作 178 forward = updateGncj(form, module, user); 179 } 180 else if(method.equals("todywslUpdatezd")){//转到多实例反馈字段页面 181 forward = todywslUpdatezd(form, module, user); 182 } 183 else if(method.equals("zdListJson")){//反馈字段列表数据显示 184 forward = zdListJson(form, module, user); 185 } 186 else if(method.equals("toaddZd")){//转到反馈字段添加页面 187 forward = toaddZd(form, module, user); 188 } 189 else if(method.equals("addZd")){//执行反馈字段添加操作 190 forward = addZd(form, module, user); 191 } 192 else if(method.equals("deleteZd")){//删除反馈字段 193 forward = deleteZd(form, module, user); 194 } 195 else if(method.equals("toUpdateZd")){//转到反馈字段修改页面 196 forward = toUpdateZd(form, module, user); 197 } 198 else if(method.equals("updateZd")){//执行反馈字段修改操作 199 forward = updateZd(form, module, user); 200 }else if(method.equals("checkadminloginno")){ 201 forward = checkadminloginno(form, module, user); 202 }else if (method.equals("plugListJson")){//插件修改页面的插件菜单列表信息数据 2016/1/4 liujunfeng 203 forward = plugListJson(form, module, user); 204 }else if (method.equals("toAddCd")){//插件菜单新增信息页面 205 forward = module.findPage("toAddCd"); 206 }else if (method.equals("addCdListJson")){//插件菜单列表数据 207 forward = addCdListJson(form, module, user); 208 }else if (method.equals("addCd")){//保存插件菜单新增数据 209 forward = addCd(form, module, user); 210 }else if (method.equals("toUpdateCd")){//插件菜单修改页面的数据 211 forward = toUpdateCd(form, module, user); 212 }else if (method.equals("updateCd")){//保存插件菜单修改数据 213 forward = updateCd(form, module, user); 214 }else if (method.equals("deleteCd")){//菜单删除数据 215 forward = deleteCd(form, module, user); 216 }else if (method.equals("addJsListJson")){//插件角色列表数据 217 forward = addJsListJson(form, module, user); 218 }else if (method.equals("cjjsListJson")){//插件角色列表信息数据 219 forward = cjjsListJson(form, module, user); 220 }else if (method.equals("toAddJs")){//插件角色新增信息页面 221 forward = module.findPage("toAddJs"); 222 }else if (method.equals("addJs")){//保存角色新增数据 223 forward = addJs(form, module, user); 224 }else if (method.equals("toUpdateJs")){//插件角色修改页面的数据 225 forward = toUpdateJs(form, module, user); 226 }else if (method.equals("updateJs")){//保存插件角色修改数据 227 forward = updateJs(form, module, user); 228 }else if (method.equals("deleteJs")){//菜单删除数据 229 forward = deleteJs(form, module, user); 230 } 231 232 233 else if (method.equals("todywslUpdatecj")){//转到多业务实例页面的菜单与角色的tab页面 234 forward = todywslUpdatecj(form, module, user); 235 }else if (method.equals("cdListJson")){//转到多业务实例页面的菜单列表数据 236 forward = cdListJson(form, module, user); 237 }else if (method.equals("jsListJson")){//转到多业务实例页面的角色列表数据 238 forward = jsListJson(form, module, user); 239 }else if (method.equals("todAddCd")){//保存菜单参数 240 forward = todAddCd(form, module, user); 241 }else if (method.equals("addCddListJson")){//获取新增页面的菜单列表数据 242 forward = addCddListJson(form, module, user); 243 }else if (method.equals("AddCdd")){//保存菜单新增数据 244 forward = AddCdd(form, module, user); 245 }else if (method.equals("toUpdateCdd")){//修改菜单数据 246 forward = toUpdateCdd(form, module, user); 247 }else if (method.equals("updateCdd")){//保存菜单修改数据 248 forward = updateCdd(form, module, user); 249 }else if (method.equals("deleteCdd")){//菜单删除数据 250 forward = deleteCdd(form, module, user); 251 } 252 253 254 255 else if (method.equals("todAddJs")){//保存角色参数 256 forward = todAddJs(form, module, user); 257 }else if (method.equals("addJsdListJson")){//获取新增页面的角色列表数据 258 forward = addJsdListJson(form, module, user); 259 }else if (method.equals("addJsd")){//保存角色新增数据 260 forward = addJsd(form, module, user); 261 }else if (method.equals("toUpdateJsd")){//保存角色数据 262 forward = toUpdateJsd(form, module, user); 263 }else if (method.equals("updateJsd")){//保存角色修改数据 264 forward = updateJsd(form, module, user); 265 }else if (method.equals("deleteJsd")){//角色删除数据 266 forward = deleteJsd(form, module, user); 267 } 268 return forward; 269 } 270 271 private Page deleteJsd(WebForm form, Module module, T_sys_user user) { 272 Connection conn = DBConnector.getconecttion(); 273 274 String groupid = StringUtil.null2String(form.get("groupid")); 275 String pluginid = StringUtil.null2String(form.get("pluginid")); 276 String buiid = StringUtil.null2String(form.get("buiid")); 277 278 String spids = StringUtil.null2String(form.get("roleid")); 279 String ids = StringUtil.getStrsplit(spids.split(",")); 280 String pni = getPluginInstID(pluginid,groupid,buiid); 281 282 String deleteSql = "DELETE from sxt_sys_plugininstrole where roleid in " + ids +"and PluginInstID=‘"+pni+"‘"; 283 System.out.println("===deleteSql====" + deleteSql); 284 //String delSql="DELETE from t_sys_menu where menuid in " +ids+ "and pluginid =‘"+pluginid+"‘"; 285 //System.out.println("===delSql==" + delSql); 286 try{ 287 DBHelper.update(conn, deleteSql, null); 288 //DBHelper.update(conn, delSql, null); 289 form.addResult("result", true); 290 }catch(Exception e){ 291 form.addResult("result", false); 292 e.printStackTrace(); 293 294 }finally{ 295 DBConnector.freecon(conn); 296 } 297 return module.findPage("jsonxml"); 298 } 299 300 private Page deleteCdd(WebForm form, Module module, T_sys_user user) { 301 Connection conn = DBConnector.getconecttion(); 302 303 String groupid = StringUtil.null2String(form.get("groupid")); 304 String pluginid = StringUtil.null2String(form.get("pluginid")); 305 String buiid = StringUtil.null2String(form.get("buiid")); 306 307 String spids = StringUtil.null2String(form.get("menuid")); 308 String ids = StringUtil.getStrsplit(spids.split(",")); 309 String pni = getPluginInstID(pluginid,groupid,buiid); 310 311 String deleteSql = "DELETE from SXT_SYS_PluginInstMenu where menuid in " + ids +"and PluginInstID=‘"+pni+"‘"; 312 System.out.println("===deleteSql====" + deleteSql); 313 //String delSql="DELETE from t_sys_menu where menuid in " +ids+ "and pluginid =‘"+pluginid+"‘"; 314 //System.out.println("===delSql==" + delSql); 315 try{ 316 DBHelper.update(conn, deleteSql, null); 317 //DBHelper.update(conn, delSql, null); 318 form.addResult("result", true); 319 }catch(Exception e){ 320 form.addResult("result", false); 321 e.printStackTrace(); 322 323 }finally{ 324 DBConnector.freecon(conn); 325 } 326 return module.findPage("jsonxml"); 327 } 328 329 private Page updateJsd(WebForm form, Module module, T_sys_user user) { 330 Connection con = DBConnector.getconecttion(); 331 String buiid= StringUtil.null2String(form.get("buiid")).trim(); 332 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 333 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 334 String roleid= StringUtil.null2String(form.get("roleid")).trim(); 335 System.out.println("======roleid======" + roleid); 336 String roleName= StringUtil.null2String(form.get("roleName")).trim(); 337 String pni =getPluginInstID(pluginid, groupid, buiid); 338 try{ 339 String upSql ="update sxt_sys_plugininstrole set roleName=‘"+roleName+"‘ where PluginInstID=‘"+pni+"‘ and roleid=‘" +roleid +"‘"; 340 System.out.println("======upSql=======" + upSql); 341 DBHelper.update(con, upSql, null); 342 //String updateSql="update t_sys_role set RoleName =‘"+roleName+"‘ where pluginid=‘"+pluginid+"‘ and roleid=‘"+roleid+"‘"; 343 //System.out.println("===updateSql==" + updateSql); 344 //DBHelper.update(con, updateSql, null); 345 form.addResult("msg", "角色数据修改成功!"); 346 }catch(Exception e){ 347 form.addResult("msg", "角色数据修改失败!"); 348 e.printStackTrace(); 349 }finally{ 350 DBConnector.freecon(con); 351 } 352 return module.findPage("toUpdateJsd"); 353 } 354 355 private Page toUpdateJsd(WebForm form, Module module, T_sys_user user) { 356 Connection con = DBConnector.getconecttion(); 357 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 358 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 359 String buiid= StringUtil.null2String(form.get("buiid")).trim(); 360 String roleid= StringUtil.null2String(form.get("roleid")).trim(); 361 362 System.out.println("====groupid===" + groupid+"=====pluginid====" + pluginid+"=====roleid=====" + roleid +"=====buiid=====" +buiid); 363 //查询插件实例id 364 String pni = getPluginInstID(pluginid,groupid,buiid); 365 366 try{ 367 String sql = "select roleid,rolename from sxt_sys_plugininstrole " 368 + " where roleid =‘" + roleid+"‘ and PluginInstID=‘" + pni +"‘"; 369 System.out.println("=======sql=========" + sql); 370 List<DBean> list = DBHelper.getDBeanList(con, sql, null); 371 form.addResult("slJsObj", list.get(0)); 372 }catch(Exception e){ 373 e.printStackTrace(); 374 }finally{ 375 DBConnector.freecon(con); 376 } 377 return module.findPage("toUpdateJsd"); 378 } 379 380 private Page updateCdd(WebForm form, Module module, T_sys_user user) { 381 Connection con = DBConnector.getconecttion(); 382 String buiid= StringUtil.null2String(form.get("buiid")).trim(); 383 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 384 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 385 String menuid= StringUtil.null2String(form.get("menuid")).trim(); 386 System.out.println("======menuid======" + menuid); 387 String menuName= StringUtil.null2String(form.get("menuName")).trim(); 388 String menuicon= StringUtil.null2String(form.get("menuicon")).trim(); 389 String menuIconbgColor= StringUtil.null2String(form.get("menuIconbgColor")).trim(); 390 String pni =getPluginInstID(pluginid, groupid, buiid); 391 try{ 392 String upSql ="update SXT_SYS_PluginInstMenu set menuname=‘"+menuName+"‘,menuicon=‘"+menuicon+"‘,menuiconbgcolor=‘"+menuIconbgColor+"‘ where PluginInstID=‘"+pni+"‘ and menuid=‘" +menuid +"‘"; 393 System.out.println("======upSql=======" + upSql); 394 DBHelper.update(con, upSql, null); 395 //String updateSql="update t_sys_role set RoleName =‘"+roleName+"‘ where pluginid=‘"+pluginid+"‘ and roleid=‘"+roleid+"‘"; 396 //System.out.println("===updateSql==" + updateSql); 397 //DBHelper.update(con, updateSql, null); 398 form.addResult("msg", "角色数据修改成功!"); 399 }catch(Exception e){ 400 form.addResult("msg", "角色数据修改失败!"); 401 e.printStackTrace(); 402 }finally{ 403 DBConnector.freecon(con); 404 } 405 return module.findPage("toUpdateCdd"); 406 } 407 408 private Page toUpdateCdd(WebForm form, Module module, T_sys_user user) { 409 Connection con = DBConnector.getconecttion(); 410 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 411 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 412 String buiid= StringUtil.null2String(form.get("buiid")).trim(); 413 String menuid= StringUtil.null2String(form.get("menuid")).trim(); 414 415 System.out.println("====groupid===" + groupid+"=====pluginid====" + pluginid+"=====menuid=====" + menuid +"=====buiid=====" +buiid); 416 //查询插件实例id 417 String pni = getPluginInstID(pluginid,groupid,buiid); 418 419 try{ 420 String sql = "select MenuName,MenuIcon,MenuIconBgColor from SXT_SYS_PluginInstMenu " 421 + " where MenuID =‘" + menuid+"‘ and PluginInstID=‘" + pni +"‘"; 422 System.out.println("=======sql=========" + sql); 423 List<DBean> list = DBHelper.getDBeanList(con, sql, null); 424 form.addResult("slcdObj", list.get(0)); 425 }catch(Exception e){ 426 e.printStackTrace(); 427 }finally{ 428 DBConnector.freecon(con); 429 } 430 return module.findPage("toUpdateCdd"); 431 } 432 433 private Page addJsd(WebForm form, Module module, T_sys_user user) { 434 Connection con = DBConnector.getconecttion(); 435 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 436 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 437 String buiid= StringUtil.null2String(form.get("buiid")).trim(); 438 439 String ids= StringUtil.null2String(form.get("ids")).trim(); 440 //System.out.println("=======ids======" +ids); 441 String[] roleId = null; 442 if(ids!=null || !ids.equals("")){ 443 roleId =ids.split(","); 444 } 445 446 String roleNames= StringUtil.null2String(form.get("roleNames")).trim(); 447 String[] roleName = null; 448 if(roleNames!=null || !roleNames.equals("")){ 449 if(roleNames.indexOf(",") > 0){ 450 roleName =roleNames.split(","); 451 } 452 } 453 //查询插件实例id 454 String pni = getPluginInstID(pluginid,groupid,buiid); 455 //System.out.println("=====pni=======" + pni+"=======buiid=====" +buiid); 456 457 try{ 458 459 for(int i=0; i < roleId.length; i++){ 460 String sql ="insert into sxt_sys_plugininstrole (PluginInstID,roleid,rolename) values(‘"+ pni+ "‘,‘"+roleId[i] + "‘,‘"+roleName[i]+"‘)"; 461 //System.out.println("==sql===" + sql); 462 DBHelper.insert(con, sql, null); 463 } 464 form.addResult("result", true); 465 }catch(Exception e){ 466 form.addResult("result", false); 467 e.printStackTrace(); 468 }finally{ 469 DBConnector.freecon(con); 470 } 471 return module.findPage("jsonxml"); 472 } 473 474 private Page addJsdListJson(WebForm form, Module module, T_sys_user user) { 475 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 476 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 477 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 478 String sort = StringUtil.null2String(form.get("sort"));//排序字段 479 String dir = StringUtil.null2String(form.get("order"));//DESC 480 481 String pluginid = StringUtil.null2String(form.get("pluginid")); 482 String groupid = StringUtil.null2String(form.get("groupid")); 483 String buiid = StringUtil.null2String(form.get("buiid")); 484 String pni = getPluginInstID(pluginid,groupid,buiid); 485 486 //System.out.println("======pni1======"+pni+"=====buiid=======" +buiid); 487 String orderSql=""; 488 if(!sort.equals("")){ 489 orderSql +=" order by "+sort+" "+dir+""; 490 } 491 try{ 492 493 String seleSql="SELECT roleid,rolename FROM t_sys_role where pluginid=‘"+pluginid 494 + "‘and roleid not in (select roleid from sxt_sys_plugininstrole where plugininstid =‘"+ pni+"‘)"; 495 //System.out.println("====seleSql1=====" + seleSql); 496 String sqlQuery = ObjectCtl.getPageSql(seleSql+orderSql, start, limit); 497 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 498 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + seleSql +orderSql + ")" ); 499 500 HttpServletResponse response = ActionContext.getContext().getResponse(); 501 ObjectCtl.sendListData(response, count, list); 502 form.addResult("msg", "数据加载成功!"); 503 }catch(Exception e){ 504 form.addResult("msg", "数据加载失败!"); 505 e.printStackTrace(); 506 }finally{ 507 DBConnector.freecon(con); 508 } 509 return module.findPage("jsonxml"); 510 } 511 512 private Page todAddJs(WebForm form, Module module, T_sys_user user) { 513 String groupid = StringUtil.null2String(form.get("groupid")); 514 String buiid = StringUtil.null2String(form.get("buiid")); 515 String pluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件ID 516 form.addResult("groupid", groupid); 517 form.addResult("buiid", buiid); 518 form.addResult("pluginid", pluginid); 519 return module.findPage("todAddJs"); 520 } 521 522 private Page AddCdd(WebForm form, Module module, T_sys_user user) { 523 Connection con = DBConnector.getconecttion(); 524 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 525 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 526 String buiid= StringUtil.null2String(form.get("buiid")).trim(); 527 String ids= StringUtil.null2String(form.get("ids")).trim(); 528 529 String[] menuId = null; 530 if(ids!=null || !ids.equals("")){ 531 menuId =ids.split(","); 532 } 533 534 String menunames= StringUtil.null2String(form.get("menunames")).trim(); 535 String[] mName = null; 536 if(menunames!=null || !menunames.equals("")){ 537 if(menunames.indexOf(",") > 0){ 538 mName =menunames.split(","); 539 } 540 } 541 //查询插件实例id 542 String pni = getPluginInstID(pluginid,groupid,buiid); 543 //System.out.println("=====pni=======" + pni+"=======buiid=====" +buiid); 544 545 try{ 546 547 for(int i=0; i < menuId.length; i++){ 548 String sql ="insert into SXT_SYS_PluginInstMenu (PluginInstID,MenuID,MenuName) values(‘"+ pni+ "‘,‘"+menuId[i] + "‘,‘"+mName[i]+"‘)"; 549 //System.out.println("==sql===" + sql); 550 DBHelper.insert(con, sql, null); 551 } 552 form.addResult("result", true); 553 }catch(Exception e){ 554 form.addResult("result", false); 555 e.printStackTrace(); 556 }finally{ 557 DBConnector.freecon(con); 558 } 559 return module.findPage("jsonxml"); 560 } 561 562 private Page addCddListJson(WebForm form, Module module, T_sys_user user) { 563 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 564 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 565 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 566 String sort = StringUtil.null2String(form.get("sort"));//排序字段 567 String dir = StringUtil.null2String(form.get("order"));//DESC 568 569 String pluginid = StringUtil.null2String(form.get("pluginid")); 570 String groupid = StringUtil.null2String(form.get("groupid")); 571 String buiid = StringUtil.null2String(form.get("buiid")); 572 String pni = getPluginInstID(pluginid,groupid,buiid); 573 574 //System.out.println("======pni======"+pni+"=====buiid=======" +buiid); 575 String orderSql=""; 576 if(!sort.equals("")){ 577 orderSql +=" order by "+sort+" "+dir+""; 578 } 579 try{ 580 581 String seleSql="SELECT menuid,menuname FROM T_SYS_MENU where pluginid=‘"+pluginid 582 + "‘and menuid not in (select menuid from SXT_SYS_PluginInstMenu where plugininstid =‘"+ pni+"‘)"; 583 //System.out.println("====seleSql=====" + seleSql); 584 String sqlQuery = ObjectCtl.getPageSql(seleSql+orderSql, start, limit); 585 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 586 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + seleSql +orderSql + ")" ); 587 588 HttpServletResponse response = ActionContext.getContext().getResponse(); 589 ObjectCtl.sendListData(response, count, list); 590 form.addResult("msg", "数据加载成功!"); 591 }catch(Exception e){ 592 form.addResult("msg", "数据加载失败!"); 593 e.printStackTrace(); 594 }finally{ 595 DBConnector.freecon(con); 596 } 597 return module.findPage("jsonxml"); 598 } 599 600 private Page todAddCd(WebForm form, Module module, T_sys_user user) { 601 String groupid = StringUtil.null2String(form.get("groupid")); 602 String buiid = StringUtil.null2String(form.get("buiid")); 603 String pluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件ID 604 form.addResult("groupid", groupid); 605 form.addResult("buiid", buiid); 606 form.addResult("pluginid", pluginid); 607 return module.findPage("todAddCd"); 608 } 609 610 //多业务实例页面的角色列表数据 611 private Page jsListJson(WebForm form, Module module, T_sys_user user) { 612 Connection con = DBConnector.getconecttion(); 613 String groupid = StringUtil.null2String(form.get("groupid")); 614 String buiid = StringUtil.null2String(form.get("buiid")); 615 String pluginid = StringUtil.null2String(form.get("pluginid")); 616 //System.out.println("==groupid==" + groupid+"==buiid=="+buiid+"==pluginid=="+pluginid); 617 618 String pni = getPluginInstID(pluginid,groupid,buiid); 619 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 620 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 621 String sort = StringUtil.null2String(form.get("sort"));//排序字段 622 String dir = StringUtil.null2String(form.get("order"));//DESC 623 624 String orderSql=""; 625 if(!sort.equals("")){ 626 orderSql +=" order by "+sort+" "+dir+""; 627 } 628 629 try{ 630 String jsSql ="select roleid,rolename from sxt_sys_plugininstrole where plugininstid= ‘"+pni+"‘"; 631 //System.out.println("=====jsSql========" + jsSql); 632 String sqlQuery = ObjectCtl.getPageSql(jsSql+orderSql, start, limit); 633 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 634 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + jsSql+orderSql + ")" ); 635 HttpServletResponse response = ActionContext.getContext().getResponse(); 636 ObjectCtl.sendListData(response, count, list); 637 form.addResult("msg", "数据加载成功!"); 638 }catch(Exception e){ 639 form.addResult("msg", "数据加载失败!"); 640 e.printStackTrace(); 641 }finally{ 642 DBConnector.freecon(con); 643 } 644 return null; 645 } 646 647 //多业务实例页面的菜单列表数据 648 private Page cdListJson(WebForm form, Module module, T_sys_user user) { 649 Connection con = DBConnector.getconecttion(); 650 String groupid = StringUtil.null2String(form.get("groupid")); 651 String buiid = StringUtil.null2String(form.get("buiid")); 652 String pluginid = StringUtil.null2String(form.get("pluginid")); 653 //System.out.println("==groupid==" + groupid+"==buiid=="+buiid+"==pluginid=="+pluginid); 654 655 String pni = getPluginInstID(pluginid,groupid,buiid); 656 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 657 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 658 String sort = StringUtil.null2String(form.get("sort"));//排序字段 659 String dir = StringUtil.null2String(form.get("order"));//DESC 660 661 String orderSql=""; 662 if(!sort.equals("")){ 663 orderSql +=" order by "+sort+" "+dir+""; 664 } 665 666 try{ 667 String cdSql ="select menuid,menuname from SXT_SYS_PluginInstMenu where plugininstid= ‘"+pni+"‘"; 668 //System.out.println("=====cdSql========" + cdSql); 669 String sqlQuery = ObjectCtl.getPageSql(cdSql+orderSql, start, limit); 670 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 671 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + cdSql+orderSql + ")" ); 672 HttpServletResponse response = ActionContext.getContext().getResponse(); 673 ObjectCtl.sendListData(response, count, list); 674 form.addResult("msg", "数据加载成功!"); 675 }catch(Exception e){ 676 form.addResult("msg", "数据加载失败!"); 677 e.printStackTrace(); 678 }finally{ 679 DBConnector.freecon(con); 680 } 681 return null; 682 } 683 684 685 //多业务实例页面的菜单与角色的tab页面 686 private Page todywslUpdatecj(WebForm form, Module module, T_sys_user user) { 687 String groupid = StringUtil.null2String(form.get("groupid")); 688 String buiid = StringUtil.null2String(form.get("buiid")); 689 String pluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件ID 690 form.addResult("groupid", groupid); 691 form.addResult("buiid", buiid); 692 form.addResult("pluginid", pluginid); 693 return module.findPage("todywslUpdatecj"); 694 } 695 696 697 698 //角色删除数据 699 private Page deleteJs(WebForm form, Module module, T_sys_user user) { 700 Connection conn = DBConnector.getconecttion(); 701 702 String groupid = StringUtil.null2String(form.get("groupid")); 703 704 String spids = StringUtil.null2String(form.get("plugininstid")); 705 String ids = StringUtil.getStrsplit(spids.split(",")); 706 String srids = StringUtil.null2String(form.get("roleid")); 707 String roids = StringUtil.getStrsplit(srids.split(",")); 708 String pluginid = StringUtil.null2String(form.get("pluginid")); 709 710 //System.out.println("=====ids==="+ ids +"====roids=====" + roids +"===pluginid====" + pluginid); 711 String delSql ="DELETE from SXT_SYS_PluginInstRole where roleId in " + roids +" and PluginInstID in "+ids; 712 //System.out.println("======delSql======" + delSql); 713 String deleteSql ="DELETE from t_sys_role where roleId in " +roids+" and pluginid=‘" +pluginid+"‘"; 714 //System.out.println("======deleteSql======" + deleteSql); 715 try{ 716 DBHelper.update(conn, delSql, null); 717 DBHelper.update(conn, deleteSql, null); 718 form.addResult("result", true); 719 }catch(Exception e){ 720 form.addResult("result", false); 721 e.printStackTrace(); 722 }finally{ 723 DBConnector.freecon(conn); 724 } 725 return module.findPage("jsonxml"); 726 } 727 728 //保存插件角色修改数据 729 private Page updateJs(WebForm form, Module module, T_sys_user user) { 730 Connection con = DBConnector.getconecttion(); 731 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 732 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 733 String plugininstid= StringUtil.null2String(form.get("plugininstid")).trim(); 734 String roleid= StringUtil.null2String(form.get("roleid")).trim(); 735 //System.out.println("======roleid======" + roleid); 736 String roleName= StringUtil.null2String(form.get("roleName")).trim(); 737 try{ 738 String upSql ="update SXT_SYS_PluginInstRole set RoleName=‘"+roleName+"‘ where PluginInstID=‘"+plugininstid+"‘ and RoleID=‘" +roleid +"‘"; 739 //System.out.println("======upSql=======" + upSql); 740 DBHelper.update(con, upSql, null); 741 String updateSql="update t_sys_role set RoleName =‘"+roleName+"‘ where pluginid=‘"+pluginid+"‘ and roleid=‘"+roleid+"‘"; 742 //System.out.println("===updateSql==" + updateSql); 743 DBHelper.update(con, updateSql, null); 744 form.addResult("msg", "角色数据修改成功!"); 745 }catch(Exception e){ 746 form.addResult("msg", "角色数据修改失败!"); 747 e.printStackTrace(); 748 }finally{ 749 DBConnector.freecon(con); 750 } 751 return module.findPage("toUpdateJs"); 752 } 753 754 //插件角色修改页面的数据 755 private Page toUpdateJs(WebForm form, Module module, T_sys_user user) { 756 Connection con = DBConnector.getconecttion(); 757 // String groupid= StringUtil.null2String(form.get("groupid")).trim(); 758 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 759 form.addResult("pluginid", pluginid); 760 String plugininstid= StringUtil.null2String(form.get("plugininstid")).trim(); 761 form.addResult("plugininstid", plugininstid); 762 String roleid= StringUtil.null2String(form.get("roleid")).trim(); 763 form.addResult("roleid", roleid); 764 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 765 //System.out.println("====plugininstid===" + plugininstid +"=====roleid=====" + roleid); 766 try{ 767 String seSql="select RoleID,RoleName from SXT_SYS_PluginInstRole where PluginInstID=‘"+plugininstid+"‘ and RoleID=‘"+roleid+"‘"; 768 List<DBean> list = DBHelper.getDBeanList(con, seSql, null); 769 form.addResult("sljsObj", list.get(0)); 770 }catch(Exception e){ 771 e.printStackTrace(); 772 }finally{ 773 DBConnector.freecon(con); 774 } 775 return module.findPage("toUpdateJs"); 776 } 777 778 //保存插件菜单修改数据 779 780 //保存角色菜单数据 781 private Page addJs(WebForm form, Module module, T_sys_user user) { 782 Connection con = DBConnector.getconecttion(); 783 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 784 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 785 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 786 787 String ids= StringUtil.null2String(form.get("ids")).trim(); 788 String[] id = null; 789 if(ids!=null || !ids.equals("")){ 790 id =ids.split(","); 791 } 792 793 String roleIds= StringUtil.null2String(form.get("roleIds")).trim(); 794 795 String[] rId = null; 796 if(roleIds!=null || !roleIds.equals("")){ 797 rId =roleIds.split(","); 798 } 799 String roleNames= StringUtil.null2String(form.get("roleNames")).trim(); 800 String[] rName = null; 801 if(roleNames!=null || !roleNames.equals("")){ 802 rName =roleNames.split(","); 803 } 804 //System.out.println("=ids="+ids+"=roleNames=" + roleNames); 805 //查询插件实例id 806 String pni = getPluginInstID(pluginid,groupid); 807 try{ 808 for(int i=0; i < id.length; i++){ 809 String sql ="insert into SXT_SYS_PluginInstRole values(‘"+pni+"‘,‘"+rId[i]+"‘,‘"+rName[i]+"‘)"; 810 //System.out.println("==sql===" + sql); 811 DBHelper.insert(con, sql, null); 812 } 813 814 form.addResult("result", true); 815 }catch(Exception e){ 816 form.addResult("result", false); 817 e.printStackTrace(); 818 }finally{ 819 DBConnector.freecon(con); 820 } 821 return module.findPage("jsonxml"); 822 } 823 824 //角色新增按钮列表页面数据来源 825 private Page addJsListJson(WebForm form, Module module, T_sys_user user) { 826 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 827 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 828 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 829 String sort = StringUtil.null2String(form.get("sort"));//排序字段 830 String dir = StringUtil.null2String(form.get("order"));//DESC 831 String orderSql=""; 832 if(!sort.equals("")){ 833 orderSql +=" order by "+sort+" "+dir+""; 834 } 835 try{ 836 String pluginid = StringUtil.null2String(form.get("pluginid")); 837 String groupid = StringUtil.null2String(form.get("groupid")); 838 String pni = getPluginInstID(pluginid,groupid); 839 String seleSql="SELECT id,roleid,rolename FROM t_sys_role where pluginid=‘"+pluginid 840 + "‘ and roleid not in (select roleid from SXT_SYS_PluginInstRole where plugininstid =‘"+ pni+"‘)"; 841 //System.out.println("====seleSql=====" + seleSql); 842 String sqlQuery = ObjectCtl.getPageSql(seleSql+orderSql, start, limit); 843 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 844 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + seleSql+orderSql + ")" ); 845 846 HttpServletResponse response = ActionContext.getContext().getResponse(); 847 ObjectCtl.sendListData(response, count, list); 848 form.addResult("msg", "数据加载成功!"); 849 }catch(Exception e){ 850 form.addResult("msg", "数据加载失败!"); 851 e.printStackTrace(); 852 }finally{ 853 DBConnector.freecon(con); 854 } 855 856 return module.findPage("jsonxml"); 857 } 858 859 //角色的列表数据 860 private Page cjjsListJson(WebForm form, Module module, T_sys_user user) { 861 Connection con = DBConnector.getconecttion(); 862 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 863 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 864 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 865 //System.out.println("======groupid======" + groupid+"======pluginid======" + pluginid); 866 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 867 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 868 String sort = StringUtil.null2String(form.get("sort"));//排序字段 869 String dir = StringUtil.null2String(form.get("order"));//DESC 870 871 String orderSql=""; 872 if(!sort.equals("")){ 873 orderSql +=" order by "+sort+" "+dir+""; 874 } 875 //查询插件实例id 876 String pni = getPluginInstID(pluginid,groupid); 877 try{ 878 String jsSql ="select PluginInstID,RoleID,RoleName from SXT_SYS_PluginInstRole where PluginInstID =‘"+pni+"‘"; 879 //System.out.println("======jsSql=====" + jsSql); 880 String sqlQuery = ObjectCtl.getPageSql(jsSql+orderSql, start, limit); 881 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 882 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + jsSql+orderSql + ")" ); 883 HttpServletResponse response = ActionContext.getContext().getResponse(); 884 ObjectCtl.sendListData(response, count, list); 885 form.addResult("msg", "数据加载成功!"); 886 }catch(Exception e){ 887 form.addResult("msg", "数据加载失败!"); 888 e.printStackTrace(); 889 }finally{ 890 DBConnector.freecon(con); 891 } 892 return null; 893 } 894 895 896 897 //删除菜单信息 898 private Page deleteCd(WebForm form, Module module, T_sys_user user) { 899 Connection conn = DBConnector.getconecttion(); 900 String spids = StringUtil.null2String(form.get("menuid")); 901 String groupid = StringUtil.null2String(form.get("groupid")); 902 String pluginid = StringUtil.null2String(form.get("pluginid")); 903 904 String ids = StringUtil.getStrsplit(spids.split(",")); 905 String pni = getPluginInstID(pluginid,groupid); 906 907 String deleteSql = "DELETE from SXT_SYS_PluginInstMenu where menuid in " + ids +"and PluginInstID=‘"+pni+"‘"; 908 //System.out.println("===deleteSql====" + deleteSql); 909 String delSql="DELETE from t_sys_menu where menuid in " +ids+ "and pluginid =‘"+pluginid+"‘"; 910 //System.out.println("===delSql==" + delSql); 911 try{ 912 DBHelper.update(conn, deleteSql, null); 913 DBHelper.update(conn, delSql, null); 914 form.addResult("result", true); 915 }catch(Exception e){ 916 form.addResult("result", false); 917 e.printStackTrace(); 918 919 }finally{ 920 DBConnector.freecon(conn); 921 } 922 return module.findPage("jsonxml"); 923 } 924 925 //保存菜单修改数据 926 private Page updateCd(WebForm form, Module module, T_sys_user user) { 927 Connection con = DBConnector.getconecttion(); 928 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 929 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 930 String menuid= StringUtil.null2String(form.get("menuid")).trim(); 931 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 932 //System.out.println("====groupid==" + groupid+"==pluginid==" + pluginid +"==menuid==" + menuid); 933 //查询插件实例id 934 935 String pni = getPluginInstID(pluginid,groupid); 936 //System.out.println("=====pni=====" +pni); 937 String menuName= StringUtil.null2String(form.get("menuName")).trim(); 938 String menuIcon= StringUtil.null2String(form.get("menuicon")).trim(); 939 String menuIconbgColor= StringUtil.null2String(form.get("menuIconbgColor")).trim(); 940 //System.out.println("=======menuIcon=====" + menuIcon); 941 try{ 942 String updateSql="update SXT_SYS_PluginInstMenu set plugininstid=‘"+ pni+ "‘,MenuID=‘"+menuid+"‘, menuName=‘"+menuName+"‘,menuIcon=‘"+menuIcon 943 +"‘,MenuIconBgColor=‘" +menuIconbgColor+"‘ where MenuID=‘"+menuid+"‘"; 944 //System.out.println("=======updateSql===========" + updateSql); 945 DBHelper.update(con, updateSql, null); 946 947 String updSql="update t_sys_menu set menuname =‘" +menuName+"‘,icon=‘" +menuIcon+"‘,iconbgcolor=‘"+menuIconbgColor 948 +"‘ where pluginid=‘"+pluginid+"‘ and menuid=‘"+menuid+"‘"; 949 //System.out.println("===updSql====" + updSql); 950 DBHelper.update(con, updSql, null); 951 form.addResult("msg", "菜单数据修改成功!"); 952 }catch(Exception e){ 953 form.addResult("msg", "菜单数据修改失败!"); 954 e.printStackTrace(); 955 }finally{ 956 DBConnector.freecon(con); 957 } 958 959 return module.findPage("toUpdateCd"); 960 } 961 962 //菜单修改页面的数据 963 private Page toUpdateCd(WebForm form, Module module, T_sys_user user) { 964 Connection con = DBConnector.getconecttion(); 965 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 966 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 967 String menuid= StringUtil.null2String(form.get("menuid")).trim(); 968 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 969 //System.out.println("====groupid===" + groupid+"=====pluginid====" + pluginid+"=====menuid=====" + menuid); 970 //查询插件实例id 971 String pni = getPluginInstID(pluginid,groupid); 972 973 try{ 974 String sql = "select PluginInstID,MenuID,MenuName,MenuIcon,MenuIconBgColor from SXT_SYS_PluginInstMenu " 975 + " where MenuID =‘" + menuid+"‘ and PluginInstID=‘" + pni +"‘"; 976 //System.out.println("=======sql=========" + sql); 977 List<DBean> list = DBHelper.getDBeanList(con, sql, null); 978 form.addResult("slcdObj", list.get(0)); 979 }catch(Exception e){ 980 e.printStackTrace(); 981 }finally{ 982 DBConnector.freecon(con); 983 } 984 return module.findPage("toUpdateCd"); 985 } 986 987 //保存菜单新增数据 988 private Page addCd(WebForm form, Module module, T_sys_user user) { 989 Connection con = DBConnector.getconecttion(); 990 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 991 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 992 String ids= StringUtil.null2String(form.get("ids")).trim(); 993 994 String[] menuId = null; 995 if(ids!=null || !ids.equals("")){ 996 menuId =ids.split(","); 997 } 998 999 String menunames= StringUtil.null2String(form.get("menunames")).trim(); 1000 String[] mName = null; 1001 if(menunames!=null || !menunames.equals("")){ 1002 if(menunames.indexOf(",") > 0){ 1003 mName =menunames.split(","); 1004 } 1005 } 1006 1007 //都是空值(待扩展) 1008 String icons= StringUtil.null2String(form.get("icons")); 1009 String ics = icons.replace("undefined,", ""); 1010 //System.out.println("=======ics======="+ics); 1011 //都是空值(待扩展) 1012 String iconbgcolors = StringUtil.null2String(form.get("iconbgcolors")); 1013 String iconbcs = iconbgcolors.replace("undefined,", ""); 1014 //System.out.println("=======iconbcs========"+iconbcs); 1015 1016 1017 //查询插件实例id 1018 String pni = getPluginInstID(pluginid,groupid); 1019 1020 try{ 1021 1022 for(int i=0; i < menuId.length; i++){ 1023 String sql ="insert into SXT_SYS_PluginInstMenu (PluginInstID,MenuID,MenuName,MenuIcon,MenuIconBgColor) values(‘"+ pni+ "‘,‘"+menuId[i] + "‘,‘"+mName[i]+"‘,‘"+ics+"‘,‘"+iconbcs+"‘)"; 1024 //System.out.println("==sql===" + sql); 1025 DBHelper.insert(con, sql, null); 1026 } 1027 form.addResult("result", true); 1028 }catch(Exception e){ 1029 form.addResult("result", false); 1030 e.printStackTrace(); 1031 }finally{ 1032 DBConnector.freecon(con); 1033 } 1034 return module.findPage("jsonxml"); 1035 } 1036 1037 //菜单新增按钮列表页面数据来源 1038 private Page addCdListJson(WebForm form, Module module, T_sys_user user) { 1039 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1040 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 1041 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 1042 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1043 String dir = StringUtil.null2String(form.get("order"));//DESC 1044 String orderSql=""; 1045 if(!sort.equals("")){ 1046 orderSql +=" order by "+sort+" "+dir+""; 1047 } 1048 try{ 1049 String pluginid = StringUtil.null2String(form.get("pluginid")); 1050 String groupid = StringUtil.null2String(form.get("groupid")); 1051 String pni = getPluginInstID(pluginid,groupid); 1052 String seleSql="SELECT menuid,menuname,icon,iconbgcolor FROM T_SYS_MENU where pluginid=‘"+pluginid 1053 + "‘and menuid not in (select menuid from SXT_SYS_PluginInstMenu where plugininstid =‘"+ pni+"‘)"; 1054 //System.out.println("====seleSql=====" + seleSql); 1055 String sqlQuery = ObjectCtl.getPageSql(seleSql+orderSql, start, limit); 1056 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1057 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + seleSql +orderSql + ")" ); 1058 1059 HttpServletResponse response = ActionContext.getContext().getResponse(); 1060 ObjectCtl.sendListData(response, count, list); 1061 form.addResult("msg", "数据加载成功!"); 1062 }catch(Exception e){ 1063 form.addResult("msg", "数据加载失败!"); 1064 e.printStackTrace(); 1065 }finally{ 1066 DBConnector.freecon(con); 1067 } 1068 return module.findPage("jsonxml"); 1069 } 1070 1071 1072 //菜单的列表数据 1073 private Page plugListJson(WebForm form, Module module, T_sys_user user) { 1074 Connection con = DBConnector.getconecttion(); 1075 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 1076 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 1077 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 1078 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 1079 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 1080 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1081 String dir = StringUtil.null2String(form.get("order"));//DESC 1082 //System.out.println("===sort====" + sort +"==dir=="+dir); 1083 String orderSql=""; 1084 if(!sort.equals("")){ 1085 orderSql +=" order by "+sort+" "+dir+""; 1086 } 1087 //查询插件实例id 1088 String pni = getPluginInstID(pluginid,groupid); 1089 try{ 1090 String plugListSql ="select MenuID,MenuName,MenuIcon,MenuIconBgColor from SXT_SYS_PluginInstMenu " 1091 + " where PluginInstID = ‘"+ pni+"‘"; 1092 1093 //System.out.println("======plugListSql=======" + plugListSql); 1094 1095 String sqlQuery = ObjectCtl.getPageSql(plugListSql+orderSql, start, limit); 1096 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1097 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + plugListSql+orderSql + ")" ); 1098 1099 HttpServletResponse response = ActionContext.getContext().getResponse(); 1100 ObjectCtl.sendListData(response, count, list); 1101 form.addResult("msg", "数据加载成功!"); 1102 }catch(Exception e){ 1103 form.addResult("msg", "数据加载失败!"); 1104 e.printStackTrace(); 1105 }finally{ 1106 DBConnector.freecon(con); 1107 } 1108 return module.findPage("jsonxml"); 1109 } 1110 1111 1112 1113 /** 1114 * 查询插件实例id 1115 * @param pluginid 插件id 1116 * @param groupid 集团id 1117 * @return 1118 */ 1119 public String getPluginInstID(String pluginid,String groupid){ 1120 Connection con = DBConnector.getconecttion(); 1121 String selectSql ="select plugininstid from SXT_SYS_PluginInst where pluginid =‘"+pluginid+"‘ and groupid=‘"+groupid+"‘"; 1122 String pni= ObjectCtl.getStrRowValue(con, selectSql) ; 1123 return pni; 1124 } 1125 1126 /** 1127 * 多业务查询插件实例id 1128 * @param pluginid 插件id 1129 * @param groupid 集团id 1130 * @param buiid 业务id 1131 * @return 1132 */ 1133 public String getPluginInstID(String pluginid,String groupid,String buiid){ 1134 Connection con = DBConnector.getconecttion(); 1135 String selectSql ="select plugininstid from SXT_SYS_PluginInst where pluginid =‘"+pluginid+"‘ and groupid=‘"+groupid+"‘ and buiid =‘"+buiid+"‘"; 1136 String pni= ObjectCtl.getStrRowValue(con, selectSql) ; 1137 return pni; 1138 } 1139 1140 1141 /** 1142 * 转到多业务实例列表页面 1143 */ 1144 private Page dywslList(WebForm form, Module module, T_sys_user user){ 1145 1146 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1147 try{ 1148 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集团id 1149 String actionpluginid = StringUtil.null2String(form.get("pluginid")).trim();//插件id 1150 form.addResult("groupid", groupid); 1151 1152 form.addResult("actionpluginid", actionpluginid); 1153 form.addResult("adminlogin", StringUtil.null2String(form.get("adminlogin"))); 1154 }catch (Exception e) { 1155 e.printStackTrace(); 1156 }finally{ 1157 DBConnector.freecon(con); //释放数据库连接 1158 } 1159 return module.findPage("dywslList"); 1160 } 1161 1162 /** 1163 * 多业务实例列表数据 1164 */ 1165 private Page dywslListJson(WebForm form, Module module, T_sys_user user) { 1166 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1167 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 1168 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 1169 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1170 String dir = StringUtil.null2String(form.get("order"));//DESC 1171 1172 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集团id 1173 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 1174 try{ 1175 String sql = "select a.groupid,a.buiid,a.buiname,a.opstartname,a.opstarturl,a.opobjname,a.opobjurl, " + 1176 " decode(a.opobjdataperm,‘0‘,‘不进行权限控制‘,‘1‘,‘进行权限控制‘) opobjdataperm, " + 1177 " a.opwindowstitle,a.opfinishname,a.opfinishurl,a.t1initclassname, " + 1178 " a.photonum, " + 1179 " a.videonum, " + 1180 " a.audionum, " + 1181 " a.isremark,b.plugininstid from T_Job_Bui a left join SXT_SYS_PluginInst b on a.buiid = b.buiid where a.groupid = ‘"+groupid+"‘ and b.pluginid = ‘"+actionpluginid+"‘ "; 1182 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1183 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1184 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 1185 HttpServletResponse response = ActionContext.getContext().getResponse(); 1186 ObjectCtl.sendListData(response, count, list); 1187 }catch (Exception e) { 1188 e.printStackTrace(); 1189 } 1190 finally 1191 { 1192 DBConnector.freecon(con); //释放数据库连接 1193 } 1194 return module.findPage("jsonxml"); 1195 } 1196 1197 /** 1198 * 转到添加多业务实例页面 1199 */ 1200 private Page toAddSl(WebForm form, Module module, T_sys_user user){ 1201 1202 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1203 try{ 1204 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 1205 form.addResult("actionpluginid", actionpluginid); 1206 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1207 form.addResult("groupid", groupid); 1208 String adminlogin = StringUtil.null2String(form.get("adminlogin")).trim(); 1209 form.addResult("adminlogin", adminlogin); 1210 }catch (Exception e) { 1211 e.printStackTrace(); 1212 }finally{ 1213 DBConnector.freecon(con); //释放数据库连接 1214 } 1215 return module.findPage("dywslAdd"); 1216 } 1217 1218 /** 1219 * 执行添加多业务实例操作 1220 */ 1221 private Page addDywsl(WebForm form, Module module, T_sys_user user){ 1222 1223 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1224 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1225 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1226 String buiid = BhGenerator.getBh(); 1227 String buiname = StringUtil.null2String(form.get("buiname")).trim(); 1228 String opstartname = StringUtil.null2String(form.get("opstartname")).trim(); 1229 String opstarturl = StringUtil.null2String(form.get("opstarturl")).trim(); 1230 String opobjname = StringUtil.null2String(form.get("opobjname")).trim(); 1231 String opobjurl = StringUtil.null2String(form.get("opobjurl")).trim(); 1232 String opobjdataperm = StringUtil.null2String(form.get("opobjdataperm")).trim(); 1233 String opwindowstitle = StringUtil.null2String(form.get("opwindowstitle")).trim(); 1234 String opfinishname = StringUtil.null2String(form.get("opfinishname")).trim(); 1235 String opfinishurl = StringUtil.null2String(form.get("opfinishurl")).trim(); 1236 String t1initclassname = StringUtil.null2String(form.get("t1initclassname")).trim(); 1237 String photonum = StringUtil.null2String(form.get("photonum")).trim(); 1238 String videonum = StringUtil.null2String(form.get("videonum")).trim(); 1239 String audionum = StringUtil.null2String(form.get("audionum")).trim(); 1240 String isremark = StringUtil.null2String(form.get("isremark")).trim(); 1241 String adminlogin = StringUtil.null2String(form.get("adminlogin")).trim(); 1242 System.err.println("-----"+adminlogin); 1243 try{ 1244 1245 String addsql = "insert into T_Job_Bui ( " + 1246 " groupid,buiid,buiname,opstartname,opstarturl,opobjname,opobjurl,opobjdataperm,opwindowstitle, " + 1247 " opfinishname,opfinishurl,t1initclassname,photonum,videonum,audionum,isremark) " + 1248 " values (‘"+groupid+"‘,‘"+buiid+"‘,‘"+buiname+"‘,‘"+opstartname+"‘,‘"+opstarturl+"‘,‘"+opobjname+"‘, " + 1249 " ‘"+opobjurl+"‘,‘"+opobjdataperm+"‘,‘"+opwindowstitle+"‘,‘"+opfinishname+"‘,‘"+opfinishurl+"‘, " + 1250 " ‘"+t1initclassname+"‘,‘"+photonum+"‘,‘"+videonum+"‘,‘"+audionum+"‘,‘"+isremark+"‘)"; 1251 DBHelper.update(con, addsql, null); 1252 1253 String sql="select CurrentUserID from t_sys_loginno where GroupID="+groupid+" and LoginNo=‘"+adminlogin+"‘"; 1254 String adminuserid=DBHelper.getRowStr(con, sql, null); 1255 String plugininstid = BhGenerator.getBh();//实例插件id 1256 comUtil.countProc(con, "pro_plugin_instantiation(‘"+groupid+"‘,‘"+actionpluginid+"‘,‘"+buiid+"‘,‘"+adminuserid+"‘,‘"+plugininstid+"‘)"); 1257 System.out.println("pro_plugin_instantiation(‘"+groupid+"‘,‘"+actionpluginid+"‘,‘"+buiid+"‘,‘"+adminuserid+"‘,‘"+plugininstid+"‘)"); 1258 form.addResult("msg", "添加成功!"); 1259 }catch (Exception e) { 1260 e.printStackTrace(); 1261 form.addResult("msg", "添加失败!"); 1262 }finally{ 1263 DBConnector.freecon(con); //释放数据库连接 1264 } 1265 return module.findPage("dywslAdd"); 1266 } 1267 1268 /** 1269 * 执行删除数据 1270 */ 1271 private Page deleteSl(WebForm form, Module module, T_sys_user user){ 1272 1273 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1274 int result = -1; 1275 try{ 1276 String id = StringUtil.null2String(form.get("id"));//获取页面传过来的需要删除的记录的id 1277 String ids=StringUtil.getStrsplit(id.split(",")); 1278 1279 if(!"".equals(id)){ 1280 String sql = "delete from T_Job_Bui where buiid in "+ids+" "; 1281 result=ObjectCtl.executeUpdateBySql(con, sql); 1282 String sql1 = "delete from T_Job_ActionPlugin_GroupBui where buiid in "+ids+" "; 1283 result=ObjectCtl.executeUpdateBySql(con, sql1); 1284 String sql2 = "delete from T_Job_FeedbackItem where buiid in "+ids+" "; 1285 result=ObjectCtl.executeUpdateBySql(con, sql2); 1286 1287 String plugininstids=StringUtil.null2String(form.get("plugininstid")).trim(); 1288 String str[] = plugininstids.split(","); 1289 for(int i=0;i<str.length;i++){ 1290 result=comUtil.countProc(con, "PRO_PLUGIN_UNINSTANTIATION(‘"+str[i]+"‘)"); 1291 } 1292 1293 }if(result!=-1){ 1294 form.addResult("result", true); 1295 }else{ 1296 form.addResult("result", false); 1297 } 1298 }catch (Exception e){ 1299 e.printStackTrace(); 1300 } 1301 finally{ 1302 DBConnector.freecon(con); //释放数据库连接 1303 } 1304 return module.findPage("jsonxml"); 1305 } 1306 1307 /** 1308 * 转到多业务实例修改页面 1309 */ 1310 private Page toUpdateSl(WebForm form, Module module, T_sys_user user){ 1311 1312 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1313 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1314 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1315 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1316 try{ 1317 form.addResult("buiid", buiid); 1318 form.addResult("groupid", groupid); 1319 form.addResult("actionpluginid", actionpluginid); 1320 1321 }catch (Exception e) { 1322 e.printStackTrace(); 1323 }finally{ 1324 DBConnector.freecon(con); //释放数据库连接 1325 } 1326 return module.findPage("dywslTab"); 1327 } 1328 1329 /** 1330 * 转到多业务实例基本信息修改页面 1331 */ 1332 private Page todywslUpdatejbxx(WebForm form, Module module, T_sys_user user){ 1333 1334 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1335 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1336 try{ 1337 String sql = "select groupid,buiid,buiname,opstartname,opstarturl,opobjname,opobjurl, " + 1338 " opobjdataperm, " + 1339 " opwindowstitle,opfinishname,opfinishurl,t1initclassname, " + 1340 " photonum, " + 1341 " videonum, " + 1342 " audionum, " + 1343 " isremark from T_Job_Bui where buiid = ‘"+buiid+"‘ "; 1344 1345 List<DBean> list=DBHelper.getDBeanList(con, sql, null); 1346 form.addResult("sljbxxObj", list.get(0)); 1347 form.addResult("buiid", buiid); 1348 }catch (Exception e) { 1349 e.printStackTrace(); 1350 }finally{ 1351 DBConnector.freecon(con); //释放数据库连接 1352 } 1353 return module.findPage("dywslUpdatejbxx"); 1354 } 1355 1356 /** 1357 * 执行多业务实例基本信息修改操作 1358 */ 1359 private Page dywslUpdatejbxx(WebForm form, Module module, T_sys_user user){ 1360 1361 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1362 //String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1363 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1364 String buiname = StringUtil.null2String(form.get("buiname")).trim(); 1365 String opstartname = StringUtil.null2String(form.get("opstartname")).trim(); 1366 String opstarturl = StringUtil.null2String(form.get("opstarturl")).trim(); 1367 String opobjname = StringUtil.null2String(form.get("opobjname")).trim(); 1368 String opobjurl = StringUtil.null2String(form.get("opobjurl")).trim(); 1369 String opobjdataperm = StringUtil.null2String(form.get("opobjdataperm")).trim(); 1370 String opwindowstitle = StringUtil.null2String(form.get("opwindowstitle")).trim(); 1371 String opfinishname = StringUtil.null2String(form.get("opfinishname")).trim(); 1372 String opfinishurl = StringUtil.null2String(form.get("opfinishurl")).trim(); 1373 String t1initclassname = StringUtil.null2String(form.get("t1initclassname")).trim(); 1374 String photonum = StringUtil.null2String(form.get("photonum")).trim(); 1375 String videonum = StringUtil.null2String(form.get("videonum")).trim(); 1376 String audionum = StringUtil.null2String(form.get("audionum")).trim(); 1377 String isremark = StringUtil.null2String(form.get("isremark")).trim(); 1378 try{ 1379 String sql = "update T_Job_Bui set " + 1380 " buiname = ‘"+buiname+"‘, " + 1381 " opstartname = ‘"+opstartname+"‘, " + 1382 " opstarturl = ‘"+opstarturl+"‘, " + 1383 " opobjname = ‘"+opobjname+"‘, " + 1384 " opobjurl = ‘"+opobjurl+"‘, " + 1385 " opobjdataperm = ‘"+opobjdataperm+"‘, " + 1386 " opwindowstitle = ‘"+opwindowstitle+"‘, " + 1387 " opfinishname = ‘"+opfinishname+"‘, " + 1388 " opfinishurl = ‘"+opfinishurl+"‘, " + 1389 " t1initclassname = ‘"+t1initclassname+"‘, " + 1390 " photonum = ‘"+photonum+"‘, " + 1391 " videonum = ‘"+videonum+"‘, " + 1392 " audionum = ‘"+audionum+"‘, " + 1393 " isremark = ‘"+isremark+"‘ " + 1394 " where buiid = ‘"+buiid+"‘ "; 1395 1396 DBHelper.update(con, sql, null); 1397 form.addResult("msg", "修改成功!"); 1398 }catch (Exception e) { 1399 e.printStackTrace(); 1400 form.addResult("msg", "修改失败!"); 1401 }finally{ 1402 DBConnector.freecon(con); //释放数据库连接 1403 } 1404 return module.findPage("dywslUpdatejbxx"); 1405 } 1406 1407 /** 1408 * 转到多业务实例功能插件修改页面 1409 */ 1410 private Page todywslUpdategncj(WebForm form, Module module, T_sys_user user){ 1411 1412 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1413 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1414 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1415 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1416 try{ 1417 form.addResult("buiid", buiid); 1418 form.addResult("groupid", groupid); 1419 form.addResult("actionpluginid", actionpluginid); 1420 }catch (Exception e) { 1421 e.printStackTrace(); 1422 }finally{ 1423 DBConnector.freecon(con); //释放数据库连接 1424 } 1425 return module.findPage("dywslUpdategncj"); 1426 } 1427 1428 /** 1429 * 功能插件列表数据 1430 */ 1431 private Page gncjListJson(WebForm form, Module module, T_sys_user user) { 1432 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1433 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 1434 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 1435 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1436 String dir = StringUtil.null2String(form.get("order"));//DESC 1437 1438 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集团id 1439 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 1440 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1441 try{ 1442 String sql = "select a.groupid,a.buiid,a.actionpluginid,a.actionplugincode,a.actionpluginmenuname,a.actionpluginprocedure, " + 1443 " decode(a.actionplugintype,‘1‘,‘首页功能插件‘,‘2‘,‘作业窗功能插件‘) actionplugintype," + 1444 " a.orderno," + 1445 " decode(a.ismustaction,‘0‘,‘否‘,‘1‘,‘是‘) ismustaction," + 1446 " a.actioncondition," + 1447 " decode(a.isextapp,‘0‘,‘不是外部App‘,‘1‘,‘是外部App‘) isextapp," + 1448 " a.appid,a.appinterfaceparam,b.actionpluginname from T_Job_ActionPlugin_GroupBui a left join T_Job_ActionPlugin b on a.actionpluginid = b.actionpluginid where buiid = ‘"+buiid+"‘ "; 1449 1450 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1451 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1452 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 1453 HttpServletResponse response = ActionContext.getContext().getResponse(); 1454 ObjectCtl.sendListData(response, count, list); 1455 1456 }catch (Exception e) { 1457 e.printStackTrace(); 1458 } 1459 finally 1460 { 1461 DBConnector.freecon(con); //释放数据库连接 1462 } 1463 return module.findPage("jsonxml"); 1464 } 1465 1466 /** 1467 * 转到添加功能插件页面 1468 */ 1469 private Page toaddGncj(WebForm form, Module module, T_sys_user user){ 1470 1471 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1472 try{ 1473 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1474 form.addResult("buiid", buiid); 1475 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1476 form.addResult("actionpluginid", actionpluginid); 1477 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1478 form.addResult("groupid", groupid); 1479 }catch (Exception e) { 1480 e.printStackTrace(); 1481 }finally{ 1482 DBConnector.freecon(con); //释放数据库连接 1483 } 1484 return module.findPage("gncjAdd"); 1485 } 1486 1487 /** 1488 * 系统功能插件 1489 */ 1490 private Page cjListJson(WebForm form, Module module, T_sys_user user) { 1491 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1492 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 1493 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 1494 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1495 String dir = StringUtil.null2String(form.get("order"));//DESC 1496 1497 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集团id 1498 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 1499 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1500 try{ 1501 String sql = "select a.ActionPluginId,a.ActionPluginCode,a.ActionPluginUrl,a.ActionPluginUrl_View,a.ActionPluginName, " + 1502 " decode(b.actionplugintype,‘1‘,‘首页功能插件‘,‘2‘,‘作业窗功能插件‘) actionplugintype " + 1503 " from T_Job_ActionPlugin a left join T_Job_ActionPlugin_GroupBui b on A.ACTIONPLUGINID = B.ACTIONPLUGINID " + 1504 " where 1=1 and a.ActionPluginId not in (select ActionPluginId from T_Job_ActionPlugin_GroupBui where buiid = ‘"+buiid+"‘) "; 1505 1506 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1507 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1508 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 1509 HttpServletResponse response = ActionContext.getContext().getResponse(); 1510 ObjectCtl.sendListData(response, count, list); 1511 }catch (Exception e) { 1512 e.printStackTrace(); 1513 } 1514 finally 1515 { 1516 DBConnector.freecon(con); //释放数据库连接 1517 } 1518 return module.findPage("jsonxml"); 1519 } 1520 1521 /** 1522 * 系统功能插件添加操作 1523 * */ 1524 private Page cjAdd(WebForm form, Module module, T_sys_user user) { 1525 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1526 try { 1527 String buiid=StringUtil.null2String(form.get("buiid")).trim(); 1528 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1529 //String actionplugincode=StringUtil.null2String(form.get("actionplugincode")).trim(); 1530 1531 int OrderNo = ObjectCtl.getIntRowValue(con, " select max(OrderNo) from T_Job_ActionPlugin_GroupBui "); 1532 OrderNo = OrderNo < 0 ? 0 : OrderNo + 1; 1533 String ids=StringUtil.null2String(form.get("ids")).trim(); 1534 String str[] = ids.split(","); 1535 String actionplugincodes=StringUtil.null2String(form.get("actionplugincodes")).trim(); 1536 String strr[] = actionplugincodes.split(","); 1537 for(int i=0;i<str.length;i++){ 1538 String sql="insert into T_Job_ActionPlugin_GroupBui " + 1539 " (groupid,buiid,actionpluginid,actionplugincode,actionpluginmenuname,actionpluginprocedure, " + 1540 " actionplugintype,orderno,ismustaction,actioncondition,isextapp,appid,appinterfaceparam) " + 1541 " values " + 1542 " (‘"+groupid+"‘,‘"+buiid+"‘,‘"+str[i]+"‘,‘"+strr[i]+"‘,‘‘, " + 1543 " ‘‘,‘‘,‘"+OrderNo+"‘,‘0‘, " + 1544 " ‘‘,‘‘,‘‘,‘‘)"; 1545 1546 DBHelper.update(con, sql, null); 1547 } 1548 form.addResult("result", true); 1549 } catch (Exception e) { 1550 form.addResult("result", false); 1551 e.printStackTrace(); 1552 } 1553 return module.findPage("jsonxml"); 1554 } 1555 1556 /** 1557 * 系统插件删除 1558 */ 1559 private Page deleteGncj(WebForm form, Module module, T_sys_user user){ 1560 1561 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1562 int result = -1; 1563 try{ 1564 String id = StringUtil.null2String(form.get("id")); 1565 String ids=StringUtil.getStrsplit(id.split(",")); 1566 String buiid = StringUtil.null2String(form.get("buiid")); 1567 String buiids=StringUtil.getStrsplit(buiid.split(",")); 1568 if(!"".equals(id) && !"".equals(buiid)){ 1569 String sql = "delete from T_Job_ActionPlugin_GroupBui where ActionPluginId in "+ids+" and buiid in "+buiids+" "; 1570 result=ObjectCtl.executeUpdateBySql(con, sql); 1571 }if(result!=-1){ 1572 form.addResult("result", true); 1573 }else{ 1574 form.addResult("result", false); 1575 } 1576 }catch (Exception e){ 1577 e.printStackTrace(); 1578 } 1579 finally{ 1580 DBConnector.freecon(con); //释放数据库连接 1581 } 1582 return module.findPage("jsonxml"); 1583 } 1584 1585 /** 1586 * 转到功能插件修改页面 1587 */ 1588 private Page toUpdateGncj(WebForm form, Module module, T_sys_user user){ 1589 1590 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1591 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1592 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1593 try{ 1594 String sql = "select groupid,buiid,actionpluginid,actionplugincode,actionpluginmenuname,actionpluginprocedure, " + 1595 " actionplugintype," + 1596 " orderno," + 1597 " ismustaction," + 1598 " actioncondition," + 1599 " decode(isextapp,‘0‘,‘不是外部App‘,‘1‘,‘是外部App‘) isextapp," + 1600 " appid,appinterfaceparam from T_Job_ActionPlugin_GroupBui where actionpluginid = ‘"+actionpluginid+"‘ and buiid = ‘"+buiid+"‘ "; 1601 1602 List<DBean> list=DBHelper.getDBeanList(con, sql, null); 1603 form.addResult("gncjObj", list.get(0)); 1604 form.addResult("actionpluginid", actionpluginid); 1605 form.addResult("buiid", buiid); 1606 }catch (Exception e) { 1607 e.printStackTrace(); 1608 }finally{ 1609 DBConnector.freecon(con); //释放数据库连接 1610 } 1611 return module.findPage("gncjUpdate"); 1612 } 1613 1614 /** 1615 * 执行功能插件修改操作 1616 */ 1617 private Page updateGncj(WebForm form, Module module, T_sys_user user){ 1618 1619 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1620 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1621 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1622 String actionpluginprocedure = StringUtil.null2String(form.get("actionpluginprocedure")).trim(); 1623 String actionpluginmenuname = StringUtil.null2String(form.get("actionpluginmenuname")).trim(); 1624 String actionplugintype = StringUtil.null2String(form.get("actionplugintype")).trim(); 1625 String ismustaction = StringUtil.null2String(form.get("ismustaction")).trim(); 1626 try{ 1627 String sql = "update T_Job_ActionPlugin_GroupBui set " + 1628 " actionpluginprocedure = ?, " + 1629 " actionpluginmenuname = ‘"+actionpluginmenuname+"‘, " + 1630 " actionplugintype = ‘"+actionplugintype+"‘, " + 1631 " ismustaction = ‘"+ismustaction+"‘ " + 1632 " where actionpluginid = ‘"+actionpluginid+"‘ and buiid = ‘"+buiid+"‘ "; 1633 1634 DBHelper.update(con, sql, new Object[]{ 1635 actionpluginprocedure 1636 }); 1637 form.addResult("msg", "修改成功!"); 1638 1639 }catch (Exception e) { 1640 e.printStackTrace(); 1641 form.addResult("msg", "修改失败!"); 1642 }finally{ 1643 DBConnector.freecon(con); //释放数据库连接 1644 } 1645 return module.findPage("gncjUpdate"); 1646 } 1647 1648 1649 1650 /** 1651 * 转到多业务实例反馈字段页面 1652 */ 1653 private Page todywslUpdatezd(WebForm form, Module module, T_sys_user user){ 1654 1655 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1656 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1657 try{ 1658 form.addResult("buiid", buiid); 1659 }catch (Exception e) { 1660 e.printStackTrace(); 1661 }finally{ 1662 DBConnector.freecon(con); //释放数据库连接 1663 } 1664 return module.findPage("dywslUpdatezd"); 1665 } 1666 1667 /** 1668 * 反馈字段列表数据显示 1669 */ 1670 private Page zdListJson(WebForm form, Module module, T_sys_user user) { 1671 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1672 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 1673 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 1674 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1675 String dir = StringUtil.null2String(form.get("order"));//DESC 1676 1677 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集团id 1678 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1679 try{ 1680 String sql = "select groupid,buiid,actionpluginid,feedbackitemid,feedbackitemname, " + 1681 " isaudioinput,orderno from T_Job_FeedbackItem " + 1682 " where buiid = ‘"+buiid+"‘ "; 1683 1684 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1685 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1686 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 1687 HttpServletResponse response = ActionContext.getContext().getResponse(); 1688 ObjectCtl.sendListData(response, count, list); 1689 }catch (Exception e) { 1690 e.printStackTrace(); 1691 } 1692 finally 1693 { 1694 DBConnector.freecon(con); //释放数据库连接 1695 } 1696 return module.findPage("jsonxml"); 1697 } 1698 1699 /** 1700 * 转到反馈字段添加页面 1701 */ 1702 private Page toaddZd(WebForm form, Module module, T_sys_user user){ 1703 1704 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1705 try{ 1706 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集团id 1707 String buiid = StringUtil.null2String(form.get("buiid")).trim();//插件id 1708 form.addResult("groupid", groupid); 1709 form.addResult("buiid", buiid); 1710 }catch (Exception e) { 1711 e.printStackTrace(); 1712 }finally{ 1713 DBConnector.freecon(con); //释放数据库连接 1714 } 1715 return module.findPage("zdAdd"); 1716 } 1717 1718 /** 1719 * 执行添加反馈字段操作 1720 */ 1721 private Page addZd(WebForm form, Module module, T_sys_user user){ 1722 1723 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1724 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1725 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1726 String feedbackitemid = BhGenerator.getBh(); 1727 String feedbackitemname = StringUtil.null2String(form.get("feedbackitemname")).trim(); 1728 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1729 int OrderNo = ObjectCtl.getIntRowValue(con, " select max(OrderNo) from T_Job_FeedbackItem "); 1730 OrderNo = OrderNo < 0 ? 0 : OrderNo + 1; 1731 try{ 1732 1733 String addsql = "insert into T_Job_FeedbackItem ( " + 1734 " groupid,buiid,actionpluginid,feedbackitemid,feedbackitemname, " + 1735 " isaudioinput,orderno ) " + 1736 " values (‘"+groupid+"‘,‘"+buiid+"‘,‘"+actionpluginid+"‘,‘"+feedbackitemid+"‘, " + 1737 " ‘"+feedbackitemname+"‘,‘1‘,‘"+OrderNo+"‘)"; 1738 DBHelper.update(con, addsql, null); 1739 1740 form.addResult("msg", "添加成功!"); 1741 }catch (Exception e) { 1742 e.printStackTrace(); 1743 form.addResult("msg", "添加失败!"); 1744 }finally{ 1745 DBConnector.freecon(con); //释放数据库连接 1746 } 1747 return module.findPage("zdAdd"); 1748 } 1749 1750 /** 1751 * 执行删除反馈字段操作 1752 */ 1753 private Page deleteZd(WebForm form, Module module, T_sys_user user){ 1754 1755 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1756 int result = -1; 1757 try{ 1758 String id = StringUtil.null2String(form.get("id"));//获取页面传过来的需要删除的记录的id 1759 String ids=StringUtil.getStrsplit(id.split(",")); 1760 1761 if(!"".equals(id)){ 1762 String sql = "delete from T_Job_FeedbackItem where feedbackitemid in "+ids+" "; 1763 result=ObjectCtl.executeUpdateBySql(con, sql); 1764 1765 }if(result!=-1){ 1766 form.addResult("result", true); 1767 }else{ 1768 form.addResult("result", false); 1769 } 1770 }catch (Exception e){ 1771 e.printStackTrace(); 1772 } 1773 finally{ 1774 DBConnector.freecon(con); //释放数据库连接 1775 } 1776 return module.findPage("jsonxml"); 1777 } 1778 1779 /** 1780 * 转到反馈字段修改页面 1781 */ 1782 private Page toUpdateZd(WebForm form, Module module, T_sys_user user){ 1783 1784 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1785 String feedbackitemid = StringUtil.null2String(form.get("feedbackitemid")).trim(); 1786 try{ 1787 String sql = " select groupid,buiid,actionpluginid,feedbackitemid,feedbackitemname,isaudioinput," + 1788 " orderno from T_Job_FeedbackItem where feedbackitemid = ‘"+feedbackitemid+"‘ "; 1789 1790 List<DBean> list=DBHelper.getDBeanList(con, sql, null); 1791 form.addResult("zdObj", list.get(0)); 1792 form.addResult("feedbackitemid", feedbackitemid); 1793 }catch (Exception e) { 1794 e.printStackTrace(); 1795 }finally{ 1796 DBConnector.freecon(con); //释放数据库连接 1797 } 1798 return module.findPage("zdUpdate"); 1799 } 1800 1801 /** 1802 * 执行反馈字段修改操作 1803 */ 1804 private Page updateZd(WebForm form, Module module, T_sys_user user){ 1805 1806 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1807 String feedbackitemid = StringUtil.null2String(form.get("feedbackitemid")).trim(); 1808 String feedbackitemname = StringUtil.null2String(form.get("feedbackitemname")).trim(); 1809 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1810 try{ 1811 String sql = "update T_Job_FeedbackItem set " + 1812 " feedbackitemname = ‘"+feedbackitemname+"‘, " + 1813 " actionpluginid = ‘"+actionpluginid+"‘ " + 1814 " where feedbackitemid = ‘"+feedbackitemid+"‘ "; 1815 1816 DBHelper.update(con, sql, null); 1817 form.addResult("msg", "修改成功!"); 1818 1819 }catch (Exception e) { 1820 e.printStackTrace(); 1821 form.addResult("msg", "修改失败!"); 1822 }finally{ 1823 DBConnector.freecon(con); //释放数据库连接 1824 } 1825 return module.findPage("zdUpdate"); 1826 } 1827 1828 /* 1829 * 删除实例插件 1830 */ 1831 private Page deletecj(WebForm form, Module module, T_sys_user user) { 1832 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1833 String pluginids=StringUtil.null2String(form.get("pluginids")).trim();// 1834 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1835 String str[] = pluginids.split(","); 1836 int result=0; 1837 for(int i=0;i<str.length;i++){ 1838 result=comUtil.countProc(con, "PRO_PLUGIN_GROUP_DELETE(‘"+str[i]+"‘,‘"+groupid+"‘)"); 1839 } 1840 if(result != -1){ 1841 form.addResult("result", true); 1842 }else { 1843 form.addResult("result", false); 1844 } 1845 1846 return module.findPage("jsonxml"); 1847 } 1848 1849 1850 private Page plugincjbcAdd(WebForm form, Module module, T_sys_user user) { 1851 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1852 String ids=StringUtil.null2String(form.get("ids")).trim(); 1853 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1854 String str[] = ids.split(","); 1855 //生成实例插件 1856 try{ 1857 String sql="select adminuserid from t_bs_group where GroupID=‘"+groupid+"‘"; 1858 String adminuserid=DBHelper.getRowStr(con, sql, null); 1859 //String adminuserid = BhGenerator.getBh(); 1860 for(int i=0;i<str.length;i++){ 1861 String IsMutiBui=DBHelper.getRowStr(con, "select IsMutiBui from T_SYS_Plugin where pluginID =‘"+str[i]+"‘", null); 1862 if(!IsMutiBui.equals("1")){ 1863 String plugininstid = BhGenerator.getBh();//实例插件id 1864 comUtil.countProc(con, "pro_plugin_instantiation(‘"+groupid+"‘,‘"+str[i]+"‘,‘‘,‘"+adminuserid+"‘,‘"+plugininstid+"‘)"); 1865 System.out.println("pro_plugin_instantiation(‘"+groupid+"‘,‘"+str[i]+"‘,‘‘,‘"+adminuserid+"‘,‘"+plugininstid+"‘)"); 1866 } 1867 DBHelper.insert(con, "insert into T_SYS_GroupPlugin(GroupID,pluginID) values(‘"+groupid+"‘,‘"+str[i]+"‘)", null); 1868 1869 } 1870 form.addResult("result", true); 1871 } catch (Exception e) { 1872 form.addResult("result", false); 1873 e.printStackTrace(); 1874 } 1875 return module.findPage("jsonxml"); 1876 } 1877 1878 1879 /** 1880 * 添加未有插件 1881 * @param form 1882 * @param module 1883 * @param user 1884 * @return 1885 */ 1886 private Page pluginListJson1(WebForm form, Module module, T_sys_user user) { 1887 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1888 int start = StringUtil.StringToInt(StringUtil.null2String(form 1889 .get("page")));// 开始位置 1890 int limit = StringUtil.StringToInt(StringUtil.null2String(form 1891 .get("rows")));// 每页数据量 1892 try 1893 { String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1894 String sql=" select plugincode,pluginnamedisplay,decode(PluginType,1,‘标准插件‘,2,‘行业插件‘,3,‘定制插件‘) plugintype,pluginid from T_SYS_Plugin where PluginStatus=‘1‘ and plugincode in("+ 1895 " select plugincode from T_SYS_Plugin where PluginType=‘01‘" 1896 +" Union " 1897 +"select plugincode from T_SYS_Plugin where PluginType=‘03 ‘" 1898 +") and pluginID not in(select pluginID from T_SYS_GroupPlugin where GroupID=‘"+groupid+"‘)"; 1899 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1900 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con, 1901 sqlQuery, null); 1902 String count = ObjectCtl.getStrRowValue(con, 1903 "select count(0) from ( " + sql + ")"); 1904 HttpServletResponse response = ActionContext.getContext() 1905 .getResponse(); 1906 ObjectCtl.sendListData(response, count, list); 1907 }catch (Exception e) { 1908 e.printStackTrace(); 1909 } 1910 finally 1911 { 1912 DBConnector.freecon(con); //释放数据库连接 1913 } 1914 return module.findPage("jsonxml"); 1915 } 1916 1917 /** 1918 * 许可授权插件 1919 * @param form 1920 * @param module 1921 * @param user 1922 * @return 1923 */ 1924 private Page pluginListJson2(WebForm form, Module module, T_sys_user user) { 1925 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 1926 try 1927 { String groupid=StringUtil.null2String(form.get("groupid")).trim(); //left join 根据插件id groupi的?? 1928 String sql=" select plugincode,pluginnamedisplay,decode(PluginType,1,‘标准插件‘,2,‘行业插件‘,3,‘定制插件‘) plugintype,pluginid,IsMutiBui from T_SYS_Plugin where PluginStatus=‘1‘ and plugincode in("+ 1929 " select plugincode from T_SYS_Plugin where PluginType=‘01‘" 1930 +" Union " 1931 +"select plugincode from T_SYS_Plugin where PluginType=‘03 ‘" 1932 +") and pluginID in(select pluginID from T_SYS_GroupPlugin where GroupID=‘"+groupid+"‘)"; 1933 1934 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con, 1935 sql, null); 1936 String count = ObjectCtl.getStrRowValue(con, 1937 "select count(0) from ( " + sql + ")"); 1938 HttpServletResponse response = ActionContext.getContext() 1939 .getResponse(); 1940 ObjectCtl.sendListData(response, count, list); 1941 }catch (Exception e) { 1942 e.printStackTrace(); 1943 } 1944 finally 1945 { 1946 DBConnector.freecon(con); //释放数据库连接 1947 } 1948 return module.findPage("jsonxml"); 1949 } 1950 1951 private Page gnsqAdd(WebForm form, Module module, T_sys_user user) { 1952 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1953 form.addResult("groupid", groupid); 1954 return module.findPage("gnsqAdd"); 1955 } 1956 1957 1958 1959 /** 1960 * 勾选取消插件实例 1961 * @param form 1962 * @param module 1963 * @param user 1964 * @return 1965 */ 1966 private Page delcjsl(WebForm form, Module module, T_sys_user user) { 1967 Connection con = DBConnector.getconecttion(); 1968 String pluginid = StringUtil.null2String(form.get("pluginid")).trim(); 1969 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1970 1971 ArrayList sqlList=new ArrayList(); 1972 try{ 1973 String roleSql="delete from SXT_SYS_PluginInstRole where PluginInstID in (select PluginInstID from SXT_SYS_PluginInst where PluginID=‘"+pluginid+"‘ and groupid=‘"+groupid+"‘)"; 1974 String menuSql="delete from SXT_SYS_PluginInstMenu where PluginInstID in (select PluginInstID from SXT_SYS_PluginInst where PluginID=‘"+pluginid+"‘ and groupid=‘"+groupid+"‘)"; 1975 String userplugininstSql="delete from SXT_SYS_UserPluginInst where PluginInstID in (select PluginInstID from SXT_SYS_PluginInst where PluginID=‘"+pluginid+"‘ and groupid=‘"+groupid+"‘)"; 1976 String plugininstSql="delete from SXT_SYS_PluginInst where PluginID=‘"+pluginid+"‘ and groupid=‘"+groupid+"‘"; 1977 sqlList.add(roleSql); 1978 sqlList.add(menuSql); 1979 sqlList.add(userplugininstSql); 1980 sqlList.add(plugininstSql); 1981 1982 boolean result=ObjectCtl.executeMulSql(con, sqlList); 1983 if(result){ 1984 form.addResult("result", "true"); 1985 }else{ 1986 form.addResult("result", "false"); 1987 } 1988 } catch (Exception e) { 1989 e.printStackTrace(); 1990 } finally { 1991 DBConnector.freecon(con); 1992 } 1993 return module.findPage("jsonxml"); 1994 } 1995 1996 /** 1997 * 判断是否已经生成过实例插件 1998 * @param form 1999 * @param module 2000 * @param user 2001 * @return 2002 */ 2003 private Page iscjsl(WebForm form, Module module, T_sys_user user) { 2004 Connection con = DBConnector.getconecttion(); 2005 String pluginid = StringUtil.null2String(form.get("pluginid")).trim(); 2006 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 2007 2008 try{ 2009 String sql="select * from SXT_SYS_PluginInst where pluginid=‘"+pluginid+"‘ and groupid=‘"+groupid+"‘"; 2010 int count=DBHelper.getTotalCount(con, sql, null); 2011 if(count>0){ 2012 form.addResult("result", "true"); 2013 }else{ 2014 form.addResult("result", "false"); 2015 } 2016 2017 } catch (Exception e) { 2018 e.printStackTrace(); 2019 } finally { 2020 DBConnector.freecon(con); 2021 } 2022 return module.findPage("jsonxml"); 2023 } 2024 /** 2025 * 插件实例添加页面 2026 * @param form 2027 * @param module 2028 * @param user 2029 * @return 2030 */ 2031 private Page Addcjsl(WebForm form, Module module, T_sys_user user) { 2032 Connection con = DBConnector.getconecttion(); 2033 String pluginid = StringUtil.null2String(form.get("pluginid")).trim(); 2034 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 2035 try{ 2036 StringBuffer sqlBuffer = new StringBuffer(); 2037 sqlBuffer.append(" SELECT plugininstname, plugininsticon, plugininsticonbgcolor "); 2038 sqlBuffer.append(" FROM sxt_sys_plugininst "); 2039 sqlBuffer.append(" WHERE pluginid = ? AND groupid = ? "); 2040 List<DBean> instList = DBHelper.getDBeanList(con, sqlBuffer.toString(), new Object[]{ 2041 pluginid, groupid 2042 }); 2043 form.addResult("instObj", instList.get(0)); 2044 } catch (Exception e) { 2045 e.printStackTrace(); 2046 } finally { 2047 DBConnector.freecon(con); 2048 } 2049 return module.findPage("cjslAdd"); 2050 2051 } 2052 2053 /** 2054 * 插件实例信息保存 2055 * @param form 2056 * @param module 2057 * @param user 2058 * @return 2059 */ 2060 private Page cjslAdd(WebForm form, Module module, T_sys_user user) { 2061 Connection con = DBConnector.getconecttion(); 2062 String PluginIcon = StringUtil.null2String(form.get("PluginIcon")).trim(); 2063 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2064 String pluginid=StringUtil.null2String(form.get("pluginid")).trim(); 2065 String plugininstname = StringUtil.null2String(form.get("PluginInstName")).trim(); 2066 String plugininsticonbgcolor = StringUtil.null2String(form.get("plugininsticonbgcolor")).trim(); 2067 2068 try { 2069 String PluginInstID=DBHelper.getRowStr(con, "select PluginInstID from sxT_SYS_PluginInst where GroupID=‘"+groupid+"‘ and PluginID=‘"+pluginid+"‘", null); 2070 String sql="update sxT_SYS_PluginInst set PluginInstName=‘" + plugininstname 2071 + "‘ , PluginInstIcon=‘" + PluginIcon + "‘,PluginInstIconBgColor=‘" 2072 + plugininsticonbgcolor + "‘ where PluginInstID=‘" + PluginInstID 2073 + "‘ and GroupID=‘" + groupid + "‘"; 2074 DBHelper.update(con, sql, null); 2075 form.addResult("msg", "保存成功"); 2076 } catch (Exception e) { 2077 form.addResult("msg", "保存失败"); 2078 e.printStackTrace(); 2079 } finally { 2080 DBConnector.freecon(con); 2081 } 2082 return module.findPage("cjslAdd"); 2083 } 2084 2085 //检查管理员帐号是否重复 2086 private Page checkadminloginno(WebForm form, Module module, T_sys_user user) { 2087 Connection con=DBConnector.getconecttion(); 2088 try { 2089 Boolean result=false; 2090 String groupfullname=StringUtil.null2String(form.get("adminloginno")).trim(); 2091 2092 String sql="select LoginNo from T_SYS_LoginNo "; 2093 ArrayList list= ObjectCtl.getMulRowValue2(con,sql); 2094 if(list!=null&&list.size()>0){ 2095 result=true; 2096 } 2097 form.addResult("result", result); 2098 2099 } 2100 catch (Exception e) { 2101 e.printStackTrace(); 2102 }finally{ 2103 DBConnector.freecon(con); 2104 } 2105 return module.findPage("jsonxml"); 2106 } 2107 2108 2109 private Page checkFullname(WebForm form, Module module, T_sys_user user) { 2110 Connection con=DBConnector.getconecttion(); 2111 try { 2112 Boolean result=false; 2113 String groupfullname=StringUtil.null2String(form.get("groupfullname")).trim(); 2114 String oldgroupfullname=StringUtil.null2String(form.get("oldgroupfullname")).trim();// 2115 String newgroupfullname=StringUtil.null2String(form.get("newgroupfullname")).trim();// 2116 String sql="select groupfullname from T_BS_Group where 1=1 "; 2117 if(!groupfullname.equals("")){ 2118 sql +=" and groupfullname=‘"+groupfullname+"‘"; 2119 } 2120 if(!oldgroupfullname.equals("")&&!newgroupfullname.equals("")){//修改 2121 sql +=" and groupfullname=‘"+newgroupfullname+"‘and groupfullname <> ‘"+oldgroupfullname+"‘"; 2122 } 2123 ArrayList list= ObjectCtl.getMulRowValue2(con,sql); 2124 if(list!=null&&list.size()>0){ 2125 result=true; 2126 } 2127 2128 form.addResult("result", result); 2129 2130 } 2131 catch (Exception e) { 2132 e.printStackTrace(); 2133 }finally{ 2134 DBConnector.freecon(con); 2135 } 2136 return module.findPage("jsonxml"); 2137 } 2138 /** 2139 * 检查类别代码是否有重 2140 * @param form 2141 * @param module 2142 * @param user 2143 * @return 2144 */ 2145 private Page checkClassCode(WebForm form, Module module, T_sys_user user) { 2146 Connection con=DBConnector.getconecttion(); 2147 try { 2148 String pluginids=StringUtil.null2String(form.get("pluginids")).trim(); 2149 String ids=StringUtil.getStrsplit(pluginids.split(",")); 2150 Hashtable ht=new Hashtable(); 2151 String plugincodeArr=""; 2152 ArrayList alllist=ObjectCtl.getMulRowValue2(con, "select pluginclasscode,PluginCode,PluginNameDisplay from T_SYS_Plugin where pluginid in "+ids+""); 2153 for (int i = 0; i < alllist.size(); i++) { 2154 ArrayList<String> list1=(ArrayList<String>)alllist.get(i); 2155 String pluginclasscode=list1.get(0); 2156 String plugincode=list1.get(1); 2157 for (int j = i+1; j < alllist.size(); j++) { 2158 ArrayList<String> list2=(ArrayList<String>)alllist.get(j); 2159 if(list2.contains(pluginclasscode)) 2160 { 2161 plugincodeArr+=plugincode+","+list2.get(1)+","; 2162 } 2163 } 2164 2165 } 2166 2167 if(!plugincodeArr.equals("")){ 2168 //数组专为list 2169 List plugincodelist = new ArrayList(Arrays.asList(plugincodeArr.split(","))); 2170 //将List转换为Set去重 2171 Set<String> plugincodeset=new HashSet(plugincodelist); 2172 plugincodeArr=""; 2173 for (String plugincode : plugincodeset) { 2174 plugincodeArr+=plugincode+","; 2175 } 2176 String zfplugincodes=StringUtil.getStrsplit(plugincodeArr.split(",")); 2177 ArrayList list=ObjectCtl.getMulRowValue2(con, "select wm_concat( PluginNameDisplay ) as PluginNameDisplays from T_SYS_Plugin where PluginCode in "+zfplugincodes+" group by PluginClassCode ") ; 2178 ht.put("result", true); 2179 ht.put("list", list); 2180 }else { 2181 ht.put("result", false); 2182 } 2183 form.addResult("result", net.sf.json.JSONObject.fromObject(ht)); 2184 } 2185 catch (Exception e) { 2186 e.printStackTrace(); 2187 }finally{ 2188 DBConnector.freecon(con); 2189 } 2190 return module.findPage("jsonxml"); 2191 } 2192 2193 /** 2194 * 去详情页面 2195 * @param form 2196 * @param module 2197 * @param user 2198 * @return 2199 */ 2200 private Page jtktDetail(WebForm form, Module module, T_sys_user user) { 2201 Connection con=DBConnector.getconecttion(); 2202 try { 2203 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2204 ArrayList list=(ArrayList) getJtobj(groupid); 2205 if(list!=null&&list.size()>0){ 2206 form.addResult("obj", list.get(0)); 2207 } 2208 String pluginids=ObjectCtl.getStrRowValue(con, " select wm_concat(Pluginid) as Pluginida from T_SYS_GroupPlugin where groupid=‘"+groupid+"‘"); 2209 Hashtable ht = comUtil.getZDHt(con, "0001", user.getGroupid()); 2210 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2211 form.addResult("hyList", hyList); 2212 form.addResult("ht", ht); 2213 form.addResult("pluginids", pluginids); 2214 } catch (Exception e) { 2215 e.printStackTrace(); 2216 }finally{ 2217 DBConnector.freecon(con); 2218 } 2219 2220 return module.findPage("jtktDetail"); 2221 } 2222 2223 2224 /** 2225 * 修改集团名称方法 2226 * @param form 2227 * @param module 2228 * @param user 2229 * @return 2230 */ 2231 private Page jtktmcUpdate(WebForm form, Module module, T_sys_user user) { 2232 Connection con=DBConnector.getconecttion(); 2233 int result=-1; 2234 try { 2235 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2236 String groupfullname=StringUtil.null2String(form.get("groupfullname")).trim(); 2237 String groupshortname=StringUtil.null2String(form.get("groupshortname")).trim(); 2238 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 2239 2240 String groupfullnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupfullname)); //集团全称简拼 2241 String groupfullnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupfullname)); //集团全称全拼 2242 String groupshortnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupshortname)); //集团简称简拼 2243 String groupshortnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupshortname)); // 集团简称全拼 2244 2245 String sql=" update T_BS_Group " + 2246 "set groupfullname=‘"+groupfullname+"‘, " + 2247 " groupshortname=‘"+groupshortname+"‘," + 2248 " industrycode=‘"+industrycode+"‘, " + 2249 " groupfullnamefirstpy=‘"+groupfullnamefirstpy+"‘, " + 2250 " groupfullnameallpy=‘"+groupfullnameallpy+"‘, " + 2251 " groupshortnamefirstpy=‘"+groupshortnamefirstpy+"‘, " + 2252 " groupshortnameallpy=‘"+groupshortnameallpy+"‘ " + 2253 " where groupid=‘"+groupid+"‘"; 2254 result=ObjectCtl.executeUpdateBySql(con, sql); 2255 if(result!=-1){ 2256 form.addResult("msg", "修改成功!"); 2257 }else{ 2258 form.addResult("msg", "修改失败!"); 2259 } 2260 2261 } catch (Exception e) { 2262 e.printStackTrace(); 2263 }finally{ 2264 DBConnector.freecon(con); 2265 } 2266 return module.findPage("jtktmcUpdate"); 2267 } 2268 2269 2270 /** 2271 * 修改集团名称页面 2272 * @param form 2273 * @param module 2274 * @param user 2275 * @return 2276 */ 2277 private Page toJtktmcUpdate(WebForm form, Module module, T_sys_user user) { 2278 Connection con=DBConnector.getconecttion(); 2279 2280 try { 2281 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2282 ArrayList list=(ArrayList) getJtobj(groupid); 2283 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2284 form.addResult("hyList", hyList); 2285 if(list!=null&&list.size()>0){ 2286 form.addResult("obj", list.get(0)); 2287 } 2288 2289 } catch (Exception e) { 2290 e.printStackTrace(); 2291 }finally{ 2292 DBConnector.freecon(con); 2293 } 2294 return module.findPage("jtktmcUpdate"); 2295 } 2296 2297 /** 2298 * 获取集团对象 2299 * @param groupid 2300 * @return 2301 */ 2302 private List getJtobj(String groupid) { 2303 Connection con=DBConnector.getconecttion(); 2304 ArrayList list=new ArrayList(); 2305 try { 2306 String sql=" select groupid,groupfullname,groupshortname,effectdate,failuredate,licenseusercount,licensemobileusercount ,licensestatus,industrycode from T_BS_Group where groupid=‘"+groupid+"‘"; 2307 list=ObjectCtl.getMulRowValue2(con, sql); 2308 } catch (Exception e) { 2309 e.printStackTrace(); 2310 }finally{ 2311 DBConnector.freecon(con); 2312 } 2313 2314 return list; 2315 } 2316 2317 /** 2318 * 集团注销 2319 * @param form 2320 * @param module 2321 * @param user 2322 * @return 2323 */ 2324 private Page jtktDelete(WebForm form, Module module, T_sys_user user) { 2325 Connection con=DBConnector.getconecttion(); 2326 int result=-1; 2327 try { 2328 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2329 String sql=" update T_BS_Group set LicenseStatus=99 where groupid=‘"+groupid+"‘"; 2330 result=ObjectCtl.executeUpdateBySql(con, sql); 2331 if(result!=-1){ 2332 form.addResult("result", true); 2333 }else { 2334 form.addResult("result", false); 2335 } 2336 2337 } catch (Exception e) { 2338 e.printStackTrace(); 2339 }finally{ 2340 DBConnector.freecon(con); 2341 } 2342 return module.findPage("jsonxml"); 2343 } 2344 2345 2346 2347 /** 2348 * 许可授权 2349 * @param form 2350 * @param module 2351 * @param user 2352 * @return 2353 */ 2354 private Page jtktUpdate(WebForm form, Module module, T_sys_user user) { 2355 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 2356 boolean result = false; 2357 try 2358 { ArrayList<String> sqlList= new ArrayList<String>(); 2359 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 2360 String licensestatus=StringUtil.null2String(form.get("licensestatus")).trim(); 2361 String effectdate=StringUtil.null2String(form.get("effectdate")).trim(); 2362 String failuredate=StringUtil.null2String(form.get("failuredate")).trim(); 2363 String licenseusercount=StringUtil.null2String(form.get("licenseusercount")).trim(); 2364 String licensemobileusercount=StringUtil.null2String(form.get("licensemobileusercount")).trim(); 2365 // String checkids=StringUtil.null2String(form.get("checkids")).trim(); 2366 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 2367 // String[] pluginids=checkids.split(","); 2368 2369 /* if(pluginids!=null&&pluginids.length>0){ 2370 String delsql=" delete from T_SYS_GroupPlugin where groupid =‘"+groupid+"‘";//删除 2371 sqlList.add(delsql); 2372 //取系统行业插件 2373 ArrayList XTHyPlugini=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like ‘XT%999%99999999‘ and PluginType = ‘02‘ and IndustryCode =‘"+industrycode+"‘"); 2374 2375 if(XTHyPlugini.size()>0){//插入系统插件 2376 2377 for (int i = 0; i < XTHyPlugini.size(); i++) { 2378 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2379 " values (‘"+groupid+"‘,‘"+XTHyPlugini.get(i)+"‘ )"; 2380 sqlList.add(insql); 2381 } 2382 }else{//取系统标准插件 2383 ArrayList XTBzPluginid=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like ‘XT%999%99999999‘ and PluginType = ‘01‘"); 2384 2385 if(XTBzPluginid.size()>0){ 2386 for (int i = 0; i < XTBzPluginid.size(); i++) { 2387 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2388 " values (‘"+groupid+"‘,‘"+XTBzPluginid.get(i)+"‘ )"; 2389 sqlList.add(insql); 2390 } 2391 } 2392 } 2393 2394 2395 2396 ArrayList<String> pluginidlist=new ArrayList<String>(Arrays.asList(pluginids)); 2397 for (int i = 0; i < pluginidlist.size(); i++) { 2398 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2399 " values (‘"+groupid+"‘,‘"+pluginidlist.get(i)+"‘ )"; 2400 sqlList.add(insql); 2401 2402 } 2403 2404 } 2405 */ 2406 String mainsql=" update T_BS_Group set " + 2407 "effectdate=‘"+effectdate+"‘," + 2408 "failuredate=‘"+failuredate+"‘," + 2409 "licenseusercount=‘"+licenseusercount+"‘," + 2410 "licensemobileusercount=‘"+licensemobileusercount+"‘," + 2411 "industrycode=‘"+industrycode+"‘," + 2412 " licensestatus=‘"+licensestatus+"‘" + 2413 " where groupid=‘"+groupid+"‘"; 2414 2415 sqlList.add(mainsql); 2416 2417 result =ObjectCtl.executeMulSql(con, sqlList); 2418 2419 //最后插件结果去重复 2420 /* String distinctSql="delete from T_SYS_GroupPlugin " 2421 + "where rowid not in " 2422 + "(select min(rowid) from T_SYS_GroupPlugin " 2423 + "where groupid=‘"+groupid+"‘ group by PLUGINID) and groupid = ‘"+groupid+"‘"; 2424 DBHelper.update(con, distinctSql, null);*/ 2425 2426 if (result) 2427 { 2428 form.addResult("msg", "保存成功!"); 2429 delFile(Globals.APP_BASE_DIR+"WEB-INF\\temp\\" + groupid + ".zip" ); 2430 } 2431 else 2432 { 2433 form.addResult("msg", "保存失败!"); 2434 } 2435 }catch(Exception e){ 2436 e.printStackTrace(); 2437 } 2438 finally 2439 { 2440 DBConnector.freecon(con); //释放数据库连接 2441 } 2442 return module.findPage("jtktUpdate"); 2443 } 2444 2445 2446 2447 2448 /** 2449 * 许可授权页面 2450 * @param form 2451 * @param module 2452 * @param user 2453 * @return 2454 */ 2455 private Page toJtktUpdate(WebForm form, Module module, T_sys_user user) { 2456 Connection con=DBConnector.getconecttion(); 2457 try { 2458 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2459 2460 ArrayList list=(ArrayList) getJtobj(groupid); 2461 if(list!=null&&list.size()>0){ 2462 form.addResult("obj", list.get(0)); 2463 } 2464 String pluginids=ObjectCtl.getStrRowValue(con, " select wm_concat(Pluginid) as Pluginida from T_SYS_GroupPlugin where groupid=‘"+groupid+"‘"); 2465 Hashtable ht = comUtil.getZDHt(con, "0001", user.getGroupid()); 2466 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2467 form.addResult("hyList", hyList); 2468 form.addResult("ht", ht); 2469 form.addResult("groupid", groupid); 2470 form.addResult("pluginids", pluginids); 2471 2472 List list1=DBHelper.getDBeanList(con,"select ADMINLOGINNO,ADMINUSERID from t_bs_group where groupid =‘"+groupid+"‘",null); 2473 form.addResult("list1", list1.get(0)); 2474 } catch (Exception e) { 2475 e.printStackTrace(); 2476 }finally{ 2477 2478 DBConnector.freecon(con); 2479 } 2480 2481 return module.findPage("jtktUpdate"); 2482 } 2483 2484 2485 2486 private void delFile(String path) { 2487 try { 2488 File f = new File(path); // 输入要删除的文件位置 2489 if(f.exists()) 2490 f.delete(); 2491 } catch (Exception e) { 2492 e.printStackTrace(); 2493 } 2494 2495 2496 2497 } 2498 2499 /** 2500 * 插件列表 2501 * @param form 2502 * @param module 2503 * @param user 2504 * @return 2505 */ 2506 private Page pluginListJson(WebForm form, Module module, T_sys_user user) { 2507 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 2508 try 2509 { String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2510 String sshy=StringUtil.null2String(form.get("sshy")).trim(); 2511 String cshsshy=StringUtil.null2String(form.get("cshsshy")).trim();//初始化所属行业 2512 String biaoshi=StringUtil.null2String(form.get("biaoshi")).trim(); 2513 String pluginids=StringUtil.null2String(form.get("pluginids")).trim(); 2514 2515 String sql=" select pluginid,plugincode,pluginnamedisplay,plugintype,industrycode,groupid,groupfullname,pluginclasscode,ismutibui from (select a.pluginid ,a.plugincode,a.plugintype,a.pluginnamedisplay,a.industrycode ,a.groupid,a.pluginclasscode,a.ismutibui, b.GroupFullName from t_sys_plugin a left outer join T_BS_Group b on a.groupid=b.groupid where 1=1 and a.pluginstatus=1 ) " + 2516 " where plugincode in ( " + 2517 "select plugincode from " + 2518 "(select plugincode from T_SYS_Plugin where PluginType=‘01‘ Union " + //取所有标准插件 2519 "select plugincode from T_SYS_Plugin where PluginType=‘02‘ "; 2520 if(!sshy.equals("")&&!sshy.equals("999")){//所属行业 2521 sql+= " and industrycode =‘"+sshy+"‘"; 2522 2523 } 2524 if(sshy.equals("")&&!cshsshy.equals("")&&!cshsshy.equals("999")){ 2525 sql+= "and industrycode =‘"+cshsshy+"‘"; 2526 } 2527 2528 sql +="Union " + //取所有行业插件 2529 " select plugincode from T_SYS_Plugin where PluginType=‘03‘ and groupid=‘"+groupid+"‘ " ; 2530 2531 2532 if(!pluginids.equals("")&&biaoshi.equals("xq")){ 2533 //sql +=" )) and plugincode not like ‘XT_%‘ and plugincode not like ‘BS_%‘ and pluginid in "+StringUtil.null2String(StringUtil.getStrsplit(pluginids.split(",")))+"" ; // 过滤系统插件和运营插件 2534 sql +=" )) and plugincode not like ‘BS_%‘ and pluginid in "+StringUtil.null2String(StringUtil.getStrsplit(pluginids.split(",")))+"" ; // 过滤系统插件和运营插件 2535 }else if(pluginids.equals("")&&biaoshi.equals("xq")) { 2536 2537 //sql +=" )) and plugincode not like ‘XT_%‘ and plugincode not like ‘BS_%‘ and 1=2 "; 2538 sql +=" )) and plugincode not like ‘BS_%‘ and 1=2 "; 2539 2540 }else if("".equals(biaoshi)) { 2541 2542 sql +=" )) and plugincode not like ‘XT_%‘ and plugincode not like ‘BS_%‘"; 2543 //sql +=" )) and plugincode not like ‘BS_%‘ and 1=2 "; 2544 2545 } 2546 else { 2547 //sql +=" )) and plugincode not like ‘XT_%‘ and plugincode not like ‘BS_%‘ "; 2548 sql +=" )) and plugincode not like ‘BS_%‘ "; 2549 } 2550 2551 2552 2553 String limitSql=""; 2554 String orderSql=" "; 2555 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 2556 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 2557 String sort = StringUtil.null2String(form.get("sort"));//排序字段 2558 String dir = StringUtil.null2String(form.get("order"));//DESC 2559 2560 if(!sort.equals("")){ 2561 orderSql +=" order by "+sort+" "+dir+""; 2562 } 2563 String sqlQuery = ObjectCtl.getPageSql(sql + limitSql + orderSql, start, limit); 2564 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sql + limitSql + orderSql,null); 2565 Hashtable<String, Object> sshyht=comUtil.getZDHt(con, "0001", user.getGroupid()); 2566 for(int i=0;i<list.size();i++){ 2567 Map<String, String> map=list.get(i); 2568 map.put("plugintype", StringUtil.null2String(CjglMemo.cjlxMap.get(StringUtil.null2String(map.get("plugintype"))))); 2569 map.put("industrycode", StringUtil.null2String(sshyht.get(StringUtil.null2String(map.get("industrycode"))))); 2570 } 2571 2572 2573 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( "+sql + limitSql + orderSql+")" ); 2574 HttpServletResponse response = ActionContext.getContext().getResponse(); 2575 ObjectCtl.sendListData(response, count, list); 2576 2577 }catch (Exception e) { 2578 e.printStackTrace(); 2579 } 2580 finally 2581 { 2582 DBConnector.freecon(con); //释放数据库连接 2583 } 2584 return module.findPage("jsonxml"); 2585 } 2586 2587 2588 /** 2589 * 初始化添加页面 2590 * @param form 2591 * @param module 2592 * @param user 2593 * @return 2594 */ 2595 private Page toJtktAdd(WebForm form, Module module, T_sys_user user) { 2596 Connection con=DBConnector.getconecttion(); 2597 try { 2598 form.addResult("today", DateUtil.getToday()); 2599 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2600 String sql=" select pluginid ,pluginname ,pluginstatus from t_sys_plugin where 1=1"; 2601 ArrayList pluglist=ObjectCtl.getMulRowValue2(con, sql); 2602 form.addResult("pluglist", pluglist); 2603 form.addResult("hyList", hyList); 2604 String mainpluginid=ObjectCtl.getStrRowValue(con, "select pluginid from T_SYS_Plugin where plugincode =‘XT-001-999-99999999‘"); 2605 String adminpluginid=ObjectCtl.getStrRowValue(con, "select pluginid from T_SYS_Plugin where plugincode =‘XT-002-999-99999999‘"); 2606 String pluginids=mainpluginid+","+adminpluginid; 2607 form.addResult("pluginids", pluginids); 2608 } catch (Exception e) { 2609 e.printStackTrace(); 2610 }finally{ 2611 DBConnector.freecon(con); 2612 } 2613 2614 return module.findPage("jtktAdd"); 2615 } 2616 /** 2617 * easyUI列表 2618 * @param form 2619 * @param module 2620 * @param user 2621 * @return 2622 */ 2623 private Page jtktListJson(WebForm form, Module module, T_sys_user user) { 2624 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 2625 try 2626 { 2627 String groupname=StringUtil.null2String(form.get("groupname")).trim(); 2628 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 2629 String licensestatus=StringUtil.null2String(form.get("licensestatus")).trim(); 2630 String sql="select t.groupid, t.groupfullname,t.groupshortname, t.licensestatus,t.effectdate,t.failuredate, t.licenseusercount, t.licensemobileusercount from T_BS_Group t " + 2631 " where 1=1 and t.groupfullname is not null and t.groupid<>‘00000000‘ "; 2632 String limitSql=""; 2633 String orderSql=" "; 2634 if(!groupname.equals("")){ 2635 limitSql+=" and t.groupfullname like ‘%"+groupname+"%‘"; 2636 } 2637 if(!industrycode.equals("")){ 2638 limitSql+=" and t.industrycode = ‘"+industrycode+"‘"; 2639 } 2640 if(!licensestatus.equals("")){ 2641 limitSql+=" and t.licensestatus = ‘"+licensestatus+"‘"; 2642 } 2643 2644 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每页数据量 2645 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//开始位置 2646 String sort = StringUtil.null2String(form.get("sort"));//排序字段 2647 String dir = StringUtil.null2String(form.get("order"));//DESC 2648 2649 if(!sort.equals("")){ 2650 orderSql +=" order by "+sort+" "+dir+""; 2651 }else{ 2652 orderSql +=" order by licensestatus asc "; 2653 } 2654 2655 String sqlQuery = ObjectCtl.getPageSql(sql + limitSql + orderSql, start, limit); 2656 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 2657 2658 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( "+sql + limitSql + orderSql+")" ); 2659 HttpServletResponse response = ActionContext.getContext().getResponse(); 2660 ObjectCtl.sendListData(response, count, list); 2661 2662 }catch (Exception e) { 2663 e.printStackTrace(); 2664 } 2665 finally 2666 { 2667 DBConnector.freecon(con); //释放数据库连接 2668 } 2669 return module.findPage("jsonxml"); 2670 } 2671 2672 2673 /** 2674 * 执行新增数据 2675 */ 2676 private Page jtktAdd(WebForm form, Module module, T_sys_user user) 2677 { 2678 2679 Connection con = DBConnector.getconecttion(); //取得一个数据库连接 2680 boolean result = false; 2681 try 2682 2683 { 2684 String groupid = ObjectCtl.getSubMenuIdZD(con, "T_BS_Group", "groupid", "", 8); 2685 String groupfullname=StringUtil.null2String(form.get("groupfullname")).trim(); 2686 String groupshortname=StringUtil.null2String(form.get("groupshortname")).trim(); 2687 String licensestatus=StringUtil.null2String(form.get("licensestatus")).trim(); 2688 String effectdate=StringUtil.null2String(form.get("effectdate")).trim(); 2689 String failuredate=StringUtil.null2String(form.get("failuredate")).trim(); 2690 String licenseusercount=StringUtil.null2String(form.get("licenseusercount")).trim(); 2691 String licensemobileusercount=StringUtil.null2String(form.get("licensemobileusercount")).trim(); 2692 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 2693 String adminloginno=StringUtil.null2String(form.get("adminloginno")).trim();//管理员帐号 2694 2695 String groupfullnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupfullname)); //集团全称简拼 2696 String groupfullnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupfullname)); //集团全称全拼 2697 String groupshortnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupshortname)); //集团简称简拼 2698 String groupshortnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupshortname)); // 集团简称全拼 2699 if(licenseusercount.equals("")){ 2700 licenseusercount="-1"; 2701 } 2702 if(licensemobileusercount.equals("")){ 2703 licensemobileusercount="-1"; 2704 } 2705 String checkids=StringUtil.null2String(form.get("checkids")).trim(); 2706 String[] pluginids=checkids.split(","); 2707 ArrayList<String> sqlList=new ArrayList<String>(); 2708 //插入集团与插件关联(T_SYS_GroupPlugin) 2709 if(pluginids!=null&&pluginids.length>=0){ 2710 //PluginType 01-标准插件 02-行业插件 03-定制插件 2711 //取系统行业插件 2712 ArrayList XTHyPlugini=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like ‘XT%999%99999999‘ and PluginType = ‘02‘ and IndustryCode =‘"+industrycode+"‘"); 2713 2714 if(XTHyPlugini.size()>0){//插入系统插件 2715 2716 for (int i = 0; i < XTHyPlugini.size(); i++) { 2717 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2718 " values (‘"+groupid+"‘,‘"+XTHyPlugini.get(i)+"‘ )"; 2719 sqlList.add(insql); 2720 } 2721 }else{//取系统标准插件 2722 ArrayList XTBzPluginid=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like ‘XT%999%99999999‘ and PluginType = ‘01‘"); 2723 2724 if(XTBzPluginid.size()>0){ 2725 for (int i = 0; i < XTBzPluginid.size(); i++) { 2726 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2727 " values (‘"+groupid+"‘,‘"+XTBzPluginid.get(i)+"‘ )"; 2728 sqlList.add(insql); 2729 } 2730 } 2731 2732 } 2733 2734 ArrayList<String> pluginidlist=new ArrayList<String>(Arrays.asList(pluginids)); 2735 for (int i = 0; i < pluginidlist.size(); i++) { 2736 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2737 " values (‘"+groupid+"‘,‘"+pluginidlist.get(i)+"‘ )"; 2738 sqlList.add(insql); 2739 2740 } 2741 2742 } 2743 String adminuserid = BhGenerator.getBh(); 2744 String mainsql=" insert into T_BS_Group " + 2745 "( GroupID,GroupFullName,GroupShortName,LicenseStatus,EffectDate,FailureDate," + 2746 "LicenseUserCount,LicenseMobileUserCount,industrycode," + 2747 "groupfullnamefirstpy,groupfullnameallpy,groupshortnamefirstpy,groupshortnameallpy,ADMINLOGINNO,ADMINUSERID)" + 2748 " values "+ 2749 "(‘"+groupid+"‘,‘"+groupfullname+"‘,‘"+groupshortname+"‘,‘"+licensestatus+"‘,‘"+effectdate+"‘,‘"+failuredate+"‘,‘" + 2750 ""+licenseusercount+"‘,‘"+licensemobileusercount+"‘,‘"+industrycode+"‘," + 2751 "‘"+groupfullnamefirstpy+"‘,‘"+groupfullnameallpy+"‘,‘"+groupshortnamefirstpy+"‘,‘"+groupshortnameallpy+"‘,‘"+adminloginno+"‘,‘"+adminuserid+"‘)"; 2752 2753 sqlList.add(mainsql); 2754 result=ObjectCtl.executeMulSql(con, sqlList); 2755 if (result) 2756 { 2757 form.addResult("msg", "开户成功!"); 2758 2759 comUtil.countProc(con, "PRO_INIT_SYSDATA(‘"+groupid+"‘,‘"+adminloginno+"‘,‘"+adminuserid+"‘)"); 2760 //生成实例插件 2761 String sql1="select pluginID from T_SYS_GroupPlugin where GroupID="+groupid; 2762 List<DBean> list=DBHelper.getDBeanList(con, sql1, null); 2763 for(int i=0;i<list.size();i++){ 2764 String IsMutiBui=DBHelper.getRowStr(con, "select IsMutiBui from T_SYS_Plugin where pluginID =‘"+list.get(i).getString("pluginid")+"‘", null); 2765 2766 if(!IsMutiBui.equals("1")){ 2767 String plugininstid = BhGenerator.getBh();//实例插件id 2768 comUtil.countProc(con, "pro_plugin_instantiation(‘"+groupid+"‘,‘"+list.get(i).getString("pluginid")+"‘,‘‘,‘"+adminuserid+"‘,‘"+plugininstid+"‘)"); 2769 } 2770 } 2771 } 2772 else 2773 { 2774 form.addResult("msg", "开户失败!"); 2775 } 2776 } catch (Exception e) { 2777 e.printStackTrace(); 2778 } 2779 finally 2780 { 2781 DBConnector.freecon(con); //释放数据库连接 2782 } 2783 return module.findPage("jtktAdd"); 2784 } 2785 /** 2786 2787 2788 /** 2789 * 列表页面 2790 */ 2791 private Page jtktList(WebForm form, Module module, T_sys_user user) 2792 { 2793 Connection con=DBConnector.getconecttion();//取得一个数据库连接 2794 try 2795 { 2796 2797 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2798 form.addResult("hyList", hyList); 2799 } 2800 catch (Exception e) { 2801 e.printStackTrace(); 2802 } 2803 finally 2804 { 2805 DBConnector.freecon(con); //释放数据库连接 2806 } 2807 return module.findPage("jtktList"); 2808 } 2809 2810 2811 }
单个实例主页面
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <title>$!globals_sys_name</title> 6 <!-- EasyUi --> 7 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.css"></link> 8 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon.css"></link> 9 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/demo.css"></link> 10 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon-all.css"></link> 11 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.sx.css"></link> 12 <!-- EasyUi --> 13 14 <!-- 框架 --> 15 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/css/$!css_path/main.css"></link> 16 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery-1.11.1.js"></script> 17 <!--easyui--> 18 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.util.js"></script> 19 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.min.js"></script> 20 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/easyui-lang-zh_CN.js"></script> 21 <!-- 扩充 jquery 框架基础功能的函数库 --> 22 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery.jdirk.js"></script> 23 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.js"></script> 24 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tabs.js"></script> 25 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tree.js"></script> 26 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.form.js"></script> 27 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.panel.js"></script> 28 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.window.js"></script> 29 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.dialog.js"></script> 30 <!--easyui--> 31 <script language=‘javascript‘ src=‘/$!globals_sys_basename/web/common/component/Date/WdatePicker.js‘></script> 32 <script language=‘javascript‘ src=‘/$!globals_sys_basename/web/common/component/zdialog/zDialog.js‘></script> 33 <script language=‘javascript‘ src=‘/$!globals_sys_basename/web/common/component/zdialog/zDialog.sunshion.js‘></script> 34 <script type="text/javascript" src="/$!globals_sys_basename/web/common/js/ajax.sunshion.js"></script> 35 <script type="text/javascript" src="/$!globals_sys_basename/web/common/js/xml.sunshion.js"></script> 36 <style> 37 .panel-body{border: 0px solid #DFDFDF !important;} 38 #leftDiv{border: 1px solid #DFDFDF !important;border-top: 0px !important;} 39 .ok{ color:green;} 40 .error{ color:red;} 41 </style> 42 43 44 <head> 45 46 <body> 47 <div id="mainLayout" class="easyui-layout hidden" data-options="fit: true"> 48 <div data-options="region: ‘north‘" style="height:80px;width:100%;margin-top: 5px;"> 49 <form name=‘form1‘ method=‘post‘ action="/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=cjslAdd"> 50 <input type="hidden" name="doAction" id="doAction" value="cjslAdd" /> 51 <input type="hidden" name="groupid" id="groupid" value="$!groupid" /> 52 <input type="hidden" name="pluginid" id="pluginid" value="$!pluginid" /> 53 <input type="hidden" name="PluginIcon" id="PluginIcon" value="$!instObj.plugininsticon" /> 54 <input name="fj" id="fj" type="hidden" value="" /> 55 56 <table class="table-nl-sx" style="margin-top: 15px;"> 57 58 <tr> 59 <th width="100" align="right">插件实例名称:</th> 60 <td width="*"> 61 <input class="easyui-textbox input_sx" type="text" name="PluginInstName" id="PluginInstName" value="$!instObj.plugininstname" maxlength="13" style="width: 150px;" onblur="checkMail(this);"/> 62 <font color=red>*</font> 63 </td> 64 <th width="100" align="right">插件实例图标:</th> 65 <td colspan="3"> 66 <img id="pluginicon" name="pluginicon" src="/$!globals_sys_basename/web/common/page/downloadFile.jsp?path=$!instObj.plugininsticon&type=images" style="cursor:pointer;width:26px;height:26px;background-color: grey"/> 67 <div class="btn_sx" class="btn_4word_sx" style="vertical-align: top;" onclick="selectUpload(‘fj‘,‘getFJS‘)"">上传图标</div> 68 </td> 69 70 <th width="100" align="right">插件实例背景色:</th> 71 <td width="*"> 72 <input class="easyui-textbox input_sx" type="text" name="plugininsticonbgcolor" id="plugininsticonbgcolor" value="$!instObj.plugininsticonbgcolor" style="width: 200px;"/></td> 73 74 <iframe src="/$!globals_sys_basename/web/plugins/sys/admin/bz/upload.xp?upfiletype=images&backobj=form1.fj&backmethod=getFJS" name="ifrobj" id="ifrobj" frameborder="0" 75 scrolling="no" width="0" height="0" style="display: none;"></iframe> 76 77 <td style="text-align:right;"> 78 <div class="btn_sx btn_2word_sx" style="width: 50px;float: right;margin: 0 30px 0 0;" onclick="doClose()">取消</div> 79 <div class="btn_sx btn_2word_sx" style="width: 50px;float: right;margin: 0 30px 0 0;" onclick="doSubmit()">保存</div> 80 </td> 81 </tr> 82 83 </table> 84 </form> 85 </div> 86 87 <div data-options="region: ‘west‘" style="height:170px;width:500px;margin-top:5px;"> 88 <table id="table_menu" border="0" class="easyui-datagrid" title="菜单列表" 89 loadMsg="正在加载..." 90 toolbar="#toolbarDiv_menu" 91 data-options="fitColumns:true, fit:true,rownumbers:true,singleSelect:false,url:‘/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=plugListJson&groupid=$groupid&pluginid=$pluginid‘,method:‘post‘, pagination:true, pageSize:20"> 92 <thead> 93 <tr> 94 <th data-options="field:‘menuid‘, align:‘center‘, checkbox:true"></th> 95 <th data-options="field:‘menuname‘,align:‘center‘,halign:‘center‘, sortable:‘true‘, width:100">菜单别名</th> 96 <th data-options="field:‘menuicon‘,align:‘center‘,halign:‘center‘, width:100">菜单图标</th> 97 <th data-options="field:‘menuiconbgcolor‘,align:‘center‘,halign:‘center‘, width:100">菜单图标背景色</th> 98 <th data-options="field:‘caozuo‘,align:‘center‘,halign:‘center‘, sortable:‘true‘,width:100,formatter:caozuoFmat">操作</th> 99 </tr> 100 </thead> 101 </table> 102 </div> 103 104 <div data-options="region: ‘center‘" style="height: 170px;width:500px;margin-top: 5px;margin-left: 10px;"> 105 <table id="table_role" border="0" class="easyui-datagrid" title="角色列表" 106 loadMsg="正在加载..." 107 toolbar="#toolbarDiv_role" 108 data-options="fitColumns:true, fit: true,rownumbers:true,singleSelect:false,url:‘/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=cjjsListJson&groupid=$groupid&pluginid=$pluginid‘,method:‘post‘, pagination:true, pageSize:20"> 109 <thead> 110 <tr> 111 <th data-options="field:‘plugininstid‘, align:‘center‘, checkbox:true"></th> 112 <th data-options="field:‘roleid‘,align:‘center‘,halign:‘center‘, sortable:‘true‘, width:100">角色ID</th> 113 <th data-options="field:‘rolename‘,align:‘center‘,halign:‘center‘, sortable:‘true‘, width:100">角色别名</th> 114 <th data-options="field:‘caozuo‘,align:‘center‘,halign:‘center‘, sortable:‘true‘,width:100,formatter:czFmat">操作</th> 115 </tr> 116 </thead> 117 </table> 118 </div> 119 120 <div id="toolbarDiv_menu" style="width:100%;"> 121 <form id="form_menu" name="form_menu" class="easyui-form"> 122 <table cell-spacing="0" style="width:100%;margin-top: 0px;"> 123 <tr> 124 <td style="width:50px;"><div style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="dosearch_menu()"></div></td> 125 <td style="text-align:right;"> 126 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toDelCd(‘1‘)">删除菜单</div> 127 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toAddCd()">增加菜单</div> 128 </td> 129 </tr> 130 </table> 131 </form> 132 </div> 133 134 <div id="toolbarDiv_role" style="width:100%;"> 135 <form id="form_role" name="form_role" class="easyui-form"> 136 <table cell-spacing="0" style="width:100%;margin-top: 0px;"> 137 <tr> 138 <td style="width:50px;"><div style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="dosearch_role()"></div></td> 139 <td style="text-align:right;"> 140 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toDelJs(‘1‘,‘1‘)">删除角色</div> 141 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toAddJs()">增加角色</div> 142 </td> 143 </tr> 144 </table> 145 </form> 146 </div> 147 </div> 148 149 </body> 150 </html> 151 152 <script type="text/javascript"> 153 154 function doClose(){ 155 156 top.Dialog.close(); 157 158 } 159 160 function doSubmit(){ 161 if($(‘#PluginInstName‘).val()==""){ 162 Dialog.alert("插件实例名称不能为空!"); 163 return; 164 } 165 166 form1.submit(); 167 } 168 function doSubmit_temp(){ 169 if(checkMail(PluginInstName)){ 170 form1.submit(); 171 } 172 } 173 174 function checkMail(t){ 175 var v=t.value; 176 var next=t.nextSibling; 177 if(v==""){ 178 next.className="error"; 179 next.innerHTML="插件实例名称不能为空"; 180 return false; 181 } 182 next.className="ok"; 183 next.innerHTML=" ?"; 184 return true; 185 } 186 187 function selectUpload(name,backMothd){ 188 ifrobj.form1.upfile.click(); 189 top.afterSelectFile = function(){ 190 //获取上传路径 191 filepath = ifrobj.form1.upfile.value; 192 //当文件不等于空时执行的操作 193 if (filepath != ‘‘){ 194 //执行附件上传 195 ifrobj.doaction(); 196 } 197 } 198 } 199 200 201 function getFJS(backName) {//附件添加 202 $(‘#PluginIcon‘).val(form1.fj.value); 203 form1.pluginicon.src = "/$!globals_sys_basename/web/common/page/downloadFile.jsp?path=" + form1.fj.value+"&type=images"; 204 setTimeout(function(){ 205 $(‘#ifrobj‘).attr(‘src‘, ‘/$!globals_sys_basename/web/plugins/sys/admin/bz/upload.xp?upfiletype=images&backobj=form1.fj&backmethod=getFJS‘) 206 }, 10); 207 } 208 209 //刷新的功能 210 function dosearch_role(){ 211 var data = $("#form_role").form("getData"); 212 searchNormalFun("table_role", data); 213 top.ppage=null; 214 } 215 216 //添加角色 217 function toAddJs(){ 218 var adminloginstr = $("#adminlogin").val(); 219 var plugid = $("#pluginid").val(); 220 var groid = $("#groupid").val(); 221 //alert("====plugid=====" + plugid); 222 top.rolepage=window; 223 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=toAddJs&pluginid="+plugid+"&groupid="+groid +"&adminlogin="+adminloginstr; 224 var diag = new Dialog(); 225 diag.Width = 460; 226 diag.Height = 460; 227 diag.Title = "添加角色"; 228 diag.URL = url; 229 diag.OkButtonText="保存"; 230 diag.CancelButtonText="取 消"; 231 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 232 diag.show(); 233 } 234 235 //操作栏中的按钮 236 function czFmat(caozuo,row,index){ 237 var str; 238 var str = "<a href=\"javascript:void(0);\" class=\"abtn_sx\" onClick=\"toUpdateJs(‘" +row.plugininstid+"‘,‘"+row.roleid+ "‘)\">修改</a>"; 239 240 str+="<span class=\"text-explode\">|</span><a href=\"javascript:void(0);\" class=\"abtn_sx\" onClick=\"toDelJs(‘" +row.plugininstid+ "‘,‘"+row.roleid+"‘)\" title=‘删除‘>删除</a>" 241 return str; 242 } 243 244 //修改角色 245 function toUpdateJs(plugininstid,roleid){ 246 //alert("========plugininstid========" + plugininstid +"==roleid==" + roleid); 247 var pluginid = $("#pluginid").val(); 248 top.rolepage=window; 249 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=toUpdateJs&plugininstid="+plugininstid+"&roleid=" + roleid+"&pluginid=" + pluginid; 250 var diag = new Dialog(); 251 diag.Width = 680; 252 diag.Height = 400; 253 diag.Title = "修改角色"; 254 diag.URL = url; 255 diag.OkButtonText="保存"; 256 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 257 diag.CancelButtonText="取 消"; 258 diag.CancelEvent = function(){diag.close();}; 259 diag.show(); 260 } 261 262 263 264 //批量删除 265 function toDelJs(plugininstid,roleid) { 266 var pluginid = $("#pluginid").val(); 267 var spids = ""; 268 var srids=""; 269 270 if(plugininstid == "1" && roleid == "1"){//批量删除 271 var rows = $(‘#table_role‘).datagrid(‘getSelections‘); 272 for (var i = 0; i < rows.length; i++) { 273 var array_element = rows[i]; 274 spids += array_element.plugininstid + ","; 275 } 276 277 for (var i = 0; i < rows.length; i++) { 278 var array_element = rows[i]; 279 srids += array_element.roleid + ","; 280 } 281 282 if(spids == "" || srids == ""){ 283 Dialog.alert("请至少选择一条需要删除的数据!"); 284 return; 285 } 286 287 }else{//删除 288 spids = plugininstid; 289 srids = roleid; 290 } 291 292 293 Dialog.confirm(‘确定删除吗?‘,function() { 294 jQuery.post("/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=deleteJs",{plugininstid:spids,roleid:srids,pluginid:pluginid}, function(date) { 295 var rest = eval("‘(" + date+ ")‘");//json对象 296 if (rest) { 297 dosearch_role(); 298 Dialog.alert("删除成功!"); 299 } else { 300 Dalog.alert("删除失败!"); 301 } 302 }); 303 }); 304 } 305 306 307 //刷新的功能 308 function dosearch_menu(){ 309 var data = $("#form_menu").form("getData"); 310 searchNormalFun("table_menu", data); 311 top.ppage=null; 312 } 313 314 //添加菜单 315 function toAddCd(){ 316 var adminloginstr = $("#adminlogin").val(); 317 var plugid = $("#pluginid").val(); 318 var groid = $("#groupid").val(); 319 //alert("====plugid=====" + plugid); 320 top.menupage=window; 321 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=toAddCd&pluginid="+plugid+"&groupid="+groid +"&adminlogin="+adminloginstr; 322 var diag = new Dialog(); 323 diag.Width = 460; 324 diag.Height = 460; 325 diag.Title = "添加菜单"; 326 diag.URL = url; 327 diag.OkButtonText="保存"; 328 diag.CancelButtonText="取 消"; 329 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 330 diag.show(); 331 } 332 333 //操作栏中的按钮 334 function caozuoFmat(caozuo,row,index){ 335 var str; 336 str = ‘<a href=\"javascript:void(0);\" class=\"abtn_sx\" onclick="toUpdateCd(\‘‘+row.menuid+‘\‘)">修改</a>‘; 337 str+="<span class=\"text-explode\">|</span><a href=\"javascript:void(0);\" class=\"abtn_sx\" onclick=\"toDelCd(‘"+row.menuid+"‘)\" title=‘删除‘>删除</a>" 338 return str; 339 } 340 341 //修改菜单(保存后图标出不来??????????) 342 function toUpdateCd(menuid){ 343 //alert("========menuid========" + menuid); 344 var groupid = $(‘#groupid‘).val(); 345 var plugid = $(‘#pluginid‘).val(); 346 347 top.menupage=window; 348 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=toUpdateCd&menuid="+menuid+"&groupid="+groupid+"&pluginid="+plugid; 349 var diag = new Dialog(); 350 diag.Width = 680; 351 diag.Height = 400; 352 diag.Title = "修改菜单"; 353 diag.URL = url; 354 diag.OkButtonText="保存"; 355 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 356 diag.CancelButtonText="取 消"; 357 diag.CancelEvent = function(){diag.close();}; 358 diag.show(); 359 } 360 361 362 363 //批量删除 364 function toDelCd(menuid) { 365 var groupid = $(‘#groupid‘).val(); 366 var pluginid = $(‘#pluginid‘).val(); 367 var spids = ""; 368 if(menuid == "1"){//批量删除 369 //alert("======menuid11======" + menuid); 370 var rows = $(‘#table_menu‘).datagrid(‘getSelections‘); 371 for (var i = 0; i < rows.length; i++) { 372 var array_element = rows[i]; 373 spids += array_element.menuid + ","; 374 } 375 376 if(spids == ""){ 377 Dialog.alert("请至少选择一条需要删除的数据!"); 378 return; 379 } 380 }else{//删除 381 spids=menuid; 382 } 383 384 385 Dialog.confirm(‘确定删除吗?‘,function() { 386 jQuery.post("/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=deleteCd",{menuid:spids,pluginid:pluginid,groupid:groupid}, function(date) { 387 var rest = eval("‘(" + date+ ")‘");//json对象 388 if (rest) { 389 dosearch_menu(); 390 Dialog.alert("删除成功!"); 391 } else { 392 Dalog.alert("删除失败!"); 393 } 394 }); 395 }); 396 } 397 398 </script>
多个实例主页面
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <title>$!globals_sys_name</title> 6 <!-- EasyUi --> 7 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.css"></link> 8 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon.css"></link> 9 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/demo.css"></link> 10 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon-all.css"></link> 11 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.sx.css"></link> 12 <!-- EasyUi --> 13 14 <!-- 框架 --> 15 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/css/$!css_path/main.css"></link> 16 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery-1.11.1.js"></script> 17 <!--easyui--> 18 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.util.js"></script> 19 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.min.js"></script> 20 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/easyui-lang-zh_CN.js"></script> 21 <!-- 扩充 jquery 框架基础功能的函数库 --> 22 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery.jdirk.js"></script> 23 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.js"></script> 24 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tabs.js"></script> 25 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tree.js"></script> 26 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.form.js"></script> 27 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.panel.js"></script> 28 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.window.js"></script> 29 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.dialog.js"></script> 30 <!--easyui--> 31 <script language=‘javascript‘ src=‘/$!globals_sys_basename/web/common/component/Date/WdatePicker.js‘></script> 32 <script language=‘javascript‘ src=‘/$!globals_sys_basename/web/common/component/zdialog/zDialog.js‘></script> 33 <script language=‘javascript‘ src=‘/$!globals_sys_basename/web/common/component/zdialog/zDialog.sunshion.js‘></script> 34 <script type="text/javascript" src="/$!globals_sys_basename/web/common/js/ajax.sunshion.js"></script> 35 <script type="text/javascript" src="/$!globals_sys_basename/web/common/js/xml.sunshion.js"></script> 36 <style> 37 .panel-body{border: 0px solid #DFDFDF !important;} 38 #leftDiv{border: 1px solid #DFDFDF !important;border-top: 0px !important;} 39 .ok{ color:green;} 40 .error{ color:red;} 41 </style> 42 43 44 <script type="text/javascript"> 45 #if($msg) 46 top.Dialog.alert(‘$!msg‘,function(){ 47 top.ppage.dosearch_license(); 48 top.Dialog.close(); 49 });//重新加载父页面 50 #end 51 </script> 52 </head> 53 54 <body> 55 <div id="mainLayout" class="easyui-layout hidden" data-options="fit:true"> 56 <input type="hidden" id="groupid" name="groupid" value="$groupid" /> 57 <input type="hidden" id="buiid" name="buiid" value="$buiid" /> 58 <input type="hidden" id="pluginid" name="pluginid" value="$pluginid" /> 59 <div data-options="region: ‘west‘" style="height:170px;width:350px;margin-top:5px;"> 60 <table id="table_menu" border="0" class="easyui-datagrid" title="菜单列表" 61 loadMsg="正在加载..." 62 toolbar="#toolbarDiv_menu" 63 data-options="fitColumns:true, fit:true,rownumbers:true,singleSelect:false,url:‘/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=cdListJson&groupid=$groupid&pluginid=$pluginid&buiid=$buiid‘,method:‘post‘, pagination:true, pageSize:20"> 64 <thead> 65 <tr> 66 <th data-options="field:‘menuid‘, align:‘center‘, checkbox:true"></th> 67 <th data-options="field:‘menuname‘,align:‘center‘,halign:‘center‘, sortable:‘true‘, width:100">菜单别名</th> 68 <th data-options="field:‘caozuo‘,align:‘center‘,halign:‘center‘, sortable:‘true‘,width:60,formatter:caozuoFmat">操作</th> 69 </tr> 70 </thead> 71 </table> 72 </div> 73 74 <div data-options="region: ‘center‘" style="height: 170px;width:320px;margin-top:5px;margin-left: 10px;"> 75 <table id="table_role" border="0" class="easyui-datagrid" title="角色列表" 76 loadMsg="正在加载..." 77 toolbar="#toolbarDiv_role" 78 data-options="fitColumns:true, fit: true,rownumbers:true,singleSelect:false,url:‘/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=jsListJson&groupid=$groupid&pluginid=$pluginid&buiid=$buiid‘,method:‘post‘, pagination:true, pageSize:20"> 79 <thead> 80 <tr> 81 <th data-options="field:‘roleid‘, align:‘center‘, checkbox:true"></th> 82 <th data-options="field:‘rolename‘,align:‘center‘,halign:‘center‘, sortable:‘true‘, width:100">角色别名</th> 83 <th data-options="field:‘caozuo‘,align:‘center‘,halign:‘center‘, sortable:‘true‘,width:100,formatter:czFmat">操作</th> 84 </tr> 85 </thead> 86 </table> 87 </div> 88 89 <div id="toolbarDiv_menu" style="width:100%;"> 90 <form id="form_menu" name="form_menu" class="easyui-form"> 91 <table cell-spacing="0" style="width:100%;margin-top: 0px;"> 92 <tr> 93 <td style="width:50px;"><div style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="dosearch_menu()"></div></td> 94 <td style="text-align:right;"> 95 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toDelCd(‘1‘)">删除菜单</div> 96 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toAddCd()">增加菜单</div> 97 </td> 98 </tr> 99 </table> 100 </form> 101 </div> 102 103 <div id="toolbarDiv_role" style="width:100%;"> 104 <form id="form_role" name="form_role" class="easyui-form"> 105 <table cell-spacing="0" style="width:100%;margin-top: 0px;"> 106 <tr> 107 <td style="width:50px;"><div style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="dosearch_role()"></div></td> 108 <td style="text-align:right;"> 109 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toDelJs(‘1‘,‘1‘)">删除角色</div> 110 <div class="btn_sx btn_4word_sx" style="width: 50px;float: right;margin: 0 5px 0 0;" onclick="toAddJs()">增加角色</div> 111 </td> 112 </tr> 113 </table> 114 </form> 115 </div> 116 </div> 117 118 119 </body> 120 <script type="text/javascript"> 121 //刷新的功能 122 function dosearch_role(){ 123 var data = $("#form_role").form("getData"); 124 searchNormalFun("table_role", data); 125 top.ppage=null; 126 } 127 128 //添加角色 129 function toAddJs(){ 130 var buiid = $("#buiid").val(); 131 var plugid = $("#pluginid").val(); 132 var groid = $("#groupid").val(); 133 //alert("====plugid=====" + plugid); 134 top.rolepage=window; 135 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=todAddJs&pluginid="+plugid+"&groupid="+groid +"&buiid="+buiid; 136 var diag = new Dialog(); 137 diag.Width = 460; 138 diag.Height = 460; 139 diag.Title = "添加角色"; 140 diag.URL = url; 141 diag.OkButtonText="保存"; 142 diag.CancelButtonText="取 消"; 143 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 144 diag.show(); 145 } 146 147 //操作栏中的按钮 148 function czFmat(caozuo,row,index){ 149 var str; 150 var str = "<a href=\"javascript:void(0);\" class=\"abtn_sx\" onClick=\"toUpdateJs(‘" +row.roleid+ "‘)\">修改</a>"; 151 152 str+="<span class=\"text-explode\">|</span><a href=\"javascript:void(0);\" class=\"abtn_sx\" onClick=\"toDelJs(‘"+row.roleid+"‘)\" title=‘删除‘>删除</a>" 153 return str; 154 } 155 156 //修改角色 157 function toUpdateJs(roleid){ 158 var groid = $("#groupid").val(); 159 var buiid = $("#buiid").val(); 160 var pluginid = $("#pluginid").val(); 161 top.rolepage=window; 162 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=toUpdateJsd&roleid=" + roleid+"&pluginid=" + pluginid+"&buiid=" + buiid+"&groupid=" + groid; 163 var diag = new Dialog(); 164 diag.Width = 680; 165 diag.Height = 400; 166 diag.Title = "修改角色"; 167 diag.URL = url; 168 diag.OkButtonText="保存"; 169 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 170 diag.CancelButtonText="取 消"; 171 diag.CancelEvent = function(){diag.close();}; 172 diag.show(); 173 } 174 175 176 177 //删除角色 178 function toDelJs(roleid) { 179 var pluginid = $("#pluginid").val(); 180 var groupid = $("#groupid").val(); 181 var buiid = $("#buiid").val(); 182 var spids = ""; 183 if(roleid == "1"){//批量删除 184 alert("====roleid11==="+roleid); 185 var rows = $(‘#table_role‘).datagrid(‘getSelections‘); 186 for (var i = 0; i < rows.length; i++) { 187 var array_element = rows[i]; 188 spids += array_element.roleid + ","; 189 } 190 191 if(spids == ""){ 192 Dialog.alert("请至少选择一条需要删除的数据!"); 193 return; 194 } 195 196 }else{//删除 197 alert("====roleid22==="+roleid); 198 spids = roleid; 199 } 200 201 202 Dialog.confirm(‘确定删除吗?‘,function() { 203 jQuery.post("/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=deleteJsd",{roleid:spids,pluginid:pluginid,groupid:groupid,buiid:buiid}, function(date) { 204 var rest = eval("‘(" + date+ ")‘");//json对象 205 if (rest) { 206 dosearch_role(); 207 Dialog.alert("删除成功!"); 208 } else { 209 Dalog.alert("删除失败!"); 210 } 211 }); 212 }); 213 } 214 215 216 //刷新的功能 217 function dosearch_menu(){ 218 var data = $("#form_menu").form("getData"); 219 searchNormalFun("table_menu", data); 220 top.ppage=null; 221 } 222 223 //添加菜单 224 function toAddCd(){ 225 var buiid = $("#buiid").val(); 226 var plugid = $("#pluginid").val(); 227 var groid = $("#groupid").val(); 228 //alert("====plugid=====" + plugid); 229 top.menupage=window; 230 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=todAddCd&pluginid="+plugid+"&groupid="+groid +"&buiid="+buiid; 231 var diag = new Dialog(); 232 diag.Width = 460; 233 diag.Height = 460; 234 diag.Title = "添加菜单"; 235 diag.URL = url; 236 diag.OkButtonText="保存"; 237 diag.CancelButtonText="取 消"; 238 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 239 diag.show(); 240 } 241 242 //操作栏中的按钮 243 function caozuoFmat(caozuo,row,index){ 244 var str; 245 str = ‘<a href=\"javascript:void(0);\" class=\"abtn_sx\" onclick="toUpdateCd(\‘‘+row.menuid+‘\‘)">修改</a>‘; 246 str+="<span class=\"text-explode\">|</span><a href=\"javascript:void(0);\" class=\"abtn_sx\" onclick=\"toDelCd(‘"+row.menuid+"‘)\" title=‘删除‘>删除</a>" 247 return str; 248 } 249 250 //修改菜单() 251 function toUpdateCd(menuid){ 252 //alert("========menuid========" + menuid); 253 var buiid = $("#buiid").val(); 254 var groupid = $(‘#groupid‘).val(); 255 var plugid = $(‘#pluginid‘).val(); 256 257 top.menupage=window; 258 var url = "/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=toUpdateCdd&menuid="+menuid+"&groupid="+groupid+"&pluginid="+plugid+"&buiid="+buiid; 259 var diag = new Dialog(); 260 diag.Width = 680; 261 diag.Height = 400; 262 diag.Title = "修改菜单"; 263 diag.URL = url; 264 diag.OkButtonText="保存"; 265 diag.OKEvent = function(){ diag.innerFrame.contentWindow.doSubmit();}; 266 diag.CancelButtonText="取 消"; 267 diag.CancelEvent = function(){diag.close();}; 268 diag.show(); 269 } 270 271 272 273 //删除菜单 274 function toDelCd(menuid) { 275 var buiid = $("#buiid").val(); 276 var groupid = $(‘#groupid‘).val(); 277 var pluginid = $(‘#pluginid‘).val(); 278 var spids = ""; 279 if(menuid == "1"){//批量删除 280 //alert("======menuid11======" + menuid); 281 var rows = $(‘#table_menu‘).datagrid(‘getSelections‘); 282 for (var i = 0; i < rows.length; i++) { 283 var array_element = rows[i]; 284 spids += array_element.menuid + ","; 285 } 286 287 if(spids == ""){ 288 Dialog.alert("请至少选择一条需要删除的数据!"); 289 return; 290 } 291 }else{//删除 292 //alert("======menuid22======="+menuid); 293 spids=menuid; 294 } 295 296 297 Dialog.confirm(‘确定删除吗?‘,function() { 298 jQuery.post("/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=deleteCdd",{menuid:spids,pluginid:pluginid,groupid:groupid,buiid:buiid}, function(date) { 299 var rest = eval("‘(" + date+ ")‘");//json对象 300 if (rest) { 301 dosearch_menu(); 302 Dialog.alert("删除成功!"); 303 } else { 304 Dalog.alert("删除失败!"); 305 } 306 }); 307 }); 308 } 309 310 </script> 311 </html>
其他代码比较相似,我就不上传
标签:
原文地址:http://www.cnblogs.com/ljf4830/p/5136789.html