/**
  * @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);
 }
 @RequestMapping(value = "/update/{id}", method = RequestMethod.GET)
 public String preUpdate(@PathVariable Long id, Map<String, Object> map) {
   BizTransRecord transRecord = transRecordService.get(id);
   if (null == transRecord) {
     return UPDATE;
   }
   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());
   BizReviewLog log = reviewLogService.getBizReviewLog(transRecord.getId(), "TRANS_RECORD");
   if (null != log) {
     map.put("failReason", log.getComment());
   }
   return UPDATE;
 }
 @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 = "/showReviewed/{id}",
     method = {RequestMethod.GET, RequestMethod.POST})
 public String showReviewed(@PathVariable Long id, Page page, Map<String, Object> map) {
   BizTransRecord transRecord = transRecordService.get(id);
   if (null != transRecord) {
     long memberId = transRecord.getMemberId();
     List<BizTransRecord> list =
         transRecordService.findTransRrcordByMemberAndTypeAndStatus(
             page, memberId, transRecord.getInvestType(), TransStatusEnum.S.getValue());
     List<Map<String, String>> temp = new ArrayList<Map<String, String>>();
     double divi = 1000000.0;
     for (BizTransRecord 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;
 }
 @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;
 }
 @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;
 }