|
@@ -5,7 +5,7 @@ import java.util.List;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.*;
|
|
|
-import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import org.dromara.system.service.ISysOssService;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
@@ -36,10 +36,12 @@ public class TblArchivesController extends BaseController {
|
|
|
|
|
|
private final ITblArchivesService tblArchivesService;
|
|
|
|
|
|
+
|
|
|
+ private final ISysOssService sysOssService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询电子档案列表
|
|
|
*/
|
|
|
- @SaCheckPermission("system:archives:list")
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo<TblArchivesVo> list(TblArchivesBo bo, PageQuery pageQuery) {
|
|
|
return tblArchivesService.queryPageList(bo, pageQuery);
|
|
@@ -48,7 +50,6 @@ public class TblArchivesController extends BaseController {
|
|
|
/**
|
|
|
* 导出电子档案列表
|
|
|
*/
|
|
|
- @SaCheckPermission("system:archives:export")
|
|
|
@Log(title = "电子档案", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
public void export(TblArchivesBo bo, HttpServletResponse response) {
|
|
@@ -61,7 +62,6 @@ public class TblArchivesController extends BaseController {
|
|
|
*
|
|
|
* @param id 主键
|
|
|
*/
|
|
|
- @SaCheckPermission("system:archives:query")
|
|
|
@GetMapping("/{id}")
|
|
|
public R<TblArchivesVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
@PathVariable Long id) {
|
|
@@ -71,18 +71,24 @@ public class TblArchivesController extends BaseController {
|
|
|
/**
|
|
|
* 新增电子档案
|
|
|
*/
|
|
|
- @SaCheckPermission("system:archives:add")
|
|
|
@Log(title = "电子档案", businessType = BusinessType.INSERT)
|
|
|
@RepeatSubmit()
|
|
|
@PostMapping()
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody TblArchivesBo bo) {
|
|
|
+ TblArchivesBo b = new TblArchivesBo();
|
|
|
+ List<TblArchivesVo> list = tblArchivesService.queryList(new TblArchivesBo());
|
|
|
+ if(list.size()>0){
|
|
|
+ if(list.stream().filter(t->t.getQiuquan()!=null && t.getEcode()!=null &&( t.getQiuquan().equals(bo.getQiuquan())||t.getEcode().equals(bo.getEcode()))).toList().size()>0){
|
|
|
+ return R.fail("存在相同丘权或电子编号!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return toAjax(tblArchivesService.insertByBo(bo));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改电子档案
|
|
|
*/
|
|
|
- @SaCheckPermission("system:archives:edit")
|
|
|
@Log(title = "电子档案", businessType = BusinessType.UPDATE)
|
|
|
@RepeatSubmit()
|
|
|
@PutMapping()
|
|
@@ -95,11 +101,19 @@ public class TblArchivesController extends BaseController {
|
|
|
*
|
|
|
* @param ids 主键串
|
|
|
*/
|
|
|
- @SaCheckPermission("system:archives:remove")
|
|
|
@Log(title = "电子档案", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
@PathVariable Long[] ids) {
|
|
|
return toAjax(tblArchivesService.deleteWithValidByIds(List.of(ids), true));
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("/{id}/files")
|
|
|
+ public R<Void> files(@PathVariable Long id) {
|
|
|
+
|
|
|
+// sysOssService.queryPageList()
|
|
|
+
|
|
|
+// return toAjax(tblArchivesService.updateByBo(bo));
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
}
|