提交代码

dev-discount
胡锐 2 years ago
parent 2dfe34821d
commit 38fc6ea5f6
  1. 30
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java
  2. 4
      hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.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 = "查询列表")

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

Loading…
Cancel
Save