|
|
@@ -1,6 +1,7 @@
|
|
|
// PointsRechargeController.java
|
|
|
package com.yami.shop.platform.controller;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
@@ -52,25 +53,13 @@ public class PointsRechargeController {
|
|
|
*/
|
|
|
@GetMapping("/page")
|
|
|
public R<IPage<PointsRecharge>> page(PageParam<PointsRecharge> pageParam, PointsRecharge pointsRecharge) {
|
|
|
- if (pointsRecharge==null||pointsRecharge.getChannelIdList()==null||pointsRecharge.getChannelIdList().isEmpty()){
|
|
|
- return R.FAIL("请求参数-所属企业不允许为空");
|
|
|
- }
|
|
|
- if (pointsRecharge.getChannelIdList().contains(0L)){
|
|
|
- Long userId = SecurityUtils.getSysUser().getUserId();
|
|
|
- List<Long> channelIdList = sysUserService.findByUserIdListId(userId);
|
|
|
- pointsRecharge.setChannelIdList(channelIdList);
|
|
|
- if (userId != Constant.SUPER_ADMIN_ID&&(pointsRecharge.getChannelIdList()==null||pointsRecharge.getChannelIdList().isEmpty())){
|
|
|
- List<Long> longs = new ArrayList<>();
|
|
|
- longs.add(0L);
|
|
|
- pointsRecharge.setChannelIdList(longs);
|
|
|
- }
|
|
|
- }
|
|
|
- IPage<PointsRecharge> page = pointsRechargeService.page(pageParam,new LambdaQueryWrapper<PointsRecharge>()
|
|
|
- .in(ObjectUtils.isNotEmpty(pointsRecharge.getChannelIdList()),PointsRecharge::getChannelId,pointsRecharge.getChannelIdList())
|
|
|
- .eq(ObjectUtils.isNotEmpty(pointsRecharge.getUserPhone()),PointsRecharge::getUserPhone,pointsRecharge.getUserPhone())
|
|
|
- .orderByDesc(PointsRecharge::getCreateTime)
|
|
|
- );
|
|
|
- return R.SUCCESS(page);
|
|
|
+ getPointsRecharge(pointsRecharge);
|
|
|
+// IPage<PointsRecharge> page = pointsRechargeService.page(pageParam,new LambdaQueryWrapper<PointsRecharge>()
|
|
|
+// .in(ObjectUtils.isNotEmpty(pointsRecharge.getChannelIdList()),PointsRecharge::getChannelId,pointsRecharge.getChannelIdList())
|
|
|
+// .eq(ObjectUtils.isNotEmpty(pointsRecharge.getUserPhone()),PointsRecharge::getUserPhone,pointsRecharge.getUserPhone())
|
|
|
+// .orderByDesc(PointsRecharge::getCreateTime)
|
|
|
+// );
|
|
|
+ return R.SUCCESS(pointsRechargeService.findPage(pageParam,pointsRecharge));
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -79,19 +68,7 @@ public class PointsRechargeController {
|
|
|
*/
|
|
|
@GetMapping("/statisticsList")
|
|
|
public R<IPage<PointsRechargeVO>> statisticsList(PageParam<PointsRecharge> pageParam, PointsRecharge pointsRecharge) {
|
|
|
- if (pointsRecharge.getChannelIdList()==null||pointsRecharge.getChannelIdList().isEmpty()){
|
|
|
- throw new GlobalException("请求参数-所属企业不允许为空");
|
|
|
- }
|
|
|
- if (pointsRecharge.getChannelIdList().contains(0L)){
|
|
|
- Long userId = SecurityUtils.getSysUser().getUserId();
|
|
|
- List<Long> channelIdList = sysUserService.findByUserIdListId(userId);
|
|
|
- pointsRecharge.setChannelIdList(channelIdList);
|
|
|
- if (userId != Constant.SUPER_ADMIN_ID&&(pointsRecharge.getChannelIdList()==null||pointsRecharge.getChannelIdList().isEmpty())){
|
|
|
- List<Long> longs = new ArrayList<>();
|
|
|
- longs.add(0L);
|
|
|
- pointsRecharge.setChannelIdList(longs);
|
|
|
- }
|
|
|
- }
|
|
|
+ getPointsRecharge(pointsRecharge);
|
|
|
IPage<PointsRechargeVO> page = pointsRechargeService.statisticsList(pointsRecharge);
|
|
|
return R.SUCCESS(page);
|
|
|
}
|
|
|
@@ -171,9 +148,16 @@ public class PointsRechargeController {
|
|
|
@GetMapping("/export")
|
|
|
@ApiOperation("后管端-积分列表导出")
|
|
|
public void export(PointsRecharge pointsRecharge, HttpServletResponse response) {
|
|
|
+ getPointsRecharge(pointsRecharge);
|
|
|
+ pointsRechargeService.export(pointsRecharge,response);
|
|
|
+ }
|
|
|
+ private void getPointsRecharge(PointsRecharge pointsRecharge){
|
|
|
if (pointsRecharge.getChannelIdList()==null||pointsRecharge.getChannelIdList().isEmpty()){
|
|
|
throw new GlobalException("请求参数-所属企业不允许为空");
|
|
|
}
|
|
|
+ if (ObjectUtil.isEmpty(pointsRecharge.getUserAttrType())){
|
|
|
+ pointsRecharge.setUserAttrType("1");//默认查询正常人员属性
|
|
|
+ }
|
|
|
if (pointsRecharge.getChannelIdList().contains(0L)){
|
|
|
Long userId = null;
|
|
|
try {
|
|
|
@@ -189,8 +173,6 @@ public class PointsRechargeController {
|
|
|
pointsRecharge.setChannelIdList(longs);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- pointsRechargeService.export(pointsRecharge,response);
|
|
|
}
|
|
|
|
|
|
|