|
@@ -1,5 +1,6 @@
|
|
|
package com.qunzhixinxi.hnqz.admin.controller.pkg;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.constant.enums.ExportType;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.dto.WmPkgDTO;
|
|
@@ -19,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 积分包导出控制器
|
|
@@ -44,6 +47,14 @@ public class WmScorePackageExportController {
|
|
|
@SysLog("个人执行包数据异步导出")
|
|
|
@PostMapping("/pkg/sub-info/export")
|
|
|
public R<Boolean> exportPackageSubInfo(@Validated @RequestBody WmPkgDTO.OnPkgSubExport params) {
|
|
|
+ HnqzUser user = SecurityUtils.getUser();
|
|
|
+ List<Integer> roles = SecurityUtils.getRoles();
|
|
|
+
|
|
|
+ // 4-区域管理员, 37-服务供应商管理员
|
|
|
+ if (!CollUtil.containsAny(roles, Arrays.asList(4, 37))) {
|
|
|
+ throw new RuntimeException("没有导出个人执行包数据权限");
|
|
|
+ }
|
|
|
+
|
|
|
LocalDate startDate = params.getStartDate();
|
|
|
LocalDate endDate = params.getEndDate();
|
|
|
|
|
@@ -56,7 +67,7 @@ public class WmScorePackageExportController {
|
|
|
startDate = LocalDate.of(today.getYear(), today.getMonth(), 1);
|
|
|
}
|
|
|
|
|
|
- return R.ok(scorePackageExportService.asyncExport(SecurityUtils.getUser(), SecurityUtils.getRoles(), startDate, endDate));
|
|
|
+ return R.ok(scorePackageExportService.asyncExport(user, roles, startDate, endDate));
|
|
|
}
|
|
|
|
|
|
/**
|