@RequestMapping(
     value = "/modifyLast/{id}",
     method = {RequestMethod.GET, RequestMethod.POST})
 public String modifyLast(@PathVariable Long id, String type, Map<String, Object> map, Page page) {
   type = StringUtils.isBlank(type) ? InvestDirectionEnum.QI_HUO.getValue() : type;
   BizTransRecordVO vo;
   try {
     vo = transRecordService.findLastRecord(id, type);
     if (null != vo) {
       BizTransRecord transRecord = transRecordService.get(vo.getId());
       map.put("id", transRecord.getId() + "");
       map.put("investType", transRecord.getInvestType());
       map.put(
           "investTypeName",
           InvestDirectionEnum.getInvestDirectionEnum(transRecord.getInvestType()).getName());
       map.put("fee", getRealValue(transRecord.getFee()));
       map.put("gainsAndLosses", getRealValue(transRecord.getGainsAndLosses()));
       map.put("currIncome", getRealValue(transRecord.getCurrIncome()));
       map.put("currOutcome", getRealValue(transRecord.getCurrOutcome()));
       map.put("currValue", getRealValue(transRecord.getCurrValue()));
       map.put("lastDayValue", getRealValue(transRecord.getLastDayValue()));
       map.put("totalGainsAndLosses", transRecord.getTotalGainsAndLosses());
       map.put("origionValue", getRealValue(transRecord.getOrigionValue()));
       map.put("status", transRecord.getStatus());
       map.put("importDate", transRecord.getImportDate());
       map.put("memberId", transRecord.getMemberId() + "");
     } else {
       return null;
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   return MODIFY_LAST;
 }
 @RequestMapping(
     value = "/findTransRecordTotal",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String findTransRecordTotal(HttpServletRequest request) {
   String memberNo = request.getParameter("memberNo");
   String investType = request.getParameter("investType");
   String startDate = request.getParameter("startDate");
   String endDate = request.getParameter("endDate");
   Map<String, Object> paramMap = new HashMap<String, Object>();
   StringBuilder dates = new StringBuilder();
   StringBuilder values = new StringBuilder();
   try {
     // 获取大师信息
     BizMember member = memberService.getBizMemberByMemberNo(memberNo);
     if (null == member) {
       return AjaxReturnInfo.returnErr("该大师不存在");
     }
     List<BizTransRecordVO> list =
         transRecordService.findTransRecrorByMemberAndTypeAndDateAndStatus(
             member.getId(), investType, startDate, endDate, "S");
     for (BizTransRecordVO vo : list) {
       if (StringUtil.isEmpty(vo.getTotalGainsAndLosses())) {
         values.append(0).append(",");
       } else {
         values
             .append(
                 StringUtil.substring(
                     vo.getTotalGainsAndLosses(), vo.getTotalGainsAndLosses().length() - 1))
             .append(",");
       }
       dates
           .append(
               DateUtil.date2String(
                   DateUtil.string2Date(vo.getImportDate(), DateUtil.PATTERN_DATE), "MMdd"))
           .append(",");
     }
     paramMap.put("dates", StringUtil.deleteLastOfChar(dates, ","));
     paramMap.put("values", StringUtil.deleteLastOfChar(values, ","));
   } catch (Exception e) {
     // 错误日志打印
     // 跳转到错误页面
     e.printStackTrace();
   }
   return AjaxReturnInfo.returnSuc(paramMap);
 }
 @RequestMapping(
     value = "/findLastTransRecord2",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String findLastTransRecord2(
     @RequestParam String type, @RequestParam String dateStr, @RequestParam Long id) {
   BizTransRecord record = transRecordService.get(id);
   Map<String, Object> paramMap = new HashMap<String, Object>();
   // 得到上日权益
   try {
     // 上日交易
     BizTransRecordVO vo =
         transRecordService.findPreviousTransRecord(
             record.getMemberId(), type, DateUtil.string2Date(dateStr, DateUtil.PATTERN_DATE));
     if (vo == null) { // 表示上日权益没有
       paramMap.put("isHave", "false");
     } else {
       paramMap.put("isHave", "true");
       paramMap.put("lastDayValue", vo.getCurrValue() / 100.0);
     }
     BizTransRecordVO totalInfo =
         transRecordService.queryTotalInfoBeforeOneDate(record.getMemberId(), type, dateStr);
     paramMap.put(
         "totalInCome",
         totalInfo.getTotalIncome() == null ? 0 : totalInfo.getTotalIncome() / 100.0);
     paramMap.put(
         "totalOutCome",
         totalInfo.getTotalOutcome() == null ? 0 : totalInfo.getTotalOutcome() / 100.0);
   } catch (Exception e) {
     e.printStackTrace();
   }
   return AjaxReturnInfo.returnSuc(paramMap);
 }
 /**
  * @param map
  * @return
  */
 @RequestMapping(
     value = "/findTransRrcordByMemberAndTypeForWeek",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String findTransRrcordByMemberAndTypeForWeek(
     Page page, Map<String, Object> map, HttpServletRequest request) {
   String memberNo = request.getParameter("memberNo");
   // 获取大师信息
   BizMember member = memberService.getBizMemberByMemberNo(memberNo);
   if (null == member) {
     return AjaxReturnInfo.returnErr("该大师不存在");
   }
   List<BizTransRecordVO> recordVOS =
       transRecordService.findTransRrcordByMemberAndTypeAndStatusForWeek(
           page, member.getId(), "S");
   List<Map<String, String>> temp = new ArrayList<Map<String, String>>();
   double f = (100.0);
   for (BizTransRecordVO recordVO : recordVOS) {
     Map<String, String> tempMap = new HashMap<String, String>();
     tempMap.put("id", recordVO.getId() + "");
     tempMap.put(
         "investTypeStr",
         InvestDirectionEnum.getInvestDirectionEnum(recordVO.getInvestType()).getName());
     tempMap.put(
         "origionValueWYuan", getRealNumWithTwo(recordVO.getOrigionValue() / f + "") + "元");
     tempMap.put("currValueWYuan", getRealNumWithTwo(recordVO.getCurrValue() / f + "") + "元");
     tempMap.put("importDate", recordVO.getImportDate());
     temp.add(tempMap);
   }
   return PageUtils.toJsonString(page, temp);
 }
 /**
  * 初期资金
  *
  * @param type
  * @return
  */
 @RequestMapping(
     value = "/findFristTransRecord",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String findFristTransRecord(@RequestParam String type) {
   BizMember member = (BizMember) HttpReceiver.getHttpSession().getAttribute("member");
   if (null == member) {
     AjaxReturnInfo.returnErr("请您先首页登录!");
   }
   long memberId = member.getId();
   Map<String, Object> paramMap = new HashMap<String, Object>();
   BizTransRecordVO transRecord = transRecordService.findFirstTransRecord(memberId, type);
   if (transRecord != null) {
     paramMap.put(
         BizTransRecordConstant.EXISTENCE_OF_FIRST, BizTransRecordConstant.EXIST_OF_FIRST);
     paramMap.put(
         BizTransRecordConstant.ORIGION_VALUES,
         transRecord.getOrigionValue() == null ? 0.0 : transRecord.getOrigionValue() / 100.0);
   } else {
     paramMap.put(
         BizTransRecordConstant.EXISTENCE_OF_FIRST, BizTransRecordConstant.NOT_EXIST_OF_FIRST);
   }
   return AjaxReturnInfo.returnSuc(paramMap);
 }
 @RequestMapping(
     value = "/modifyLast1",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String modifyLast1(HttpServletRequest request) {
   String type = request.getParameter("type");
   String id = request.getParameter("id");
   type = StringUtils.isBlank(type) ? InvestDirectionEnum.QI_HUO.getValue() : type;
   BizTransRecordVO vo;
   try {
     vo = transRecordService.findLastRecord(Long.parseLong(id), type);
     if (null != vo) {
       BizTransRecord record = transRecordService.get(vo.getId());
       record.setInvestType(
           InvestDirectionEnum.getInvestDirectionEnum(record.getInvestType()).getName());
       return AjaxReturnInfo.returnSuc(record);
     } else {
       return null;
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   return null;
 }
 /**
  * 上日权益级累计信息查询
  *
  * @param type
  * @param dateStr
  * @return
  */
 @RequestMapping(
     value = "/findLastTransRecord",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String findLastTransRecord(
     @RequestParam String type, @RequestParam String dateStr) {
   BizMember member = (BizMember) HttpReceiver.getHttpSession().getAttribute("member");
   if (null == member) {
     return AjaxReturnInfo.returnErr("请您先首页登录!");
   }
   long memberId = member.getId();
   Map<String, Object> paramMap = new HashMap<String, Object>();
   // 得到上日权益
   try {
     // 当日交易
     BizTransRecordVO currRecord = transRecordService.findCurrTransRecord(memberId, type, dateStr);
     if (currRecord != null) {
       return AjaxReturnInfo.returnErr("当天记录不得重复录入");
     }
     // 上日交易
     BizTransRecordVO vo =
         transRecordService.findPreviousTransRecord(
             memberId, type, DateUtil.string2Date(dateStr, DateUtil.PATTERN_DATE));
     if (vo == null) { // 表示上日权益没有
       paramMap.put("isHave", "false");
     } else {
       paramMap.put("isHave", "true");
       paramMap.put("lastDayValue", vo.getCurrValue() / 100.0);
     }
     BizTransRecordVO totalInfo =
         transRecordService.queryTotalInfoBeforeOneDate(memberId, type, dateStr);
     paramMap.put(
         "totalInCome",
         totalInfo.getTotalIncome() == null ? 0 : totalInfo.getTotalIncome() / 100.0);
     paramMap.put(
         "totalOutCome",
         totalInfo.getTotalOutcome() == null ? 0 : totalInfo.getTotalOutcome() / 100.0);
   } catch (Exception e) {
     e.printStackTrace();
   }
   return AjaxReturnInfo.returnSuc(paramMap);
 }
 @RequestMapping(
     value = "/showLast",
     method = {RequestMethod.GET, RequestMethod.POST})
 public String showLast(Page page, String keywords, Map<String, Object> map) {
   List<BizTransRecordVO> records = transRecordService.findTransRecordToReview(page);
   List<Map<String, String>> recordList = new ArrayList<Map<String, String>>();
   if (!CollectionUtils.isEmpty(records)) {
     Map<Long, BizMember> cacheMap = new HashMap<Long, BizMember>();
     for (BizTransRecordVO vo : records) {
       Map<String, String> tempMap = new HashMap<String, String>();
       String name = "该用户已经被删除!";
       String memberNo = "无";
       String isVal = "";
       if (!StringUtils.isBlank(vo.getMemberId())) {
         Long memberId = Long.parseLong(vo.getMemberId());
         BizMember member =
             cacheMap.get(memberId) == null ? memberService.get(memberId) : cacheMap.get(memberId);
         name = member.getName();
         memberNo = member.getMemberNo();
         BizInvestion investion =
             investionService.findByMemberIdAndInvestDirection(
                 Long.parseLong(vo.getMemberId()), vo.getInvestType());
         if (null == investion) {
           isVal = "无";
         } else {
           isVal = StringUtils.equals(investion.getIsValidated(), "1") ? "赛" : "无";
         }
       }
       tempMap.put("id", vo.getId() + "");
       tempMap.put(
           "investTypeStr",
           InvestDirectionEnum.getInvestDirectionEnum(vo.getInvestType()).getName());
       tempMap.put("name", name);
       tempMap.put("memberNo", memberNo);
       tempMap.put("isVal", isVal);
       tempMap.put("origionValue", getRealString(vo.getOrigionValue()) + "");
       tempMap.put("currValue", getRealString(vo.getCurrValue()) + "");
       tempMap.put("lastDayValue", getRealString(vo.getLastDayValue()) + "");
       tempMap.put("fee", getRealString(vo.getFee()) + "");
       tempMap.put("gainsAndLosses", getRealString(vo.getGainsAndLosses()) + "");
       tempMap.put("currIncome", getRealString(vo.getCurrIncome()) + "");
       tempMap.put("currOutcome", getRealString(vo.getCurrOutcome()) + "");
       recordList.add(tempMap);
     }
   }
   map.put("page", page);
   map.put("records", recordList);
   map.put("keywords", keywords);
   return SHOW_LAST;
 }
 /**
  * @param map
  * @return
  */
 @RequestMapping(
     value = "/myTransRecords",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String myTransRecords(
     Page page, Map<String, Object> map, HttpServletRequest request) {
   BizMember member = (BizMember) HttpReceiver.getHttpSession().getAttribute("member");
   if (null == member) {
     return AjaxReturnInfo.returnErr("请您先首页登录!");
   }
   List<BizTransRecordVO> recordVOS =
       transRecordService.findTransRecordByUserForSubmit(page, member.getId());
   List<Map<String, String>> temp = new ArrayList<Map<String, String>>();
   double divi = 100.0;
   for (BizTransRecordVO recordVO : recordVOS) {
     Map<String, String> tempMap = new HashMap<String, String>();
     tempMap.put("id", recordVO.getId() + "");
     tempMap.put("investTypeStr", recordVO.getInvestTypeStr());
     tempMap.put("importDate", recordVO.getImportDate());
     tempMap.put(
         "currIncomeWYuan",
         (null == recordVO.getCurrIncome() ? 0 : recordVO.getCurrIncome()) / divi + "");
     tempMap.put(
         "currOutcomeWYuan",
         (null == recordVO.getCurrOutcome() ? 0 : recordVO.getCurrOutcome()) / divi + "");
     tempMap.put("currValueWYuan", recordVO.getCurrValue() / divi + "");
     tempMap.put(
         "lastDayValueWYuan",
         (null == recordVO.getLastDayValue() ? 0 : recordVO.getLastDayValue()) / divi + "");
     tempMap.put("status", recordVO.getStatus());
     String statusName = "";
     if (StringUtils.equals(recordVO.getStatus(), "I")) {
       statusName = "审核中";
     } else if (StringUtils.equals(recordVO.getStatus(), "S")) {
       statusName = "审核通过";
     } else if (StringUtils.equals(recordVO.getStatus(), "F")) {
       BizReviewLog log = reviewLogService.getBizReviewLog(recordVO.getId(), "TRANS_RECORD");
       if (null != log) {
         tempMap.put("failReason", log.getComment());
       }
       statusName = "审核退回";
     } else {
       statusName = "莫名其妙";
     }
     tempMap.put("statusName", statusName);
     temp.add(tempMap);
   }
   return PageUtils.toJsonString(page, temp);
 }
 @RequestMapping(
     value = "/showReviewed1/{id}",
     method = {RequestMethod.GET, RequestMethod.POST})
 public String showReviewed1(@PathVariable Long id, Page page, Map<String, Object> map) {
   List<BizTransRecordVO> list =
       transRecordService.findTransRrcordByMemberAndTypeAndStatusForWeek(
           page, id, TransStatusEnum.S.getValue());
   List<Map<String, String>> temp = new ArrayList<Map<String, String>>();
   double divi = 1000000.0;
   for (BizTransRecordVO recordVO : list) {
     Map<String, String> tempMap = new HashMap<String, String>();
     tempMap.put("id", recordVO.getId() + "");
     tempMap.put(
         "investTypeStr",
         InvestDirectionEnum.getInvestDirectionEnum(recordVO.getInvestType()).getName());
     tempMap.put("importDate", recordVO.getImportDate());
     tempMap.put(
         "currIncomeWYuan",
         (null == recordVO.getCurrIncome() ? 0 : recordVO.getCurrIncome()) / divi + "");
     tempMap.put(
         "currOutcomeWYuan",
         (null == recordVO.getCurrOutcome() ? 0 : recordVO.getCurrOutcome()) / divi + "");
     tempMap.put("currValueWYuan", recordVO.getCurrValue() / divi + "");
     tempMap.put(
         "lastDayValueWYuan",
         (null == recordVO.getLastDayValue() ? 0 : recordVO.getLastDayValue()) / divi + "");
     tempMap.put("status", recordVO.getStatus());
     String statusName = "";
     if (StringUtils.equals(recordVO.getStatus(), "I")) {
       statusName = "审核中";
     } else if (StringUtils.equals(recordVO.getStatus(), "S")) {
       statusName = "审核通过";
     } else if (StringUtils.equals(recordVO.getStatus(), "F")) {
       BizReviewLog log = reviewLogService.getBizReviewLog(recordVO.getId(), "TRANS_RECORD");
       if (null != log) {
         tempMap.put("failReason", log.getComment());
       }
       statusName = "审核退回";
     } else {
       statusName = "莫名其妙";
     }
     tempMap.put("statusName", statusName);
     temp.add(tempMap);
   }
   map.put("page", page);
   map.put("data", temp);
   return SHOW_REVIEWED;
 }