|
|
@@ -9,6 +9,7 @@ import com.sqx.common.utils.Result;
|
|
|
import com.sqx.common.utils.SftpUtil;
|
|
|
import com.sqx.modules.common.service.CommonInfoService;
|
|
|
import com.sqx.modules.datacentre.query.ShopCenterQuery;
|
|
|
+import com.sqx.modules.exportExecl.dto.AccountEntry;
|
|
|
import com.sqx.modules.exportExecl.mapper.ExportJobMapper;
|
|
|
import com.sqx.modules.exportExecl.model.ExportJob;
|
|
|
import com.sqx.modules.exportExecl.service.ExportJobService;
|
|
|
@@ -45,8 +46,6 @@ public class ExportExeclController {
|
|
|
|
|
|
private final AppOrderDao appOrderDao;
|
|
|
|
|
|
- private final ExportJobMapper exportJobMapper;
|
|
|
-
|
|
|
private final ExportJobService exportJobService;
|
|
|
|
|
|
private final CommonInfoService commonInfoService;
|
|
|
@@ -95,8 +94,8 @@ public class ExportExeclController {
|
|
|
exportJob.setUserId(userId);
|
|
|
exportJob.setCreateTime(new Date());
|
|
|
exportJob.setUpdateTime(new Date());
|
|
|
- int a=exportJobMapper.insert(exportJob);
|
|
|
- if (a==1){
|
|
|
+ boolean a=exportJobService.save(exportJob);
|
|
|
+ if (a){
|
|
|
return Result.success("新增导出计划成功");
|
|
|
}else{
|
|
|
return Result.error("新增导出计划失败");
|
|
|
@@ -108,23 +107,13 @@ public class ExportExeclController {
|
|
|
if(!StringUtils.hasText(userId)){
|
|
|
return Result.error("用户id不能为空");
|
|
|
}
|
|
|
- StringBuffer stringBuffer=new StringBuffer();
|
|
|
+ StringBuilder stringBuffer=new StringBuilder();
|
|
|
if(rechargeOrder!=null&&rechargeOrder!=""){stringBuffer.append("充值订单号:"+rechargeOrder+";");}
|
|
|
if(acount!=null&&acount!=""){stringBuffer.append("被充值账号:"+acount+";");}
|
|
|
|
|
|
- ExportJob exportJob =new ExportJob();
|
|
|
- exportJob.setFlag(0);
|
|
|
- exportJob.setFileType("recharge");
|
|
|
- exportJob.setConditionDetail(stringBuffer.toString());
|
|
|
- exportJob.setConditions(","+rechargeOrder+","+acount);
|
|
|
- LocalDateTime localDateTime = LocalDateTime.now();
|
|
|
- String time=localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
|
|
|
- exportJob.setFileName(time+"充值记录.xlsx");
|
|
|
- exportJob.setCreateTime(new Date());
|
|
|
- exportJob.setUpdateTime(new Date());
|
|
|
- exportJob.setUserId(userId);
|
|
|
- int a=exportJobMapper.insert(exportJob);
|
|
|
- if (a==1){
|
|
|
+ ExportJob exportJob =this.buildExportJob("充值记录.xlsx","recharge", userId,stringBuffer.toString(),","+rechargeOrder+","+acount);
|
|
|
+ boolean a=exportJobService.save(exportJob);
|
|
|
+ if (a){
|
|
|
return Result.success("新增导出计划成功");
|
|
|
}else{
|
|
|
return Result.error("新增导出计划失败");
|
|
|
@@ -137,19 +126,9 @@ public class ExportExeclController {
|
|
|
if(queryDTO.getUserId()==null){
|
|
|
return Result.error("用户id不能为空");
|
|
|
}
|
|
|
- ExportJob exportJob =new ExportJob();
|
|
|
- exportJob.setFlag(0);
|
|
|
- exportJob.setFileType("payouts");
|
|
|
- exportJob.setConditionDetail(queryDTO.toStrMessage());
|
|
|
- exportJob.setConditions(queryDTO.toStrCode());
|
|
|
- LocalDateTime localDateTime = LocalDateTime.now();
|
|
|
- String time=localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
|
|
|
- exportJob.setFileName(time+"提现管理.xlsx");
|
|
|
- exportJob.setCreateTime(new Date());
|
|
|
- exportJob.setUpdateTime(new Date());
|
|
|
- exportJob.setUserId(queryDTO.getUserId()+"");
|
|
|
- int a=exportJobMapper.insert(exportJob);
|
|
|
- if (a==1){
|
|
|
+ ExportJob exportJob =this.buildExportJob("提现管理.xlsx","payouts", String.valueOf(queryDTO.getUserId()),queryDTO.toStrMessage(),queryDTO.toStrCode());
|
|
|
+ boolean a=exportJobService.save(exportJob);
|
|
|
+ if (a){
|
|
|
return Result.success("新增提现管理导出计划成功");
|
|
|
}else{
|
|
|
return Result.error("新增提现管理导出计划失败");
|
|
|
@@ -162,19 +141,9 @@ public class ExportExeclController {
|
|
|
if(!StringUtils.hasText(queryDTO.getUserId())){
|
|
|
return Result.error("用户id不能为空");
|
|
|
}
|
|
|
- ExportJob exportJob =new ExportJob();
|
|
|
- exportJob.setFlag(0);
|
|
|
- exportJob.setFileType("deposit");
|
|
|
- exportJob.setConditionDetail(queryDTO.toStrMessage());
|
|
|
- exportJob.setConditions(queryDTO.toStrCode());
|
|
|
- LocalDateTime localDateTime = LocalDateTime.now();
|
|
|
- String time=localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
|
|
|
- exportJob.setFileName(time+"保证金记录.xlsx");
|
|
|
- exportJob.setCreateTime(new Date());
|
|
|
- exportJob.setUpdateTime(new Date());
|
|
|
- exportJob.setUserId(queryDTO.getUserId()+"");
|
|
|
- int a=exportJobMapper.insert(exportJob);
|
|
|
- if (a==1){
|
|
|
+ ExportJob exportJob =this.buildExportJob("保证金记录.xlsx","deposit",queryDTO.getUserId(),queryDTO.toStrMessage(),queryDTO.toStrCode());
|
|
|
+ boolean a=exportJobService.save(exportJob);
|
|
|
+ if (a){
|
|
|
return Result.success("新增保证金记录导出计划成功");
|
|
|
}else{
|
|
|
return Result.error("新增保证金记录导出计划失败");
|
|
|
@@ -244,28 +213,50 @@ public class ExportExeclController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //构建导出对象
|
|
|
+ private ExportJob buildExportJob(String fileName,String fileType,String userId,String condDetail,String condCode){
|
|
|
+ ExportJob exportJob=new ExportJob();
|
|
|
+ //设置为待导出
|
|
|
+ exportJob.setFlag(0);
|
|
|
+ exportJob.setFileType(fileType);
|
|
|
+ exportJob.setConditionDetail(condDetail);
|
|
|
+ exportJob.setConditions(condCode);
|
|
|
+ LocalDateTime localDateTime = LocalDateTime.now();
|
|
|
+ String time=localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
|
|
|
+ exportJob.setFileName(time+fileName);
|
|
|
+ exportJob.setCreateTime(new Date());
|
|
|
+ exportJob.setUpdateTime(new Date());
|
|
|
+ exportJob.setUserId(userId);
|
|
|
+ return exportJob;
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("excelShopCenter")
|
|
|
@ApiOperation("导出商户收益统计")
|
|
|
public Result excelShopCenter(ShopCenterQuery queryDTO) throws Exception{
|
|
|
if(!StringUtils.hasText(queryDTO.getUserId())){
|
|
|
return Result.error("用户id不能为空");
|
|
|
}
|
|
|
- ExportJob exportJob =new ExportJob();
|
|
|
- exportJob.setFlag(0);
|
|
|
- exportJob.setFileType("shopCenter");
|
|
|
- exportJob.setConditionDetail(queryDTO.toStrMessage());
|
|
|
- exportJob.setConditions(queryDTO.toStrCode());
|
|
|
- LocalDateTime localDateTime = LocalDateTime.now();
|
|
|
- String time=localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
|
|
|
- exportJob.setFileName(time+"商铺收益排行.xlsx");
|
|
|
- exportJob.setCreateTime(new Date());
|
|
|
- exportJob.setUpdateTime(new Date());
|
|
|
- exportJob.setUserId(queryDTO.getUserId()+"");
|
|
|
- int a=exportJobMapper.insert(exportJob);
|
|
|
- if (a==1){
|
|
|
+ ExportJob exportJob =this.buildExportJob("商铺收益排行.xlsx","shopCenter",queryDTO.getUserId(),queryDTO.toStrMessage(),queryDTO.toStrCode());
|
|
|
+ boolean a=exportJobService.save(exportJob);
|
|
|
+ if (a){
|
|
|
return Result.success("新增商铺收益排行导出计划成功");
|
|
|
}else{
|
|
|
return Result.error("新增商铺收益排行导出计划失败");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("excelAccountEntry")
|
|
|
+ @ApiOperation("导出入账管理")
|
|
|
+ public Result excelAccountEntry(AccountEntry queryDTO) throws Exception{
|
|
|
+ if(!StringUtils.hasText(queryDTO.getUserId())){
|
|
|
+ return Result.error("用户id不能为空");
|
|
|
+ }
|
|
|
+ ExportJob exportJob =this.buildExportJob("入账管理.xlsx","accountEntry",queryDTO.getUserId(),queryDTO.toStrMessage(),queryDTO.toStrCode());
|
|
|
+ boolean a=exportJobService.save(exportJob);
|
|
|
+ if (a){
|
|
|
+ return Result.success("新增入账管理导出计划成功");
|
|
|
+ }else{
|
|
|
+ return Result.error("新增入账管理导出计划失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|