Showing
7 changed files
with
113 additions
and
2 deletions
1 | package com.yohoufo.dal.order; | 1 | package com.yohoufo.dal.order; |
2 | 2 | ||
3 | import com.yohoufo.dal.order.model.EntrySellerRechargeOrder; | 3 | import com.yohoufo.dal.order.model.EntrySellerRechargeOrder; |
4 | +import org.apache.ibatis.annotations.Param; | ||
5 | + | ||
6 | +import java.util.List; | ||
4 | 7 | ||
5 | public interface EntrySellerRechargeOrderMapper { | 8 | public interface EntrySellerRechargeOrderMapper { |
6 | int deleteByPrimaryKey(Integer id); | 9 | int deleteByPrimaryKey(Integer id); |
@@ -14,4 +17,10 @@ public interface EntrySellerRechargeOrderMapper { | @@ -14,4 +17,10 @@ public interface EntrySellerRechargeOrderMapper { | ||
14 | int updateByPrimaryKeySelective(EntrySellerRechargeOrder record); | 17 | int updateByPrimaryKeySelective(EntrySellerRechargeOrder record); |
15 | 18 | ||
16 | int updateByPrimaryKey(EntrySellerRechargeOrder record); | 19 | int updateByPrimaryKey(EntrySellerRechargeOrder record); |
20 | + | ||
21 | + | ||
22 | + int selectCountByUid(@Param("uid") Integer uid); | ||
23 | + | ||
24 | + //根据用户uid ,获取流水(分页) | ||
25 | + List<EntrySellerRechargeOrder> selectWithPageByUid(@Param("uid") Integer uid, @Param("start") Integer start, @Param("limit") Integer limit); | ||
17 | } | 26 | } |
@@ -138,4 +138,25 @@ | @@ -138,4 +138,25 @@ | ||
138 | update_time = #{updateTime,jdbcType=INTEGER} | 138 | update_time = #{updateTime,jdbcType=INTEGER} |
139 | where id = #{id,jdbcType=INTEGER} | 139 | where id = #{id,jdbcType=INTEGER} |
140 | </update> | 140 | </update> |
141 | + | ||
142 | + <sql id="Query_Condition_Sql" > | ||
143 | + uid = #{uid,jdbcType=INTEGER} | ||
144 | + </sql> | ||
145 | + | ||
146 | + <select id="selectCountByUid" resultType="java.lang.Integer" parameterType="java.lang.Integer" > | ||
147 | + select | ||
148 | + count(id) | ||
149 | + from entry_seller_recharge_order | ||
150 | + where <include refid="Query_Condition_Sql" /> | ||
151 | + </select> | ||
152 | + | ||
153 | + <select id="selectWithPageByUid" resultMap="BaseResultMap"> | ||
154 | + select | ||
155 | + <include refid="Base_Column_List" /> | ||
156 | + from entry_seller_recharge_order | ||
157 | + where <include refid="Query_Condition_Sql" /> | ||
158 | + order by id desc | ||
159 | + limit #{start,jdbcType=INTEGER},#{limit,jdbcType=INTEGER} | ||
160 | + </select> | ||
161 | + | ||
141 | </mapper> | 162 | </mapper> |
@@ -38,7 +38,7 @@ public class AssetsController { | @@ -38,7 +38,7 @@ public class AssetsController { | ||
38 | */ | 38 | */ |
39 | @RequestMapping(params = "method=ufo.asssets.storedSellerDepositDetail") | 39 | @RequestMapping(params = "method=ufo.asssets.storedSellerDepositDetail") |
40 | @ResponseBody | 40 | @ResponseBody |
41 | - public ApiResponse storedSellerDepositDetail(@RequestParam(name = "uid")int uid, | 41 | + public ApiResponse getStoredSellerDepositDetail(@RequestParam(name = "uid")int uid, |
42 | @RequestParam(value = "page", required = false, defaultValue = "1") int page, | 42 | @RequestParam(value = "page", required = false, defaultValue = "1") int page, |
43 | @RequestParam(value = "limit", required = false, defaultValue = "10") int limit){ | 43 | @RequestParam(value = "limit", required = false, defaultValue = "10") int limit){ |
44 | logger.info("in ufo.sellerOrder.storedSellerDepositDetail, uid {},page {},limit {}", uid, page, limit); | 44 | logger.info("in ufo.sellerOrder.storedSellerDepositDetail, uid {},page {},limit {}", uid, page, limit); |
1 | +package com.yohoufo.order.model; | ||
2 | + | ||
3 | +import lombok.Data; | ||
4 | +import lombok.ToString; | ||
5 | + | ||
6 | +import java.math.BigDecimal; | ||
7 | + | ||
8 | +@Data | ||
9 | +@ToString | ||
10 | +public class EntrySellerDepositBo { | ||
11 | + | ||
12 | + private Integer uid; | ||
13 | + | ||
14 | + private Long orderCode; | ||
15 | + | ||
16 | + private Integer payment; | ||
17 | + | ||
18 | + private Integer status; | ||
19 | + | ||
20 | + private BigDecimal amount; | ||
21 | + | ||
22 | + private Integer type; | ||
23 | + | ||
24 | + private String typeDesc; | ||
25 | + | ||
26 | + private Integer createTime; | ||
27 | +} |
1 | +package com.yohoufo.order.model.response; | ||
2 | + | ||
3 | +import com.yohobuy.ufo.model.order.resp.PageResp; | ||
4 | +import com.yohoufo.order.model.EntrySellerDepositBo; | ||
5 | +import lombok.Data; | ||
6 | + | ||
7 | +/** | ||
8 | + * Created by craig.qin | ||
9 | + */ | ||
10 | +@Data | ||
11 | +public class EntrySellerDepositResp extends PageResp<EntrySellerDepositBo>{ | ||
12 | + | ||
13 | + | ||
14 | +} |
@@ -2,12 +2,17 @@ package com.yohoufo.order.service.impl; | @@ -2,12 +2,17 @@ package com.yohoufo.order.service.impl; | ||
2 | 2 | ||
3 | import com.google.common.cache.Cache; | 3 | import com.google.common.cache.Cache; |
4 | import com.google.common.cache.CacheBuilder; | 4 | import com.google.common.cache.CacheBuilder; |
5 | +import com.yohobuy.ufo.model.order.common.EntrySellerDepositType; | ||
6 | +import com.yohoufo.dal.order.EntrySellerRechargeOrderMapper; | ||
5 | import com.yohoufo.dal.order.TradeBillsMapper; | 7 | import com.yohoufo.dal.order.TradeBillsMapper; |
8 | +import com.yohoufo.dal.order.model.EntrySellerRechargeOrder; | ||
6 | import com.yohoufo.dal.order.model.TradeBills; | 9 | import com.yohoufo.dal.order.model.TradeBills; |
7 | import com.yohoufo.order.common.TradeType; | 10 | import com.yohoufo.order.common.TradeType; |
11 | +import com.yohoufo.order.model.EntrySellerDepositBo; | ||
8 | import com.yohoufo.order.model.bo.TradeBillsBo; | 12 | import com.yohoufo.order.model.bo.TradeBillsBo; |
9 | import com.yohoufo.order.model.bo.TradeBillsSummaryBo; | 13 | import com.yohoufo.order.model.bo.TradeBillsSummaryBo; |
10 | import com.yohoufo.order.model.response.AssetsResp; | 14 | import com.yohoufo.order.model.response.AssetsResp; |
15 | +import com.yohoufo.order.model.response.EntrySellerDepositResp; | ||
11 | import org.apache.commons.collections.CollectionUtils; | 16 | import org.apache.commons.collections.CollectionUtils; |
12 | import org.slf4j.Logger; | 17 | import org.slf4j.Logger; |
13 | import org.slf4j.LoggerFactory; | 18 | import org.slf4j.LoggerFactory; |
@@ -35,6 +40,9 @@ public class AssetsService { | @@ -35,6 +40,9 @@ public class AssetsService { | ||
35 | @Autowired | 40 | @Autowired |
36 | private TradeBillsMapper tradeBillsMapper; | 41 | private TradeBillsMapper tradeBillsMapper; |
37 | 42 | ||
43 | + @Autowired | ||
44 | + private EntrySellerRechargeOrderMapper entrySellerRechargeOrderMapper; | ||
45 | + | ||
38 | public AssetsResp getAssetsDetails(int uid, int page, int pageSize){ | 46 | public AssetsResp getAssetsDetails(int uid, int page, int pageSize){ |
39 | 47 | ||
40 | //TODO get count | 48 | //TODO get count |
@@ -61,6 +69,38 @@ public class AssetsService { | @@ -61,6 +69,38 @@ public class AssetsService { | ||
61 | return assetsResp; | 69 | return assetsResp; |
62 | } | 70 | } |
63 | 71 | ||
72 | + public EntrySellerDepositResp getStoredSellerDepositDetail(int uid, int page, int pageSize){ | ||
73 | + int total = entrySellerRechargeOrderMapper.selectCountByUid(uid); | ||
74 | + | ||
75 | + List<EntrySellerDepositBo> detailList = new ArrayList<>();; | ||
76 | + if(total>0){ | ||
77 | + List<EntrySellerRechargeOrder> orders=entrySellerRechargeOrderMapper.selectWithPageByUid(uid,page,pageSize); | ||
78 | + for(EntrySellerRechargeOrder order:orders){ | ||
79 | + EntrySellerDepositBo bo=new EntrySellerDepositBo(); | ||
80 | + bo.setUid(order.getUid()); | ||
81 | + bo.setOrderCode(order.getOrderCode()); | ||
82 | + bo.setPayment(order.getPayment()); | ||
83 | + bo.setStatus(order.getStatus()); | ||
84 | + bo.setAmount(order.getAmount()); | ||
85 | + bo.setCreateTime(order.getCreateTime()); | ||
86 | + bo.setType(order.getType()); | ||
87 | + bo.setTypeDesc(EntrySellerDepositType.getDescByType(order.getType())); | ||
88 | + detailList.add(bo); | ||
89 | + } | ||
90 | + } | ||
91 | + | ||
92 | + EntrySellerDepositResp resp=new EntrySellerDepositResp(); | ||
93 | + resp.setData(detailList); | ||
94 | + resp.setTotal(total); | ||
95 | + resp.setPage(page); | ||
96 | + if(total<=0){ | ||
97 | + resp.setPagetotal(0); | ||
98 | + }else{ | ||
99 | + resp.setPagetotal(total%pageSize==0?total/pageSize:((total/pageSize)+1)); | ||
100 | + } | ||
101 | + return resp; | ||
102 | + } | ||
103 | + | ||
64 | /** | 104 | /** |
65 | * TODO 可以考虑把第一页放缓存 | 105 | * TODO 可以考虑把第一页放缓存 |
66 | * @param uid | 106 | * @param uid |
@@ -64,7 +64,7 @@ public class RealNameAuthorize4PlatformController { | @@ -64,7 +64,7 @@ public class RealNameAuthorize4PlatformController { | ||
64 | @RequestMapping(value="/quitStoredSeller") | 64 | @RequestMapping(value="/quitStoredSeller") |
65 | @IgnoreSession | 65 | @IgnoreSession |
66 | @IgnoreSignature | 66 | @IgnoreSignature |
67 | - public ApiResponse quitStoredSeller(RealNameAuthorizeReqVO reqVO) throws GatewayException { | 67 | + public ApiResponse quitStoredSeller(@RequestBody RealNameAuthorizeReqVO reqVO) throws GatewayException { |
68 | logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO); | 68 | logger.info("enter StoredSellerController applyQuitStoredSeller param reqVO is {}", reqVO); |
69 | //(1) 优先校验请求的参数 | 69 | //(1) 优先校验请求的参数 |
70 | if (reqVO == null || reqVO.getUid() <=0 ){ | 70 | if (reqVO == null || reqVO.getUid() <=0 ){ |
-
Please register or login to post a comment