| @@ -83,4 +83,27 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(res); | return new ResultData(res); | ||||
| } | } | ||||
| //// ------ 卡相关接口 | |||||
| @ApiOperation("卡包分页列表接口") | |||||
| @GetMapping("cardList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||||
| }) | |||||
| public ResultData cardList(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | |||||
| if (pageNum == null || pageSize == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCVo(); | |||||
| wxCouponOrder.setCUserId(getUser().getId()); | |||||
| if (wxCouponOrder.getCouponOrderStatus() == null) | |||||
| wxCouponOrder.setSortColumns(WxCouponOrder.Field.CreateDate_DESC); | |||||
| else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) | |||||
| wxCouponOrder.setSortColumns(WxCouponOrder.Field.CreateDate_DESC); | |||||
| else | |||||
| wxCouponOrder.setSortColumns(WxCouponOrder.Field.UpdateDate_DESC); | |||||
| return wxCouponOrderService.listCUserVoAsPage(wxCouponOrder, pageNum, pageSize); | |||||
| } | |||||
| } | } | ||||
| @@ -97,4 +97,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||||
| void offExpiredCouponOrderByValidDate(); | void offExpiredCouponOrderByValidDate(); | ||||
| List<WxCouponOrder> findExpiredCouponOrderByValidDate(); | List<WxCouponOrder> findExpiredCouponOrderByValidDate(); | ||||
| //// 卡相关接口 | |||||
| List<WxCouponOrderCVo> findCardListOfCUser(WxCouponOrder wxCouponOrder); | |||||
| } | } | ||||
| @@ -162,4 +162,14 @@ public interface WxCouponOrderService { | |||||
| int queryPriceTotal(String tenantId, Date startTime, Date endTime); | int queryPriceTotal(String tenantId, Date startTime, Date endTime); | ||||
| ////// ------- 卡 | |||||
| /** | |||||
| * C用户查卡list | |||||
| * | |||||
| * @param record C端用户 | |||||
| */ | |||||
| ResultData listCardVoAsPage(WxCouponOrder record, Integer pageIndex, Integer pageSize); | |||||
| } | } | ||||
| @@ -588,4 +588,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| return wxCouponOrderMapper.queryPriceTotal(tenantId, startTime, endTime); | return wxCouponOrderMapper.queryPriceTotal(tenantId, startTime, endTime); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData listCardVoAsPage(WxCouponOrder record, Integer pageIndex, Integer pageSize) { | |||||
| return new ResultData(PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findCardListOfCUser(record))); | |||||
| } | |||||
| } | } | ||||
| @@ -553,10 +553,34 @@ | |||||
| from wx_coupon_order co,wx_coupon c | from wx_coupon_order co,wx_coupon c | ||||
| where 1=1 | where 1=1 | ||||
| and co.coupon_id = c.id | and co.coupon_id = c.id | ||||
| and c.type != 5 | |||||
| and co.coupon_type != 5 and co.coupon_type != 7 | |||||
| <if test="cUserId != null"> | <if test="cUserId != null"> | ||||
| and co.c_user_id = #{cUserId} | and co.c_user_id = #{cUserId} | ||||
| </if> | </if> | ||||
| <if test="ownerId != null"> | |||||
| and co.owner_id = #{ownerId} | |||||
| </if> | |||||
| <if test="tenantId != null"> | |||||
| and co.tenant_id = #{tenantId} | |||||
| </if> | |||||
| <if test="couponOrderStatus != null"> | |||||
| AND co.coupon_order_status = #{couponOrderStatus} | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| </select> | |||||
| <select id="findCardListOfCUser" parameterType="com.iformall.domain.vo.WxCouponOrderCVo" resultMap="CVoResultMap"> | |||||
| select <include refid="allCUserCouponOrderListColumns" /> | |||||
| from wx_coupon_order co,wx_coupon c | |||||
| where 1=1 | |||||
| and co.coupon_id = c.id | |||||
| and co.coupon_type == 7 | |||||
| <if test="cUserId != null"> | |||||
| and co.c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test="ownerId != null"> | |||||
| and co.owner_id = #{ownerId} | |||||
| </if> | |||||
| <if test="tenantId != null"> | <if test="tenantId != null"> | ||||
| and co.tenant_id = #{tenantId} | and co.tenant_id = #{tenantId} | ||||
| </if> | </if> | ||||