|
@@ -1,9 +1,95 @@
|
|
package com.citu.module.menduner.system.controller.admin.projectexp;
|
|
package com.citu.module.menduner.system.controller.admin.projectexp;
|
|
|
|
|
|
-/**
|
|
|
|
- * @author rayson
|
|
|
|
- * @description ProjectExpController
|
|
|
|
- * @create 2024/5/21 下午2:49
|
|
|
|
- **/
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
+
|
|
|
|
+import javax.validation.constraints.*;
|
|
|
|
+import javax.validation.*;
|
|
|
|
+import javax.servlet.http.*;
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+
|
|
|
|
+import com.citu.framework.common.pojo.PageParam;
|
|
|
|
+import com.citu.framework.common.pojo.PageResult;
|
|
|
|
+import com.citu.framework.common.pojo.CommonResult;
|
|
|
|
+import com.citu.framework.common.util.object.BeanUtils;
|
|
|
|
+import static com.citu.framework.common.pojo.CommonResult.success;
|
|
|
|
+
|
|
|
|
+import com.citu.framework.excel.core.util.ExcelUtils;
|
|
|
|
+
|
|
|
|
+import com.citu.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
|
+import static com.citu.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
|
|
+
|
|
|
|
+import com.citu.module.menduner.system.controller.admin.projectexp.vo.*;
|
|
|
|
+import com.citu.module.menduner.system.dal.dataobject.projectexp.ProjectExpDO;
|
|
|
|
+import com.citu.module.menduner.system.service.projectexp.ProjectExpService;
|
|
|
|
+
|
|
|
|
+@Tag(name = "管理后台 - 门墩儿-项目经历")
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/menduner/system/project-exp")
|
|
|
|
+@Validated
|
|
public class ProjectExpController {
|
|
public class ProjectExpController {
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProjectExpService projectExpService;
|
|
|
|
+
|
|
|
|
+ @PostMapping("/create")
|
|
|
|
+ @Operation(summary = "创建门墩儿-项目经历")
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('menduner:system:project-exp:create')")
|
|
|
|
+ public CommonResult<Long> createProjectExp(@Valid @RequestBody ProjectExpSaveReqVO createReqVO) {
|
|
|
|
+ return success(projectExpService.createProjectExp(createReqVO));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PutMapping("/update")
|
|
|
|
+ @Operation(summary = "更新门墩儿-项目经历")
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('menduner:system:project-exp:update')")
|
|
|
|
+ public CommonResult<Boolean> updateProjectExp(@Valid @RequestBody ProjectExpSaveReqVO updateReqVO) {
|
|
|
|
+ projectExpService.updateProjectExp(updateReqVO);
|
|
|
|
+ return success(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @DeleteMapping("/delete")
|
|
|
|
+ @Operation(summary = "删除门墩儿-项目经历")
|
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('menduner:system:project-exp:delete')")
|
|
|
|
+ public CommonResult<Boolean> deleteProjectExp(@RequestParam("id") Long id) {
|
|
|
|
+ projectExpService.deleteProjectExp(id);
|
|
|
|
+ return success(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/get")
|
|
|
|
+ @Operation(summary = "获得门墩儿-项目经历")
|
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('menduner:system:project-exp:query')")
|
|
|
|
+ public CommonResult<ProjectExpRespVO> getProjectExp(@RequestParam("id") Long id) {
|
|
|
|
+ ProjectExpDO projectExp = projectExpService.getProjectExp(id);
|
|
|
|
+ return success(BeanUtils.toBean(projectExp, ProjectExpRespVO.class));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/page")
|
|
|
|
+ @Operation(summary = "获得门墩儿-项目经历分页")
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('menduner:system:project-exp:query')")
|
|
|
|
+ public CommonResult<PageResult<ProjectExpRespVO>> getProjectExpPage(@Valid ProjectExpPageReqVO pageReqVO) {
|
|
|
|
+ PageResult<ProjectExpDO> pageResult = projectExpService.getProjectExpPage(pageReqVO);
|
|
|
|
+ return success(BeanUtils.toBean(pageResult, ProjectExpRespVO.class));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/export-excel")
|
|
|
|
+ @Operation(summary = "导出门墩儿-项目经历 Excel")
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('menduner:system:project-exp:export')")
|
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
|
+ public void exportProjectExpExcel(@Valid ProjectExpPageReqVO pageReqVO,
|
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
+ List<ProjectExpDO> list = projectExpService.getProjectExpPage(pageReqVO).getList();
|
|
|
|
+ // 导出 Excel
|
|
|
|
+ ExcelUtils.write(response, "门墩儿-项目经历.xls", "数据", ProjectExpRespVO.class,
|
|
|
|
+ BeanUtils.toBean(list, ProjectExpRespVO.class));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|