Commit a303e5d4 by 郑勇

加过期页面

parent e4da6c52
...@@ -19,7 +19,7 @@ public interface GiftCouponPackageBiz { ...@@ -19,7 +19,7 @@ public interface GiftCouponPackageBiz {
PageBeanNew<GiftPackageDTO> list4GiftPackage(String title, Integer state, Integer currentPage, Integer numPerPage); PageBeanNew<GiftPackageDTO> list4GiftPackage(String title, Integer state, Integer currentPage, Integer numPerPage);
PageBeanNew<MyGiftPackageDTO> list4MyGiftPackage(Long wechatUserId,Integer currentPage, Integer numPerPage); PageBeanNew<MyGiftPackageDTO> list4MyGiftPackage(Integer state,Long wechatUserId,Integer currentPage, Integer numPerPage);
void useGiftCoupon(Long wechatUserId, Long giftPackageId); void useGiftCoupon(Long wechatUserId, Long giftPackageId);
} }
...@@ -115,10 +115,12 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz { ...@@ -115,10 +115,12 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
} }
@Override @Override
public PageBeanNew<MyGiftPackageDTO> list4MyGiftPackage(Long wechatUserId,Integer currentPage, Integer numPerPage) { public PageBeanNew<MyGiftPackageDTO> list4MyGiftPackage(Integer state,Long wechatUserId,Integer currentPage, Integer numPerPage) {
//state=1 已领取 state=2 已过期
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("wechatUserId", wechatUserId); paramMap.put("wechatUserId", wechatUserId);
PageBeanNew<MyGiftPackageDTO> pageBeanNew=giftCouponPackageDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "list4MyGiftPackage"); paramMap.put("state", state);
PageBeanNew<MyGiftPackageDTO> pageBeanNew=giftReceiveDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "list4MyGiftPackage");
if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>());
} }
......
...@@ -109,11 +109,12 @@ public class GiftCouponPackageFacade { ...@@ -109,11 +109,12 @@ public class GiftCouponPackageFacade {
@GetMapping("/list4MyGiftPackage") @GetMapping("/list4MyGiftPackage")
public ResponseDto<PageBeanNew<MyGiftPackageDTO>> list4MyGiftPackage( public ResponseDto<PageBeanNew<MyGiftPackageDTO>> list4MyGiftPackage(
@CookieValue(value = "userInfo") String userInfo , @CookieValue(value = "userInfo") String userInfo ,
@RequestParam(value = "state", required = false) Integer state,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage @RequestParam(value = "numPerPage", required = false) Integer numPerPage
) throws BizException, PermissionException { ) throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(giftCouponPackageBiz.list4MyGiftPackage(wechatUserId,currentPage,numPerPage)); return new ResponseDto<>(giftCouponPackageBiz.list4MyGiftPackage(state,wechatUserId,currentPage,numPerPage));
} }
@ApiOperation("券包使用") @ApiOperation("券包使用")
......
...@@ -123,6 +123,12 @@ ...@@ -123,6 +123,12 @@
on a.id=b.gift_package_id on a.id=b.gift_package_id
where b.wechat_user_id=#{wechatUserId} where b.wechat_user_id=#{wechatUserId}
and b.used_num <![CDATA[ < ]]> b.receive_num and b.used_num <![CDATA[ < ]]> b.receive_num
<if test="state!=null and state==1">
and now() <![CDATA[ <= ]]> a.valid_date_end
</if>
<if test="state!=null and state==2">
and now() > a.valid_date_end
</if>
order by b.update_time desc order by b.update_time desc
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment