|
@@ -0,0 +1,53 @@
|
|
|
+package org.springblade.archive.controller;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.archive.entity.ArchiveProjectConfig;
|
|
|
+import org.springblade.archive.service.IArchiveProjectConfigService;
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/archiveProjectConfig")
|
|
|
+@Api(value = "档案配置信息", tags = "档案配置信息")
|
|
|
+public class ArchiveProjectConfigController {
|
|
|
+
|
|
|
+ private final IArchiveProjectConfigService archiveProjectConfigService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改档案配置信息
|
|
|
+ **/
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "修改档案配置", notes = "修改档案配置")
|
|
|
+ public R update(@Valid @RequestBody ArchiveProjectConfig config) {
|
|
|
+ ArchiveProjectConfig archiveProjectConfig = archiveProjectConfigService.getById(config.getId());
|
|
|
+ if (archiveProjectConfig == null) {
|
|
|
+ return R.fail(200, "未查询到对应节点信息");
|
|
|
+ }
|
|
|
+
|
|
|
+ archiveProjectConfig.setProjectType(config.getProjectType());
|
|
|
+ archiveProjectConfig.setFactorType(config.getFactorType());
|
|
|
+
|
|
|
+ boolean result = archiveProjectConfigService.updateById(archiveProjectConfig);
|
|
|
+ return R.status(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据项目ID获取档案配置信息
|
|
|
+ **/
|
|
|
+ @GetMapping("/getByProjectId")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "根据项目ID获取档案配置信息", notes = "根据项目ID获取档案配置信息")
|
|
|
+ public R<ArchiveProjectConfig> getByProjectId(@RequestParam Long projectId) {
|
|
|
+ ArchiveProjectConfig config = archiveProjectConfigService.getByProjectIdOrNew(projectId);
|
|
|
+ return R.data(config);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|