|
@@ -8,10 +8,8 @@ import com.qmth.paper.library.business.bean.result.EditResult;
|
|
|
import com.qmth.paper.library.business.entity.PaperArchives;
|
|
|
import com.qmth.paper.library.business.service.PaperArchivesService;
|
|
|
import com.qmth.paper.library.common.contant.SystemConstant;
|
|
|
-import com.qmth.paper.library.common.entity.SysUser;
|
|
|
import com.qmth.paper.library.common.util.Result;
|
|
|
import com.qmth.paper.library.common.util.ResultUtil;
|
|
|
-import com.qmth.paper.library.common.util.ServletUtil;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -29,7 +27,7 @@ import javax.validation.constraints.Min;
|
|
|
*/
|
|
|
@Api(tags = "档案管理表controller")
|
|
|
@RestController
|
|
|
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.paper}/library")
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.paper}/archives")
|
|
|
@Validated
|
|
|
@Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
|
|
|
public class PaperArchivesController {
|
|
@@ -37,34 +35,33 @@ public class PaperArchivesController {
|
|
|
private PaperArchivesService paperArchivesService;
|
|
|
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
- @RequestMapping(value = "/page", method = RequestMethod.POST)
|
|
|
+ @PostMapping("/page")
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
public Result page(@ApiParam(value = "档案所属学期") @RequestParam(required = false) Long semesterId,
|
|
|
- @ApiParam(value = "档案管理部门") @RequestParam(required = false) Long orgId,
|
|
|
+ @ApiParam(value = "档案管理部门") @RequestParam(required = false) Long managerOrgId,
|
|
|
@ApiParam(value = "档案类型") @RequestParam(required = false) Long archivesTypeId,
|
|
|
@ApiParam(value = "档案名称") @RequestParam(required = false) String archivesName,
|
|
|
@ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
@ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
- return ResultUtil.ok();
|
|
|
+ return ResultUtil.ok(paperArchivesService.pageData(semesterId, managerOrgId, archivesTypeId, archivesName, pageNumber, pageSize));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "新增")
|
|
|
- @RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = EditResult.class)})
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "新增成功", response = EditResult.class)})
|
|
|
public Result save(@Valid @RequestBody PaperArchives paperArchives, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
}
|
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- return ResultUtil.ok();
|
|
|
+ return ResultUtil.ok(paperArchivesService.saveData(paperArchives));
|
|
|
}
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "删除")
|
|
|
- @RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
+ @PostMapping("/delete")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "删除成功", response = Result.class)})
|
|
|
public Result delete(@ApiParam(value = "主键") @RequestParam(required = false) Long id) {
|
|
|
- return ResultUtil.ok();
|
|
|
+ return ResultUtil.ok(paperArchivesService.delete(id));
|
|
|
}
|
|
|
|
|
|
}
|