/** * @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 = "/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 = "/create", method = RequestMethod.POST) public @ResponseBody String create(HttpServletRequest request) { try { BizMember member = HttpReceiver.getCurrentMember(); if (null == member) { return AjaxReturnInfo.returnSuc("请您先首页登录!"); } String memberNo = request.getParameter("memberNo"); BizMember tempMem = memberService.getBizMemberByMemberNo(memberNo); BizMemberCollect collect = new BizMemberCollect(); collect.setMemberId(member.getId()); collect.setCollectedMemberId(tempMem.getId()); Date date = DateUtil.getNowDate(); collect.setGmtCreate(date); collect.setGmtModified(date); memberCollectService.save(collect); return AjaxReturnInfo.returnSuc("添加大师收藏成功!"); } catch (Exception e) { return AjaxReturnInfo.returnErr("添加大师收藏异常!"); } }