|
|
@@ -16,10 +16,10 @@ import com.railway.business.catenary.service.IBusJcebLbjghjlService;
|
|
|
import com.railway.business.catenary.service.IBusJcebQmjcjlService;
|
|
|
import com.railway.business.catenary.service.IBusJcebXsjcjlService;
|
|
|
import com.railway.common.core.controller.BaseController;
|
|
|
-import com.railway.common.core.domain.entity.SysUser;
|
|
|
+import com.railway.common.core.domain.AjaxResult;
|
|
|
import com.railway.common.core.page.TableDataInfo;
|
|
|
-import com.railway.common.utils.SecurityUtils;
|
|
|
-import com.railway.common.enums.PostTypeEnum;
|
|
|
+import com.railway.common.utils.StringUtils;
|
|
|
+import com.railway.system.service.ISysFileService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import java.util.ArrayList;
|
|
|
@@ -52,6 +52,8 @@ public class BusJcebController extends BaseController {
|
|
|
private final IBusJcbJcxcService jcxcService;
|
|
|
private final IBusJcbWjcxcService wjcxcService;
|
|
|
|
|
|
+ private final ISysFileService fileService;
|
|
|
+
|
|
|
public BusJcebController(
|
|
|
IBusJcebXsjcjlService xsjcjlService,
|
|
|
IBusJcebQmjcjlService qmjcjlService,
|
|
|
@@ -64,7 +66,7 @@ public class BusJcebController extends BaseController {
|
|
|
IBusJcbFdfxjyqService fdfxjyqService,
|
|
|
IBusJcbGlkgService glkgService,
|
|
|
IBusJcbJcxcService jcxcService,
|
|
|
- IBusJcbWjcxcService wjcxcService) {
|
|
|
+ IBusJcbWjcxcService wjcxcService, ISysFileService fileService) {
|
|
|
this.xsjcjlService = xsjcjlService;
|
|
|
this.qmjcjlService = qmjcjlService;
|
|
|
this.lbjghjlService = lbjghjlService;
|
|
|
@@ -77,6 +79,7 @@ public class BusJcebController extends BaseController {
|
|
|
this.glkgService = glkgService;
|
|
|
this.jcxcService = jcxcService;
|
|
|
this.wjcxcService = wjcxcService;
|
|
|
+ this.fileService = fileService;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -84,14 +87,6 @@ public class BusJcebController extends BaseController {
|
|
|
@GetMapping(value = "listByType")
|
|
|
public TableDataInfo listByType(JcebQueryVo query) {
|
|
|
startPage();
|
|
|
- SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
- PostTypeEnum postType = PostTypeEnum.ofValue(user.getPost());
|
|
|
- if(postType == PostTypeEnum.STAFF){
|
|
|
- query.setCreateBy(user.getUserName());
|
|
|
- }else {
|
|
|
- query.setCreateBy(null);
|
|
|
- }
|
|
|
-
|
|
|
JcebTypeEnum jcebTypeEnum = JcebTypeEnum.ofValue(query.getJcebType());
|
|
|
List<JcebRecordVo> list = null;
|
|
|
switch (jcebTypeEnum){
|
|
|
@@ -137,6 +132,58 @@ public class BusJcebController extends BaseController {
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "导出Excel")
|
|
|
+ @GetMapping(value = "exportExcel")
|
|
|
+ public AjaxResult exportExcel(JcebQueryVo query) {
|
|
|
+ JcebTypeEnum jcebTypeEnum = JcebTypeEnum.ofValue(query.getJcebType());
|
|
|
+ String localFilePath = null;
|
|
|
+
|
|
|
+ switch (jcebTypeEnum){
|
|
|
+ case Jddz:
|
|
|
+ localFilePath = jddzService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Gjsfx:
|
|
|
+ localFilePath = gjsfxService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Qmjcjl:
|
|
|
+ localFilePath = qmjcjlService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Xsjcjl:
|
|
|
+ localFilePath = xsjcjlService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Jyzqsjl:
|
|
|
+ localFilePath = jyzqsjlService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Lbjghjl:
|
|
|
+ localFilePath = lbjghjlService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Blq:
|
|
|
+ localFilePath = blqService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Dmcgyq:
|
|
|
+ localFilePath = dmcgyqService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Fdfxjyq:
|
|
|
+ localFilePath = fdfxjyqService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Glkg:
|
|
|
+ localFilePath = glkgService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Jcxc:
|
|
|
+ localFilePath = jcxcService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ case Wjcxc:
|
|
|
+ localFilePath = wjcxcService.exportExcel(query);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(localFilePath)){
|
|
|
+ return AjaxResult.error("下载失败");
|
|
|
+ }
|
|
|
+ return fileService.uploadFile(localFilePath);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "汇总列表")
|
|
|
@GetMapping(value = "listAll")
|
|
|
public TableDataInfo listAll(JcebQueryVo query) {
|