Authored by qinchao

保证金明细流水接口

package com.yohoufo.dal.order;
import com.yohoufo.dal.order.model.EntrySellerRechargeOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface EntrySellerRechargeOrderMapper {
int deleteByPrimaryKey(Integer id);
... ... @@ -14,4 +17,10 @@ public interface EntrySellerRechargeOrderMapper {
int updateByPrimaryKeySelective(EntrySellerRechargeOrder record);
int updateByPrimaryKey(EntrySellerRechargeOrder record);
int selectCountByUid(@Param("uid") Integer uid);
//根据用户uid ,获取流水(分页)
List<EntrySellerRechargeOrder> selectWithPageByUid(@Param("uid") Integer uid, @Param("start") Integer start, @Param("limit") Integer limit);
}
\ No newline at end of file
... ...
... ... @@ -138,4 +138,25 @@
update_time = #{updateTime,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<sql id="Query_Condition_Sql" >
uid = #{uid,jdbcType=INTEGER}
</sql>
<select id="selectCountByUid" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
select
count(id)
from entry_seller_recharge_order
where <include refid="Query_Condition_Sql" />
</select>
<select id="selectWithPageByUid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from entry_seller_recharge_order
where <include refid="Query_Condition_Sql" />
order by id desc
limit #{start,jdbcType=INTEGER},#{limit,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -38,7 +38,7 @@ public class AssetsController {
*/
@RequestMapping(params = "method=ufo.asssets.storedSellerDepositDetail")
@ResponseBody
public ApiResponse storedSellerDepositDetail(@RequestParam(name = "uid")int uid,
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);
... ...
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 Integer status;
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,12 +2,17 @@ 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.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;
... ... @@ -35,6 +40,9 @@ public class AssetsService {
@Autowired
private TradeBillsMapper tradeBillsMapper;
@Autowired
private EntrySellerRechargeOrderMapper entrySellerRechargeOrderMapper;
public AssetsResp getAssetsDetails(int uid, int page, int pageSize){
//TODO get count
... ... @@ -61,6 +69,38 @@ 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,page,pageSize);
for(EntrySellerRechargeOrder order:orders){
EntrySellerDepositBo bo=new EntrySellerDepositBo();
bo.setUid(order.getUid());
bo.setOrderCode(order.getOrderCode());
bo.setPayment(order.getPayment());
bo.setStatus(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);
if(total<=0){
resp.setPagetotal(0);
}else{
resp.setPagetotal(total%pageSize==0?total/pageSize:((total/pageSize)+1));
}
return resp;
}
/**
* TODO 可以考虑把第一页放缓存
* @param uid
... ...
... ... @@ -64,7 +64,7 @@ public class RealNameAuthorize4PlatformController {
@RequestMapping(value="/quitStoredSeller")
@IgnoreSession
@IgnoreSignature
public ApiResponse quitStoredSeller(RealNameAuthorizeReqVO reqVO) throws GatewayException {
public ApiResponse quitStoredSeller(@RequestBody RealNameAuthorizeReqVO reqVO) throws GatewayException {
logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO);
//(1) 优先校验请求的参数
if (reqVO == null || reqVO.getUid() <=0 ){
... ...