public HashMap<String, Object> getBorrow_failrecheckList(PageData pd, ModelAndView mv) { Connection conn = MySQL.getConnectionReadOnly(true); HashMap<String, Object> list = null; HashMap<String, Object> rp = new HashMap<String, Object>(); WhereUtil whereUtil = new WhereUtil(); whereUtil.setAlias("m", "user"); whereUtil.setAlias("bi", "borrow_info"); whereUtil.setAlias("v", "borrow_verify"); whereUtil.parseSearchMap(pd, whereUtil, conn); whereUtil.getStringCondition("borrow_status", "5", "="); HashMap<String, String> defaultMap = whereUtil.getCommonMap(); rp.put("paramCondition", whereUtil.getParamConditionList()); mv.addObject("defaultMap", defaultMap); // 注册时间 baseService.timeFrame("bi.add_time", whereUtil, pd, mv); // 影响积分 baseService.compareNum("bi.borrow_money", whereUtil, pd, mv); try { list = thisDao.getBorrow_failrecheckList(conn, rp); } catch (Exception e) { logger.error("getBorrow_checkList失败", e); } finally { MySQL.closeConnection(conn); } return list; }
public String doappoint(String uid, String recommendUser) { Connection conn = MySQL.getConnectionReadOnly(false); String ress = ""; Map<String, String> rusInfo = new HashMap<>(); try { DataSet rus = T.load("user", conn).W(Tools.BuildWhereMap("user_name", recommendUser, "=")).Q("id"); rusInfo = BeanMapUtils.dataSetToListMap(rus).get(0); } catch (Exception e) { ress = "输入的推荐人不存在"; } if (rusInfo.size() == 0) ress = "输入的推荐人不存在"; if (uid.equals(rusInfo.get("id"))) ress = "推荐人不能是自己"; try { if (!"".equals(ress)) { return ress; } else { HashMap<String, Object> recommendHashMap = new HashMap<>(); recommendHashMap.put("id", uid); recommendHashMap.put("recommend_id", rusInfo.get("id")); recommendHashMap.put("recommend_type", "2"); recommendHashMap.put("recommend_time", Tools.getLongTime()); BaseDao.update(conn, "user", recommendHashMap, null); MySQL.commit(conn); } } catch (Exception e) { logger.error("doappoint失败", e); MySQL.rollback(conn); return "保存失败"; } finally { MySQL.closeConnection(conn); } return "success"; }
public HashMap<String, Object> getUser_referList(PageData pd, ModelAndView mv) { Connection conn = MySQL.getConnectionReadOnly(true); HashMap<String, Object> list = null; HashMap<String, Object> rp = new HashMap<String, Object>(); WhereUtil whereUtil = new WhereUtil(); whereUtil.setAlias("m", "user"); whereUtil.setAlias("rm", "user"); whereUtil.setAlias("mi", "user_info"); whereUtil.parseSearchMap(pd, whereUtil, conn); HashMap<String, String> defaultMap = whereUtil.getCommonMap(); rp.put("paramCondition", whereUtil.getParamConditionList()); if (pd.rqst().containsKey("pagebar")) rp.put("pagebar", pd.rqst("pagebar")); mv.addObject("defaultMap", defaultMap); // 是否VIP baseService.isVip("isVip", whereUtil, pd, mv); // 注册时间 baseService.timeFrame("m.reg_time", whereUtil, pd, mv); try { list = thisDao.getUser_referList(conn, rp); } catch (Exception e) { logger.error("getUser_bankList失败", e); } finally { MySQL.closeConnection(conn); } return list; }
public Map<String, String> getBorrowInfo(PageData pd, ModelAndView mv) { Connection conn = MySQL.getConnectionReadOnly(true); Map<String, String> list = null; HashMap<String, Object> rp = new HashMap<String, Object>(); rp.put("paramCondition", Tools.BuildWhereMap("b.id", pd.rqst("id"), "=")); try { list = thisDao.getBorrowInfo(conn, rp); } catch (Exception e) { logger.error("getBorrowInfo失败", e); } finally { MySQL.closeConnection(conn); } return list; }
public String removerefer(String uid) { Connection conn = MySQL.getConnectionReadOnly(false); try { HashMap<String, Object> recommendHashMap = new HashMap<>(); recommendHashMap.put("id", uid); recommendHashMap.put("recommend_id", 0); recommendHashMap.put("recommend_type", "0"); recommendHashMap.put("recommend_time", 0); BaseDao.update(conn, "user", recommendHashMap, null); MySQL.commit(conn); } catch (Exception e) { logger.error("doappoint失败", e); MySQL.rollback(conn); return "保存失败"; } finally { MySQL.closeConnection(conn); } return "success"; }
public String editBorrow(PageData pd, Map<String, String> thisBorrowInfo) { // 些标种相关信息 Map<String, Object> borrowTypeConfig = (Map<String, Object>) ((Map<String, Object>) borrowAndInvest.getBorrowTypeConfig(thisBorrowInfo.get("borrow_type"))) .get("borrow"); Connection conn = MySQL.getConnectionReadOnly(false); String[] onlycanEditField = { "id", "can_auto", "deposit_fee", "borrow_fee", "vouch_company_id", "mortgage_id", "collect_time", "collect_day", "borrow_pass", "borrow_max", "borrow_money", "borrow_status", "borrow_info", "borrow_use", "borrow_name", "deal_info", "start_time" }; Map<String, Object> borrowInfoMap = pd.getFormHandlerCan("borrow_info", onlycanEditField); List<String> canEditStatus = Arrays.asList("1", "2", "10"); List<String[]> validatorMap = new ArrayList(); validatorMap.add( Tools.buildValidatorObject( "deal_info", "处理说明不能为空", !StringUtils.isBlank(pd.post("deal_info") + ""))); validatorMap.add( Tools.buildValidatorObject( "borrow_status", "处理状态不正确", canEditStatus.contains(borrowInfoMap.get("borrow_status") + ""))); List<String> fieldCheck = PageData.getError(validatorMap); if (fieldCheck.size() > 0) return fieldCheck.get(0); // 密码标 String password = borrowInfoMap.get("borrow_pass").toString(); if (StringUtils.isBlank(password)) borrowInfoMap.remove("borrow_pass"); else borrowInfoMap.put("borrow_pass", borrowAndInvest.md5(password)); // logger.info("############"+borrowInfoMap.get("start_time")+""); // 预约标开标时间 if (!Common.isBlankInMap(borrowInfoMap, "start_time")) borrowInfoMap.put("start_time", Tools.strToTime(borrowInfoMap.get("start_time") + "")); // 初审通过或者预发布 if ("2".equals(borrowInfoMap.get("borrow_status")) || "10".equals(borrowInfoMap.get("borrow_status"))) { // 初审通过 borrowInfoMap.put("collect_time", Tools.strToTime(borrowInfoMap.get("collect_time") + "")); // 保证金 Tools.printData(borrowTypeConfig); String depositFeeRateString = (borrowTypeConfig != null) ? (String) ((Map<String, Object>) borrowTypeConfig.get("borrowFee")).get("deposit") : "5"; double depositFeeRate = DfMath.s2div(depositFeeRateString, "100", 9); double depositFee = DfMath.round( (DfMath.s2multi(depositFeeRate + "", borrowInfoMap.get("borrow_money") + ""))); borrowInfoMap.put("deposit_fee", depositFee); } HashMap<String, String> AdminInfo = (HashMap<String, String>) Common.getSession("AdminInfo"); // 初审记录 HashMap<String, Object> verifyLogMap = new HashMap<>(); verifyLogMap.put("borrow_id", borrowInfoMap.get("id")); verifyLogMap.put("deal_info", pd.post("deal_info")); verifyLogMap.put("deal_user", AdminInfo.get("id")); verifyLogMap.put("deal_time", Tools.getLongTime()); verifyLogMap.put("deal_status", borrowInfoMap.get("borrow_status")); try { thisDao.eidtBorrowInfo(conn, borrowInfoMap); thisDao.addVerify(conn, verifyLogMap); MySQL.commit(conn); } catch (Exception e) { MySQL.rollback(conn); logger.error("borrow_check失败", e); return "数据修改失败"; } finally { MySQL.closeConnection(conn); } return "success"; }