コード例 #1
0
 @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;
 }
コード例 #2
0
 @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;
 }