@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); }
@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); }
/** * 上日权益级累计信息查询 * * @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); }