zoujiajian 1 жил өмнө
parent
commit
43a2c0c46a

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/model/excel/ExcelExchangeCodeData.java

@@ -80,4 +80,8 @@ public class ExcelExchangeCodeData {
 	@ExcelProperty("用户id")
 	@DbField("u.id")
 	private Long userId;
+
+	@DbField("ec.operator")
+	@ExcelIgnore
+	private String operator;
 }

+ 6 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/exchange/ExchangeCodeController.java

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