|
@@ -3,19 +3,24 @@ package com.ydtech.modules.admin.controller;
|
|
|
|
|
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.modules.admin.model.dto.SysAmountAuditingDto;
|
|
import com.ydtech.modules.admin.model.dto.SysAmountAuditingDto;
|
|
|
|
|
+import com.ydtech.modules.admin.model.dto.SysAmountAuditingEntityDto;
|
|
|
import com.ydtech.modules.admin.model.po.SysAmountAuditingEntity;
|
|
import com.ydtech.modules.admin.model.po.SysAmountAuditingEntity;
|
|
|
import com.ydtech.modules.admin.model.vo.SysAmountAuditingVo;
|
|
import com.ydtech.modules.admin.model.vo.SysAmountAuditingVo;
|
|
|
import com.ydtech.modules.admin.model.vo.SysAmountRejectVo;
|
|
import com.ydtech.modules.admin.model.vo.SysAmountRejectVo;
|
|
|
import com.ydtech.modules.admin.service.SysAmountAuditingService;
|
|
import com.ydtech.modules.admin.service.SysAmountAuditingService;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
|
|
+import com.ydtech.utils.ExcelUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
@Api(tags = "提现审核")
|
|
@Api(tags = "提现审核")
|
|
|
@RequestMapping("/sysAmountAuditing")
|
|
@RequestMapping("/sysAmountAuditing")
|
|
@@ -24,6 +29,13 @@ public class SysAmountAuditingController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SysAmountAuditingService sysAmountAuditingService;
|
|
private SysAmountAuditingService sysAmountAuditingService;
|
|
|
|
|
|
|
|
|
|
+ @Value("${upload.file.path}")
|
|
|
|
|
+ private String uploadPath;
|
|
|
|
|
+
|
|
|
|
|
+ private String EXCEL_PATH = "excel//";
|
|
|
|
|
+
|
|
|
|
|
+ private String UPLOAD_PATH = "/upload//excel//";
|
|
|
|
|
+
|
|
|
@PostMapping("/queryPage")
|
|
@PostMapping("/queryPage")
|
|
|
@ApiOperation(value = "提现审核分页")
|
|
@ApiOperation(value = "提现审核分页")
|
|
|
public HttpResult<BasePageResult<SysAmountAuditingEntity>> queryPageOrder(@RequestBody @Valid SysAmountAuditingVo sysAmountAuditingVo) {
|
|
public HttpResult<BasePageResult<SysAmountAuditingEntity>> queryPageOrder(@RequestBody @Valid SysAmountAuditingVo sysAmountAuditingVo) {
|
|
@@ -81,4 +93,41 @@ public class SysAmountAuditingController extends BaseController {
|
|
|
SysAmountAuditingEntity vo = sysAmountAuditingService.getById(id);
|
|
SysAmountAuditingEntity vo = sysAmountAuditingService.getById(id);
|
|
|
return HttpResult.ok("success", vo);
|
|
return HttpResult.ok("success", vo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/7/9 9:53
|
|
|
|
|
+ * @Description: 已提现导出功能
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("expeortData")
|
|
|
|
|
+ @ApiOperation("导出已提现明细")
|
|
|
|
|
+ public HttpResult<List<SysAmountAuditingEntityDto>> expeortData(@RequestBody SysAmountAuditingVo sysAmountAuditingVo){
|
|
|
|
|
+ List<SysAmountAuditingEntity> exportIncomeTypeDetalsList = sysAmountAuditingService.expeortData(sysAmountAuditingVo);
|
|
|
|
|
+ List<SysAmountAuditingEntityDto> newList= new ArrayList<SysAmountAuditingEntityDto>();
|
|
|
|
|
+ int num=0;
|
|
|
|
|
+ if(exportIncomeTypeDetalsList!=null && exportIncomeTypeDetalsList.size()>0){
|
|
|
|
|
+ for(SysAmountAuditingEntity entity : exportIncomeTypeDetalsList){
|
|
|
|
|
+ num++;
|
|
|
|
|
+ SysAmountAuditingEntityDto vo=new SysAmountAuditingEntityDto(num, entity.getId(), entity.getUserId(),
|
|
|
|
|
+ entity.getUserName(), entity.getLeaderId(), entity.getLeaderName(), entity.getAccountName(),
|
|
|
|
|
+ entity.getBankCardNum(), entity.getBankName(), entity.getBankNum(), entity.getMobile(),
|
|
|
|
|
+ entity.getAmount(), entity.getSurplusAmount(), entity.getRealUserName(),
|
|
|
|
|
+ entity.getBankAccount(), entity.getBankAddress(), entity.getBankNumber(),
|
|
|
|
|
+ entity.getVoucherId(), entity.getCreateTime());
|
|
|
|
|
+ newList.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ExcelUtils<SysAmountAuditingEntityDto> excelUtils = new ExcelUtils<>(SysAmountAuditingEntityDto.class);
|
|
|
|
|
+ String fileName = "已提现明细" + System.currentTimeMillis() + ".xlsx";
|
|
|
|
|
+ String saveFilePath = uploadPath+"//" + EXCEL_PATH + fileName;
|
|
|
|
|
+ String resultPath = UPLOAD_PATH + fileName;
|
|
|
|
|
+ String sheetName = "已提现明细表";
|
|
|
|
|
+ try{
|
|
|
|
|
+ excelUtils.writeExcelNew(saveFilePath,sheetName, newList);
|
|
|
|
|
+ return HttpResult.ok(resultPath);
|
|
|
|
|
+ }catch(Exception e){
|
|
|
|
|
+ return HttpResult.error("导出已提现明细表失败:"+e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|