|
@@ -7,7 +7,9 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.archive.dto.ArchiveInspectionDTO;
|
|
|
import org.springblade.archive.entity.ArchiveInspection;
|
|
|
+import org.springblade.archive.entity.ArchivesAuto;
|
|
|
import org.springblade.archive.service.IArchiveInspectionService;
|
|
|
+import org.springblade.archive.service.IArchivesAutoService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
@@ -19,7 +21,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@Api(value = "档案检查信息", tags = "档案检查信息")
|
|
|
public class ArchiveInspectionInfoController {
|
|
|
|
|
|
- private IArchiveInspectionService archiveInspectionService;
|
|
|
+ private final IArchiveInspectionService archiveInspectionService;
|
|
|
+ private final IArchivesAutoService archivesAutoService;
|
|
|
|
|
|
@GetMapping("/detail")
|
|
|
@ApiOperationSupport(order = 2)
|
|
@@ -34,6 +37,15 @@ public class ArchiveInspectionInfoController {
|
|
|
@ApiOperation(value = "新增档案检查", notes = "传入archiveInspection")
|
|
|
public R addArchiveInspection(@RequestBody ArchiveInspection archiveInspection) {
|
|
|
|
|
|
+ if (archiveInspection.getArchiveId() != null ) {
|
|
|
+ ArchivesAuto archivesAuto = archivesAutoService.getById(archiveInspection.getArchiveId());
|
|
|
+ if (archivesAuto!= null ) {
|
|
|
+ archiveInspection.setArchiveName(archivesAuto.getName());
|
|
|
+ archiveInspection.setProjectId(archivesAuto.getProjectId());
|
|
|
+ archiveInspection.setTenantId(AuthUtil.getTenantId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
boolean success = archiveInspectionService.save(archiveInspection);
|
|
|
return success ? R.success("新增成功") : R.fail("新增失败");
|
|
|
}
|
|
@@ -50,7 +62,11 @@ public class ArchiveInspectionInfoController {
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "修改档案检查", notes = "传入archiveInspection")
|
|
|
public R submit(@RequestBody ArchiveInspection archiveInspection) {
|
|
|
- return R.status(archiveInspectionService.saveOrUpdate(archiveInspection));
|
|
|
+ ArchiveInspection archiveInspectionMod = archiveInspectionService.getById(archiveInspection.getId());
|
|
|
+ if (archiveInspectionMod!= null ) {
|
|
|
+ archiveInspectionMod.setOpinion(archiveInspection.getOpinion());
|
|
|
+ }
|
|
|
+ return R.status(archiveInspectionService.saveOrUpdate(archiveInspectionMod));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/opinion")
|