feat(integral-external): 新增寄卖外部免认证三件套页面
This commit is contained in:
@@ -3,20 +3,35 @@ package com.zbkj.admin.controller;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.*;
|
||||
import com.zbkj.common.response.ExternalGrabUserResponse;
|
||||
import com.zbkj.common.response.StoreOrderDetailResponse;
|
||||
import com.zbkj.common.response.TeamDailyMultiReportResponse;
|
||||
import com.zbkj.common.response.TeamDailyReportResponse;
|
||||
import com.zbkj.common.response.UserIntegralRecordResponse;
|
||||
import com.zbkj.common.response.UserResponse;
|
||||
import com.zbkj.common.response.WaOrderResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.ExternalGrabUserService;
|
||||
import com.zbkj.service.service.StoreOrderService;
|
||||
import com.zbkj.service.service.TeamReportExternalService;
|
||||
import com.zbkj.service.service.UserIntegralRecordService;
|
||||
import com.zbkj.service.service.UserService;
|
||||
import com.zbkj.service.service.WaOrderAdminService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* 积分模块外部免认证接口 Controller
|
||||
* 供管理后台外部页面(/integral-external/*)调用,跳过登录验证。
|
||||
@@ -40,6 +55,15 @@ public class ExternalIntegralController {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private WaOrderAdminService waOrderAdminService;
|
||||
|
||||
@Autowired
|
||||
private TeamReportExternalService teamReportExternalService;
|
||||
|
||||
@Autowired
|
||||
private ExternalGrabUserService externalGrabUserService;
|
||||
|
||||
/**
|
||||
* 积分明细分页列表(免认证)
|
||||
* 复用 UserIntegralRecordService.findAdminList,与 /admin/user/integral/list 逻辑完全一致。
|
||||
@@ -93,4 +117,90 @@ public class ExternalIntegralController {
|
||||
}
|
||||
return CommonResult.success(restPage);
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// 寄卖订单管理(wa_order)
|
||||
// 复用 WaOrderAdminService(仅读路径),不使用 @PreAuthorize。
|
||||
// ========================================================================
|
||||
|
||||
/**
|
||||
* 寄卖订单分页列表(免认证)
|
||||
*/
|
||||
@ApiOperation(value = "寄卖订单分页列表(免认证)")
|
||||
@GetMapping(value = "/wa-order/list")
|
||||
public CommonResult<CommonPage<WaOrderResponse>> waOrderList(
|
||||
@ModelAttribute @Validated WaOrderSearchRequest request,
|
||||
@Validated PageParamRequest pageParamRequest) {
|
||||
CommonPage<WaOrderResponse> restPage =
|
||||
CommonPage.restPage(waOrderAdminService.getAdminList(request, pageParamRequest));
|
||||
return CommonResult.success(restPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 寄卖订单详情(免认证)
|
||||
*/
|
||||
@ApiOperation(value = "寄卖订单详情(免认证)")
|
||||
@GetMapping(value = "/wa-order/info")
|
||||
public CommonResult<WaOrderResponse> waOrderInfo(@RequestParam Integer id) {
|
||||
return CommonResult.success(waOrderAdminService.getDetailById(id));
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// 团队每日对账日报
|
||||
// ========================================================================
|
||||
|
||||
/**
|
||||
* 团队每日对账日报(免认证)。
|
||||
* - leaderId 非空:返回该团队对账(teams 仅 1 项)
|
||||
* - leaderId 为空:按团队长分组返回所有团队对账 + 跨团队总计
|
||||
*/
|
||||
@ApiOperation(value = "团队每日对账(免认证)")
|
||||
@GetMapping(value = "/team-report/daily")
|
||||
public CommonResult<TeamDailyMultiReportResponse> teamDailyReport(
|
||||
@ModelAttribute @Validated TeamDailyReportRequest request) {
|
||||
return CommonResult.success(teamReportExternalService.getMultiDailyReport(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 团队每日对账日报 - Excel 导出(免认证;仅支持单团队,必须传 leaderId)
|
||||
*/
|
||||
@ApiOperation(value = "团队每日对账 Excel 导出(免认证)")
|
||||
@GetMapping(value = "/team-report/daily/export")
|
||||
public ResponseEntity<byte[]> teamDailyReportExport(
|
||||
@ModelAttribute @Validated TeamDailyReportRequest request) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
TeamDailyReportResponse data = teamReportExternalService.exportDailyReport(request, out);
|
||||
|
||||
String fileName = String.format("团队%s_%s.xlsx",
|
||||
data.getTeamCode() == null ? "" : data.getTeamCode(),
|
||||
data.getDate());
|
||||
String encoded = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name())
|
||||
.replaceAll("\\+", "%20");
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.parseMediaType(
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));
|
||||
headers.add(HttpHeaders.CONTENT_DISPOSITION,
|
||||
"attachment; filename=\"" + encoded + "\"; filename*=UTF-8''" + encoded);
|
||||
|
||||
return new ResponseEntity<>(out.toByteArray(), headers, org.springframework.http.HttpStatus.OK);
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// 今日抢单用户列表
|
||||
// ========================================================================
|
||||
|
||||
/**
|
||||
* 今日抢单用户列表(免认证)
|
||||
* 过滤口径:今日购买总金额 > 0;已在 SQL 层落实。
|
||||
*/
|
||||
@ApiOperation(value = "今日抢单用户分页列表(免认证)")
|
||||
@GetMapping(value = "/grab-user/list")
|
||||
public CommonResult<CommonPage<ExternalGrabUserResponse>> grabUserList(
|
||||
@ModelAttribute @Validated ExternalGrabUserRequest request,
|
||||
@Validated PageParamRequest pageParamRequest) {
|
||||
CommonPage<ExternalGrabUserResponse> restPage =
|
||||
CommonPage.restPage(externalGrabUserService.list(request, pageParamRequest));
|
||||
return CommonResult.success(restPage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user