From 7bce3a96c4a1a61a2c299be033c3fb798648ad78 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 22 十月 2024 15:05:49 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectCtrl.java | 67 ++++++++++++++++++++++++++++++--- 1 files changed, 60 insertions(+), 7 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectCtrl.java index ddcbe74..6f46207 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectCtrl.java @@ -3,8 +3,14 @@ import com.dy.common.aop.SsoAop; import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryResultVo; import com.dy.common.webUtil.ResultCodeMsg; import com.dy.pipIrrGlobal.pojoIr.IrProject; +import com.dy.pipIrrGlobal.pojoPr.PrIntake; +import com.dy.pipIrrGlobal.voIr.VoProject; +import com.dy.pipIrrGlobal.voIr.VoProjectOne; +import com.dy.pipIrrGlobal.voPr.VoIntake; +import com.dy.pipIrrGlobal.voSe.VoActiveCard; import com.dy.pipIrrIrrigate.result.IrrigateResultCode; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; @@ -19,10 +25,7 @@ import org.springframework.http.MediaType; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.lang.reflect.Array; import java.util.*; @@ -118,12 +121,13 @@ @PostMapping(path = "delete_batch", consumes = MediaType.APPLICATION_JSON_VALUE) @Transactional(rollbackFor = Exception.class) @SsoAop() - public BaseResponse<Boolean> delete_batch(@RequestBody List<Long> projectIds) { + public BaseResponse<Boolean> delete_batch(@RequestBody Map<String,List> projectIds) { if (projectIds == null || projectIds.size() <= 0) { BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage()); } - for (int i = 0; i < projectIds.size(); i++) { - Long projectId = projectIds.get(i); + List ids = projectIds.get("projectIds"); + for (int i = 0; i < ids.size(); i++) { + long projectId = Long.parseLong(ids.get(i).toString()); try { Integer rows = projectSv.deleteProject(projectId); if (rows == 0) { @@ -201,4 +205,53 @@ } return BaseResponseUtils.buildSuccess(true); } + + /** + * 鑾峰彇涓�涓」鐩暟鎹� + * + * @return 鑾峰彇涓�涓」鐩暟鎹� + */ + @Operation(summary = "鑾峰彇涓�涓」鐩暟鎹�", description = "鑾峰彇涓�涓」鐩暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鑾峰彇涓�涓」鐩暟鎹紙BaseResponse.content:{}锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = IrProject.class))} + ) + }) + @GetMapping(path = "one") + @SsoAop() + public BaseResponse<VoProjectOne> one(@RequestParam Long id) { + VoProjectOne irProject = this.projectSv.selectById(id); + + return BaseResponseUtils.buildSuccess(irProject); + + } + + /** + * 鍒嗛〉鏌ヨ + * @param vo + * @return + */ + @Operation(summary = "鑾峰緱涓�椤甸」鐩褰�", description = "鑾峰緱涓�椤甸」鐩褰�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鑾峰緱涓�椤甸」鐩褰曪紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoActiveCard.class))} + ) + }) + @GetMapping(path = "some") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoProject>>> getProjects(QueryVo vo) { + try { + QueryResultVo<List<VoProject>> res = projectSv.getProjects(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇椤圭洰璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } } -- Gitblit v1.8.0