Просмотр исходного кода

[储值卡][新增]:c端显示卡包列表

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
f4b06d05fe
5 измененных файлов: 66 добавлений и 1 удалений
  1. +23
    -0
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  3. +10
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java
  4. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  5. +25
    -1
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 23
- 0
mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java Просмотреть файл

@@ -83,4 +83,27 @@ public class WxCouponOrderController extends BaseController {

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);
}
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java Просмотреть файл

@@ -97,4 +97,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
void offExpiredCouponOrderByValidDate();

List<WxCouponOrder> findExpiredCouponOrderByValidDate();

//// 卡相关接口
List<WxCouponOrderCVo> findCardListOfCUser(WxCouponOrder wxCouponOrder);
}

+ 10
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java Просмотреть файл

@@ -162,4 +162,14 @@ public interface WxCouponOrderService {
int queryPriceTotal(String tenantId, Date startTime, Date endTime);


////// ------- 卡
/**
* C用户查卡list
*
* @param record C端用户
*/

ResultData listCardVoAsPage(WxCouponOrder record, Integer pageIndex, Integer pageSize);


}

+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java Просмотреть файл

@@ -588,4 +588,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
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)));
}

}

+ 25
- 1
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -553,10 +553,34 @@
from wx_coupon_order co,wx_coupon c
where 1=1
and co.coupon_id = c.id
and c.type != 5
and co.coupon_type != 5 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">
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">
and co.tenant_id = #{tenantId}
</if>


Загрузка…
Отмена
Сохранить