|
@@ -6,6 +6,7 @@ import com.bosshand.virgo.exception.ServiceException;
|
|
|
import com.bosshand.virgo.file.seal.model.*;
|
|
|
import com.bosshand.virgo.file.seal.service.SealService;
|
|
|
import com.bosshand.virgo.file.service.FileManagerService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -15,188 +16,189 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
+@Api(tags = {"印章管理"})
|
|
|
public class SealController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private SealService sealService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private FileManagerService fileManagerService;
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "印章列表")
|
|
|
- @RequestMapping(value = "/seal/{organizationId}", method = RequestMethod.GET)
|
|
|
- public Response getList(@PathVariable int organizationId) {
|
|
|
- return Response.ok(sealService.getList(organizationId));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "申请印章列表分页")
|
|
|
- @RequestMapping(value = "/sealRequest/{sealId}/{currPage}/{pageSize}", method = RequestMethod.GET)
|
|
|
- public Response getListLimit(@PathVariable int sealId,@PathVariable int currPage, @PathVariable int pageSize) {
|
|
|
- List<SealRequest> list = sealService.listSealRequest(sealId, currPage, pageSize);
|
|
|
- Map<String, Object> result = new HashMap<String, Object>();
|
|
|
- result.put("dataList", list);
|
|
|
- result.put("totalCount", sealService.listSealRequest(sealId).size());
|
|
|
- return Response.ok(result);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "印章详情")
|
|
|
- @RequestMapping(value = "/seal/detail/{id}", method = RequestMethod.GET)
|
|
|
- public Response get(@PathVariable int id) {
|
|
|
- return Response.ok(sealService.getById(id));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "创建印章")
|
|
|
- @RequestMapping(value = "/seal", method = RequestMethod.POST)
|
|
|
- public Response createSeal(@RequestBody Seal seal) {
|
|
|
- try {
|
|
|
- sealService.insert(seal);
|
|
|
- fileManagerService.convertTransparency(seal.getFileNodeId());
|
|
|
- } catch (ServiceException e) {
|
|
|
- return Response.fail(500,"创建失败");
|
|
|
- }
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "修改印章")
|
|
|
- @RequestMapping(value = "/seal", method = RequestMethod.PUT)
|
|
|
- public Response updateSeal(@RequestBody Seal seal) {
|
|
|
- try {
|
|
|
- sealService.update(seal);
|
|
|
- if(seal.getFileNodeId()!=0) {
|
|
|
- fileManagerService.convertTransparency(seal.getFileNodeId());
|
|
|
- }
|
|
|
- } catch (ServiceException e) {
|
|
|
- return Response.fail(500,"创建失败");
|
|
|
- }
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "删除印章")
|
|
|
- @RequestMapping(value = "/seal/{id}", method = RequestMethod.DELETE)
|
|
|
- public Response deleteSeal(@PathVariable int id) {
|
|
|
- sealService.delete(id);
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "申请印章")
|
|
|
- @RequestMapping(value = "/sealRequest", method = RequestMethod.POST)
|
|
|
- public Response createSealRequest(@RequestBody SealRequest sealRequest) {
|
|
|
- return Response.ok(sealService.saveSealRequest(sealRequest));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "申请印章详情")
|
|
|
- @RequestMapping(value = "/sealRequest/{id}", method = RequestMethod.GET)
|
|
|
- public Response getSealRequest(@PathVariable int id) {
|
|
|
- return Response.ok(sealService.getSealRequest(id));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "获取申请印章列表")
|
|
|
- @RequestMapping(value = "/sealRequest/{projectId}/{sealId}", method = RequestMethod.GET)
|
|
|
- public Response listeSealRequest(@PathVariable int projectId, @PathVariable int sealId) {
|
|
|
- return Response.ok(sealService.listSealRequest(projectId, sealId));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "获取申请印章分页列表")
|
|
|
- @RequestMapping(value = "/sealRequest/{projectId}/{sealId}/{currPage}/{pageSize}", method = RequestMethod.GET)
|
|
|
- public Response listeSealRequest(@PathVariable int projectId, @PathVariable int sealId, @PathVariable int currPage, @PathVariable int pageSize) {
|
|
|
- List<SealRequest> list = sealService.listSealRequest(projectId, sealId, currPage, pageSize);
|
|
|
- Map<String, Object> result = new HashMap<String, Object>();
|
|
|
- result.put("dataList", list);
|
|
|
- result.put("totalCount", sealService.listSealRequest(projectId, sealId).size());
|
|
|
- return Response.ok(result);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "印章", notes = "申请印章审核")
|
|
|
- @RequestMapping(value = "/sealRequest/{id}", method = RequestMethod.POST)
|
|
|
- public Response sealRequestStatus(@PathVariable int id, @RequestBody SealUsage sealUsage) {
|
|
|
- SealRequest sealRequest = sealService.getSealRequest(id);
|
|
|
- if(sealRequest == null) {
|
|
|
- throw new BadRequestException("Incorrect SealRequest");
|
|
|
- }
|
|
|
- sealService.updateSealRequestStatus(sealRequest, sealUsage);
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "判断审核中包含的所有文档中使用印章是否审核通过", notes = "判断审核中包含的所有文档中使用印章是否审核通过")
|
|
|
- @RequestMapping(value = "/sealRequest/document/{documentIds}", method = RequestMethod.GET)
|
|
|
- public Response sealRequestStatusBydocument(@PathVariable String documentIds) {
|
|
|
- return Response.ok(sealService.sealRequestStatusBydocument(documentIds));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "根据organizationId和projectId获取印章列表", notes = "根据organizationId和projectId获取印章列表")
|
|
|
- @RequestMapping(value = "/seal/{organizationId}/{projectId}", method = RequestMethod.GET)
|
|
|
- public Response getByProject(@PathVariable int organizationId, @PathVariable int projectId) {
|
|
|
- return Response.ok(sealService.getByProject(organizationId, projectId));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "绑定项目下印章", notes = "绑定项目下印章")
|
|
|
- @RequestMapping(value = "/seal/{organizationId}/{projectId}/{sealIds}", method = RequestMethod.POST)
|
|
|
- public Response bindProject(@PathVariable int organizationId, @PathVariable int projectId, @PathVariable String sealIds) {
|
|
|
- sealService.bindProject(organizationId, projectId, sealIds);
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- //===============================================================================
|
|
|
- // 个人注册章
|
|
|
- //===============================================================================
|
|
|
- @ApiOperation(value = "获取个人注册印章", notes = "获取个人注册印章")
|
|
|
- @RequestMapping(value = "/sealRegister/{userId}", method = RequestMethod.GET)
|
|
|
- public Response getSealRegister(@PathVariable long userId) {
|
|
|
- return Response.ok(sealService.getSealRegisterByUserId(userId));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "创建个人注册印章", notes = "创建个人注册印章")
|
|
|
- @RequestMapping(value = "/sealRegister", method = RequestMethod.POST)
|
|
|
- public Response createSealRegister(@RequestBody SealRegister sealRegister) {
|
|
|
- try {
|
|
|
- sealService.insertSealRegister(sealRegister);
|
|
|
- fileManagerService.blueConvertTransparency(sealRegister.getFileNodeId());
|
|
|
- } catch (ServiceException e) {
|
|
|
- return Response.fail(500,"创建失败");
|
|
|
- }
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "修改个人注册印章", notes = "修改个人注册印章")
|
|
|
- @RequestMapping(value = "/sealRegister", method = RequestMethod.PUT)
|
|
|
- public Response updateSealRegister(@RequestBody SealRegister sealRegister) {
|
|
|
- try {
|
|
|
- sealService.updateSealRegister(sealRegister);
|
|
|
- if(sealRegister.getFileNodeId()!=0) {
|
|
|
- fileManagerService.blueConvertTransparency(sealRegister.getFileNodeId());
|
|
|
- }
|
|
|
- } catch (ServiceException e) {
|
|
|
- return Response.fail(500,"创建失败");
|
|
|
- }
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "删除个人注册印章", notes = "删除个人注册印章")
|
|
|
- @RequestMapping(value = "/sealRegister/{id}", method = RequestMethod.DELETE)
|
|
|
- public Response deleteSealRegister(@PathVariable int id) {
|
|
|
- sealService.deleteSealRegister(id);
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "保存注册印章位置", notes = "保存注册印章位置")
|
|
|
- @RequestMapping(value = "/sealRegisterkey", method = RequestMethod.POST)
|
|
|
- public Response createSealRegisterKey(@RequestBody SealRegisterKey sealRegisterKey) {
|
|
|
- sealService.insertSealRegisterKey(sealRegisterKey);
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "获取注册印章位置", notes = "获取注册印章位置")
|
|
|
- @RequestMapping(value = "/sealRegisterkey/{documentId}", method = RequestMethod.GET)
|
|
|
- public Response getSealRegisterKey(@PathVariable int documentId) {
|
|
|
- return Response.ok(sealService.getSealRegisterKey(documentId));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "删除注册印章位置", notes = "删除注册印章位置")
|
|
|
- @RequestMapping(value = "/sealRegisterkey/{documentId}", method = RequestMethod.DELETE)
|
|
|
- public Response deleteSealRegisterKey(@PathVariable int documentId) {
|
|
|
- sealService.deleteSealRegisterKeyByDocumentId(documentId);
|
|
|
- return Response.ok();
|
|
|
- }
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private SealService sealService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FileManagerService fileManagerService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "印章列表")
|
|
|
+ @RequestMapping(value = "/seal/{organizationId}", method = RequestMethod.GET)
|
|
|
+ public Response getList(@PathVariable int organizationId) {
|
|
|
+ return Response.ok(sealService.getList(organizationId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "申请印章列表分页")
|
|
|
+ @RequestMapping(value = "/sealRequest/{sealId}/{currPage}/{pageSize}", method = RequestMethod.GET)
|
|
|
+ public Response getListLimit(@PathVariable int sealId, @PathVariable int currPage, @PathVariable int pageSize) {
|
|
|
+ List<SealRequest> list = sealService.listSealRequest(sealId, currPage, pageSize);
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", list);
|
|
|
+ result.put("totalCount", sealService.listSealRequest(sealId).size());
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "印章详情")
|
|
|
+ @RequestMapping(value = "/seal/detail/{id}", method = RequestMethod.GET)
|
|
|
+ public Response get(@PathVariable int id) {
|
|
|
+ return Response.ok(sealService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "创建印章")
|
|
|
+ @RequestMapping(value = "/seal", method = RequestMethod.POST)
|
|
|
+ public Response createSeal(@RequestBody Seal seal) {
|
|
|
+ try {
|
|
|
+ sealService.insert(seal);
|
|
|
+ fileManagerService.convertTransparency(seal.getFileNodeId());
|
|
|
+ } catch (ServiceException e) {
|
|
|
+ return Response.fail(500, "创建失败");
|
|
|
+ }
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "修改印章")
|
|
|
+ @RequestMapping(value = "/seal", method = RequestMethod.PUT)
|
|
|
+ public Response updateSeal(@RequestBody Seal seal) {
|
|
|
+ try {
|
|
|
+ sealService.update(seal);
|
|
|
+ if (seal.getFileNodeId() != 0) {
|
|
|
+ fileManagerService.convertTransparency(seal.getFileNodeId());
|
|
|
+ }
|
|
|
+ } catch (ServiceException e) {
|
|
|
+ return Response.fail(500, "创建失败");
|
|
|
+ }
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "删除印章")
|
|
|
+ @RequestMapping(value = "/seal/{id}", method = RequestMethod.DELETE)
|
|
|
+ public Response deleteSeal(@PathVariable int id) {
|
|
|
+ sealService.delete(id);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "申请印章")
|
|
|
+ @RequestMapping(value = "/sealRequest", method = RequestMethod.POST)
|
|
|
+ public Response createSealRequest(@RequestBody SealRequest sealRequest) {
|
|
|
+ return Response.ok(sealService.saveSealRequest(sealRequest));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "申请印章详情")
|
|
|
+ @RequestMapping(value = "/sealRequest/{id}", method = RequestMethod.GET)
|
|
|
+ public Response getSealRequest(@PathVariable int id) {
|
|
|
+ return Response.ok(sealService.getSealRequest(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "获取申请印章列表")
|
|
|
+ @RequestMapping(value = "/sealRequest/{projectId}/{sealId}", method = RequestMethod.GET)
|
|
|
+ public Response listSealRequest(@PathVariable int projectId, @PathVariable int sealId) {
|
|
|
+ return Response.ok(sealService.listSealRequest(projectId, sealId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "获取申请印章分页列表")
|
|
|
+ @RequestMapping(value = "/sealRequest/{projectId}/{sealId}/{currPage}/{pageSize}", method = RequestMethod.GET)
|
|
|
+ public Response listSealRequest(@PathVariable int projectId, @PathVariable int sealId, @PathVariable int currPage, @PathVariable int pageSize) {
|
|
|
+ List<SealRequest> list = sealService.listSealRequest(projectId, sealId, currPage, pageSize);
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", list);
|
|
|
+ result.put("totalCount", sealService.listSealRequest(projectId, sealId).size());
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "印章", notes = "申请印章审核")
|
|
|
+ @RequestMapping(value = "/sealRequest/{id}", method = RequestMethod.POST)
|
|
|
+ public Response sealRequestStatus(@PathVariable int id, @RequestBody SealUsage sealUsage) {
|
|
|
+ SealRequest sealRequest = sealService.getSealRequest(id);
|
|
|
+ if (sealRequest == null) {
|
|
|
+ throw new BadRequestException("Incorrect SealRequest");
|
|
|
+ }
|
|
|
+ sealService.updateSealRequestStatus(sealRequest, sealUsage);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "判断审核中包含的所有文档中使用印章是否审核通过", notes = "判断审核中包含的所有文档中使用印章是否审核通过")
|
|
|
+ @RequestMapping(value = "/sealRequest/document/{documentIds}", method = RequestMethod.GET)
|
|
|
+ public Response sealRequestStatusByDocument(@PathVariable String documentIds) {
|
|
|
+ return Response.ok(sealService.sealRequestStatusBydocument(documentIds));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据organizationId和projectId获取印章列表", notes = "根据organizationId和projectId获取印章列表")
|
|
|
+ @RequestMapping(value = "/seal/{organizationId}/{projectId}", method = RequestMethod.GET)
|
|
|
+ public Response getByProject(@PathVariable int organizationId, @PathVariable int projectId) {
|
|
|
+ return Response.ok(sealService.getByProject(organizationId, projectId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "绑定项目下印章", notes = "绑定项目下印章")
|
|
|
+ @RequestMapping(value = "/seal/{organizationId}/{projectId}/{sealIds}", method = RequestMethod.POST)
|
|
|
+ public Response bindProject(@PathVariable int organizationId, @PathVariable int projectId, @PathVariable String sealIds) {
|
|
|
+ sealService.bindProject(organizationId, projectId, sealIds);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ //===============================================================================
|
|
|
+ // 个人注册章
|
|
|
+ //===============================================================================
|
|
|
+ @ApiOperation(value = "获取个人注册印章", notes = "获取个人注册印章")
|
|
|
+ @RequestMapping(value = "/sealRegister/{userId}", method = RequestMethod.GET)
|
|
|
+ public Response getSealRegister(@PathVariable long userId) {
|
|
|
+ return Response.ok(sealService.getSealRegisterByUserId(userId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "创建个人注册印章", notes = "创建个人注册印章")
|
|
|
+ @RequestMapping(value = "/sealRegister", method = RequestMethod.POST)
|
|
|
+ public Response createSealRegister(@RequestBody SealRegister sealRegister) {
|
|
|
+ try {
|
|
|
+ sealService.insertSealRegister(sealRegister);
|
|
|
+ fileManagerService.blueConvertTransparency(sealRegister.getFileNodeId());
|
|
|
+ } catch (ServiceException e) {
|
|
|
+ return Response.fail(500, "创建失败");
|
|
|
+ }
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "修改个人注册印章", notes = "修改个人注册印章")
|
|
|
+ @RequestMapping(value = "/sealRegister", method = RequestMethod.PUT)
|
|
|
+ public Response updateSealRegister(@RequestBody SealRegister sealRegister) {
|
|
|
+ try {
|
|
|
+ sealService.updateSealRegister(sealRegister);
|
|
|
+ if (sealRegister.getFileNodeId() != 0) {
|
|
|
+ fileManagerService.blueConvertTransparency(sealRegister.getFileNodeId());
|
|
|
+ }
|
|
|
+ } catch (ServiceException e) {
|
|
|
+ return Response.fail(500, "创建失败");
|
|
|
+ }
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除个人注册印章", notes = "删除个人注册印章")
|
|
|
+ @RequestMapping(value = "/sealRegister/{id}", method = RequestMethod.DELETE)
|
|
|
+ public Response deleteSealRegister(@PathVariable int id) {
|
|
|
+ sealService.deleteSealRegister(id);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "保存注册印章位置", notes = "保存注册印章位置")
|
|
|
+ @RequestMapping(value = "/sealRegisterkey", method = RequestMethod.POST)
|
|
|
+ public Response createSealRegisterKey(@RequestBody SealRegisterKey sealRegisterKey) {
|
|
|
+ sealService.insertSealRegisterKey(sealRegisterKey);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取注册印章位置", notes = "获取注册印章位置")
|
|
|
+ @RequestMapping(value = "/sealRegisterkey/{documentId}", method = RequestMethod.GET)
|
|
|
+ public Response getSealRegisterKey(@PathVariable int documentId) {
|
|
|
+ return Response.ok(sealService.getSealRegisterKey(documentId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除注册印章位置", notes = "删除注册印章位置")
|
|
|
+ @RequestMapping(value = "/sealRegisterkey/{documentId}", method = RequestMethod.DELETE)
|
|
|
+ public Response deleteSealRegisterKey(@PathVariable int documentId) {
|
|
|
+ sealService.deleteSealRegisterKeyByDocumentId(documentId);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|