发表于: 2018-01-28 21:43:40

1 552



今天完成的事

接着敲项目

public String getInvestRecordList(Long uid, Integer status, Integer page, Integer size) {
logger.info("Display user's invest records, uid = " + uid + ", status = " + status + ", page = " + page + ", size = " + size);
   if (status == null || status < -1 || status > 3) {
map.put("message", "参数不可以为空");
       String json = null;
       try {
json = mapper.writeValueAsString(map);
       } catch (JsonProcessingException e) {
e.printStackTrace();
       }
return json;
   }
if (page == null) {
page = 1;
   }

if (size == null) {
size = 10;
   }

int start = (page - 1) * size;
   if (start < 0) {
start = 0;
   }

try {
List<TInvestment> tInvestments = tInvestmentMapper.selectInvestmenteByUidandStatus(Math.toIntExact(uid), status);
       List<InvestProduct> investProducts = new ArrayList();

       for (TInvestment invest : tInvestments) {

Integer pid = invest.getUpdateBy();
           TProduct product = tProductMapper.getTProductById(Long.valueOf(pid));
           logger.info("取到的关联产品为" + product);
           //map.put(""+pid, product);
           InvestProduct investProduct = new InvestProduct();
           investProduct.setInvestId(invest.getId());
           investProduct.setProductName(product.getName());
           investProduct.setYearRate(product.getYearRate());
           investProduct.setStatus(invest.getStatus());
           investProduct.setTag(product.getTag());
           BigDecimal P = invest.getAlreadyInterest().add(invest.getNotYetInterest());
           investProduct.setPrincipal(P);
           investProduct.setBeginAt(invest.getInterestBeginAt());
           investProduct.setEndAt(invest.getInterestEndAt());
           logger.info("理财记录为" + investProduct);

           investProducts.add(investProduct);
       }
//map.put("investList",tInvestments);

       map.put("investList", investProducts);
       String json = mapper.writeValueAsString(map);
       return json;


   } catch (Exception e) {
e.printStackTrace();
   }

遇到的问题





postman使用不熟练。

 明天的计划

继续敲项目


返回列表 返回列表
评论

    分享到