|
|
@@ -5,11 +5,15 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.sqx.common.utils.SftpUtil;
|
|
|
import com.sqx.modules.app.entity.RechargeRecord;
|
|
|
import com.sqx.modules.app.service.RechargeRecordService;
|
|
|
+import com.sqx.modules.app.service.UserMoneyDetailsService;
|
|
|
import com.sqx.modules.common.service.CommonInfoService;
|
|
|
import com.sqx.modules.exportExecl.mapper.ExportJobMapper;
|
|
|
import com.sqx.modules.exportExecl.model.ExportJob;
|
|
|
import com.sqx.modules.exportExecl.service.ExportJobService;
|
|
|
import com.sqx.modules.order.service.AppOrderService;
|
|
|
+import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
|
|
|
+import com.sqx.modules.pay.controller.query.WalletDetailQuery;
|
|
|
+import com.sqx.modules.pay.service.CashOutService;
|
|
|
import com.sqx.modules.utils.excel.ExcelData;
|
|
|
import com.sqx.modules.utils.excel.ExportExcelUtils;
|
|
|
import com.sqx.scheduler.config.SchedulerLock;
|
|
|
@@ -55,6 +59,8 @@ public class ExportScheduler {
|
|
|
private final AppOrderService appOrderService;
|
|
|
private final RechargeRecordService rechargeRecordService;
|
|
|
private final SftpUtil sftpUtil;
|
|
|
+ private final CashOutService cashOutService;
|
|
|
+ private final UserMoneyDetailsService userMoneyDetailsService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -62,8 +68,8 @@ public class ExportScheduler {
|
|
|
* 每分钟运行一次
|
|
|
*/
|
|
|
@Async
|
|
|
- @Scheduled(cron = "18 */1 * * * ?", zone = "Asia/Shanghai")
|
|
|
-// @GetMapping("excelOrder")
|
|
|
+// @Scheduled(cron = "18 */1 * * * ?", zone = "Asia/Shanghai")
|
|
|
+ @GetMapping("excelOrder")
|
|
|
public void orderExport() throws Exception {
|
|
|
List<ExportJob> exportJobList=exportJobService.list(new QueryWrapper<ExportJob>()
|
|
|
.eq("flag",0).last("order by create_time limit 10"));
|
|
|
@@ -103,6 +109,12 @@ public class ExportScheduler {
|
|
|
excelData=getOrderExcelData(exportJob);
|
|
|
}else if("recharge".equals(fileType)){
|
|
|
excelData=getRechargeOrderExcelData(exportJob);
|
|
|
+ }else if("payouts".equals(fileType)){
|
|
|
+ excelData=getPayoutsExcelData(exportJob);
|
|
|
+ }else if("deposit".equals(fileType)){
|
|
|
+ excelData=getDepositExcelData(exportJob);
|
|
|
+ }else{
|
|
|
+ continue;
|
|
|
}
|
|
|
String value=commonInfoService.findOne(430).getValue();
|
|
|
ExportExcelUtils.writeExcel2(os,fileName,excelData);
|
|
|
@@ -216,4 +228,35 @@ public class ExportScheduler {
|
|
|
data.setRows(rows);
|
|
|
return data;
|
|
|
}
|
|
|
+
|
|
|
+ //提现管理导出
|
|
|
+ private ExcelData getPayoutsExcelData(ExportJob exportJob){
|
|
|
+ String[] conditions=exportJob.getConditions().split(",",-1);
|
|
|
+ CashOutQueryDTO queryDTO =new CashOutQueryDTO();
|
|
|
+ queryDTO.setZhifubaoName(conditions[1]);
|
|
|
+ queryDTO.setZhifubao(conditions[2]);
|
|
|
+ queryDTO.setShopName(conditions[3]);
|
|
|
+ if(!"".equals(conditions[4])){
|
|
|
+ queryDTO.setState(Integer.valueOf(conditions[4]));
|
|
|
+ }
|
|
|
+ queryDTO.setType(conditions[5]);
|
|
|
+ queryDTO.setStartTime(conditions[6]);
|
|
|
+ queryDTO.setEndTime(conditions[7]);
|
|
|
+ ExcelData excelData = cashOutService.excelPayDetails(queryDTO);
|
|
|
+ return excelData;
|
|
|
+ }
|
|
|
+
|
|
|
+ //导出保证金记录
|
|
|
+ private ExcelData getDepositExcelData(ExportJob exportJob){
|
|
|
+ String[] conditions=exportJob.getConditions().split(",",-1);
|
|
|
+ WalletDetailQuery queryDTO =new WalletDetailQuery();
|
|
|
+ queryDTO.setShopName(conditions[1]);
|
|
|
+ queryDTO.setType(conditions[2]);
|
|
|
+ queryDTO.setClassify(conditions[3]);
|
|
|
+ queryDTO.setStartTime(conditions[4]);
|
|
|
+ queryDTO.setEndTime(conditions[5]);
|
|
|
+ ExcelData excelData = userMoneyDetailsService.excelWalletDetails(queryDTO);
|
|
|
+
|
|
|
+ return excelData;
|
|
|
+ }
|
|
|
}
|