From 38fc6ea5f6d86a0b4ea13387d328e983d1fe07f2 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 28 Mar 2023 09:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HighDiscountAgentRelController.java | 30 +++++++++++++++++++ .../impl/HighDiscountUserRelServiceImpl.java | 4 +++ 2 files changed, 34 insertions(+) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java index 79847183..53665372 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java @@ -1,8 +1,10 @@ package com.bweb.controller; +import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.bweb.config.SysConst; +import com.bweb.model.ExportHighOrderModel; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.Base64Util; @@ -19,6 +21,7 @@ import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.CommonSysConst; import com.hai.entity.*; import com.hai.enum_type.QrCodeType; +import com.hai.model.HighOrderModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; import com.hai.service.*; @@ -32,9 +35,11 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.io.File; import java.net.URLEncoder; import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -159,6 +164,31 @@ public class HighDiscountAgentRelController { } } + @RequestMapping(value="/exportReceive",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "导出领取记录") + public ResponseData exportReceive(@RequestParam(name = "id", required = true) Long id) { + try { + HighDiscountAgentRel rel = highDiscountAgentRelService.getRelById(id); + if (rel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "数据不存在"); + } + + String fileUrl = SysConst.getSysConfig().getFileUrl() + "/temporary/"; + String pathName = System.currentTimeMillis()+".xlsx"; + File file = new File(fileUrl); + if (!file.exists()) { + file.mkdirs(); + } + // EasyExcel.write(fileUrl+pathName).sheet("sheet1").doWrite(dataList); + return ResponseMsgUtil.success(pathName); + + } catch (Exception e) { + log.error("HighDiscountController -> getReceiveLink() error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/getDiscountAgentList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询列表") diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java index 2f02ed4c..1522f2ed 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java @@ -258,6 +258,10 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic HighDiscountUserRelExample example = new HighDiscountUserRelExample(); HighDiscountUserRelExample.Criteria criteria = example.createCriteria(); + if (MapUtils.getInteger(map, "platform") != null) { + criteria.andDiscountPlatformEqualTo(MapUtils.getInteger(map, "platform")); + } + if (MapUtils.getLong(map, "userId") != null) { criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId")); }