IndexS.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. package ss;
  2. import java.io.Serial;
  3. import jakarta.servlet.annotation.WebServlet;
  4. import jakarta.servlet.http.HttpServlet;
  5. import jakarta.servlet.http.HttpServletRequest;
  6. import jakarta.servlet.http.HttpServletResponse;
  7. import jakarta.servlet.http.HttpSession;
  8. import org.apache.commons.lang3.StringUtils;
  9. import org.apache.logging.log4j.LogManager;
  10. import org.apache.logging.log4j.Logger;
  11. import base.SsC;
  12. import ss.db.SqlCmd;
  13. import ss.db.Db;
  14. import ss.log.SsLog;
  15. import ss.page.PageU;
  16. import ss.serv.ServC;
  17. import ss.user.UserC;
  18. import ss.user.UserDevRunB;
  19. import ss.user.UserRunB;
  20. import ss.user.UserU;
  21. // 来自 MisIndexAction implements Action。Lin
  22. @WebServlet(WebC.SPATH_initLogin)
  23. public class IndexS extends HttpServlet {
  24. @Serial
  25. private static final long serialVersionUID = 1L;
  26. private static final String FORWARD_REDIRECT = "wdIndexforwardRedirect"; // 去掉 public,VisitUtil 并过来了。Lin
  27. // 增加,去掉 e.printStackTrace(),改用 log4j -- 按 IDEA 规范。Lin
  28. private static final Logger log4j = LogManager.getLogger(IndexS.class);
  29. /*
  30. // 有时是 Get 方法,有时是 Post 方法。Lin
  31. @Override
  32. protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
  33. this.doPost(req, resp);
  34. }
  35. // 来自 @Override(implements Action)
  36. // MisIndexAction.service(HttpServletRequest request, HttpServletResponse response)。Lin
  37. @Override
  38. protected void doPost(HttpServletRequest request, HttpServletResponse response)
  39. throws ServletException, IOException {
  40. */
  41. @Override
  42. protected void service(HttpServletRequest request, HttpServletResponse response) {
  43. HttpSession session = request.getSession(); // 再增加,不重复取。Lin
  44. // ActionErrors errors = new ActionErrors();
  45. // ActionForward forward = new ActionForward();
  46. // if(checkAgentIsMobile(request.getHeader("User-Agent")) && new
  47. // File(CoreConstVars.webRoot+"/mobile/index.html").exists()){
  48. // Cookie cookie = getCookie("device",request.getCookies());
  49. // if(cookie == null || cookie.getValue().equalsIgnoreCase("app")){
  50. // forward.setPath("/mobile/index.html");
  51. // return forward;
  52. // }
  53. // }
  54. // Boolean isMobile=checkAgentIsMobile(request.getHeader("User-Agent"));
  55. // if (isMobile) {
  56. // Cookie cookie = getCookie("device", request.getCookies());
  57. // if (cookie == null || cookie.getValue().equalsIgnoreCase("app")) {
  58. // forward.setRedirect(true);
  59. // }
  60. // }
  61. // return value
  62. // GeneralDBAccess gdba = GeneralDBAccess
  63. // .getInstance(ConstVars.DB_JDNI_NAME);
  64. try {
  65. // 读取输入的URL
  66. /* 再改,增加 session(HttpSession),不重复取。Lin
  67. String indexPath = getMisIndexPath(request); // VisitUtil.,移过来了。Lin
  68. */ String indexPath = getMisIndexPath(request, session); // VisitUtil.,移过来了。Lin
  69. // setUserInfoIntoRequest(request);
  70. boolean redirect = false;
  71. String atrStr = (String) request.getAttribute(FORWARD_REDIRECT); // 增加,处理空值。Lin
  72. if (atrStr != null && atrStr.equals("1")) {
  73. // forward.setRedirect(true);
  74. redirect = true;
  75. }
  76. if (StringUtils.isBlank(indexPath)) { // 去掉 StrU.isNull(),直接用 StringUtils.isBlank()。Lin
  77. SsLog.print("没有找到首页:"+ request.getServerName());
  78. response.sendError(HttpServletResponse.SC_BAD_REQUEST,
  79. "home page not found: " + request.getServerName());
  80. return;
  81. }
  82. // autoLogin默认值为1,表示如果session已经存在已登录用户就不用再登录了
  83. /* 增加,处理空值。Lin
  84. Boolean autoLogin = "0".equals(request.getParameter("autoLogin")) ? false : true;
  85. */
  86. boolean autoLogin = false;
  87. atrStr = request.getParameter("autoLogin");
  88. if (atrStr != null && atrStr.equals("1"))
  89. autoLogin = true;
  90. Object level = session.getAttribute(UserC.LOGIN_level); // = request.getSession().。Lin
  91. // CoreConstVars.SESSION_LOGIN_LEVEL。Lin
  92. // 已登录用户打开首页自动跳转
  93. /* 再改,增加 UserU.rdOrigUserBySess(session),便于维护。Lin
  94. WdYh yh = (WdYh) request.getSession().getAttribute(
  95. ServiceConst.WD_YYH);
  96. */ UserRunB yh = UserU.rdOrigUserBySess(session);
  97. if (autoLogin
  98. && yh != null
  99. // && yh.getGxhym() != null // 去掉 .gxhym,不能放在 UserPo 里。Lin
  100. && level != null
  101. && level.toString().equals(UserC.LOGIN_sysLevel)) {
  102. // CoreConstVars.LOGIN_LEVEL_SYS_LOGIN。Lin
  103. response.sendRedirect(WebC.PPATH_home); // yh.getGxhym()。去掉 .gxhym,直接用 WebC.PPATH_home。Lin
  104. return ;
  105. }
  106. // forward.setPath(indexPath);
  107. if (redirect) {
  108. response.sendRedirect(indexPath);
  109. } else {
  110. request.getRequestDispatcher(indexPath).forward(request, response);
  111. }
  112. } catch (Exception e) {
  113. /* 改,去掉 e.printStackTrace(),改用 log4j -- 按 IDEA 规范。Lin
  114. e.printStackTrace();
  115. */ log4j.error("IndexS.service( 异常", e);
  116. // errors.add("name", new ActionError("id"));
  117. /* 再改。IDEA:Empty 'finally' block。Lin
  118. } finally {
  119. // gdba.close();
  120. */
  121. }
  122. // if (!errors.isEmpty()) {
  123. // saveErrors(request, errors);
  124. // }
  125. // return; // 再去掉,IDEA:'return' is unnecessary as the last statement in a 'void' method。Lin
  126. }
  127. /**
  128. * 计算获取首页位置
  129. *
  130. * @param request;
  131. * @return String
  132. */
  133. // 来自 VisitUtil.getMisIndexPath(HttpServletRequest request)。Lin
  134. /* 再改,增加 session(HttpSession),不重复取。Lin
  135. private static String getMisIndexPath(HttpServletRequest request) {
  136. */ private static String getMisIndexPath(HttpServletRequest request, HttpSession session) {
  137. /* 再去掉,移到用到的地方 'try' with sources。Lin
  138. Db wdgdba_maybe_null = null; // 只是在 if 里用到,不用 'try' with sources。Lin
  139. */
  140. try {
  141. // String appName=WdLoginUtil.getLoginedAppName(request); // 去掉,不支持多个应用 -- 需要时用 SsC.APP_name。Lin
  142. // boolean userCookie = false;
  143. boolean secondHomePage;
  144. // String userid =
  145. // request.getParameter(CoreConstVars.COOKIE_USERID);
  146. String logintoken = request.getParameter(UserC.LOGIN_token); // CoreConstVars.REQUEST_LOGIN_TOKEN。Lin
  147. // if (request.getCookies() != null) {
  148. // for (Cookie c : request.getCookies()) {
  149. // if (c.getName().equals(CoreConstVars.COOKIE_USERID)) {
  150. // userCookie = true;
  151. // userid = c.getValue();
  152. // request.setAttribute(CoreConstVars.COOKIE_USERID, userid);
  153. // }
  154. // // if(c.getName().equals(CoreConstVars.COOKIE_USER))
  155. // // userCookie=true;
  156. // }
  157. // }
  158. //
  159. // String requestuserid =
  160. // request.getParameter(CoreConstVars.COOKIE_USERID);
  161. String deviceid = request.getParameter(UserC.DEV_id); // CoreConstVars.REQUEST_DEVICEID。Lin
  162. /* 再改用 UserDevRunB,从业务的 RysbPo 分开 -- 剥离 SS。Lin
  163. RysbPo yhsb = null; // Yhsb。Lin
  164. */ UserDevRunB yhsb = null;
  165. if (StringUtils.isNotBlank(logintoken) && StringUtils.isNotBlank(deviceid)) {
  166. // 去掉 StrU.notNull(),直接用 StringUtils.isNotBlank()。Lin
  167. /* 去掉 VisitUtil.initWDgdba(),直接把内容移上来。Lin
  168. wdgdba_maybe_null = initWDgdba(wdgdba_maybe_null);
  169. */
  170. /// 来自 VisitUtil.(GeneralDBAccess) initWDgdba(GeneralDBAccess wdgdba)。Lin
  171. // "减少获取gdba连接数,用到才调用"
  172. // return wdgdba != null ? wdgdba : GeneralDBAccess
  173. // .getInstance(ConstVars.DB_JDNI_NAME);
  174. /* 再改,IDEA:Condition 'wdgdba_maybe_null == null' is always 'true'。Lin
  175. wdgdba_maybe_null = (wdgdba_maybe_null == null)? Db.makeConn() : wdgdba_maybe_null;
  176. */
  177. /* 再改,用 'try' with sources。Lin
  178. wdgdba_maybe_null = Db.makeConn();
  179. */ try (Db wdgdba_maybe_null = Db.makeConn()) {
  180. ///
  181. /* 再改用 UserDevRunB,从业务的 RysbPo 分开 -- 剥离 SS。Lin
  182. yhsb = findYhsb11(logintoken, deviceid, wdgdba_maybe_null);
  183. */ yhsb = selUserDevRunB(logintoken, deviceid, wdgdba_maybe_null);
  184. request.setAttribute(UserC.DEV_nofind, (yhsb == null) ? "1" : "0"); // CoreConstVars.LOGIN_PAGE_YHSB_EXPIRES。Lin
  185. /// 再增加,用 'try' with sources。Lin
  186. }
  187. ///
  188. }
  189. // if (StringUtil.notNull(requestuserid)) {
  190. // userid = requestuserid;
  191. // userCookie = true;
  192. // }
  193. // 跳到第二个首页
  194. // 请求发现homepage=1,不用第二首页
  195. secondHomePage = (yhsb != null) && (!request.getParameter("homepage").equals("1"));
  196. // secondHomePage=false;
  197. /* 去掉,不支持多个应用。Lin
  198. * 去掉 ApplicationLogin,去掉 application.xml
  199. String serverName = request.getServerName();
  200. WebApp webapp = null;
  201. ApplicationLogin login = null;
  202. for (WebApp app : WD.getSysWD().getAppMap().values()) {
  203. if (app.getApplicationConfig().getApplicationLoginMap().containsKey(serverName)) {
  204. webapp = app;
  205. login = webapp.getApplicationConfig().getApplicationLoginMap().get(serverName);
  206. }
  207. }
  208. if (webapp == null||login==null) {// 域名不在配置文件
  209. String sqlcmd = null;
  210. String wzid = null;
  211. String ymid = null;
  212. wdgdba_maybe_null = (wdgdba_maybe_null == null)? SsDb.makeConn() : wdgdba_maybe_null;
  213. // initWDgdba(wdgdba_maybe_null)。去掉 VisitUtil.initWDgdba(),直接把内容移上来。Lin
  214. // if (checkAgentIsMobile(request.getHeader("User-Agent"))) {
  215. // Cookie cookie = getCookie("device", request.getCookies());
  216. // if (cookie == null || cookie.getValue().equalsIgnoreCase("app")) {
  217. // wdgdba_maybe_null.select(sqlcmd);
  218. // if (wdgdba_maybe_null.getRowCount() == 0) {
  219. // return null;
  220. // } else {
  221. // wzid = wdgdba_maybe_null.getColumnAsString("wzid");
  222. // request.setAttribute("wzid", wzid);
  223. // String xmdm = wd.core.web.WebUtil.getYyhByWzid(wdgdba_maybe_null, wzid);
  224. // request.getSession().setAttribute(CoreConstVars.SESSION_WZID, wzid);
  225. // request.getSession().setAttribute(CoreConstVars.XMMC, xmdm);
  226. // PageObject pageobj = WebUtil.findPageObjectById("wz", PageObject.BJLBM_MOBILE_SY, xmdm);
  227. // if ( pageobj != null) {
  228. // // 重定向
  229. // request.setAttribute(IndexAction.FORWARD_REDIRECT, "1");
  230. //
  231. // if (ConstVars.IS_DEVELOP_MODE) {
  232. // return "/service?wdApplication=" + xmdm + "&wdService=loadMobileHtml&code=wz&bjlbm=85&xmmc=" + xmdm + "&appbrower=1" + "&wzid=" + wzid;
  233. // } else {
  234. // return "/service?wdApplication=" + xmdm + "&wdService=loadMobileHtml&code=wz&bjlbm=85&xmmc=" + xmdm + "&appbrower=3" + "&wzid=" + wzid;
  235. // }
  236. // } else {
  237. // sqlcmd = "select ymid,wzid from ym where sfqy=1 and ymlbm=1 and wzid in(" + sqlcmd + ") order by length(dm||'0')";
  238. // wdgdba_maybe_null.select(sqlcmd);
  239. // if (wdgdba_maybe_null.getRowCount() == 1) {
  240. // wzid = wdgdba_maybe_null.getColumnAsString("wzid");
  241. // ymid = wdgdba_maybe_null.getColumnAsString("ymid");
  242. // request.getSession().setAttribute(CoreConstVars.SESSION_WZID, wzid);
  243. // return "/web/loadWebPage.do?" + wzid + ConstVars.YHZH_SEPT + ymid + ConstVars.YHZH_SEPT + "0" + ConstVars.YHZH_SEPT + ConstVars.PAGE_FIRST;
  244. // }
  245. // }
  246. //
  247. // //
  248. // }
  249. // }
  250. // } else {
  251. // sqlcmd = "SELECT wzid FROM wz WHERE regexp_like(lower(ym),'(*;)?" + shuRuUrl + "(;*)?')";
  252. // sqlcmd = "select ymid,wzid from ym where sfqy=1 and ymlbm=1 and wzid in(" + sqlcmd + ") order by length(dm||'0')";
  253. // wdgdba_maybe_null.select(sqlcmd);
  254. //
  255. // if (wdgdba_maybe_null.getRowCount() == 0) {
  256. // return null;
  257. // }
  258. //
  259. //
  260. // wzid = wdgdba_maybe_null.getColumnAsString("wzid");
  261. // ymid = wdgdba_maybe_null.getColumnAsString("ymid");
  262. //
  263. VisitPath res= getIndexPath(serverName, wdgdba_maybe_null);
  264. if(res==null||res.getYmid()==null)return null;
  265. ymid=res.getYmid();
  266. wzid=res.getWzid();
  267. if(WebUtil.checkAgentIsMobile(request)&&WebUtil.findPageObjectById((ConstVars.IS_DEVELOP_MODE?"wz":wd.core.util.FileAssistant.encriptDesignId("wz")), PageObject.BJLBM_MOBILE_SY, appName)!=null){
  268. request.setAttribute(MisIndexAction.FORWARD_REDIRECT, "1");
  269. return "/service?wdApplication=" + appName + "&wdService=loadMobileHtml&code="+(ConstVars.IS_DEVELOP_MODE?"wz":wd.core.util.FileAssistant.encriptDesignId("wz"))+"&bjlbm=85&xmmc=" + appName + "&wzid=" + wzid+ "&appbrower=1"+(ConstVars.IS_DEVELOP_MODE?"1":"3");
  270. }else{
  271. request.getSession().setAttribute(CoreConstVars.SESSION_WZID, wzid);
  272. return "/web/loadWebPage.do?" + wzid + ConstVars.YHZH_SEPT + ymid + ConstVars.YHZH_SEPT + "0" + ConstVars.YHZH_SEPT + ConstVars.PAGE_FIRST;
  273. }
  274. // }
  275. } else {
  276. */
  277. /* 去掉 ApplicationLogin。Lin
  278. * 再增加 session(HttpSession),不重复取。Lin
  279. request.getSession().setAttribute(CoreConstVars.SESSIOJ_PROJECT_URL_DESC, login.getDesc());
  280. */ session.setAttribute(WebC.REQ_appDesc, SsC.APP_desc); // request.getSession().。Lin
  281. //GlobalFilter work----------------------
  282. // if (StringUtil.isNull(WdLoginUtil.getLoginedAppName(request))) {
  283. // request.getSession().setAttribute(CoreConstVars.XMMC, webapp.getName());
  284. // }
  285. // 移动端页面
  286. // if (ApplicationLogin.TYPE_APPLICATION.equals(login.getType()) && checkAgentIsMobile(request.getHeader("User-Agent"))) {
  287. // Cookie cookie = getCookie("device", request.getCookies());
  288. // if (cookie == null || cookie.getValue().equalsIgnoreCase("app")) {
  289. // String xmdm = webapp.getName();
  290. //
  291. // PageObject pageobj = WebUtil.findPageObjectById("wz", PageObject.BJLBM_MOBILE_SY, xmdm);
  292. // if (pageobj != null) {
  293. // if (ConstVars.IS_DEVELOP_MODE) {
  294. // return "/service?wdApplication=" + xmdm + "&wdService=loadMobileHtml&code=wz&bjlbm=85&xmmc=" + xmdm + "&appbrower=1";
  295. // } else {
  296. // return "/service?wdApplication=" + xmdm + "&wdService=loadMobileHtml&code=wz&bjlbm=85&xmmc=" + xmdm + "&appbrower=3";
  297. // }
  298. // } else {
  299. // String result = null;
  300. //
  301. // result = login.getLoginMap().get("firstLogin").getPath();
  302. //
  303. // return result;
  304. // }
  305. //
  306. // }
  307. // } else {
  308. String result;
  309. // 登录页2
  310. /* 去掉 appName。Lin
  311. * 去掉 wdApplication=、bjlbm=85、xmmc=
  312. if(WebUtil.checkAgentIsMobile(request)&&WebUtil.findPageObjectById("wz", PageObject.BJLBM_MOBILE_SY, appName)!=null){
  313. result="/service?wdApplication=" + appName + "&wdService=loadMobileHtml&code="
  314. +(ConstVars.IS_DEVELOP_MODE?"wz":wd.core.util.FileAssistant.encriptDesignId("wz"))
  315. +"&bjlbm=85&xmmc=" + appName + "&appbrower="+(ConstVars.IS_DEVELOP_MODE?"1":"3");
  316. */
  317. if (WebU.isMdByReq(request) && AppB.pageMap.get("wz") != null) {
  318. result = ServC.SPATH_root +"?"+ ServC.URL_ssServ +"=loadMobileHtml&code="
  319. + ((AppB.inDebug)?"wz" : PageU.md5PageName("wz"))
  320. + "&appbrower="+ ((AppB.inDebug)? "1" : "3");
  321. request.setAttribute(FORWARD_REDIRECT, "1"); // 去掉 MisIndexAction.,合并了。Lin
  322. /* 去掉 ApplicationLogin。Lin
  323. }else if (secondHomePage && login.getLoginMap().containsKey("login")) {
  324. result = login.getLoginMap().get("login").getPath();
  325. request.setAttribute(CoreConstVars.LOGIN_PAGE_YHSB, yhsb);
  326. setUserInfoIntoRequest(request, yhsb.getYhid());
  327. }else {
  328. result = login.getLoginMap().get("firstLogin").getPath();
  329. }
  330. */
  331. } else if (secondHomePage) {
  332. result = WebC.PPATH_login;
  333. /// 应该是传输给 "/login.jsp" 的参数。Lin
  334. request.setAttribute(UserC.DEV_userDevRunB, yhsb); // CoreConstVars.LOGIN_PAGE_YHSB。Lin
  335. ///
  336. /* 再去掉,写 Request."userinfo" -- 没用到,用到再弄。Lin
  337. setUserInfoIntoRequest(request, yhsb.getRyid());
  338. */
  339. } else {
  340. result = WebC.PPATH_fstLogin;
  341. }
  342. return result;
  343. // }
  344. // } // 相应地去掉。Lin
  345. } catch (Exception e) {
  346. /* 改,去掉 e.printStackTrace(),改用 log4j -- 按 IDEA 规范。Lin
  347. e.printStackTrace();
  348. */ log4j.error("IndexS.getMisIndexPath() 异常", e);
  349. /* 再去掉,用 'try' with sources。Lin
  350. } finally {
  351. if (wdgdba_maybe_null != null)
  352. wdgdba_maybe_null.close();
  353. */
  354. }
  355. return null;
  356. }
  357. // 来自 VisitUtil.setUserInfoIntoRequest(HttpServletRequest request,Long userid)。Lin
  358. // userid 改为 long
  359. /* 再去掉,写 Request."userinfo" -- 没用到,用到再弄。Lin
  360. private static void setUserInfoIntoRequest(HttpServletRequest request, long userid) {
  361. /// * 去掉 appName,不支持多个应用。Lin
  362. // String appName = WdLoginUtil.getLoginedAppName(request);
  363. // WebApp app;
  364. // if (userid==null) {
  365. // } else if (StringUtil.isNull(appName)) {
  366. // System.out.println("获取不到appname");
  367. // } else if ((app = WD.getApp(appName)) == null) {
  368. // System.out.println("找不到app:" + appName);
  369. // } else {
  370. /// *
  371. /// * 直接用 SsDb.makeConn(),使用默认 JNDI。Lin
  372. // String jndi = app.getDefaultDbJndiName();
  373. // try (GeneralDBAccess gdbadc = GeneralDBAccess.getInstance(jndi)) {
  374. /// *
  375. try (Db gdbadc = Db.makeConn()) {
  376. /// * 去掉 WD 数据库。Lin
  377. // String sql = "select ry.ryid,yh.zh,ry.xm,ry.yszwj from ry join wd.yh on ry.ryid=yh.yhid where ry.ryid=:RYID";
  378. /// *
  379. String sql = "select RYID,ZH,XM,YSZWJ from RY where RYID=:ryid";
  380. SqlCmd sqlc = new SqlCmd(sql); // SqlCommandImpl。Lin
  381. sqlc.wrLongParm("ryid", userid); // .setString()。Lin
  382. gdbadc.selMapListByC(sqlc) // .selectAsMapList(。Lin
  383. .stream()
  384. .findFirst()
  385. .ifPresent(map -> request.setAttribute("userinfo", map));
  386. } catch (Exception e) {
  387. SsLog.print("用户信息查询失败:" + userid);
  388. }
  389. // } // 去掉 appName。Lin
  390. }
  391. */
  392. // 来自 VisitUtil.(Yhsb) findYhsb11(String logintoken, String deviceId, GeneralDBAccess wdgdba)。Lin
  393. /* 再改用 UserDevRunB,从业务的 RysbPo 分开 -- 剥离 SS。Lin
  394. private static RysbPo findYhsb11(String logintoken, String deviceId, Db wdgdba) throws Exception {
  395. */ private static UserDevRunB selUserDevRunB(String logintoken, String deviceId, Db wdgdba) throws Exception {
  396. if (StringUtils.isNotBlank(deviceId) && StringUtils.isNotBlank(logintoken)) {
  397. // 去掉 StrU.notNull(),直接用 StringUtils.isNotBlank()。Lin
  398. /* 去掉 WD 数据库。Lin
  399. SqlCommandImpl cmd = new SqlCommandImpl(
  400. "select * from wd.yhsb where bs=:bs and token=:token");
  401. */
  402. /* 再改用 UserDevRunB,从业务的 RysbPo 分开 -- 剥离 SS。Lin
  403. SqlCmd cmd = new SqlCmd("select * from RYSB where BS=:bs and LP=:token");
  404. */ SqlCmd cmd = new SqlCmd("select SFZCSPB from RYSB where BS=:bs and LP=:lp");
  405. cmd.wrStrParm("lp", logintoken); // .setString()。Lin
  406. cmd.wrStrParm("bs", deviceId); // .setString()。Lin
  407. SsLog.print("index.do:" + cmd);
  408. wdgdba.doSelByC(cmd);
  409. if (wdgdba.rowNum == 1) {
  410. /* 再改用 UserDevRunB,从业务的 RysbPo 分开 -- 剥离 SS。Lin
  411. RysbPo yhsb = new RysbPo(); // Yhsb。Lin
  412. wdgdba.loadPo(yhsb); // getValuesIntoBean()。Lin
  413. return yhsb;
  414. */
  415. UserDevRunB yhsb = new UserDevRunB();
  416. yhsb.id = deviceId;
  417. yhsb.token = logintoken;
  418. yhsb.isFormChk = wdgdba.rdBoolCol("sfzcspb");
  419. return yhsb;
  420. }
  421. }
  422. return null;
  423. }
  424. }