Authored by qinchao

去掉不用的类

... ... @@ -2,7 +2,6 @@ package com.yohoufo.order.controller;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.order.model.response.AssetsResp;
import com.yohoufo.order.model.response.EntrySellerDepositResp;
import com.yohoufo.order.service.impl.AssetsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -34,17 +33,5 @@ public class AssetsController {
return new ApiResponse.ApiResponseBuilder().code(200).data(resp).message("流水详情").build();
}
/**
* 入驻商家的保证金明细
*/
@RequestMapping(params = "method=ufo.asssets.storedSellerDepositDetail")
@ResponseBody
public ApiResponse getStoredSellerDepositDetail(@RequestParam(name = "uid")int uid,
@RequestParam(value = "page", required = false, defaultValue = "1") int page,
@RequestParam(value = "limit", required = false, defaultValue = "10") int limit){
logger.info("in ufo.sellerOrder.storedSellerDepositDetail, uid {},page {},limit {}", uid, page, limit);
EntrySellerDepositResp resp=assetsService.getStoredSellerDepositDetail(uid, page, limit);
return new ApiResponse.ApiResponseBuilder().code(200).data(resp).message("入驻商家保证金流水").build();
}
}
... ...
package com.yohoufo.order.model;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
@Data
@ToString
public class EntrySellerDepositBo {
private Integer uid;
private Long orderCode;
private Integer payment;
private String paymentDesc;
private Integer status;
private String statusDesc;
private BigDecimal amount;
private Integer type;
private String typeDesc;
private Integer createTime;
}
package com.yohoufo.order.model.response;
import com.yohobuy.ufo.model.order.resp.PageResp;
import com.yohoufo.order.model.EntrySellerDepositBo;
import lombok.Data;
/**
* Created by craig.qin
*/
@Data
public class EntrySellerDepositResp extends PageResp<EntrySellerDepositBo>{
}
... ... @@ -2,18 +2,13 @@ package com.yohoufo.order.service.impl;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.yohobuy.ufo.model.order.common.EntrySellerDepositType;
import com.yohoufo.dal.order.EntrySellerRechargeOrderMapper;
import com.yohoufo.dal.order.TradeBillsMapper;
import com.yohoufo.dal.order.model.EntrySellerRechargeOrder;
import com.yohoufo.dal.order.model.TradeBills;
import com.yohoufo.order.common.Payment;
import com.yohoufo.order.common.TradeType;
import com.yohoufo.order.model.EntrySellerDepositBo;
import com.yohoufo.order.model.bo.TradeBillsBo;
import com.yohoufo.order.model.bo.TradeBillsSummaryBo;
import com.yohoufo.order.model.response.AssetsResp;
import com.yohoufo.order.model.response.EntrySellerDepositResp;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -70,40 +65,6 @@ public class AssetsService {
return assetsResp;
}
public EntrySellerDepositResp getStoredSellerDepositDetail(int uid, int page, int pageSize){
int total = entrySellerRechargeOrderMapper.selectCountByUid(uid);
List<EntrySellerDepositBo> detailList = new ArrayList<>();;
if(total>0){
List<EntrySellerRechargeOrder> orders=entrySellerRechargeOrderMapper.selectWithPageByUid(uid,pageSize*(page-1),pageSize);
for(EntrySellerRechargeOrder order:orders){
EntrySellerDepositBo bo=new EntrySellerDepositBo();
bo.setUid(order.getUid());
bo.setOrderCode(order.getOrderCode());
bo.setPayment(order.getPayment());
bo.setPaymentDesc(Payment.getPaymentDesc(order.getPayment()));
bo.setStatus(order.getStatus());
bo.setStatusDesc((order.getStatus()!=null&&1==order.getStatus())?"已支付":"未支付");
bo.setAmount(order.getAmount());//保留两位小数
bo.setCreateTime(order.getCreateTime());
bo.setType(order.getType());
bo.setTypeDesc(EntrySellerDepositType.getDescByType(order.getType()));
detailList.add(bo);
}
}
EntrySellerDepositResp resp=new EntrySellerDepositResp();
resp.setData(detailList);
resp.setTotal(total);
resp.setPage(page);
resp.setPageSize(pageSize);
if(total<=0){
resp.setPagetotal(0);
}else{
resp.setPagetotal(total%pageSize==0?total/pageSize:((total/pageSize)+1));
}
return resp;
}
/**
* TODO 可以考虑把第一页放缓存
... ...