|
|
@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.annotation.Log;
|
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
|
@@ -18,6 +19,7 @@ import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
+import com.cyksj.model.excel.ExcelRechargeAccountData;
|
|
|
import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.model.manage.views.GroupsRelationBackView;
|
|
|
import com.cyksj.model.request.*;
|
|
|
@@ -32,6 +34,7 @@ import com.cyksj.service.mange.gpt.GptRechargeService;
|
|
|
import com.cyksj.service.relation.GroupRelationClearService;
|
|
|
import com.cyksj.service.scheduler.SchedulerService;
|
|
|
import com.cyksj.web.controller.recharge.req.ParseTokenRequest;
|
|
|
+import com.cyksj.web.util.EasyExcelUtils;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.param.Operator;
|
|
|
@@ -45,6 +48,7 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
@@ -149,6 +153,41 @@ public class CmsGroupRelationController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 导出代充账号
|
|
|
+ */
|
|
|
+ @GetMapping("/export/recharge")
|
|
|
+ public void getRechargeList(String rechargeStatus, String orderNo, Boolean isVipError, HttpServletResponse response) {
|
|
|
+ MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
+ if (StrUtil.isEmpty(rechargeStatus)) {
|
|
|
+ builder.field(ExcelRechargeAccountData::getRechargeStatus).op(Operator.NotNull);
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(orderNo)) {
|
|
|
+ OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .eq(OrderDon::getOrderNo, orderNo)
|
|
|
+ .last("limit 1"));
|
|
|
+ Long relationId = 0l;
|
|
|
+ if (orderDon != null) {
|
|
|
+ relationId = orderDon.getRelationId();
|
|
|
+ builder.field(ExcelRechargeAccountData::getUserId, orderDon.getUserId());
|
|
|
+ }
|
|
|
+ builder.field(ExcelRechargeAccountData::getRelationId, relationId);
|
|
|
+ }
|
|
|
+ if (isVipError != null) {
|
|
|
+ builder.field(ExcelRechargeAccountData::getRechargeStatus, GroupsRelation.RechargeStatus.recharge_error.name());
|
|
|
+ if (isVipError) {
|
|
|
+ builder.field(ExcelRechargeAccountData::getRechargeErrorInfo, "会员").op(Operator.Contain);
|
|
|
+ } else {
|
|
|
+ builder.put("errorInfo", "(gr.recharge_error_info is null or gr.recharge_error_info not like '%会员%')");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<ExcelRechargeAccountData> list = beanSearcher.searchAll(ExcelRechargeAccountData.class, builder
|
|
|
+ .field(ExcelRechargeAccountData::getStatus, List.of(GroupsRelation.Status.validity.name(), GroupsRelation.Status.outside.name())).op(Operator.InList)
|
|
|
+ .orderBy(ExcelRechargeAccountData::getSubmitTime).desc()
|
|
|
+ .build());
|
|
|
+ EasyExcelUtils.createExcelStreamMutilByEasyExcel(response, ExcelRechargeAccountData.class, list, "代充列表", "代充列表", ExcelTypeEnum.XLSX, null);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 代充账号 状态变更
|
|
|
*/
|