public ModelAndView index(
      HttpServletRequest request, HttpServletResponse response, ModelAndView mv) {
    Map<String, String> compareSignSelect = new LinkedHashMap<String, String>();
    compareSignSelect.put("gt", "大于");
    compareSignSelect.put("eq", "等于");
    compareSignSelect.put("lt", "小于");
    mv.addObject("compareSignSelect", compareSignSelect);

    Map<String, String> txSignSelect = new LinkedHashMap<String, String>();
    txSignSelect.put("gt", "大于");
    txSignSelect.put("eq", "等于");
    txSignSelect.put("lt", "小于");
    mv.addObject("tbjSignSelect", txSignSelect);

    PageData pd = new PageData(request);

    HashMap<String, Object> list = thisService.getCapital_borrow_repaymentList(pd, mv);

    mv.addObject("list", list);

    Map<String, Object> borrowType = ConfigCache.getCacheList("BorrowType");
    if (borrowType != null) {
      HashMap<String, Object> typeList = (HashMap<String, Object>) borrowType.get("type");
      HashMap<String, Object> borrowTypeData = new LinkedHashMap<>();
      HashMap<String, Object> borrowTypeDataX =
          Common.buildNewKVMap(typeList, "key", "borrow_name");
      borrowTypeData.put(" ", "选择产品类型");
      for (Entry<String, Object> entry : borrowTypeDataX.entrySet()) {
        String ekeyString = entry.getKey();
        String eValueString = entry.getValue() + "";
        borrowTypeData.put(ekeyString, eValueString);
      }

      mv.addObject("borrowType", borrowTypeData);
    }

    Map<String, String> istatus = new LinkedHashMap<String, String>();
    istatus.put("", "==回款状态==");
    istatus.put("0", "还未确认通过");
    istatus.put("1", "已回收");
    istatus.put("7", "待回收");
    mv.addObject("istatus", istatus);

    return this.getTplView(request, response, tplPath, mv);
  }
  public void toExcel(HttpServletRequest request, HttpServletResponse response, ModelAndView mv) {
    PageData pd = new PageData(request);

    HashMap<String, Object> list = thisService.getCapital_borrow_repaymentExcelList(pd, mv);
    String[] arr = {
      "id as ID",
      "borrow_id as 标号",
      "user_name as 投资人",
      "real_name as 真实姓名",
      "capital as 应收本金",
      "interest as 应收利息",
      "use_reward_money as 使用奖励",
      "will_receive_capital as 待收本金",
      "will_receive_interest as 待收利息",
      "interest_fee as 利息管理费",
      "sort_order as 当前期数",
      "total as 总期数",
      "borrow_name as 借款名",
      "borrow_type as 产品名称",
      "deadline as 应收时间",
      "repayment_time as 实收时间",
    };

    Map<String, Object> borrowType = ConfigCache.getCacheList("BorrowType");

    HashMap<String, Object> typeList = (HashMap<String, Object>) borrowType.get("type");
    HashMap<String, Object> borrowTypeDataX = Common.buildNewKVMap(typeList, "key", "borrow_name");
    List<Map<String, Object>> SSData = (List<Map<String, Object>>) list.get("data");
    for (Map<String, Object> thisdata : SSData) {
      thisdata.put(
          "will_receive_capital",
          DfMath.s2sub(thisdata.get("capital") + "", thisdata.get("receive_capital") + ""));
      thisdata.put(
          "will_receive_interest",
          DfMath.s2sub(thisdata.get("interest") + "", thisdata.get("receive_interest") + ""));
      thisdata.put("borrow_type", borrowTypeDataX.get(thisdata.get("borrow_type")) + "");
    }
    ExcelUtil.writeExcel(SSData, "会员待收明细", arr, response);
  }
