@RequestMapping(value = "/reviewTransRecord", method = RequestMethod.POST) public @ResponseBody String reviewTransRecord( TransRecordReviewForm form, HttpServletRequest request) { BizTransRecord transRecord = transRecordService.get(form.getTransRecordId()); // 后续应加上判断此刻该记录的状态,应先锁,后判断状态,再更新 if (isPass(form)) { transRecord.setStatus(TransStatusEnum.S.getValue()); transRecord.setGmtValidate(DateUtil.getNowDate()); } else { transRecord.setStatus(TransStatusEnum.F.getValue()); } transRecordService.saveWithStatisAndReview(transRecord, form); return new AjaxObject("审核成功").toString(); }
@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("添加大师收藏异常!"); } }
/** * 组装交易对象 * * @param request * @return */ private BizTransRecord getRecord(HttpServletRequest request) { String id = request.getParameter("id"); if (StringUtils.isBlank(id)) { return null; } BizTransRecord record = transRecordService.get(Long.parseLong(id)); String fee = request.getParameter("fee"); String gainsAndLosses = request.getParameter("gainsAndLosses"); String currValue = request.getParameter("currValue"); String totleGainsAndLosses = request.getParameter("totleGainsAndLosses"); String currIncome = request.getParameter("currIncome"); String currOutcome = request.getParameter("currOutcome"); record.setFee(getRealLong(fee)); record.setCurrIncome(getRealLong(currIncome)); record.setCurrOutcome(getRealLong(currOutcome)); record.setTotalGainsAndLosses(totleGainsAndLosses); record.setGainsAndLosses(getRealLong(gainsAndLosses)); record.setCurrValue(getRealLong(currValue)); record.setGmtModified(DateUtil.getNowDate()); return record; }