這個是根據前面一篇項目做出修改,那個增長的頁面都是列表頁面javascript
配置文件css
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 <page name="AddcjslXx" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/AddcjslXx.html" type="template"/> 65 66 <page name="cjslAdd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/cjslAdd.html" type="template"/> 67 68 <page name="plugList" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/jtktPlugList.html" type="template"/> 69 <page name="toAddCd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toAddCd.html" type="template"/> 70 <page name="toUpdateCd" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toUpdateCd.html" type="template"/> 71 72 <page name="cjjsList" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/cjjsList.html" type="template"/> 73 <page name="toAddJs" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toAddJs.html" type="template"/> 74 <page name="toUpdateJs" url="/web/plugins/bs/yygl/dz/g00000000/jtkt/toUpdateJs.html" type="template"/> 75 76 </module> 77 78 <!-- 能力平臺配置 --> 79 <module path="/web/plugins/bs/yygl/dz/g00000000/nlpt" form="" scope="request" action="plugins.bs.yygl.dz.g00000000.nlpt.NlptAction" defaultPage=""> 80 <page name="nlptList" url="/web/plugins/bs/yygl/dz/g00000000/nlpt/nlptList.html" type="template" /> 81 <page name="nlptDate" url="/web/plugins/bs/yygl/dz/g00000000/nlpt/nlptDate.html" type="template" /> 82 </module> 83 </modules> 84 </xp-web>
後臺代碼html
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")){//插件實例添加頁面 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("AddcjslXx")){//插件修改頁面的主頁面 2015-12-24 liujunfeng 203 forward = AddcjslXx(form, module, user); 204 }else if(method.equals("plugList")){//插件修改頁面的插件菜單列表信息頁面 205 forward = plugList(form, module, user); 206 }else if (method.equals("plugListJson")){//插件修改頁面的插件菜單列表信息數據 207 forward = plugListJson(form, module, user); 208 }else if (method.equals("toAddCd")){//插件菜單新增信息頁面 209 forward = module.findPage("toAddCd"); 210 }else if (method.equals("addCdListJson")){//插件菜單列表數據 211 forward = addCdListJson(form, module, user); 212 }else if (method.equals("addCd")){//保存插件菜單新增數據 213 forward = addCd(form, module, user); 214 }else if (method.equals("toUpdateCd")){//插件菜單修改頁面的數據 215 forward = toUpdateCd(form, module, user); 216 }else if (method.equals("updateCd")){//保存插件菜單修改數據 217 forward = updateCd(form, module, user); 218 }else if (method.equals("deleteCd")){//菜單刪除數據 219 forward = deleteCd(form, module, user); 220 }else if (method.equals("addJsListJson")){//插件角色列表數據 221 forward = addJsListJson(form, module, user); 222 }else if (method.equals("cjjsList")){//插件角色列表信息頁面 223 forward = cjjsList(form, module, user); 224 }else if (method.equals("cjjsListJson")){//插件角色列表信息數據 225 forward = cjjsListJson(form, module, user); 226 }else if (method.equals("toAddJs")){//插件角色新增信息頁面 227 forward = module.findPage("toAddJs"); 228 }else if (method.equals("addJs")){//保存角色新增數據 229 forward = addJs(form, module, user); 230 }else if (method.equals("toUpdateJs")){//插件角色修改頁面的數據 231 forward = toUpdateJs(form, module, user); 232 }else if (method.equals("updateJs")){//保存插件角色修改數據 233 forward = updateJs(form, module, user); 234 }else if (method.equals("deleteJs")){//菜單刪除數據 235 forward = deleteJs(form, module, user); 236 } 237 238 239 return forward; 240 } 241 242 243 244 //角色刪除數據 245 private Page deleteJs(WebForm form, Module module, T_sys_user user) { 246 Connection conn = DBConnector.getconecttion(); 247 248 String groupid = StringUtil.null2String(form.get("groupid")); 249 250 String spids = StringUtil.null2String(form.get("plugininstid")); 251 String ids = StringUtil.getStrsplit(spids.split(",")); 252 String srids = StringUtil.null2String(form.get("roleid")); 253 String roids = StringUtil.getStrsplit(srids.split(",")); 254 String pluginid = StringUtil.null2String(form.get("pluginid")); 255 256 System.out.println("=====ids==="+ ids +"====roids=====" + roids +"===pluginid====" + pluginid); 257 String delSql ="DELETE from SXT_SYS_PluginInstRole where roleId in " + roids +" and PluginInstID in "+ids; 258 System.out.println("======delSql======" + delSql); 259 String deleteSql ="DELETE from t_sys_role where roleId in " +roids+" and pluginid='" +pluginid+"'"; 260 System.out.println("======deleteSql======" + deleteSql); 261 try{ 262 DBHelper.update(conn, delSql, null); 263 DBHelper.update(conn, deleteSql, null); 264 form.addResult("result", true); 265 }catch(Exception e){ 266 form.addResult("result", false); 267 e.printStackTrace(); 268 }finally{ 269 DBConnector.freecon(conn); 270 } 271 return module.findPage("jsonxml"); 272 } 273 274 //保存插件角色修改數據 275 private Page updateJs(WebForm form, Module module, T_sys_user user) { 276 Connection con = DBConnector.getconecttion(); 277 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 278 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 279 String plugininstid= StringUtil.null2String(form.get("plugininstid")).trim(); 280 String roleid= StringUtil.null2String(form.get("roleid")).trim(); 281 //System.out.println("======roleid======" + roleid); 282 String roleName= StringUtil.null2String(form.get("roleName")).trim(); 283 try{ 284 String upSql ="update SXT_SYS_PluginInstRole set RoleName='"+roleName+"' where PluginInstID='"+plugininstid+"' and RoleID='" +roleid +"'"; 285 //System.out.println("======upSql=======" + upSql); 286 DBHelper.update(con, upSql, null); 287 String updateSql="update t_sys_role set RoleName ='"+roleName+"' where pluginid='"+pluginid+"' and roleid='"+roleid+"'"; 288 //System.out.println("===updateSql==" + updateSql); 289 DBHelper.update(con, updateSql, null); 290 form.addResult("msg", "角色數據修改爲功!"); 291 }catch(Exception e){ 292 form.addResult("msg", "角色數據修改失敗!"); 293 e.printStackTrace(); 294 }finally{ 295 DBConnector.freecon(con); 296 } 297 return module.findPage("toUpdateJs"); 298 } 299 300 //插件角色修改頁面的數據 301 private Page toUpdateJs(WebForm form, Module module, T_sys_user user) { 302 Connection con = DBConnector.getconecttion(); 303 // String groupid= StringUtil.null2String(form.get("groupid")).trim(); 304 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 305 form.addResult("pluginid", pluginid); 306 String plugininstid= StringUtil.null2String(form.get("plugininstid")).trim(); 307 form.addResult("plugininstid", plugininstid); 308 String roleid= StringUtil.null2String(form.get("roleid")).trim(); 309 form.addResult("roleid", roleid); 310 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 311 //System.out.println("====plugininstid===" + plugininstid +"=====roleid=====" + roleid); 312 try{ 313 String seSql="select RoleID,RoleName from SXT_SYS_PluginInstRole where PluginInstID='"+plugininstid+"' and RoleID='"+roleid+"'"; 314 List<DBean> list = DBHelper.getDBeanList(con, seSql, null); 315 form.addResult("sljsObj", list.get(0)); 316 }catch(Exception e){ 317 e.printStackTrace(); 318 }finally{ 319 DBConnector.freecon(con); 320 } 321 return module.findPage("toUpdateJs"); 322 } 323 324 //保存角色菜單數據 325 private Page addJs(WebForm form, Module module, T_sys_user user) { 326 Connection con = DBConnector.getconecttion(); 327 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 328 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 329 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 330 331 String ids= StringUtil.null2String(form.get("ids")).trim(); 332 String[] id = null; 333 if(ids!=null || !ids.equals("")){ 334 id =ids.split(","); 335 } 336 337 String roleIds= StringUtil.null2String(form.get("roleIds")).trim(); 338 339 String[] rId = null; 340 if(roleIds!=null || !roleIds.equals("")){ 341 rId =roleIds.split(","); 342 } 343 String roleNames= StringUtil.null2String(form.get("roleNames")).trim(); 344 String[] rName = null; 345 if(roleNames!=null || !roleNames.equals("")){ 346 rName =roleNames.split(","); 347 } 348 //System.out.println("=ids="+ids+"=roleNames=" + roleNames); 349 //查詢插件實例id 350 String pni = getPluginInstID(pluginid,groupid); 351 try{ 352 for(int i=0; i < id.length; i++){ 353 String sql ="insert into SXT_SYS_PluginInstRole values('"+pni+"','"+rId[i]+"','"+rName[i]+"')"; 354 //System.out.println("==sql===" + sql); 355 DBHelper.insert(con, sql, null); 356 } 357 358 form.addResult("result", true); 359 }catch(Exception e){ 360 form.addResult("result", false); 361 e.printStackTrace(); 362 }finally{ 363 DBConnector.freecon(con); 364 } 365 return module.findPage("jsonxml"); 366 } 367 368 //角色新增按鈕列表頁面數據來源 369 private Page addJsListJson(WebForm form, Module module, T_sys_user user) { 370 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 371 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 372 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 373 String sort = StringUtil.null2String(form.get("sort"));//排序字段 374 String dir = StringUtil.null2String(form.get("order"));//DESC 375 String orderSql=""; 376 if(!sort.equals("")){ 377 orderSql +=" order by "+sort+" "+dir+""; 378 } 379 try{ 380 String pluginid = StringUtil.null2String(form.get("pluginid")); 381 String groupid = StringUtil.null2String(form.get("groupid")); 382 String pni = getPluginInstID(pluginid,groupid); 383 String seleSql="SELECT id,roleid,rolename FROM t_sys_role where pluginid='"+pluginid 384 + "' and roleid not in (select roleid from SXT_SYS_PluginInstRole where plugininstid ='"+ pni+"')"; 385 //System.out.println("====seleSql=====" + seleSql); 386 String sqlQuery = ObjectCtl.getPageSql(seleSql+orderSql, start, limit); 387 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 388 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + seleSql+orderSql + ")" ); 389 390 HttpServletResponse response = ActionContext.getContext().getResponse(); 391 ObjectCtl.sendListData(response, count, list); 392 form.addResult("msg", "數據加載成功!"); 393 }catch(Exception e){ 394 form.addResult("msg", "數據加載失敗!"); 395 e.printStackTrace(); 396 }finally{ 397 DBConnector.freecon(con); 398 } 399 400 return module.findPage("jsonxml"); 401 } 402 403 //角色的列表數據 404 private Page cjjsListJson(WebForm form, Module module, T_sys_user user) { 405 Connection con = DBConnector.getconecttion(); 406 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 407 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 408 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 409 //System.out.println("======groupid======" + groupid+"======pluginid======" + pluginid); 410 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 411 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 412 String sort = StringUtil.null2String(form.get("sort"));//排序字段 413 String dir = StringUtil.null2String(form.get("order"));//DESC 414 415 String orderSql=""; 416 if(!sort.equals("")){ 417 orderSql +=" order by "+sort+" "+dir+""; 418 } 419 //查詢插件實例id 420 String pni = getPluginInstID(pluginid,groupid); 421 try{ 422 String jsSql ="select PluginInstID,RoleID,RoleName from SXT_SYS_PluginInstRole where PluginInstID ='"+pni+"'"; 423 //System.out.println("======jsSql=====" + jsSql); 424 String sqlQuery = ObjectCtl.getPageSql(jsSql+orderSql, start, limit); 425 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 426 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + jsSql+orderSql + ")" ); 427 HttpServletResponse response = ActionContext.getContext().getResponse(); 428 ObjectCtl.sendListData(response, count, list); 429 form.addResult("msg", "數據加載成功!"); 430 }catch(Exception e){ 431 form.addResult("msg", "數據加載失敗!"); 432 e.printStackTrace(); 433 }finally{ 434 DBConnector.freecon(con); 435 } 436 return null; 437 } 438 439 //角色信息頁面 440 private Page cjjsList(WebForm form, Module module, T_sys_user user) { 441 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 442 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 443 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 444 form.addResult("groupid", groupid); 445 form.addResult("actionpluginid", pluginid); 446 form.addResult("adminlogin", adminlogin ); 447 return module.findPage("cjjsList"); 448 } 449 450 //刪除菜單信息 451 private Page deleteCd(WebForm form, Module module, T_sys_user user) { 452 Connection conn = DBConnector.getconecttion(); 453 String spids = StringUtil.null2String(form.get("menuid")); 454 String groupid = StringUtil.null2String(form.get("groupid")); 455 String pluginid = StringUtil.null2String(form.get("pluginid")); 456 457 String ids = StringUtil.getStrsplit(spids.split(",")); 458 String pni = getPluginInstID(pluginid,groupid); 459 460 String deleteSql = "DELETE from SXT_SYS_PluginInstMenu where menuid in " + ids +"and PluginInstID='"+pni+"'"; 461 //System.out.println("===deleteSql====" + deleteSql); 462 String delSql="DELETE from t_sys_menu where menuid in " +ids+ "and pluginid ='"+pluginid+"'"; 463 //System.out.println("===delSql==" + delSql); 464 try{ 465 DBHelper.update(conn, deleteSql, null); 466 DBHelper.update(conn, delSql, null); 467 form.addResult("result", true); 468 }catch(Exception e){ 469 form.addResult("result", false); 470 e.printStackTrace(); 471 472 }finally{ 473 DBConnector.freecon(conn); 474 } 475 return module.findPage("jsonxml"); 476 } 477 478 //保存菜單修改數據 479 private Page updateCd(WebForm form, Module module, T_sys_user user) { 480 Connection con = DBConnector.getconecttion(); 481 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 482 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 483 String menuid= StringUtil.null2String(form.get("menuid")).trim(); 484 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 485 //System.out.println("====groupid==" + groupid+"==pluginid==" + pluginid +"==menuid==" + menuid); 486 //查詢插件實例id 487 488 String pni = getPluginInstID(pluginid,groupid); 489 //System.out.println("=====pni=====" +pni); 490 String menuName= StringUtil.null2String(form.get("menuName")).trim(); 491 String menuIcon= StringUtil.null2String(form.get("menuIcon")).trim(); 492 String menuIconbgColor= StringUtil.null2String(form.get("menuIconbgColor")).trim(); 493 494 try{ 495 String updateSql="update SXT_SYS_PluginInstMenu set plugininstid='"+ pni+ "',MenuID='"+menuid+"', menuName='"+menuName+"',menuIcon='"+menuIcon 496 +"',MenuIconBgColor='" +menuIconbgColor+"' where MenuID='"+menuid+"'"; 497 //System.out.println("=======updateSql===========" + updateSql); 498 DBHelper.update(con, updateSql, null); 499 500 String updSql="update t_sys_menu set menuname ='" +menuName+"',icon='" +menuIcon+"',iconbgcolor='"+menuIconbgColor 501 +"' where pluginid='"+pluginid+"' and menuid='"+menuid+"'"; 502 //System.out.println("===updSql====" + updSql); 503 DBHelper.update(con, updSql, null); 504 form.addResult("msg", "菜單數據修改爲功!"); 505 }catch(Exception e){ 506 form.addResult("msg", "菜單數據修改失敗!"); 507 e.printStackTrace(); 508 }finally{ 509 DBConnector.freecon(con); 510 } 511 512 return module.findPage("toUpdateCd"); 513 } 514 515 //菜單修改頁面的數據 516 private Page toUpdateCd(WebForm form, Module module, T_sys_user user) { 517 Connection con = DBConnector.getconecttion(); 518 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 519 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 520 String menuid= StringUtil.null2String(form.get("menuid")).trim(); 521 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 522 //System.out.println("====groupid===" + groupid+"=====pluginid====" + pluginid+"=====menuid=====" + menuid); 523 //查詢插件實例id 524 String pni = getPluginInstID(pluginid,groupid); 525 526 try{ 527 String sql = "select PluginInstID,MenuID,MenuName,MenuIcon,MenuIconBgColor from SXT_SYS_PluginInstMenu " 528 + " where MenuID ='" + menuid+"' and PluginInstID='" + pni +"'"; 529 //System.out.println("=======sql=========" + sql); 530 List<DBean> list = DBHelper.getDBeanList(con, sql, null); 531 form.addResult("slcdObj", list.get(0)); 532 }catch(Exception e){ 533 e.printStackTrace(); 534 535 }finally{ 536 DBConnector.freecon(con); 537 } 538 return module.findPage("toUpdateCd"); 539 } 540 541 //保存菜單新增數據 542 private Page addCd(WebForm form, Module module, T_sys_user user) { 543 Connection con = DBConnector.getconecttion(); 544 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 545 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 546 String ids= StringUtil.null2String(form.get("ids")).trim(); 547 548 String[] menuId = null; 549 if(ids!=null || !ids.equals("")){ 550 menuId =ids.split(","); 551 } 552 553 String menunames= StringUtil.null2String(form.get("menunames")).trim(); 554 String[] mName = null; 555 if(menunames!=null || !menunames.equals("")){ 556 if(menunames.indexOf(",") > 0){ 557 mName =menunames.split(","); 558 } 559 } 560 561 //都是空值(待擴展) 562 String icons= StringUtil.null2String(form.get("icons")); 563 String ics = icons.replace("undefined,", ""); 564 //System.out.println("=======ics======="+ics); 565 //都是空值(待擴展) 566 String iconbgcolors = StringUtil.null2String(form.get("iconbgcolors")); 567 String iconbcs = iconbgcolors.replace("undefined,", ""); 568 //System.out.println("=======iconbcs========"+iconbcs); 569 570 571 //查詢插件實例id 572 String pni = getPluginInstID(pluginid,groupid); 573 574 try{ 575 576 for(int i=0; i < menuId.length; i++){ 577 String sql ="insert into SXT_SYS_PluginInstMenu (PluginInstID,MenuID,MenuName,MenuIcon,MenuIconBgColor) values('"+ pni+ "','"+menuId[i] + "','"+mName[i]+"','"+ics+"','"+iconbcs+"')"; 578 //System.out.println("==sql===" + sql); 579 DBHelper.insert(con, sql, null); 580 } 581 form.addResult("result", true); 582 }catch(Exception e){ 583 form.addResult("result", false); 584 e.printStackTrace(); 585 }finally{ 586 DBConnector.freecon(con); 587 } 588 return module.findPage("jsonxml"); 589 } 590 591 //菜單新增按鈕列表頁面數據來源 592 private Page addCdListJson(WebForm form, Module module, T_sys_user user) { 593 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 594 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 595 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 596 String sort = StringUtil.null2String(form.get("sort"));//排序字段 597 String dir = StringUtil.null2String(form.get("order"));//DESC 598 String orderSql=""; 599 if(!sort.equals("")){ 600 orderSql +=" order by "+sort+" "+dir+""; 601 } 602 try{ 603 String pluginid = StringUtil.null2String(form.get("pluginid")); 604 String groupid = StringUtil.null2String(form.get("groupid")); 605 String pni = getPluginInstID(pluginid,groupid); 606 String seleSql="SELECT menuid,menuname,icon,iconbgcolor FROM T_SYS_MENU where pluginid='"+pluginid 607 + "'and menuid not in (select menuid from SXT_SYS_PluginInstMenu where plugininstid ='"+ pni+"')"; 608 //System.out.println("====seleSql=====" + seleSql); 609 String sqlQuery = ObjectCtl.getPageSql(seleSql+orderSql, start, limit); 610 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 611 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + seleSql +orderSql + ")" ); 612 613 HttpServletResponse response = ActionContext.getContext().getResponse(); 614 ObjectCtl.sendListData(response, count, list); 615 form.addResult("msg", "數據加載成功!"); 616 }catch(Exception e){ 617 form.addResult("msg", "數據加載失敗!"); 618 e.printStackTrace(); 619 }finally{ 620 DBConnector.freecon(con); 621 } 622 return module.findPage("jsonxml"); 623 } 624 625 //菜單列表信息頁面 626 private Page plugList(WebForm form, Module module, T_sys_user user) { 627 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 628 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 629 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 630 form.addResult("groupid", groupid); 631 form.addResult("actionpluginid", pluginid); 632 form.addResult("adminlogin", adminlogin ); 633 //System.out.println("========pluginid======" + pluginid); 634 return module.findPage("plugList"); 635 } 636 637 //菜單的列表數據 638 private Page plugListJson(WebForm form, Module module, T_sys_user user) { 639 Connection con = DBConnector.getconecttion(); 640 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 641 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 642 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 643 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 644 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 645 String sort = StringUtil.null2String(form.get("sort"));//排序字段 646 String dir = StringUtil.null2String(form.get("order"));//DESC 647 //System.out.println("===sort====" + sort +"==dir=="+dir); 648 String orderSql=""; 649 if(!sort.equals("")){ 650 orderSql +=" order by "+sort+" "+dir+""; 651 } 652 //查詢插件實例id 653 String pni = getPluginInstID(pluginid,groupid); 654 try{ 655 String plugListSql ="select MenuID,MenuName,MenuIcon,MenuIconBgColor from SXT_SYS_PluginInstMenu " 656 + " where PluginInstID = '"+ pni+"'"; 657 658 //System.out.println("======plugListSql=======" + plugListSql); 659 660 String sqlQuery = ObjectCtl.getPageSql(plugListSql+orderSql, start, limit); 661 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 662 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + plugListSql+orderSql + ")" ); 663 664 HttpServletResponse response = ActionContext.getContext().getResponse(); 665 ObjectCtl.sendListData(response, count, list); 666 form.addResult("msg", "數據加載成功!"); 667 }catch(Exception e){ 668 form.addResult("msg", "數據加載失敗!"); 669 e.printStackTrace(); 670 }finally{ 671 DBConnector.freecon(con); 672 } 673 return module.findPage("jsonxml"); 674 } 675 676 //保存數據在主頁面 677 private Page AddcjslXx(WebForm form, Module module, T_sys_user user) { 678 String pluginid= StringUtil.null2String(form.get("pluginid")).trim(); 679 String groupid= StringUtil.null2String(form.get("groupid")).trim(); 680 String adminlogin= StringUtil.null2String(form.get("adminlogin")).trim(); 681 form.addResult("groupid", groupid); 682 form.addResult("actionpluginid", pluginid); 683 form.addResult("adminlogin", adminlogin ); 684 return module.findPage("AddcjslXx"); 685 } 686 687 /** 688 * 查詢插件實例id 689 * @param pluginid 插件id 690 * @param groupid 集團id 691 * @return 692 */ 693 public String getPluginInstID(String pluginid,String groupid){ 694 Connection con = DBConnector.getconecttion(); 695 String selectSql ="select plugininstid from SXT_SYS_PluginInst where pluginid ='"+pluginid+"' and groupid='"+groupid+"'"; 696 String pni= ObjectCtl.getStrRowValue(con, selectSql) ; 697 return pni; 698 } 699 700 701 /** 702 * 轉到多業務實例列表頁面 703 */ 704 private Page dywslList(WebForm form, Module module, T_sys_user user){ 705 706 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 707 try{ 708 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集團id 709 String actionpluginid = StringUtil.null2String(form.get("pluginid")).trim();//插件id 710 form.addResult("groupid", groupid); 711 712 form.addResult("actionpluginid", actionpluginid); 713 form.addResult("adminlogin", StringUtil.null2String(form.get("adminlogin"))); 714 }catch (Exception e) { 715 e.printStackTrace(); 716 }finally{ 717 DBConnector.freecon(con); //釋放數據庫鏈接 718 } 719 return module.findPage("dywslList"); 720 } 721 722 /** 723 * 多業務實例列表數據 724 */ 725 private Page dywslListJson(WebForm form, Module module, T_sys_user user) { 726 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 727 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 728 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 729 String sort = StringUtil.null2String(form.get("sort"));//排序字段 730 String dir = StringUtil.null2String(form.get("order"));//DESC 731 732 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集團id 733 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 734 try{ 735 String sql = "select a.groupid,a.buiid,a.buiname,a.opstartname,a.opstarturl,a.opobjname,a.opobjurl, " + 736 " decode(a.opobjdataperm,'0','不進行權限控制','1','進行權限控制') opobjdataperm, " + 737 " a.opwindowstitle,a.opfinishname,a.opfinishurl,a.t1initclassname, " + 738 " a.photonum, " + 739 " a.videonum, " + 740 " a.audionum, " + 741 " 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+"' "; 742 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 743 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 744 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 745 HttpServletResponse response = ActionContext.getContext().getResponse(); 746 ObjectCtl.sendListData(response, count, list); 747 }catch (Exception e) { 748 e.printStackTrace(); 749 } 750 finally 751 { 752 DBConnector.freecon(con); //釋放數據庫鏈接 753 } 754 return module.findPage("jsonxml"); 755 } 756 757 /** 758 * 轉到添加多業務實例頁面 759 */ 760 private Page toAddSl(WebForm form, Module module, T_sys_user user){ 761 762 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 763 try{ 764 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 765 form.addResult("actionpluginid", actionpluginid); 766 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 767 form.addResult("groupid", groupid); 768 String adminlogin = StringUtil.null2String(form.get("adminlogin")).trim(); 769 form.addResult("adminlogin", adminlogin); 770 }catch (Exception e) { 771 e.printStackTrace(); 772 }finally{ 773 DBConnector.freecon(con); //釋放數據庫鏈接 774 } 775 return module.findPage("dywslAdd"); 776 } 777 778 /** 779 * 執行添加多業務實例操做 780 */ 781 private Page addDywsl(WebForm form, Module module, T_sys_user user){ 782 783 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 784 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 785 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 786 String buiid = BhGenerator.getBh(); 787 String buiname = StringUtil.null2String(form.get("buiname")).trim(); 788 String opstartname = StringUtil.null2String(form.get("opstartname")).trim(); 789 String opstarturl = StringUtil.null2String(form.get("opstarturl")).trim(); 790 String opobjname = StringUtil.null2String(form.get("opobjname")).trim(); 791 String opobjurl = StringUtil.null2String(form.get("opobjurl")).trim(); 792 String opobjdataperm = StringUtil.null2String(form.get("opobjdataperm")).trim(); 793 String opwindowstitle = StringUtil.null2String(form.get("opwindowstitle")).trim(); 794 String opfinishname = StringUtil.null2String(form.get("opfinishname")).trim(); 795 String opfinishurl = StringUtil.null2String(form.get("opfinishurl")).trim(); 796 String t1initclassname = StringUtil.null2String(form.get("t1initclassname")).trim(); 797 String photonum = StringUtil.null2String(form.get("photonum")).trim(); 798 String videonum = StringUtil.null2String(form.get("videonum")).trim(); 799 String audionum = StringUtil.null2String(form.get("audionum")).trim(); 800 String isremark = StringUtil.null2String(form.get("isremark")).trim(); 801 String adminlogin = StringUtil.null2String(form.get("adminlogin")).trim(); 802 System.err.println("-----"+adminlogin); 803 try{ 804 805 String addsql = "insert into T_Job_Bui ( " + 806 " groupid,buiid,buiname,opstartname,opstarturl,opobjname,opobjurl,opobjdataperm,opwindowstitle, " + 807 " opfinishname,opfinishurl,t1initclassname,photonum,videonum,audionum,isremark) " + 808 " values ('"+groupid+"','"+buiid+"','"+buiname+"','"+opstartname+"','"+opstarturl+"','"+opobjname+"', " + 809 " '"+opobjurl+"','"+opobjdataperm+"','"+opwindowstitle+"','"+opfinishname+"','"+opfinishurl+"', " + 810 " '"+t1initclassname+"','"+photonum+"','"+videonum+"','"+audionum+"','"+isremark+"')"; 811 DBHelper.update(con, addsql, null); 812 813 String sql="select CurrentUserID from t_sys_loginno where GroupID="+groupid+" and LoginNo='"+adminlogin+"'"; 814 String adminuserid=DBHelper.getRowStr(con, sql, null); 815 String plugininstid = BhGenerator.getBh();//實例插件id 816 comUtil.countProc(con, "pro_plugin_instantiation('"+groupid+"','"+actionpluginid+"','"+buiid+"','"+adminuserid+"','"+plugininstid+"')"); 817 System.out.println("pro_plugin_instantiation('"+groupid+"','"+actionpluginid+"','"+buiid+"','"+adminuserid+"','"+plugininstid+"')"); 818 form.addResult("msg", "添加成功!"); 819 }catch (Exception e) { 820 e.printStackTrace(); 821 form.addResult("msg", "添加失敗!"); 822 }finally{ 823 DBConnector.freecon(con); //釋放數據庫鏈接 824 } 825 return module.findPage("dywslAdd"); 826 } 827 828 /** 829 * 執行刪除數據 830 */ 831 private Page deleteSl(WebForm form, Module module, T_sys_user user){ 832 833 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 834 int result = -1; 835 try{ 836 String id = StringUtil.null2String(form.get("id"));//獲取頁面傳過來的須要刪除的記錄的id 837 String ids=StringUtil.getStrsplit(id.split(",")); 838 839 if(!"".equals(id)){ 840 String sql = "delete from T_Job_Bui where buiid in "+ids+" "; 841 result=ObjectCtl.executeUpdateBySql(con, sql); 842 String sql1 = "delete from T_Job_ActionPlugin_GroupBui where buiid in "+ids+" "; 843 result=ObjectCtl.executeUpdateBySql(con, sql1); 844 String sql2 = "delete from T_Job_FeedbackItem where buiid in "+ids+" "; 845 result=ObjectCtl.executeUpdateBySql(con, sql2); 846 847 String plugininstids=StringUtil.null2String(form.get("plugininstid")).trim(); 848 String str[] = plugininstids.split(","); 849 for(int i=0;i<str.length;i++){ 850 result=comUtil.countProc(con, "PRO_PLUGIN_UNINSTANTIATION('"+str[i]+"')"); 851 } 852 853 }if(result!=-1){ 854 form.addResult("result", true); 855 }else{ 856 form.addResult("result", false); 857 } 858 }catch (Exception e){ 859 e.printStackTrace(); 860 } 861 finally{ 862 DBConnector.freecon(con); //釋放數據庫鏈接 863 } 864 return module.findPage("jsonxml"); 865 } 866 867 /** 868 * 轉到多業務實例修改頁面 869 */ 870 private Page toUpdateSl(WebForm form, Module module, T_sys_user user){ 871 872 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 873 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 874 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 875 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 876 try{ 877 form.addResult("buiid", buiid); 878 form.addResult("groupid", groupid); 879 form.addResult("actionpluginid", actionpluginid); 880 881 }catch (Exception e) { 882 e.printStackTrace(); 883 }finally{ 884 DBConnector.freecon(con); //釋放數據庫鏈接 885 } 886 return module.findPage("dywslTab"); 887 } 888 889 /** 890 * 轉到多業務實例基本信息修改頁面 891 */ 892 private Page todywslUpdatejbxx(WebForm form, Module module, T_sys_user user){ 893 894 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 895 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 896 try{ 897 String sql = "select groupid,buiid,buiname,opstartname,opstarturl,opobjname,opobjurl, " + 898 " opobjdataperm, " + 899 " opwindowstitle,opfinishname,opfinishurl,t1initclassname, " + 900 " photonum, " + 901 " videonum, " + 902 " audionum, " + 903 " isremark from T_Job_Bui where buiid = '"+buiid+"' "; 904 905 List<DBean> list=DBHelper.getDBeanList(con, sql, null); 906 form.addResult("sljbxxObj", list.get(0)); 907 form.addResult("buiid", buiid); 908 }catch (Exception e) { 909 e.printStackTrace(); 910 }finally{ 911 DBConnector.freecon(con); //釋放數據庫鏈接 912 } 913 return module.findPage("dywslUpdatejbxx"); 914 } 915 916 /** 917 * 執行多業務實例基本信息修改操做 918 */ 919 private Page dywslUpdatejbxx(WebForm form, Module module, T_sys_user user){ 920 921 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 922 //String groupid = StringUtil.null2String(form.get("groupid")).trim(); 923 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 924 String buiname = StringUtil.null2String(form.get("buiname")).trim(); 925 String opstartname = StringUtil.null2String(form.get("opstartname")).trim(); 926 String opstarturl = StringUtil.null2String(form.get("opstarturl")).trim(); 927 String opobjname = StringUtil.null2String(form.get("opobjname")).trim(); 928 String opobjurl = StringUtil.null2String(form.get("opobjurl")).trim(); 929 String opobjdataperm = StringUtil.null2String(form.get("opobjdataperm")).trim(); 930 String opwindowstitle = StringUtil.null2String(form.get("opwindowstitle")).trim(); 931 String opfinishname = StringUtil.null2String(form.get("opfinishname")).trim(); 932 String opfinishurl = StringUtil.null2String(form.get("opfinishurl")).trim(); 933 String t1initclassname = StringUtil.null2String(form.get("t1initclassname")).trim(); 934 String photonum = StringUtil.null2String(form.get("photonum")).trim(); 935 String videonum = StringUtil.null2String(form.get("videonum")).trim(); 936 String audionum = StringUtil.null2String(form.get("audionum")).trim(); 937 String isremark = StringUtil.null2String(form.get("isremark")).trim(); 938 try{ 939 String sql = "update T_Job_Bui set " + 940 " buiname = '"+buiname+"', " + 941 " opstartname = '"+opstartname+"', " + 942 " opstarturl = '"+opstarturl+"', " + 943 " opobjname = '"+opobjname+"', " + 944 " opobjurl = '"+opobjurl+"', " + 945 " opobjdataperm = '"+opobjdataperm+"', " + 946 " opwindowstitle = '"+opwindowstitle+"', " + 947 " opfinishname = '"+opfinishname+"', " + 948 " opfinishurl = '"+opfinishurl+"', " + 949 " t1initclassname = '"+t1initclassname+"', " + 950 " photonum = '"+photonum+"', " + 951 " videonum = '"+videonum+"', " + 952 " audionum = '"+audionum+"', " + 953 " isremark = '"+isremark+"' " + 954 " where buiid = '"+buiid+"' "; 955 956 DBHelper.update(con, sql, null); 957 form.addResult("msg", "修改爲功!"); 958 }catch (Exception e) { 959 e.printStackTrace(); 960 form.addResult("msg", "修改失敗!"); 961 }finally{ 962 DBConnector.freecon(con); //釋放數據庫鏈接 963 } 964 return module.findPage("dywslUpdatejbxx"); 965 } 966 967 /** 968 * 轉到多業務實例功能插件修改頁面 969 */ 970 private Page todywslUpdategncj(WebForm form, Module module, T_sys_user user){ 971 972 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 973 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 974 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 975 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 976 try{ 977 form.addResult("buiid", buiid); 978 form.addResult("groupid", groupid); 979 form.addResult("actionpluginid", actionpluginid); 980 }catch (Exception e) { 981 e.printStackTrace(); 982 }finally{ 983 DBConnector.freecon(con); //釋放數據庫鏈接 984 } 985 return module.findPage("dywslUpdategncj"); 986 } 987 988 /** 989 * 功能插件列表數據 990 */ 991 private Page gncjListJson(WebForm form, Module module, T_sys_user user) { 992 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 993 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 994 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 995 String sort = StringUtil.null2String(form.get("sort"));//排序字段 996 String dir = StringUtil.null2String(form.get("order"));//DESC 997 998 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集團id 999 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 1000 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1001 try{ 1002 String sql = "select a.groupid,a.buiid,a.actionpluginid,a.actionplugincode,a.actionpluginmenuname,a.actionpluginprocedure, " + 1003 " decode(a.actionplugintype,'1','首頁功能插件','2','做業窗功能插件') actionplugintype," + 1004 " a.orderno," + 1005 " decode(a.ismustaction,'0','否','1','是') ismustaction," + 1006 " a.actioncondition," + 1007 " decode(a.isextapp,'0','不是外部App','1','是外部App') isextapp," + 1008 " 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+"' "; 1009 1010 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1011 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1012 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 1013 HttpServletResponse response = ActionContext.getContext().getResponse(); 1014 ObjectCtl.sendListData(response, count, list); 1015 1016 }catch (Exception e) { 1017 e.printStackTrace(); 1018 } 1019 finally 1020 { 1021 DBConnector.freecon(con); //釋放數據庫鏈接 1022 } 1023 return module.findPage("jsonxml"); 1024 } 1025 1026 /** 1027 * 轉到添加功能插件頁面 1028 */ 1029 private Page toaddGncj(WebForm form, Module module, T_sys_user user){ 1030 1031 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1032 try{ 1033 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1034 form.addResult("buiid", buiid); 1035 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1036 form.addResult("actionpluginid", actionpluginid); 1037 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1038 form.addResult("groupid", groupid); 1039 }catch (Exception e) { 1040 e.printStackTrace(); 1041 }finally{ 1042 DBConnector.freecon(con); //釋放數據庫鏈接 1043 } 1044 return module.findPage("gncjAdd"); 1045 } 1046 1047 /** 1048 * 系統功能插件 1049 */ 1050 private Page cjListJson(WebForm form, Module module, T_sys_user user) { 1051 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1052 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 1053 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 1054 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1055 String dir = StringUtil.null2String(form.get("order"));//DESC 1056 1057 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集團id 1058 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim();//插件id 1059 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1060 try{ 1061 String sql = "select a.ActionPluginId,a.ActionPluginCode,a.ActionPluginUrl,a.ActionPluginUrl_View,a.ActionPluginName, " + 1062 " decode(b.actionplugintype,'1','首頁功能插件','2','做業窗功能插件') actionplugintype " + 1063 " from T_Job_ActionPlugin a left join T_Job_ActionPlugin_GroupBui b on A.ACTIONPLUGINID = B.ACTIONPLUGINID " + 1064 " where 1=1 and a.ActionPluginId not in (select ActionPluginId from T_Job_ActionPlugin_GroupBui where buiid = '"+buiid+"') "; 1065 1066 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1067 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1068 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 1069 HttpServletResponse response = ActionContext.getContext().getResponse(); 1070 ObjectCtl.sendListData(response, count, list); 1071 }catch (Exception e) { 1072 e.printStackTrace(); 1073 } 1074 finally 1075 { 1076 DBConnector.freecon(con); //釋放數據庫鏈接 1077 } 1078 return module.findPage("jsonxml"); 1079 } 1080 1081 /** 1082 * 系統功能插件添加操做 1083 * */ 1084 private Page cjAdd(WebForm form, Module module, T_sys_user user) { 1085 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1086 try { 1087 String buiid=StringUtil.null2String(form.get("buiid")).trim(); 1088 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1089 //String actionplugincode=StringUtil.null2String(form.get("actionplugincode")).trim(); 1090 1091 int OrderNo = ObjectCtl.getIntRowValue(con, " select max(OrderNo) from T_Job_ActionPlugin_GroupBui "); 1092 OrderNo = OrderNo < 0 ? 0 : OrderNo + 1; 1093 String ids=StringUtil.null2String(form.get("ids")).trim(); 1094 String str[] = ids.split(","); 1095 String actionplugincodes=StringUtil.null2String(form.get("actionplugincodes")).trim(); 1096 String strr[] = actionplugincodes.split(","); 1097 for(int i=0;i<str.length;i++){ 1098 String sql="insert into T_Job_ActionPlugin_GroupBui " + 1099 " (groupid,buiid,actionpluginid,actionplugincode,actionpluginmenuname,actionpluginprocedure, " + 1100 " actionplugintype,orderno,ismustaction,actioncondition,isextapp,appid,appinterfaceparam) " + 1101 " values " + 1102 " ('"+groupid+"','"+buiid+"','"+str[i]+"','"+strr[i]+"','', " + 1103 " '','','"+OrderNo+"','0', " + 1104 " '','','','')"; 1105 1106 DBHelper.update(con, sql, null); 1107 } 1108 form.addResult("result", true); 1109 } catch (Exception e) { 1110 form.addResult("result", false); 1111 e.printStackTrace(); 1112 } 1113 return module.findPage("jsonxml"); 1114 } 1115 1116 /** 1117 * 系統插件刪除 1118 */ 1119 private Page deleteGncj(WebForm form, Module module, T_sys_user user){ 1120 1121 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1122 int result = -1; 1123 try{ 1124 String id = StringUtil.null2String(form.get("id")); 1125 String ids=StringUtil.getStrsplit(id.split(",")); 1126 String buiid = StringUtil.null2String(form.get("buiid")); 1127 String buiids=StringUtil.getStrsplit(buiid.split(",")); 1128 if(!"".equals(id) && !"".equals(buiid)){ 1129 String sql = "delete from T_Job_ActionPlugin_GroupBui where ActionPluginId in "+ids+" and buiid in "+buiids+" "; 1130 result=ObjectCtl.executeUpdateBySql(con, sql); 1131 }if(result!=-1){ 1132 form.addResult("result", true); 1133 }else{ 1134 form.addResult("result", false); 1135 } 1136 }catch (Exception e){ 1137 e.printStackTrace(); 1138 } 1139 finally{ 1140 DBConnector.freecon(con); //釋放數據庫鏈接 1141 } 1142 return module.findPage("jsonxml"); 1143 } 1144 1145 /** 1146 * 轉到功能插件修改頁面 1147 */ 1148 private Page toUpdateGncj(WebForm form, Module module, T_sys_user user){ 1149 1150 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1151 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1152 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1153 try{ 1154 String sql = "select groupid,buiid,actionpluginid,actionplugincode,actionpluginmenuname,actionpluginprocedure, " + 1155 " actionplugintype," + 1156 " orderno," + 1157 " ismustaction," + 1158 " actioncondition," + 1159 " decode(isextapp,'0','不是外部App','1','是外部App') isextapp," + 1160 " appid,appinterfaceparam from T_Job_ActionPlugin_GroupBui where actionpluginid = '"+actionpluginid+"' and buiid = '"+buiid+"' "; 1161 1162 List<DBean> list=DBHelper.getDBeanList(con, sql, null); 1163 form.addResult("gncjObj", list.get(0)); 1164 form.addResult("actionpluginid", actionpluginid); 1165 form.addResult("buiid", buiid); 1166 }catch (Exception e) { 1167 e.printStackTrace(); 1168 }finally{ 1169 DBConnector.freecon(con); //釋放數據庫鏈接 1170 } 1171 return module.findPage("gncjUpdate"); 1172 } 1173 1174 /** 1175 * 執行功能插件修改操做 1176 */ 1177 private Page updateGncj(WebForm form, Module module, T_sys_user user){ 1178 1179 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1180 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1181 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1182 String actionpluginprocedure = StringUtil.null2String(form.get("actionpluginprocedure")).trim(); 1183 String actionpluginmenuname = StringUtil.null2String(form.get("actionpluginmenuname")).trim(); 1184 String actionplugintype = StringUtil.null2String(form.get("actionplugintype")).trim(); 1185 String ismustaction = StringUtil.null2String(form.get("ismustaction")).trim(); 1186 try{ 1187 String sql = "update T_Job_ActionPlugin_GroupBui set " + 1188 " actionpluginprocedure = ?, " + 1189 " actionpluginmenuname = '"+actionpluginmenuname+"', " + 1190 " actionplugintype = '"+actionplugintype+"', " + 1191 " ismustaction = '"+ismustaction+"' " + 1192 " where actionpluginid = '"+actionpluginid+"' and buiid = '"+buiid+"' "; 1193 1194 DBHelper.update(con, sql, new Object[]{ 1195 actionpluginprocedure 1196 }); 1197 form.addResult("msg", "修改爲功!"); 1198 1199 }catch (Exception e) { 1200 e.printStackTrace(); 1201 form.addResult("msg", "修改失敗!"); 1202 }finally{ 1203 DBConnector.freecon(con); //釋放數據庫鏈接 1204 } 1205 return module.findPage("gncjUpdate"); 1206 } 1207 1208 1209 1210 /** 1211 * 轉到多業務實例反饋字段頁面 1212 */ 1213 private Page todywslUpdatezd(WebForm form, Module module, T_sys_user user){ 1214 1215 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1216 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1217 try{ 1218 form.addResult("buiid", buiid); 1219 }catch (Exception e) { 1220 e.printStackTrace(); 1221 }finally{ 1222 DBConnector.freecon(con); //釋放數據庫鏈接 1223 } 1224 return module.findPage("dywslUpdatezd"); 1225 } 1226 1227 /** 1228 * 反饋字段列表數據顯示 1229 */ 1230 private Page zdListJson(WebForm form, Module module, T_sys_user user) { 1231 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1232 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 1233 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 1234 String sort = StringUtil.null2String(form.get("sort"));//排序字段 1235 String dir = StringUtil.null2String(form.get("order"));//DESC 1236 1237 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集團id 1238 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1239 try{ 1240 String sql = "select groupid,buiid,actionpluginid,feedbackitemid,feedbackitemname, " + 1241 " isaudioinput,orderno from T_Job_FeedbackItem " + 1242 " where buiid = '"+buiid+"' "; 1243 1244 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1245 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 1246 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( " + sql + ")" ); 1247 HttpServletResponse response = ActionContext.getContext().getResponse(); 1248 ObjectCtl.sendListData(response, count, list); 1249 }catch (Exception e) { 1250 e.printStackTrace(); 1251 } 1252 finally 1253 { 1254 DBConnector.freecon(con); //釋放數據庫鏈接 1255 } 1256 return module.findPage("jsonxml"); 1257 } 1258 1259 /** 1260 * 轉到反饋字段添加頁面 1261 */ 1262 private Page toaddZd(WebForm form, Module module, T_sys_user user){ 1263 1264 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1265 try{ 1266 String groupid = StringUtil.null2String(form.get("groupid")).trim();//集團id 1267 String buiid = StringUtil.null2String(form.get("buiid")).trim();//插件id 1268 form.addResult("groupid", groupid); 1269 form.addResult("buiid", buiid); 1270 }catch (Exception e) { 1271 e.printStackTrace(); 1272 }finally{ 1273 DBConnector.freecon(con); //釋放數據庫鏈接 1274 } 1275 return module.findPage("zdAdd"); 1276 } 1277 1278 /** 1279 * 執行添加反饋字段操做 1280 */ 1281 private Page addZd(WebForm form, Module module, T_sys_user user){ 1282 1283 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1284 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1285 String buiid = StringUtil.null2String(form.get("buiid")).trim(); 1286 String feedbackitemid = BhGenerator.getBh(); 1287 String feedbackitemname = StringUtil.null2String(form.get("feedbackitemname")).trim(); 1288 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1289 int OrderNo = ObjectCtl.getIntRowValue(con, " select max(OrderNo) from T_Job_FeedbackItem "); 1290 OrderNo = OrderNo < 0 ? 0 : OrderNo + 1; 1291 try{ 1292 1293 String addsql = "insert into T_Job_FeedbackItem ( " + 1294 " groupid,buiid,actionpluginid,feedbackitemid,feedbackitemname, " + 1295 " isaudioinput,orderno ) " + 1296 " values ('"+groupid+"','"+buiid+"','"+actionpluginid+"','"+feedbackitemid+"', " + 1297 " '"+feedbackitemname+"','1','"+OrderNo+"')"; 1298 DBHelper.update(con, addsql, null); 1299 1300 form.addResult("msg", "添加成功!"); 1301 }catch (Exception e) { 1302 e.printStackTrace(); 1303 form.addResult("msg", "添加失敗!"); 1304 }finally{ 1305 DBConnector.freecon(con); //釋放數據庫鏈接 1306 } 1307 return module.findPage("zdAdd"); 1308 } 1309 1310 /** 1311 * 執行刪除反饋字段操做 1312 */ 1313 private Page deleteZd(WebForm form, Module module, T_sys_user user){ 1314 1315 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1316 int result = -1; 1317 try{ 1318 String id = StringUtil.null2String(form.get("id"));//獲取頁面傳過來的須要刪除的記錄的id 1319 String ids=StringUtil.getStrsplit(id.split(",")); 1320 1321 if(!"".equals(id)){ 1322 String sql = "delete from T_Job_FeedbackItem where feedbackitemid in "+ids+" "; 1323 result=ObjectCtl.executeUpdateBySql(con, sql); 1324 1325 }if(result!=-1){ 1326 form.addResult("result", true); 1327 }else{ 1328 form.addResult("result", false); 1329 } 1330 }catch (Exception e){ 1331 e.printStackTrace(); 1332 } 1333 finally{ 1334 DBConnector.freecon(con); //釋放數據庫鏈接 1335 } 1336 return module.findPage("jsonxml"); 1337 } 1338 1339 /** 1340 * 轉到反饋字段修改頁面 1341 */ 1342 private Page toUpdateZd(WebForm form, Module module, T_sys_user user){ 1343 1344 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1345 String feedbackitemid = StringUtil.null2String(form.get("feedbackitemid")).trim(); 1346 try{ 1347 String sql = " select groupid,buiid,actionpluginid,feedbackitemid,feedbackitemname,isaudioinput," + 1348 " orderno from T_Job_FeedbackItem where feedbackitemid = '"+feedbackitemid+"' "; 1349 1350 List<DBean> list=DBHelper.getDBeanList(con, sql, null); 1351 form.addResult("zdObj", list.get(0)); 1352 form.addResult("feedbackitemid", feedbackitemid); 1353 }catch (Exception e) { 1354 e.printStackTrace(); 1355 }finally{ 1356 DBConnector.freecon(con); //釋放數據庫鏈接 1357 } 1358 return module.findPage("zdUpdate"); 1359 } 1360 1361 /** 1362 * 執行反饋字段修改操做 1363 */ 1364 private Page updateZd(WebForm form, Module module, T_sys_user user){ 1365 1366 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1367 String feedbackitemid = StringUtil.null2String(form.get("feedbackitemid")).trim(); 1368 String feedbackitemname = StringUtil.null2String(form.get("feedbackitemname")).trim(); 1369 String actionpluginid = StringUtil.null2String(form.get("actionpluginid")).trim(); 1370 try{ 1371 String sql = "update T_Job_FeedbackItem set " + 1372 " feedbackitemname = '"+feedbackitemname+"', " + 1373 " actionpluginid = '"+actionpluginid+"' " + 1374 " where feedbackitemid = '"+feedbackitemid+"' "; 1375 1376 DBHelper.update(con, sql, null); 1377 form.addResult("msg", "修改爲功!"); 1378 1379 }catch (Exception e) { 1380 e.printStackTrace(); 1381 form.addResult("msg", "修改失敗!"); 1382 }finally{ 1383 DBConnector.freecon(con); //釋放數據庫鏈接 1384 } 1385 return module.findPage("zdUpdate"); 1386 } 1387 1388 /* 1389 * 刪除實例插件 1390 */ 1391 private Page deletecj(WebForm form, Module module, T_sys_user user) { 1392 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1393 String pluginids=StringUtil.null2String(form.get("pluginids")).trim();// 1394 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1395 String str[] = pluginids.split(","); 1396 int result=0; 1397 for(int i=0;i<str.length;i++){ 1398 result=comUtil.countProc(con, "PRO_PLUGIN_GROUP_DELETE('"+str[i]+"','"+groupid+"')"); 1399 } 1400 if(result != -1){ 1401 form.addResult("result", true); 1402 }else { 1403 form.addResult("result", false); 1404 } 1405 1406 return module.findPage("jsonxml"); 1407 } 1408 1409 1410 private Page plugincjbcAdd(WebForm form, Module module, T_sys_user user) { 1411 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1412 String ids=StringUtil.null2String(form.get("ids")).trim(); 1413 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1414 String str[] = ids.split(","); 1415 //生成實例插件 1416 try{ 1417 String sql="select adminuserid from t_bs_group where GroupID='"+groupid+"'"; 1418 String adminuserid=DBHelper.getRowStr(con, sql, null); 1419 //String adminuserid = BhGenerator.getBh(); 1420 for(int i=0;i<str.length;i++){ 1421 String IsMutiBui=DBHelper.getRowStr(con, "select IsMutiBui from T_SYS_Plugin where pluginID ='"+str[i]+"'", null); 1422 if(!IsMutiBui.equals("1")){ 1423 String plugininstid = BhGenerator.getBh();//實例插件id 1424 comUtil.countProc(con, "pro_plugin_instantiation('"+groupid+"','"+str[i]+"','','"+adminuserid+"','"+plugininstid+"')"); 1425 System.out.println("pro_plugin_instantiation('"+groupid+"','"+str[i]+"','','"+adminuserid+"','"+plugininstid+"')"); 1426 } 1427 DBHelper.insert(con, "insert into T_SYS_GroupPlugin(GroupID,pluginID) values('"+groupid+"','"+str[i]+"')", null); 1428 1429 } 1430 form.addResult("result", true); 1431 } catch (Exception e) { 1432 form.addResult("result", false); 1433 e.printStackTrace(); 1434 } 1435 return module.findPage("jsonxml"); 1436 } 1437 1438 1439 /** 1440 * 添加未有插件 1441 * @param form 1442 * @param module 1443 * @param user 1444 * @return 1445 */ 1446 private Page pluginListJson1(WebForm form, Module module, T_sys_user user) { 1447 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1448 int start = StringUtil.StringToInt(StringUtil.null2String(form 1449 .get("page")));// 開始位置 1450 int limit = StringUtil.StringToInt(StringUtil.null2String(form 1451 .get("rows")));// 每頁數據量 1452 try 1453 { String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1454 String sql=" select plugincode,pluginnamedisplay,decode(PluginType,1,'標準插件',2,'行業插件',3,'定製插件') plugintype,pluginid from T_SYS_Plugin where PluginStatus='1' and plugincode in("+ 1455 " select plugincode from T_SYS_Plugin where PluginType='01'" 1456 +" Union " 1457 +"select plugincode from T_SYS_Plugin where PluginType='03 '" 1458 +") and pluginID not in(select pluginID from T_SYS_GroupPlugin where GroupID='"+groupid+"')"; 1459 String sqlQuery = ObjectCtl.getPageSql(sql, start, limit); 1460 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con, 1461 sqlQuery, null); 1462 String count = ObjectCtl.getStrRowValue(con, 1463 "select count(0) from ( " + sql + ")"); 1464 HttpServletResponse response = ActionContext.getContext() 1465 .getResponse(); 1466 ObjectCtl.sendListData(response, count, list); 1467 }catch (Exception e) { 1468 e.printStackTrace(); 1469 } 1470 finally 1471 { 1472 DBConnector.freecon(con); //釋放數據庫鏈接 1473 } 1474 return module.findPage("jsonxml"); 1475 } 1476 1477 /** 1478 * 許可受權插件 1479 * @param form 1480 * @param module 1481 * @param user 1482 * @return 1483 */ 1484 private Page pluginListJson2(WebForm form, Module module, T_sys_user user) { 1485 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1486 try 1487 { String groupid=StringUtil.null2String(form.get("groupid")).trim(); //left join 根據插件id groupi的?? 1488 String sql=" select plugincode,pluginnamedisplay,decode(PluginType,1,'標準插件',2,'行業插件',3,'定製插件') plugintype,pluginid,IsMutiBui from T_SYS_Plugin where PluginStatus='1' and plugincode in("+ 1489 " select plugincode from T_SYS_Plugin where PluginType='01'" 1490 +" Union " 1491 +"select plugincode from T_SYS_Plugin where PluginType='03 '" 1492 +") and pluginID in(select pluginID from T_SYS_GroupPlugin where GroupID='"+groupid+"')"; 1493 1494 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con, 1495 sql, null); 1496 String count = ObjectCtl.getStrRowValue(con, 1497 "select count(0) from ( " + sql + ")"); 1498 HttpServletResponse response = ActionContext.getContext() 1499 .getResponse(); 1500 ObjectCtl.sendListData(response, count, list); 1501 }catch (Exception e) { 1502 e.printStackTrace(); 1503 } 1504 finally 1505 { 1506 DBConnector.freecon(con); //釋放數據庫鏈接 1507 } 1508 return module.findPage("jsonxml"); 1509 } 1510 1511 private Page gnsqAdd(WebForm form, Module module, T_sys_user user) { 1512 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1513 form.addResult("groupid", groupid); 1514 return module.findPage("gnsqAdd"); 1515 } 1516 1517 1518 1519 /** 1520 * 勾選取消插件實例 1521 * @param form 1522 * @param module 1523 * @param user 1524 * @return 1525 */ 1526 private Page delcjsl(WebForm form, Module module, T_sys_user user) { 1527 Connection con = DBConnector.getconecttion(); 1528 String pluginid = StringUtil.null2String(form.get("pluginid")).trim(); 1529 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1530 1531 ArrayList sqlList=new ArrayList(); 1532 try{ 1533 String roleSql="delete from SXT_SYS_PluginInstRole where PluginInstID in (select PluginInstID from SXT_SYS_PluginInst where PluginID='"+pluginid+"' and groupid='"+groupid+"')"; 1534 String menuSql="delete from SXT_SYS_PluginInstMenu where PluginInstID in (select PluginInstID from SXT_SYS_PluginInst where PluginID='"+pluginid+"' and groupid='"+groupid+"')"; 1535 String userplugininstSql="delete from SXT_SYS_UserPluginInst where PluginInstID in (select PluginInstID from SXT_SYS_PluginInst where PluginID='"+pluginid+"' and groupid='"+groupid+"')"; 1536 String plugininstSql="delete from SXT_SYS_PluginInst where PluginID='"+pluginid+"' and groupid='"+groupid+"'"; 1537 sqlList.add(roleSql); 1538 sqlList.add(menuSql); 1539 sqlList.add(userplugininstSql); 1540 sqlList.add(plugininstSql); 1541 1542 boolean result=ObjectCtl.executeMulSql(con, sqlList); 1543 if(result){ 1544 form.addResult("result", "true"); 1545 }else{ 1546 form.addResult("result", "false"); 1547 } 1548 } catch (Exception e) { 1549 e.printStackTrace(); 1550 } finally { 1551 DBConnector.freecon(con); 1552 } 1553 return module.findPage("jsonxml"); 1554 } 1555 1556 /** 1557 * 判斷是否已經生成過實例插件 1558 * @param form 1559 * @param module 1560 * @param user 1561 * @return 1562 */ 1563 private Page iscjsl(WebForm form, Module module, T_sys_user user) { 1564 Connection con = DBConnector.getconecttion(); 1565 String pluginid = StringUtil.null2String(form.get("pluginid")).trim(); 1566 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1567 1568 try{ 1569 String sql="select * from SXT_SYS_PluginInst where pluginid='"+pluginid+"' and groupid='"+groupid+"'"; 1570 int count=DBHelper.getTotalCount(con, sql, null); 1571 if(count>0){ 1572 form.addResult("result", "true"); 1573 }else{ 1574 form.addResult("result", "false"); 1575 } 1576 1577 } catch (Exception e) { 1578 e.printStackTrace(); 1579 } finally { 1580 DBConnector.freecon(con); 1581 } 1582 return module.findPage("jsonxml"); 1583 } 1584 /** 1585 * 插件實例添加頁面 1586 * @param form 1587 * @param module 1588 * @param user 1589 * @return 1590 */ 1591 private Page Addcjsl(WebForm form, Module module, T_sys_user user) { 1592 Connection con = DBConnector.getconecttion(); 1593 String pluginid = StringUtil.null2String(form.get("pluginid")).trim(); 1594 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1595 try{ 1596 StringBuffer sqlBuffer = new StringBuffer(); 1597 sqlBuffer.append(" SELECT plugininstname, plugininsticon, plugininsticonbgcolor "); 1598 sqlBuffer.append(" FROM sxt_sys_plugininst "); 1599 sqlBuffer.append(" WHERE pluginid = ? AND groupid = ? "); 1600 List<DBean> instList = DBHelper.getDBeanList(con, sqlBuffer.toString(), new Object[]{ 1601 pluginid, groupid 1602 }); 1603 form.addResult("instObj", instList.get(0)); 1604 } catch (Exception e) { 1605 e.printStackTrace(); 1606 } finally { 1607 DBConnector.freecon(con); 1608 } 1609 return module.findPage("cjslAdd"); 1610 1611 } 1612 1613 /** 1614 * 插件實例信息保存 1615 * @param form 1616 * @param module 1617 * @param user 1618 * @return 1619 */ 1620 private Page cjslAdd(WebForm form, Module module, T_sys_user user) { 1621 Connection con = DBConnector.getconecttion(); 1622 String PluginIcon = StringUtil.null2String(form.get("PluginIcon")).trim(); 1623 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1624 String pluginid=StringUtil.null2String(form.get("pluginid")).trim(); 1625 String plugininstname = StringUtil.null2String(form.get("PluginInstName")).trim(); 1626 String plugininsticonbgcolor = StringUtil.null2String(form.get("plugininsticonbgcolor")).trim(); 1627 1628 try { 1629 String PluginInstID=DBHelper.getRowStr(con, "select PluginInstID from sxT_SYS_PluginInst where GroupID='"+groupid+"' and PluginID='"+pluginid+"'", null); 1630 String sql="update sxT_SYS_PluginInst set PluginInstName='" + plugininstname 1631 + "' , PluginInstIcon='" + PluginIcon + "',PluginInstIconBgColor='" 1632 + plugininsticonbgcolor + "' where PluginInstID='" + PluginInstID 1633 + "' and GroupID='" + groupid + "'"; 1634 DBHelper.update(con, sql, null); 1635 form.addResult("msg", "保存成功"); 1636 } catch (Exception e) { 1637 form.addResult("msg", "保存失敗"); 1638 e.printStackTrace(); 1639 } finally { 1640 DBConnector.freecon(con); 1641 } 1642 return module.findPage("cjslAdd"); 1643 } 1644 1645 //檢查管理員賬號是否重複 1646 private Page checkadminloginno(WebForm form, Module module, T_sys_user user) { 1647 Connection con=DBConnector.getconecttion(); 1648 try { 1649 Boolean result=false; 1650 String groupfullname=StringUtil.null2String(form.get("adminloginno")).trim(); 1651 1652 String sql="select LoginNo from T_SYS_LoginNo "; 1653 ArrayList list= ObjectCtl.getMulRowValue2(con,sql); 1654 if(list!=null&&list.size()>0){ 1655 result=true; 1656 } 1657 form.addResult("result", result); 1658 1659 } 1660 catch (Exception e) { 1661 e.printStackTrace(); 1662 }finally{ 1663 DBConnector.freecon(con); 1664 } 1665 return module.findPage("jsonxml"); 1666 } 1667 1668 1669 private Page checkFullname(WebForm form, Module module, T_sys_user user) { 1670 Connection con=DBConnector.getconecttion(); 1671 try { 1672 Boolean result=false; 1673 String groupfullname=StringUtil.null2String(form.get("groupfullname")).trim(); 1674 String oldgroupfullname=StringUtil.null2String(form.get("oldgroupfullname")).trim();// 1675 String newgroupfullname=StringUtil.null2String(form.get("newgroupfullname")).trim();// 1676 String sql="select groupfullname from T_BS_Group where 1=1 "; 1677 if(!groupfullname.equals("")){ 1678 sql +=" and groupfullname='"+groupfullname+"'"; 1679 } 1680 if(!oldgroupfullname.equals("")&&!newgroupfullname.equals("")){//修改 1681 sql +=" and groupfullname='"+newgroupfullname+"'and groupfullname <> '"+oldgroupfullname+"'"; 1682 } 1683 ArrayList list= ObjectCtl.getMulRowValue2(con,sql); 1684 if(list!=null&&list.size()>0){ 1685 result=true; 1686 } 1687 1688 form.addResult("result", result); 1689 1690 } 1691 catch (Exception e) { 1692 e.printStackTrace(); 1693 }finally{ 1694 DBConnector.freecon(con); 1695 } 1696 return module.findPage("jsonxml"); 1697 } 1698 /** 1699 * 檢查類別代碼是否有重 1700 * @param form 1701 * @param module 1702 * @param user 1703 * @return 1704 */ 1705 private Page checkClassCode(WebForm form, Module module, T_sys_user user) { 1706 Connection con=DBConnector.getconecttion(); 1707 try { 1708 String pluginids=StringUtil.null2String(form.get("pluginids")).trim(); 1709 String ids=StringUtil.getStrsplit(pluginids.split(",")); 1710 Hashtable ht=new Hashtable(); 1711 String plugincodeArr=""; 1712 ArrayList alllist=ObjectCtl.getMulRowValue2(con, "select pluginclasscode,PluginCode,PluginNameDisplay from T_SYS_Plugin where pluginid in "+ids+""); 1713 for (int i = 0; i < alllist.size(); i++) { 1714 ArrayList<String> list1=(ArrayList<String>)alllist.get(i); 1715 String pluginclasscode=list1.get(0); 1716 String plugincode=list1.get(1); 1717 for (int j = i+1; j < alllist.size(); j++) { 1718 ArrayList<String> list2=(ArrayList<String>)alllist.get(j); 1719 if(list2.contains(pluginclasscode)) 1720 { 1721 plugincodeArr+=plugincode+","+list2.get(1)+","; 1722 } 1723 } 1724 1725 } 1726 1727 if(!plugincodeArr.equals("")){ 1728 //數組專爲list 1729 List plugincodelist = new ArrayList(Arrays.asList(plugincodeArr.split(","))); 1730 //將List轉換爲Set去重 1731 Set<String> plugincodeset=new HashSet(plugincodelist); 1732 plugincodeArr=""; 1733 for (String plugincode : plugincodeset) { 1734 plugincodeArr+=plugincode+","; 1735 } 1736 String zfplugincodes=StringUtil.getStrsplit(plugincodeArr.split(",")); 1737 ArrayList list=ObjectCtl.getMulRowValue2(con, "select wm_concat( PluginNameDisplay ) as PluginNameDisplays from T_SYS_Plugin where PluginCode in "+zfplugincodes+" group by PluginClassCode ") ; 1738 ht.put("result", true); 1739 ht.put("list", list); 1740 }else { 1741 ht.put("result", false); 1742 } 1743 form.addResult("result", net.sf.json.JSONObject.fromObject(ht)); 1744 } 1745 catch (Exception e) { 1746 e.printStackTrace(); 1747 }finally{ 1748 DBConnector.freecon(con); 1749 } 1750 return module.findPage("jsonxml"); 1751 } 1752 1753 /** 1754 * 去詳情頁面 1755 * @param form 1756 * @param module 1757 * @param user 1758 * @return 1759 */ 1760 private Page jtktDetail(WebForm form, Module module, T_sys_user user) { 1761 Connection con=DBConnector.getconecttion(); 1762 try { 1763 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1764 ArrayList list=(ArrayList) getJtobj(groupid); 1765 if(list!=null&&list.size()>0){ 1766 form.addResult("obj", list.get(0)); 1767 } 1768 String pluginids=ObjectCtl.getStrRowValue(con, " select wm_concat(Pluginid) as Pluginida from T_SYS_GroupPlugin where groupid='"+groupid+"'"); 1769 Hashtable ht = comUtil.getZDHt(con, "0001", user.getGroupid()); 1770 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 1771 form.addResult("hyList", hyList); 1772 form.addResult("ht", ht); 1773 form.addResult("pluginids", pluginids); 1774 } catch (Exception e) { 1775 e.printStackTrace(); 1776 }finally{ 1777 DBConnector.freecon(con); 1778 } 1779 1780 return module.findPage("jtktDetail"); 1781 } 1782 1783 1784 /** 1785 * 修改集團名稱方法 1786 * @param form 1787 * @param module 1788 * @param user 1789 * @return 1790 */ 1791 private Page jtktmcUpdate(WebForm form, Module module, T_sys_user user) { 1792 Connection con=DBConnector.getconecttion(); 1793 int result=-1; 1794 try { 1795 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1796 String groupfullname=StringUtil.null2String(form.get("groupfullname")).trim(); 1797 String groupshortname=StringUtil.null2String(form.get("groupshortname")).trim(); 1798 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 1799 1800 String groupfullnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupfullname)); //集團全稱簡拼 1801 String groupfullnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupfullname)); //集團全稱全拼 1802 String groupshortnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupshortname)); //集團簡稱簡拼 1803 String groupshortnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupshortname)); // 集團簡稱全拼 1804 1805 String sql=" update T_BS_Group " + 1806 "set groupfullname='"+groupfullname+"', " + 1807 " groupshortname='"+groupshortname+"'," + 1808 " industrycode='"+industrycode+"', " + 1809 " groupfullnamefirstpy='"+groupfullnamefirstpy+"', " + 1810 " groupfullnameallpy='"+groupfullnameallpy+"', " + 1811 " groupshortnamefirstpy='"+groupshortnamefirstpy+"', " + 1812 " groupshortnameallpy='"+groupshortnameallpy+"' " + 1813 " where groupid='"+groupid+"'"; 1814 result=ObjectCtl.executeUpdateBySql(con, sql); 1815 if(result!=-1){ 1816 form.addResult("msg", "修改爲功!"); 1817 }else{ 1818 form.addResult("msg", "修改失敗!"); 1819 } 1820 1821 } catch (Exception e) { 1822 e.printStackTrace(); 1823 }finally{ 1824 DBConnector.freecon(con); 1825 } 1826 return module.findPage("jtktmcUpdate"); 1827 } 1828 1829 1830 /** 1831 * 修改集團名稱頁面 1832 * @param form 1833 * @param module 1834 * @param user 1835 * @return 1836 */ 1837 private Page toJtktmcUpdate(WebForm form, Module module, T_sys_user user) { 1838 Connection con=DBConnector.getconecttion(); 1839 1840 try { 1841 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1842 ArrayList list=(ArrayList) getJtobj(groupid); 1843 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 1844 form.addResult("hyList", hyList); 1845 if(list!=null&&list.size()>0){ 1846 form.addResult("obj", list.get(0)); 1847 } 1848 1849 } catch (Exception e) { 1850 e.printStackTrace(); 1851 }finally{ 1852 DBConnector.freecon(con); 1853 } 1854 return module.findPage("jtktmcUpdate"); 1855 } 1856 1857 /** 1858 * 獲取集團對象 1859 * @param groupid 1860 * @return 1861 */ 1862 private List getJtobj(String groupid) { 1863 Connection con=DBConnector.getconecttion(); 1864 ArrayList list=new ArrayList(); 1865 try { 1866 String sql=" select groupid,groupfullname,groupshortname,effectdate,failuredate,licenseusercount,licensemobileusercount ,licensestatus,industrycode from T_BS_Group where groupid='"+groupid+"'"; 1867 list=ObjectCtl.getMulRowValue2(con, sql); 1868 } catch (Exception e) { 1869 e.printStackTrace(); 1870 }finally{ 1871 DBConnector.freecon(con); 1872 } 1873 1874 return list; 1875 } 1876 1877 /** 1878 * 集團註銷 1879 * @param form 1880 * @param module 1881 * @param user 1882 * @return 1883 */ 1884 private Page jtktDelete(WebForm form, Module module, T_sys_user user) { 1885 Connection con=DBConnector.getconecttion(); 1886 int result=-1; 1887 try { 1888 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 1889 String sql=" update T_BS_Group set LicenseStatus=99 where groupid='"+groupid+"'"; 1890 result=ObjectCtl.executeUpdateBySql(con, sql); 1891 if(result!=-1){ 1892 form.addResult("result", true); 1893 }else { 1894 form.addResult("result", false); 1895 } 1896 1897 } catch (Exception e) { 1898 e.printStackTrace(); 1899 }finally{ 1900 DBConnector.freecon(con); 1901 } 1902 return module.findPage("jsonxml"); 1903 } 1904 1905 1906 1907 /** 1908 * 許可受權 1909 * @param form 1910 * @param module 1911 * @param user 1912 * @return 1913 */ 1914 private Page jtktUpdate(WebForm form, Module module, T_sys_user user) { 1915 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 1916 boolean result = false; 1917 try 1918 { ArrayList<String> sqlList= new ArrayList<String>(); 1919 String groupid = StringUtil.null2String(form.get("groupid")).trim(); 1920 String licensestatus=StringUtil.null2String(form.get("licensestatus")).trim(); 1921 String effectdate=StringUtil.null2String(form.get("effectdate")).trim(); 1922 String failuredate=StringUtil.null2String(form.get("failuredate")).trim(); 1923 String licenseusercount=StringUtil.null2String(form.get("licenseusercount")).trim(); 1924 String licensemobileusercount=StringUtil.null2String(form.get("licensemobileusercount")).trim(); 1925 // String checkids=StringUtil.null2String(form.get("checkids")).trim(); 1926 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 1927 // String[] pluginids=checkids.split(","); 1928 1929 /* if(pluginids!=null&&pluginids.length>0){ 1930 String delsql=" delete from T_SYS_GroupPlugin where groupid ='"+groupid+"'";//刪除 1931 sqlList.add(delsql); 1932 //取系統行業插件 1933 ArrayList XTHyPlugini=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like 'XT%999%99999999' and PluginType = '02' and IndustryCode ='"+industrycode+"'"); 1934 1935 if(XTHyPlugini.size()>0){//插入系統插件 1936 1937 for (int i = 0; i < XTHyPlugini.size(); i++) { 1938 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 1939 " values ('"+groupid+"','"+XTHyPlugini.get(i)+"' )"; 1940 sqlList.add(insql); 1941 } 1942 }else{//取系統標準插件 1943 ArrayList XTBzPluginid=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like 'XT%999%99999999' and PluginType = '01'"); 1944 1945 if(XTBzPluginid.size()>0){ 1946 for (int i = 0; i < XTBzPluginid.size(); i++) { 1947 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 1948 " values ('"+groupid+"','"+XTBzPluginid.get(i)+"' )"; 1949 sqlList.add(insql); 1950 } 1951 } 1952 } 1953 1954 1955 1956 ArrayList<String> pluginidlist=new ArrayList<String>(Arrays.asList(pluginids)); 1957 for (int i = 0; i < pluginidlist.size(); i++) { 1958 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 1959 " values ('"+groupid+"','"+pluginidlist.get(i)+"' )"; 1960 sqlList.add(insql); 1961 1962 } 1963 1964 } 1965 */ 1966 String mainsql=" update T_BS_Group set " + 1967 "effectdate='"+effectdate+"'," + 1968 "failuredate='"+failuredate+"'," + 1969 "licenseusercount='"+licenseusercount+"'," + 1970 "licensemobileusercount='"+licensemobileusercount+"'," + 1971 "industrycode='"+industrycode+"'," + 1972 " licensestatus='"+licensestatus+"'" + 1973 " where groupid='"+groupid+"'"; 1974 1975 sqlList.add(mainsql); 1976 1977 result =ObjectCtl.executeMulSql(con, sqlList); 1978 1979 //最後插件結果去重複 1980 /* String distinctSql="delete from T_SYS_GroupPlugin " 1981 + "where rowid not in " 1982 + "(select min(rowid) from T_SYS_GroupPlugin " 1983 + "where groupid='"+groupid+"' group by PLUGINID) and groupid = '"+groupid+"'"; 1984 DBHelper.update(con, distinctSql, null);*/ 1985 1986 if (result) 1987 { 1988 form.addResult("msg", "保存成功!"); 1989 delFile(Globals.APP_BASE_DIR+"WEB-INF\\temp\\" + groupid + ".zip" ); 1990 } 1991 else 1992 { 1993 form.addResult("msg", "保存失敗!"); 1994 } 1995 }catch(Exception e){ 1996 e.printStackTrace(); 1997 } 1998 finally 1999 { 2000 DBConnector.freecon(con); //釋放數據庫鏈接 2001 } 2002 return module.findPage("jtktUpdate"); 2003 } 2004 2005 2006 2007 2008 /** 2009 * 許可受權頁面 2010 * @param form 2011 * @param module 2012 * @param user 2013 * @return 2014 */ 2015 private Page toJtktUpdate(WebForm form, Module module, T_sys_user user) { 2016 Connection con=DBConnector.getconecttion(); 2017 try { 2018 String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2019 2020 ArrayList list=(ArrayList) getJtobj(groupid); 2021 if(list!=null&&list.size()>0){ 2022 form.addResult("obj", list.get(0)); 2023 } 2024 String pluginids=ObjectCtl.getStrRowValue(con, " select wm_concat(Pluginid) as Pluginida from T_SYS_GroupPlugin where groupid='"+groupid+"'"); 2025 Hashtable ht = comUtil.getZDHt(con, "0001", user.getGroupid()); 2026 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2027 form.addResult("hyList", hyList); 2028 form.addResult("ht", ht); 2029 form.addResult("groupid", groupid); 2030 form.addResult("pluginids", pluginids); 2031 2032 List list1=DBHelper.getDBeanList(con,"select ADMINLOGINNO,ADMINUSERID from t_bs_group where groupid ='"+groupid+"'",null); 2033 form.addResult("list1", list1.get(0)); 2034 } catch (Exception e) { 2035 e.printStackTrace(); 2036 }finally{ 2037 2038 DBConnector.freecon(con); 2039 } 2040 2041 return module.findPage("jtktUpdate"); 2042 } 2043 2044 2045 2046 private void delFile(String path) { 2047 try { 2048 File f = new File(path); // 輸入要刪除的文件位置 2049 if(f.exists()) 2050 f.delete(); 2051 } catch (Exception e) { 2052 e.printStackTrace(); 2053 } 2054 2055 2056 2057 } 2058 2059 /** 2060 * 插件列表 2061 * @param form 2062 * @param module 2063 * @param user 2064 * @return 2065 */ 2066 private Page pluginListJson(WebForm form, Module module, T_sys_user user) { 2067 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 2068 try 2069 { String groupid=StringUtil.null2String(form.get("groupid")).trim(); 2070 String sshy=StringUtil.null2String(form.get("sshy")).trim(); 2071 String cshsshy=StringUtil.null2String(form.get("cshsshy")).trim();//初始化所屬行業 2072 String biaoshi=StringUtil.null2String(form.get("biaoshi")).trim(); 2073 String pluginids=StringUtil.null2String(form.get("pluginids")).trim(); 2074 2075 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 ) " + 2076 " where plugincode in ( " + 2077 "select plugincode from " + 2078 "(select plugincode from T_SYS_Plugin where PluginType='01' Union " + //取全部標準插件 2079 "select plugincode from T_SYS_Plugin where PluginType='02' "; 2080 if(!sshy.equals("")&&!sshy.equals("999")){//所屬行業 2081 sql+= " and industrycode ='"+sshy+"'"; 2082 2083 } 2084 if(sshy.equals("")&&!cshsshy.equals("")&&!cshsshy.equals("999")){ 2085 sql+= "and industrycode ='"+cshsshy+"'"; 2086 } 2087 2088 sql +="Union " + //取全部行業插件 2089 " select plugincode from T_SYS_Plugin where PluginType='03' and groupid='"+groupid+"' " ; 2090 2091 2092 if(!pluginids.equals("")&&biaoshi.equals("xq")){ 2093 //sql +=" )) and plugincode not like 'XT_%' and plugincode not like 'BS_%' and pluginid in "+StringUtil.null2String(StringUtil.getStrsplit(pluginids.split(",")))+"" ; // 過濾系統插件和運營插件 2094 sql +=" )) and plugincode not like 'BS_%' and pluginid in "+StringUtil.null2String(StringUtil.getStrsplit(pluginids.split(",")))+"" ; // 過濾系統插件和運營插件 2095 }else if(pluginids.equals("")&&biaoshi.equals("xq")) { 2096 2097 //sql +=" )) and plugincode not like 'XT_%' and plugincode not like 'BS_%' and 1=2 "; 2098 sql +=" )) and plugincode not like 'BS_%' and 1=2 "; 2099 2100 }else if("".equals(biaoshi)) { 2101 2102 sql +=" )) and plugincode not like 'XT_%' and plugincode not like 'BS_%'"; 2103 //sql +=" )) and plugincode not like 'BS_%' and 1=2 "; 2104 2105 } 2106 else { 2107 //sql +=" )) and plugincode not like 'XT_%' and plugincode not like 'BS_%' "; 2108 sql +=" )) and plugincode not like 'BS_%' "; 2109 } 2110 2111 2112 2113 String limitSql=""; 2114 String orderSql=" "; 2115 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 2116 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 2117 String sort = StringUtil.null2String(form.get("sort"));//排序字段 2118 String dir = StringUtil.null2String(form.get("order"));//DESC 2119 2120 if(!sort.equals("")){ 2121 orderSql +=" order by "+sort+" "+dir+""; 2122 } 2123 String sqlQuery = ObjectCtl.getPageSql(sql + limitSql + orderSql, start, limit); 2124 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sql + limitSql + orderSql,null); 2125 Hashtable<String, Object> sshyht=comUtil.getZDHt(con, "0001", user.getGroupid()); 2126 for(int i=0;i<list.size();i++){ 2127 Map<String, String> map=list.get(i); 2128 map.put("plugintype", StringUtil.null2String(CjglMemo.cjlxMap.get(StringUtil.null2String(map.get("plugintype"))))); 2129 map.put("industrycode", StringUtil.null2String(sshyht.get(StringUtil.null2String(map.get("industrycode"))))); 2130 } 2131 2132 2133 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( "+sql + limitSql + orderSql+")" ); 2134 HttpServletResponse response = ActionContext.getContext().getResponse(); 2135 ObjectCtl.sendListData(response, count, list); 2136 2137 }catch (Exception e) { 2138 e.printStackTrace(); 2139 } 2140 finally 2141 { 2142 DBConnector.freecon(con); //釋放數據庫鏈接 2143 } 2144 return module.findPage("jsonxml"); 2145 } 2146 2147 2148 /** 2149 * 初始化添加頁面 2150 * @param form 2151 * @param module 2152 * @param user 2153 * @return 2154 */ 2155 private Page toJtktAdd(WebForm form, Module module, T_sys_user user) { 2156 Connection con=DBConnector.getconecttion(); 2157 try { 2158 form.addResult("today", DateUtil.getToday()); 2159 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2160 String sql=" select pluginid ,pluginname ,pluginstatus from t_sys_plugin where 1=1"; 2161 ArrayList pluglist=ObjectCtl.getMulRowValue2(con, sql); 2162 form.addResult("pluglist", pluglist); 2163 form.addResult("hyList", hyList); 2164 String mainpluginid=ObjectCtl.getStrRowValue(con, "select pluginid from T_SYS_Plugin where plugincode ='XT-001-999-99999999'"); 2165 String adminpluginid=ObjectCtl.getStrRowValue(con, "select pluginid from T_SYS_Plugin where plugincode ='XT-002-999-99999999'"); 2166 String pluginids=mainpluginid+","+adminpluginid; 2167 form.addResult("pluginids", pluginids); 2168 } catch (Exception e) { 2169 e.printStackTrace(); 2170 }finally{ 2171 DBConnector.freecon(con); 2172 } 2173 2174 return module.findPage("jtktAdd"); 2175 } 2176 /** 2177 * easyUI列表 2178 * @param form 2179 * @param module 2180 * @param user 2181 * @return 2182 */ 2183 private Page jtktListJson(WebForm form, Module module, T_sys_user user) { 2184 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 2185 try 2186 { 2187 String groupname=StringUtil.null2String(form.get("groupname")).trim(); 2188 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 2189 String licensestatus=StringUtil.null2String(form.get("licensestatus")).trim(); 2190 String sql="select t.groupid, t.groupfullname,t.groupshortname, t.licensestatus,t.effectdate,t.failuredate, t.licenseusercount, t.licensemobileusercount from T_BS_Group t " + 2191 " where 1=1 and t.groupfullname is not null and t.groupid<>'00000000' "; 2192 String limitSql=""; 2193 String orderSql=" "; 2194 if(!groupname.equals("")){ 2195 limitSql+=" and t.groupfullname like '%"+groupname+"%'"; 2196 } 2197 if(!industrycode.equals("")){ 2198 limitSql+=" and t.industrycode = '"+industrycode+"'"; 2199 } 2200 if(!licensestatus.equals("")){ 2201 limitSql+=" and t.licensestatus = '"+licensestatus+"'"; 2202 } 2203 2204 int limit = StringUtil.StringToInt(StringUtil.null2String(form.get("rows")));//每頁數據量 2205 int start = StringUtil.StringToInt(StringUtil.null2String(form.get("page")));//開始位置 2206 String sort = StringUtil.null2String(form.get("sort"));//排序字段 2207 String dir = StringUtil.null2String(form.get("order"));//DESC 2208 2209 if(!sort.equals("")){ 2210 orderSql +=" order by "+sort+" "+dir+""; 2211 }else{ 2212 orderSql +=" order by licensestatus asc "; 2213 } 2214 2215 String sqlQuery = ObjectCtl.getPageSql(sql + limitSql + orderSql, start, limit); 2216 List<Map<String, String>> list = ObjectCtl.getListMapStrStr(con,sqlQuery,null); 2217 2218 String count = ObjectCtl.getStrRowValue(con, "select count(0) from ( "+sql + limitSql + orderSql+")" ); 2219 HttpServletResponse response = ActionContext.getContext().getResponse(); 2220 ObjectCtl.sendListData(response, count, list); 2221 2222 }catch (Exception e) { 2223 e.printStackTrace(); 2224 } 2225 finally 2226 { 2227 DBConnector.freecon(con); //釋放數據庫鏈接 2228 } 2229 return module.findPage("jsonxml"); 2230 } 2231 2232 2233 /** 2234 * 執行新增數據 2235 */ 2236 private Page jtktAdd(WebForm form, Module module, T_sys_user user) 2237 { 2238 2239 Connection con = DBConnector.getconecttion(); //取得一個數據庫鏈接 2240 boolean result = false; 2241 try 2242 2243 { 2244 String groupid = ObjectCtl.getSubMenuIdZD(con, "T_BS_Group", "groupid", "", 8); 2245 String groupfullname=StringUtil.null2String(form.get("groupfullname")).trim(); 2246 String groupshortname=StringUtil.null2String(form.get("groupshortname")).trim(); 2247 String licensestatus=StringUtil.null2String(form.get("licensestatus")).trim(); 2248 String effectdate=StringUtil.null2String(form.get("effectdate")).trim(); 2249 String failuredate=StringUtil.null2String(form.get("failuredate")).trim(); 2250 String licenseusercount=StringUtil.null2String(form.get("licenseusercount")).trim(); 2251 String licensemobileusercount=StringUtil.null2String(form.get("licensemobileusercount")).trim(); 2252 String industrycode=StringUtil.null2String(form.get("industrycode")).trim(); 2253 String adminloginno=StringUtil.null2String(form.get("adminloginno")).trim();//管理員賬號 2254 2255 String groupfullnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupfullname)); //集團全稱簡拼 2256 String groupfullnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupfullname)); //集團全稱全拼 2257 String groupshortnamefirstpy=StringUtil.null2String(ConverPinyin2.getHanziJianpin(groupshortname)); //集團簡稱簡拼 2258 String groupshortnameallpy=StringUtil.null2String(ConverPinyin2.getHanzipinyin(groupshortname)); // 集團簡稱全拼 2259 if(licenseusercount.equals("")){ 2260 licenseusercount="-1"; 2261 } 2262 if(licensemobileusercount.equals("")){ 2263 licensemobileusercount="-1"; 2264 } 2265 String checkids=StringUtil.null2String(form.get("checkids")).trim(); 2266 String[] pluginids=checkids.split(","); 2267 ArrayList<String> sqlList=new ArrayList<String>(); 2268 //插入集團與插件關聯(T_SYS_GroupPlugin) 2269 if(pluginids!=null&&pluginids.length>=0){ 2270 //PluginType 01-標準插件 02-行業插件 03-定製插件 2271 //取系統行業插件 2272 ArrayList XTHyPlugini=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like 'XT%999%99999999' and PluginType = '02' and IndustryCode ='"+industrycode+"'"); 2273 2274 if(XTHyPlugini.size()>0){//插入系統插件 2275 2276 for (int i = 0; i < XTHyPlugini.size(); i++) { 2277 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2278 " values ('"+groupid+"','"+XTHyPlugini.get(i)+"' )"; 2279 sqlList.add(insql); 2280 } 2281 }else{//取系統標準插件 2282 ArrayList XTBzPluginid=ObjectCtl.getMulRowValue2(con, "select pluginid from T_SYS_Plugin where plugincode like 'XT%999%99999999' and PluginType = '01'"); 2283 2284 if(XTBzPluginid.size()>0){ 2285 for (int i = 0; i < XTBzPluginid.size(); i++) { 2286 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2287 " values ('"+groupid+"','"+XTBzPluginid.get(i)+"' )"; 2288 sqlList.add(insql); 2289 } 2290 } 2291 2292 } 2293 2294 ArrayList<String> pluginidlist=new ArrayList<String>(Arrays.asList(pluginids)); 2295 for (int i = 0; i < pluginidlist.size(); i++) { 2296 String insql="insert into T_SYS_GroupPlugin (groupid,pluginid)" + 2297 " values ('"+groupid+"','"+pluginidlist.get(i)+"' )"; 2298 sqlList.add(insql); 2299 2300 } 2301 2302 } 2303 String adminuserid = BhGenerator.getBh(); 2304 String mainsql=" insert into T_BS_Group " + 2305 "( GroupID,GroupFullName,GroupShortName,LicenseStatus,EffectDate,FailureDate," + 2306 "LicenseUserCount,LicenseMobileUserCount,industrycode," + 2307 "groupfullnamefirstpy,groupfullnameallpy,groupshortnamefirstpy,groupshortnameallpy,ADMINLOGINNO,ADMINUSERID)" + 2308 " values "+ 2309 "('"+groupid+"','"+groupfullname+"','"+groupshortname+"','"+licensestatus+"','"+effectdate+"','"+failuredate+"','" + 2310 ""+licenseusercount+"','"+licensemobileusercount+"','"+industrycode+"'," + 2311 "'"+groupfullnamefirstpy+"','"+groupfullnameallpy+"','"+groupshortnamefirstpy+"','"+groupshortnameallpy+"','"+adminloginno+"','"+adminuserid+"')"; 2312 2313 sqlList.add(mainsql); 2314 result=ObjectCtl.executeMulSql(con, sqlList); 2315 if (result) 2316 { 2317 form.addResult("msg", "開戶成功!"); 2318 2319 comUtil.countProc(con, "PRO_INIT_SYSDATA('"+groupid+"','"+adminloginno+"','"+adminuserid+"')"); 2320 //生成實例插件 2321 String sql1="select pluginID from T_SYS_GroupPlugin where GroupID="+groupid; 2322 List<DBean> list=DBHelper.getDBeanList(con, sql1, null); 2323 for(int i=0;i<list.size();i++){ 2324 String IsMutiBui=DBHelper.getRowStr(con, "select IsMutiBui from T_SYS_Plugin where pluginID ='"+list.get(i).getString("pluginid")+"'", null); 2325 2326 if(!IsMutiBui.equals("1")){ 2327 String plugininstid = BhGenerator.getBh();//實例插件id 2328 comUtil.countProc(con, "pro_plugin_instantiation('"+groupid+"','"+list.get(i).getString("pluginid")+"','','"+adminuserid+"','"+plugininstid+"')"); 2329 } 2330 } 2331 } 2332 else 2333 { 2334 form.addResult("msg", "開戶失敗!"); 2335 } 2336 } catch (Exception e) { 2337 e.printStackTrace(); 2338 } 2339 finally 2340 { 2341 DBConnector.freecon(con); //釋放數據庫鏈接 2342 } 2343 return module.findPage("jtktAdd"); 2344 } 2345 /** 2346 2347 2348 /** 2349 * 列表頁面 2350 */ 2351 private Page jtktList(WebForm form, Module module, T_sys_user user) 2352 { 2353 Connection con=DBConnector.getconecttion();//取得一個數據庫鏈接 2354 try 2355 { 2356 2357 ArrayList hyList = comUtil.getZDList(con, "0001", user.getGroupid()); 2358 form.addResult("hyList", hyList); 2359 } 2360 catch (Exception e) { 2361 e.printStackTrace(); 2362 } 2363 finally 2364 { 2365 DBConnector.freecon(con); //釋放數據庫鏈接 2366 } 2367 return module.findPage("jtktList"); 2368 } 2369 2370 2371 }
第二個tab頁面的新增頁面java
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <title></title> 6 <script type='text/javascript' src='/$!globals_sys_basename/dwr/interface/JsonData.js'></script> 7 <script type='text/javascript' src='/$!globals_sys_basename/dwr/engine.js'></script> 8 <script type='text/javascript' src='/$!globals_sys_basename/dwr/util.js'></script> 9 10 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery-1.11.1.js"></script> 11 12 <!-- EasyUi --> 13 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.css"></link> 14 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon.css"></link> 15 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/demo.css"></link> 16 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon-all.css"></link> 17 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.sx.css"></link> 18 <!-- EasyUi --> 19 20 <!-- 框架 --> 21 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/css/$!css_path/main.css"></link> 22 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery-1.11.1.js"></script> 23 <!--easyui--> 24 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.util.js"></script> 25 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.min.js"></script> 26 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/easyui-lang-zh_CN.js"></script> 27 <!-- 擴充 jquery 框架基礎功能的函數庫 --> 28 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery.jdirk.js"></script> 29 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.js"></script> 30 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.form.js"></script> 31 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tabs.js"></script> 32 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tree.js"></script> 33 <!--easyui--> 34 <script language='javascript' src='/$!globals_sys_basename/web/common/component/Date/WdatePicker.js'></script> 35 <script language='javascript' src='/$!globals_sys_basename/web/common/component/zdialog/zDialog.js'></script> 36 <script language='javascript' src='/$!globals_sys_basename/web/common/component/zdialog/zDialog.sunshion.js'></script> 37 38 <style> 39 .panel-body-noheader{ 40 border: 0px; 41 } 42 </style> 43 </head> 44 45 <body> 46 <form id="form_easyui" name="form_easyui" class="easyui-form"> 47 <input type="hidden" name="groupid" id="groupid" value="$!groupid"/> 48 <input type="hidden" name="pluginid" id="pluginid" value="$!pluginid"/> 49 <input type="hidden" name="adminlogin" id="adminlogin" value="$!adminlogin"/> 50 </form> 51 <div id="mainLayout" class="easyui-layout hidden" data-options="fit: true"> 52 <div data-options="region: 'center'" style="padding: 0px;"> 53 54 <table id="dg_license" border="0" class="easyui-datagrid" title="" 55 loadMsg="正在加載..." 56 toolbar="#toolbarDiv_license" 57 data-options="fitColumns:true, fit: true,rownumbers:true,singleSelect:false,url:'/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=addCdListJson&groupid=$groupid&pluginid=$!pluginid',method:'post', pageSize:20"> 58 <thead> 59 <tr> 60 <th data-options="field:'menuid', align:'center', checkbox:true"></th> 61 <th data-options="field:'menuname',align:'center',halign:'center', sortable:'true',width:100">菜單別名</th> 62 <th data-options="field:'icon',align:'center',halign:'center', width:100">菜單圖標</th> 63 <th data-options="field:'iconbgcolor',align:'center',halign:'center', width:100">菜單圖標背景色</th> 64 </tr> 65 </thead> 66 </table> 67 </div> 68 69 </div> 70 </body> 71 <script type="text/javascript"> 72 73 function doSubmit(){ 74 75 var rows=$("#dg_license").datagrid('getSelections'); 76 var ids=""; 77 for (var i=0;i<rows.length;i++){ 78 var row=rows[i]; 79 ids+=row.menuid+","; 80 } 81 var menunames=""; 82 for (var i=0;i<rows.length;i++){ 83 var row=rows[i]; 84 menunames+=row.menuname+","; 85 } 86 var icons=""; 87 for (var i=0;i<rows.length;i++){ 88 var row=rows[i]; 89 icons+=row.icon+","; 90 } 91 iconbgcolors=""; 92 for (var i=0;i<rows.length;i++){ 93 var row=rows[i]; 94 iconbgcolors+=row.iconbgcolor+","; 95 96 } 97 98 if(ids != ""){ 99 jQuery.post("/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=addCd",{ids:ids,menunames:menunames,icons:icons,iconbgcolors:iconbgcolors,pluginid:$('#pluginid').val(),groupid:$('#groupid').val()}, function (date){ 100 rest = eval(date); 101 if(rest){ 102 //alert("===2222========"); 103 top.Dialog.alert('添加成功',function(){ 104 top.ppage.dosearch_license(); 105 top.Dialog.close(); 106 }); 107 }else{ 108 Dialog.alert("添加失敗!"); 109 } 110 111 }); 112 113 }else{ 114 Dialog.alert("您未添加任何菜單"); 115 } 116 } 117 </script> 118 </html>
第三個tab頁面新增頁面jquery
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <title></title> 6 <script type='text/javascript' src='/$!globals_sys_basename/dwr/interface/JsonData.js'></script> 7 <script type='text/javascript' src='/$!globals_sys_basename/dwr/engine.js'></script> 8 <script type='text/javascript' src='/$!globals_sys_basename/dwr/util.js'></script> 9 10 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery-1.11.1.js"></script> 11 12 <!-- EasyUi --> 13 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.css"></link> 14 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon.css"></link> 15 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/demo.css"></link> 16 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/icon-all.css"></link> 17 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/component/easyui/themes/$!easyui_css_path/easyui.sx.css"></link> 18 <!-- EasyUi --> 19 20 <!-- 框架 --> 21 <link rel="stylesheet" type="text/css" href="/$!globals_sys_basename/web/common/css/$!css_path/main.css"></link> 22 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery-1.11.1.js"></script> 23 <!--easyui--> 24 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.util.js"></script> 25 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/jquery.easyui.min.js"></script> 26 <script type="text/javascript" src="/$!globals_sys_basename/web/common/component/easyui/easyui-lang-zh_CN.js"></script> 27 <!-- 擴充 jquery 框架基礎功能的函數庫 --> 28 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jquery.jdirk.js"></script> 29 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.js"></script> 30 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.form.js"></script> 31 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tabs.js"></script> 32 <script language=javascript src="/$!globals_sys_basename/web/common/component/easyui/jeasyui-extensions/jeasyui.extensions.tree.js"></script> 33 <!--easyui--> 34 <script language='javascript' src='/$!globals_sys_basename/web/common/component/Date/WdatePicker.js'></script> 35 <script language='javascript' src='/$!globals_sys_basename/web/common/component/zdialog/zDialog.js'></script> 36 <script language='javascript' src='/$!globals_sys_basename/web/common/component/zdialog/zDialog.sunshion.js'></script> 37 38 <style> 39 .panel-body-noheader{ 40 border: 0px; 41 } 42 </style> 43 </head> 44 45 <body> 46 <form id="form_easyui" name="form_easyui" class="easyui-form"> 47 <input type="hidden" name="groupid" id="groupid" value="$!groupid"/> 48 <input type="hidden" name="pluginid" id="pluginid" value="$!pluginid"/> 49 <input type="hidden" name="adminlogin" id="adminlogin" value="$!adminlogin"/> 50 </form> 51 <div id="mainLayout" class="easyui-layout hidden" data-options="fit: true"> 52 <div data-options="region: 'center'" style="padding: 0px;"> 53 54 <table id="dg_license" border="0" class="easyui-datagrid" title="" 55 loadMsg="正在加載..." 56 toolbar="#toolbarDiv_license" 57 data-options="fitColumns:true, fit: true,rownumbers:true,singleSelect:false,url:'/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=addJsListJson&groupid=$groupid&pluginid=$!pluginid',method:'post', pageSize:20"> 58 <thead> 59 <tr> 60 <th data-options="field:'id', align:'center', checkbox:true"></th> 61 <th data-options="field:'roleid',align:'center',halign:'center', sortable:'true', width:100">角色ID</th> 62 <th data-options="field:'rolename',align:'center',halign:'center', sortable:'true',width:100">角色別名</th> 63 </tr> 64 </thead> 65 </table> 66 </div> 67 68 </div> 69 </body> 70 <script type="text/javascript"> 71 72 function doSubmit(){ 73 74 var rows=$("#dg_license").datagrid('getSelections'); 75 var ids=""; 76 for (var i=0;i<rows.length;i++){ 77 var row=rows[i]; 78 ids+=row.id+","; 79 } 80 //alert("====ids====" + ids); 81 82 var roleIds=""; 83 for (var i=0;i<rows.length;i++){ 84 var row=rows[i]; 85 roleIds+=row.roleid+","; 86 } 87 88 var roleNames=""; 89 for (var i=0;i<rows.length;i++){ 90 var row=rows[i]; 91 roleNames+=row.rolename+","; 92 } 93 94 95 if(ids != ""){ 96 jQuery.post("/$!globals_sys_basename/web/plugins/bs/yygl/dz/g00000000/jtkt.xp?doAction=addJs",{ids:ids,roleIds:roleIds,roleNames:roleNames,pluginid:$('#pluginid').val(),groupid:$('#groupid').val()}, function (date){ 97 rest = eval(date); 98 if(rest){ 99 //alert("===2222========"); 100 top.Dialog.alert('添加成功',function(){ 101 top.ppage.dosearch_license(); 102 top.Dialog.close(); 103 }); 104 }else{ 105 Dialog.alert("添加失敗!"); 106 } 107 108 }); 109 110 }else{ 111 Dialog.alert("您未添加任何角色"); 112 } 113 } 114 </script> 115 </html>