Example #3
0
  /** 获取初审失败的发送列表,需要传入invest_id */
  @Override
  public List<HashMap<String, String>> getReceiverList(
      String event, HashMap<String, String> map, Connection conn) {
    List<HashMap<String, String>> sendList = new ArrayList<>();
    Map<String, Object> list = ConfigCache.getCacheList("cache_msgset");
    Map<String, Object> msgSetConfig = (Map<String, Object>) list.get("msgset");
    Map<String, Object> PhoneTPL =
        (Map<String, Object>) ConfigCache.getCacheList("msg_phone").get("msgPhone");
    Map<String, Object> SiteTPL =
        (Map<String, Object>) ConfigCache.getCacheList("msg_site").get("msgSite");
    Map<String, Object> EmailTPL =
        (Map<String, Object>) ConfigCache.getCacheList("msg_email").get("msgEmail");

    if (((Map<String, String>) msgSetConfig.get("invest")).containsKey(event)) {
      DataSet msgInfoDS;
      try {
        msgInfoDS =
            T.load("borrow_investor i", conn)
                .LJ("user u ON u.id=i.investor_uid")
                .LJ("borrow_info b ON b.id=i.borrow_id")
                .W(Tools.BuildWhereMap("i.id", map.get("invest_id"), "="))
                .Q(
                    "u.id as uid,u.user_phone,u.user_email,i.investor_capital as '#INVEST_MONEY#',i.investor_interest as '#INVEST_INTEREST#',b.id as '#BORROW_ID#',b.borrow_name as '#BORROW_NAME#',u.user_name as '#UserName#'");
        Map<String, String> msgInfo = BeanMapUtils.dataSetToListMap(msgInfoDS).get(0);

        String setConf = ((Map<String, String>) msgSetConfig.get("borrow")).get(event);
        String msgKeyString = "invest_" + event;
        // logger.info("当前配置:"+setConf+"Key="+msgKeyString+"List="+PhoneTPL);
        if (!StringUtils.isBlank(msgInfo.get("user_phone"))
            && setConf.contains("1")
            && PhoneTPL != null
            && PhoneTPL.containsKey("phone_" + msgKeyString)) { // 手机
          String newTextString =
              MessageManager.replaceHandler(PhoneTPL.get("phone_" + msgKeyString) + "", msgInfo);

          HashMap<String, String> thisReceiver = new HashMap<>();
          thisReceiver.put("type", "phone");
          thisReceiver.put("receiver", msgInfo.get("user_phone"));
          thisReceiver.put("text", newTextString);
          sendList.add(thisReceiver);
        }
        if (!StringUtils.isBlank(msgInfo.get("user_email"))
            && setConf.contains("2")
            && EmailTPL != null
            && EmailTPL.containsKey(msgKeyString)) { // 邮箱
          String newTextString =
              MessageManager.replaceHandler(
                  ((Map<String, String>) EmailTPL.get(msgKeyString)).get("content") + "", msgInfo);
          String newTitleString =
              MessageManager.replaceHandler(
                  ((Map<String, String>) EmailTPL.get(msgKeyString)).get("title") + "", msgInfo);

          HashMap<String, String> thisReceiver = new HashMap<>();
          thisReceiver.put("type", "email");
          thisReceiver.put("receiver", msgInfo.get("user_email"));
          thisReceiver.put("text", newTextString);
          thisReceiver.put("title", newTitleString);
          sendList.add(thisReceiver);
        }
        if (!StringUtils.isBlank(msgInfo.get("uid"))
            && setConf.contains("3")
            && SiteTPL != null
            && SiteTPL.containsKey("site_" + msgKeyString)) { // 站内信
          String newTextString =
              MessageManager.replaceHandler(
                  ((Map<String, String>) SiteTPL.get("site_" + msgKeyString)).get("content") + "",
                  msgInfo);
          String newTitleString =
              MessageManager.replaceHandler(
                  ((Map<String, String>) SiteTPL.get("site_" + msgKeyString)).get("title") + "",
                  msgInfo);

          HashMap<String, String> thisReceiver = new HashMap<>();
          thisReceiver.put("type", "site");
          thisReceiver.put("receiver", msgInfo.get("uid"));
          thisReceiver.put("text", newTextString);
          thisReceiver.put("title", newTitleString);
          sendList.add(thisReceiver);
        }
      } catch (Exception e) {
        logger.error("获取发送列表出错" + e.toString());
      }
    }
    // logger.info("最终获取的列表"+sendList);
    return sendList;
  }