|
|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.yami.shop.bean.model.PointsRecharge;
|
|
|
import com.yami.shop.bean.po.EnterpriseUserPo;
|
|
|
import com.yami.shop.bean.vo.PointsRechargeVO;
|
|
|
+import com.yami.shop.common.config.Constant;
|
|
|
import com.yami.shop.common.exception.GlobalException;
|
|
|
import com.yami.shop.common.util.PageParam;
|
|
|
import com.yami.shop.common.util.R;
|
|
|
@@ -26,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -57,9 +59,14 @@ public class PointsRechargeController {
|
|
|
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(PointsRecharge::getChannelId,pointsRecharge.getChannelIdList())
|
|
|
+ .in(ObjectUtils.isNotEmpty(pointsRecharge.getChannelIdList()),PointsRecharge::getChannelId,pointsRecharge.getChannelIdList())
|
|
|
.eq(ObjectUtils.isNotEmpty(pointsRecharge.getUserPhone()),PointsRecharge::getUserPhone,pointsRecharge.getUserPhone())
|
|
|
.orderByDesc(PointsRecharge::getCreateTime)
|
|
|
);
|
|
|
@@ -79,6 +86,11 @@ public class PointsRechargeController {
|
|
|
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<PointsRechargeVO> page = pointsRechargeService.statisticsList(pointsRecharge);
|
|
|
return R.SUCCESS(page);
|
|
|
@@ -171,7 +183,13 @@ public class PointsRechargeController {
|
|
|
}
|
|
|
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);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
pointsRechargeService.export(pointsRecharge,response);
|
|
|
}
|
|
|
|