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