コード例 #1
0
  @Log(message = "添加了transRecord,id:{0}。")
  @RequestMapping(value = "/create", method = RequestMethod.POST)
  public String create(
      @RequestParam MultipartFile[] myfiles1,
      @RequestParam MultipartFile[] myfiles2,
      HttpServletRequest request) {
    // 如果只是上传一个文件,则只需要MultipartFile类型接收文件即可,而且无需显式指定@RequestParam注解
    // 如果想上传多个文件,那么这里就要用MultipartFile[]类型来接收文件,并且还要指定@RequestParam注解
    // 并且上传多个文件时,前台表单中的所有<input
    // type="file"/>的name都应该是myfiles1,2,否则参数里的myfiles无法获取到所有上传的文件

    BizTransRecord transRecord = buildBizTransRecord(request);
    // 设置为初始状态
    transRecord.setStatus(TransStatusEnum.I.getValue());
    HttpSession session = HttpReceiver.getHttpSession();
    BizMember member = (BizMember) session.getAttribute("member");
    transRecord.setMemberId(member.getId());
    Map<String, String> extendMap = new HashMap<String, String>();
    extendMap.put("memberNo", member.getMemberNo());
    try {
      transRecordService.save(transRecord, myfiles1, myfiles2, extendMap);
    } catch (ServiceException e) {
      return "redirect:/personalPage?suc=false";
    }
    return "redirect:/personalPage?suc=true";
  }
コード例 #2
0
 @RequestMapping(
     value = "/findAll",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String findAll(
     Page page, Map<String, Object> map, @RequestParam String type) {
   BizMember member = (BizMember) HttpReceiver.getHttpSession().getAttribute("member");
   if (null == member) {
     AjaxReturnInfo.returnErr("请您先首页登录!");
   }
   List<BizTransRecord> list = transRecordService.findAllByType(page, type);
   if (CollectionUtils.isEmpty(list)) {
     return PageUtils.toJsonString(page, new ArrayList<Map<String, String>>());
   }
   return PageUtils.toJsonString(page, list);
 }
コード例 #3
0
 /**
  * @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);
 }
コード例 #4
0
 @RequestMapping(
     value = "/list",
     method = {RequestMethod.GET, RequestMethod.POST})
 public String list(Page page, Map<String, Object> map, BizMember member) {
   BizMember admin = memberService.getAdminAccount();
   if (null == admin) {
     return LIST;
   }
   String type = HttpReceiver.getHttpServletReqeuest().getParameter("keywords");
   List<BizSiteMessage> list = null;
   if (StringUtils.isBlank(type)) {
     list = siteMessageService.findAll(page);
   } else {
     list = siteMessageService.findByMessageType(page, type);
   }
   List<Map<String, String>> mapList = new ArrayList<Map<String, String>>();
   if (CollectionUtils.isNotEmpty(list)) {
     for (BizSiteMessage message : list) {
       Map<String, String> tempMap = new HashMap<String, String>();
       tempMap.put("type", SiteMessageTypeEnum.getEnum(message.getMessageType()).getName());
       BizMember tempMem = memberService.get(message.getMemberId());
       tempMap.put("id", message.getId() + "");
       tempMap.put("name", (null == tempMem) ? "该用户已经被删除!" : tempMem.getName());
       tempMap.put("content", message.getMessageContent());
       tempMap.put("status", MsgStatusEnum.getMsgUseEnum(message.getStatus()).getName());
       tempMap.put(
           "time", DateUtil.date2String(message.getGmtCreate(), BizConstant.DATE_TIME_FORMAT));
       mapList.add(tempMap);
     }
   }
   List<Map<String, String>> tempList = new ArrayList<Map<String, String>>();
   for (SiteMessageTypeEnum enu : SiteMessageTypeEnum.values()) {
     Map<String, String> temp = new HashMap<String, String>();
     temp.put("name", enu.getName());
     temp.put("value", enu.getValue());
     tempList.add(temp);
   }
   map.put("types", tempList);
   map.put("page", page);
   map.put("data", mapList);
   return LIST;
 }
コード例 #5
0
 @RequestMapping(
     value = "/list",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody String listTop(Page page, Map<String, Object> map) {
   BizMember member = HttpReceiver.getCurrentMember();
   if (null == member) {
     return PageUtils.toJsonString(page, null);
   }
   List<BizMemberCollect> collectList = memberCollectService.findByMemberId(page, member.getId());
   List<Map<String, String>> mapList = new ArrayList<Map<String, String>>();
   for (BizMemberCollect collect : collectList) {
     Map<String, String> tempMap = new HashMap<String, String>();
     BizMember mem = memberService.get(collect.getCollectedMemberId());
     tempMap.put("id", collect.getId() + "");
     tempMap.put("name", mem.getName());
     tempMap.put("memberNo", mem.getMemberNo());
     mapList.add(tempMap);
   }
   return PageUtils.toJsonString(page, mapList);
 }
コード例 #6
0
 /**
  * 上日权益级累计信息查询
  *
  * @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);
 }
コード例 #7
0
 @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("添加大师收藏异常!");
   }
 }
コード例 #8
0
 /**
  * 初期资金
  *
  * @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);
 }