|
|
@@ -5,11 +5,17 @@ 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.datacentre.query.ShopCenterQuery;
|
|
|
+import com.sqx.modules.datacentre.service.DataCentreService;
|
|
|
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 +61,9 @@ public class ExportScheduler {
|
|
|
private final AppOrderService appOrderService;
|
|
|
private final RechargeRecordService rechargeRecordService;
|
|
|
private final SftpUtil sftpUtil;
|
|
|
+ private final CashOutService cashOutService;
|
|
|
+ private final UserMoneyDetailsService userMoneyDetailsService;
|
|
|
+ private final DataCentreService dataCentreService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -62,11 +71,11 @@ 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"));
|
|
|
+ .eq("flag",3).last("order by create_time limit 10"));
|
|
|
log.info("本次导出数据exportJobList==========="+exportJobList);
|
|
|
if (null == exportJobList ||exportJobList.isEmpty()){
|
|
|
return;
|
|
|
@@ -103,6 +112,14 @@ 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 if("shopCenter".equals(fileType)){
|
|
|
+ excelData=getShopCenterExcelData(exportJob);
|
|
|
+ }else{
|
|
|
+ continue;
|
|
|
}
|
|
|
String value=commonInfoService.findOne(430).getValue();
|
|
|
ExportExcelUtils.writeExcel2(os,fileName,excelData);
|
|
|
@@ -216,4 +233,47 @@ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ //导出商铺收益排行
|
|
|
+ private ExcelData getShopCenterExcelData(ExportJob exportJob){
|
|
|
+ String[] conditions=exportJob.getConditions().split(",",-1);
|
|
|
+ ShopCenterQuery query =new ShopCenterQuery();
|
|
|
+ query.setShopType(conditions[3]);
|
|
|
+ query.setStartTime(conditions[1]);
|
|
|
+ query.setEndTime(conditions[2]);
|
|
|
+ query.setDate(conditions[4]);
|
|
|
+ query.setDateType(conditions[5]);
|
|
|
+ return dataCentreService.excelShopCenter(query);
|
|
|
+ }
|
|
|
}
|