|
|
@@ -80,6 +80,7 @@ public class ExchangeCodeController {
|
|
|
@GetMapping("/get")
|
|
|
@SaCheckPermission("exchangeCode:view")
|
|
|
public Result<SearchResult<ExchangeCodeView>> getExchangeCodeView(Long goodsId, Long skuId) {
|
|
|
+ long adminId = StpUtil.getLoginIdAsLong();
|
|
|
String condition = StrUtil.EMPTY;
|
|
|
if (goodsId != null) {
|
|
|
condition = String.format(" and JSON_CONTAINS(goods_ids,'%s')", goodsId);
|
|
|
@@ -91,6 +92,8 @@ public class ExchangeCodeController {
|
|
|
if (StrUtil.isNotEmpty(condition)) {
|
|
|
builder.put("condition", condition);
|
|
|
}
|
|
|
+ CmsUser cmsUser = cmsUserMapper.selectById(adminId);
|
|
|
+ builder.field(ExchangeCodeView::getOperator, cmsUser.getNickname());
|
|
|
SearchResult<ExchangeCodeView> search = beanSearcher.search(ExchangeCodeView.class, builder.build());
|
|
|
search.getDataList().forEach(data -> {
|
|
|
try {
|
|
|
@@ -113,6 +116,7 @@ public class ExchangeCodeController {
|
|
|
@GetMapping("/export")
|
|
|
@SaCheckPermission("exchangeCode:export")
|
|
|
public void exportExchangeCode(HttpServletResponse response, Long goodsId, Long skuId) {
|
|
|
+ long adminId = StpUtil.getLoginIdAsLong();
|
|
|
String condition = StrUtil.EMPTY;
|
|
|
if (goodsId != null) {
|
|
|
condition = String.format(" and JSON_CONTAINS(goods_ids,'%s')", goodsId);
|
|
|
@@ -124,6 +128,8 @@ public class ExchangeCodeController {
|
|
|
if (StrUtil.isNotEmpty(condition)) {
|
|
|
builder.put("condition", condition);
|
|
|
}
|
|
|
+ CmsUser cmsUser = cmsUserMapper.selectById(adminId);
|
|
|
+ builder.field(ExcelExchangeCodeData::getOperator, cmsUser.getNickname());
|
|
|
List<ExcelExchangeCodeData> data = beanSearcher.searchAll(ExcelExchangeCodeData.class, builder.build());
|
|
|
EasyExcelUtils.createExcelStreamMutilByEasyExcel(response, ExcelExchangeCodeData.class, data, "银河兑换码", "银河兑换码", ExcelTypeEnum.XLSX, null);
|
|
|
}
|