From fe031e01cc1737c2f05a133fde7c36c7a2a7b4b4 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 21 一月 2026 17:38:32 +0800
Subject: [PATCH] 2026.1.21 1. 新增完善台账复制逻辑
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt | 40 +++++++++++++++++++++++++++++++++-------
1 files changed, 33 insertions(+), 7 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt
index a35178d..2e89d21 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt
@@ -1,10 +1,16 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.service.CommitmentService
+import cn.flightfeather.supervision.lightshare.vo.BaseResponse
+import cn.flightfeather.supervision.lightshare.vo.CommitmentVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
+import io.swagger.annotations.ApiResponse
import org.springframework.web.bind.annotation.*
import org.springframework.web.multipart.MultipartFile
+import org.springframework.web.multipart.MultipartHttpServletRequest
+import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
/**
@@ -19,16 +25,36 @@
@ApiOperation(value = "鑾峰彇鐢ㄦ埛鎵胯涔�")
@GetMapping("/letter")
fun getLetterOfCommitment(
- @RequestParam("userId") userId: String,
- @RequestParam("page") page: Int,
- @RequestParam("per_page") perPage: Int,
- response: HttpServletResponse
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ @ApiParam(value = "椤电爜") @RequestParam("page") page: Int,
+ @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam("per_page") perPage: Int,
+ response: HttpServletResponse
) = commitmentService.getLetterOfCommitment(userId, page, perPage, response)
+ @ApiOperation(value = "鑾峰彇鐢ㄦ埛鎵胯涔︽ā鏉�")
+ @GetMapping("/letter/template")
+ fun getTemplateOfCommitment(
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ ) = commitmentService.getTemplateOfCommitment(userId)
+
+ @ApiOperation(value = "涓婁紶鎵胯涔�")
@PostMapping("/letter/upload")
fun uploadLetterOfCommitment(
- @RequestParam userId: String,
- @RequestParam("params") commitmentVoList: String,
- @RequestPart("images") files: Array<MultipartFile>
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+ @ApiParam(value = "鎵胯涔︿俊鎭痡son") @RequestParam("params") commitmentVoList: String,
+ @ApiParam(value = "鎵胯涔﹀浘鐗�") @RequestPart("images") files: Array<MultipartFile>
) = commitmentService.uploadLetterOfCommitment(userId, commitmentVoList, files)
+
+ @ApiOperation(value = "鐢熸垚鎵胯涔�")
+ @PostMapping("/letter/create")
+ fun createLetterOfCommitment(request: HttpServletRequest) = if (request is MultipartHttpServletRequest) {
+ val sign = request.getFile("sign")
+ val seal = request.getFile("seal")
+ val userId = request.getParameter("userId")
+ val vo = request.getParameter("coVo")
+
+ commitmentService.createLetterOfCommitment(userId, vo, sign, seal)
+ } else {
+ BaseResponse(false)
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3