public String emailModifySubmit() { logger.info("11111___________"); String mothed = ServletActionContext.getRequest().getMethod(); if (!"post".equalsIgnoreCase(mothed)) { return "sessionDestory"; } String usAccount = ServletActionContext.getRequest().getParameter("usAccount"); String accountNewPass = ServletActionContext.getRequest().getParameter("accountNewPass"); String validatecode = ServletActionContext.getRequest().getParameter("validatecode"); if (usAccount == null || accountNewPass == null || validatecode == null) { ServletActionContext.getRequest().setAttribute("checkFlag", "1"); return "email"; } String validateCode = (String) ActionContext.getContext().getSession().get(Constants.VALIDATE_RECOVER_CODE_EMAIL); if (!validatecode.equalsIgnoreCase(validateCode)) { ServletActionContext.getRequest().setAttribute("checkFlag", "2"); return "email"; } if (!iAccountInfo.isNotExistAccountName(usAccount)) { AuctionAccount auctionAccount = iAccountInfo.getAccountInfoByAccountName(usAccount); if ("0".equals(auctionAccount.getAccountStatus())) { ServletActionContext.getRequest().setAttribute("checkFlag", "4"); return "email"; } else if ("2".equals(auctionAccount.getAccountStatus())) { ServletActionContext.getRequest().setAttribute("checkFlag", "5"); return "email"; } else if ("1".equals(auctionAccount.getAccountStatus())) { auctionAccount.setAccountPass(Tools.StingToMD5(accountNewPass)); auctionAccount.setUpdateTime(new Date()); iAccountInfo.saveAuctionAccount(auctionAccount); ServletActionContext.getRequest().setAttribute("checkFlag", "8"); return "email"; } else { ServletActionContext.getRequest().setAttribute("checkFlag", "1"); return "email"; } } else { ServletActionContext.getRequest().setAttribute("checkFlag", "1"); return "email"; } }
public String search() throws UnsupportedEncodingException { logger.info("11111___________"); String searchType = ServletActionContext.getRequest().getParameter("searchType"); String companyFlag = ServletActionContext.getRequest().getParameter("companyFlag"); String auctionType = ServletActionContext.getRequest().getParameter("auctionType"); String keyVal = ServletActionContext.getRequest().getParameter("keyVal"); String key = java.net.URLDecoder.decode(keyVal, "UTF-8"); if (companyFlag == null || !Tools.checkRegen("^[0-9][0-9]{0,6}$", companyFlag)) { return "sessionDestory"; } if (auctionType == null || !Tools.checkRegen("^[0-9]{1,1}$", auctionType)) { return "sessionDestory"; } String result = ""; if (("1").equals(searchType)) { result = "auctionSearch"; String companyVal = null; String currentPage = ServletActionContext.getRequest().getParameter("currentPage"); if (currentPage == null || "".equals(currentPage)) { currentPage = "1"; } ServletActionContext.getRequest().setAttribute("currentPage", currentPage); String url = ServletActionContext.getActionMapping().getName() + "?searchType=" + searchType + "&companyFlag=" + companyFlag + "&auctionType=" + auctionType + "&keyVal=" + java.net.URLEncoder.encode(keyVal, "UTF-8") + "&"; if (("0").equals(companyFlag)) { } else { companyVal = companyFlag; } long count = Long.valueOf( iAuctionInfo.getAuctionInfoDtoCountInSearch( companyVal, auctionType, "5", ("1"), key)); BasePage basePage = new BasePage(count, currentPage, url); List<AuctionInfoDto> AuctionInfoDtoList = iAuctionInfo.getAuctionInfoDtoListInSearch( companyVal, auctionType, "5", ("1"), basePage, key); ServletActionContext.getRequest().setAttribute("basePage", basePage); if (AuctionInfoDtoList != null && AuctionInfoDtoList.size() > 0) { for (int i = 0; i < AuctionInfoDtoList.size(); i++) { AuctionInfoDto auctionInfoDto = AuctionInfoDtoList.get(i); auctionInfoDto.setCompanyName( iCompanyInfo.getCompanyInfo(auctionInfoDto.getAuctionCompanyId()).getCompanyName()); auctionInfoDto.setCompanyInterfaceFlag( iCompanyInfo .getCompanyInfo(auctionInfoDto.getAuctionCompanyId()) .getCompanyInterfaceFlag()); String imgType = auctionInfoDto.getAuctionPicType(); // img type if ("1".equals(imgType)) { UploadImgInfo uploadImgInfo = iUploadImgInfo.getUploadImgInfo("1", auctionInfoDto.getAuctionCompanyId()); if (uploadImgInfo != null && uploadImgInfo.getUploadUrl() != null) { auctionInfoDto.setAuctionPicUrl(uploadImgInfo.getUploadUrl()); } } else if ("3".equals(imgType)) { UploadImgInfo uploadImgInfo = iUploadImgInfo.getUploadImgInfo("2", "" + auctionInfoDto.getId()); if (uploadImgInfo != null && uploadImgInfo.getUploadUrl() != null) { auctionInfoDto.setAuctionPicUrl(uploadImgInfo.getUploadUrl()); } } } } ServletActionContext.getRequest().setAttribute("auctionInfoList", AuctionInfoDtoList); } else if (("2").equals(searchType)) { result = "itemSearch"; String companyVal = null; String currentPage = ServletActionContext.getRequest().getParameter("currentPage"); if (currentPage == null || "".equals(currentPage)) { currentPage = "1"; } ServletActionContext.getRequest().setAttribute("currentPage", currentPage); String url = ServletActionContext.getActionMapping().getName() + "?searchType=" + searchType + "&companyFlag=" + companyFlag + "&auctionType=" + auctionType + "&keyVal=" + java.net.URLEncoder.encode(keyVal, "UTF-8") + "&"; if (("0").equals(companyFlag)) { } else { companyVal = companyFlag; } long count = Long.valueOf(iItemInfo.getItemInfoCountInSearch(companyVal, auctionType, key)); BasePage basePage = new BasePage(count, currentPage, url); List<Object[]> itemInfoList = iItemInfo.getItemInfoListInSearch(companyVal, auctionType, basePage, key); ServletActionContext.getRequest().setAttribute("basePage", basePage); if (itemInfoList != null && itemInfoList.size() > 0) { for (int j = 0; j < itemInfoList.size(); j++) { Object[] object = itemInfoList.get(j); String itemFlag = ""; if ("1".equals(currentPage)) { itemFlag = object[0].toString(); // item id } else { itemFlag = object[1].toString(); // item id Object[] objectNew = new Object[object.length - 1]; for (int z = 0; z < objectNew.length; z++) { objectNew[z] = object[z + 1]; } object = objectNew; } List<UploadImgInfo> uploadImgInfoList = iUploadImgInfo.getUploadImgInfoList("5", itemFlag); if (uploadImgInfoList == null) { object[object.length - 1] = "0"; object[object.length - 2] = ""; } else { if (uploadImgInfoList.size() == 0) { object[object.length - 1] = "0"; object[object.length - 2] = ""; } else if (uploadImgInfoList.size() == 1) { object[object.length - 1] = "0"; object[object.length - 2] = uploadImgInfoList.get(0).getUploadUrl(); } else if (uploadImgInfoList.size() > 1) { object[object.length - 1] = "1"; object[object.length - 2] = uploadImgInfoList.get(0).getUploadUrl(); } } itemInfoList.set(j, object); } } ServletActionContext.getRequest().setAttribute("itemInfoList", itemInfoList); } else { result = "sessionDestory"; } List<AuctionInfoDto> auctionInfoDtoListTop = iAuctionInfo.getAuctionInfoDtoListTop(); ServletActionContext.getRequest().setAttribute("auctionInfoDtoListTop", auctionInfoDtoListTop); List<CompanyInfoDto> companyInfoDtoList = iCompanyInfo.getCompanyInfoDtoList(); ServletActionContext.getRequest().setAttribute("companyInfoDtoList", companyInfoDtoList); ServletActionContext.getRequest().setAttribute("key", key); ServletActionContext.getRequest().setAttribute("companyFlag", companyFlag); ServletActionContext.getRequest().setAttribute("auctionType", auctionType); return result; }