From 7aab004601e77890b158f19d1735594a8326feaa Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 24 四月 2025 17:11:17 +0800 Subject: [PATCH] 数据库事务注解位置调整 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 212 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java new file mode 100644 index 0000000..25f859e --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java @@ -0,0 +1,212 @@ +package com.dy.pipIrrRemote.records; + +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.voRm.VoClientAmountDay; +import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; +import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; +import com.dy.pipIrrGlobal.voSe.VoActiveCard; +import com.dy.pipIrrRemote.records.clientAmountDay.ClientAmountDayQueryVo; +import com.dy.pipIrrRemote.records.controllerAlarmState.ControllerAlarmStateQueryVo; +import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author :WuZeYu + * @Date :2024/7/22 20:00 + * @LastEditTime :2024/7/22 20:00 + * @Description + */ +@Slf4j +@Tag(name = "妫�娴嬫帶鍒舵煡璇�", description = "妫�娴嬫帶鍒舵煡璇�") +@RestController +@RequestMapping(path = "remoteRecords") +public class RecordsCtrl { + @Autowired + private RecordsSv recordsSv; + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鎺у埗鍣ㄦ姤璀︿笌鐘舵�佸垪琛紙鍘嗗彶锛� + * + * @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 = "/getControllerAlarmStateHistory") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory(@RequestBody ControllerAlarmStateQueryVo vo) { + try { + QueryResultVo<List<VoControllerAlarmState>> res = recordsSv.getControllerAlarmStateHistory(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鎺у埗鍣ㄦ姤璀︿笌鐘舵�佽褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鎺у埗鍣ㄦ姤璀︿笌鐘舵�佸垪琛紙鏈�鏂帮級 + * + * @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 = "/getControllerAlarmStateLast") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast(@RequestBody ControllerAlarmStateQueryVo vo) { + try { + QueryResultVo<List<VoControllerAlarmState>> res = recordsSv.getControllerAlarmStateLast(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鎺у埗鍣ㄨ褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻鍒楄〃锛堝巻鍙诧級 + * + * @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 = "/getClientAmountDayHistory") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayHistory(@RequestBody ClientAmountDayQueryVo vo) { + try { + QueryResultVo<List<VoClientAmountDay>> res = recordsSv.getClientAmountDayHistory(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻鍒楄〃锛堟渶鏂帮級 + * + * @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 = "/getClientAmountDayLast") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayLast(@RequestBody ClientAmountDayQueryVo vo) { + try { + QueryResultVo<List<VoClientAmountDay>> res = recordsSv.getClientAmountDayLast(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍙栨按鍙f棩鍙栨按閲忔紡鎹熷垪琛紙鍘嗗彶锛� + * + * @param vo 鏌ヨ鏉′欢 + * @return 绗﹀悎鏉′欢鐨勫彇姘村彛鏃ュ彇姘撮噺婕忔崯鍒楄〃锛堝巻鍙诧級 + */ + @Operation(summary = "鑾峰緱涓�椤靛彇姘村彛鏃ュ彇姘撮噺婕忔崯璁板綍", description = "杩斿洖涓�椤靛彇姘村彛鏃ュ彇姘撮噺婕忔崯鏁版嵁") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛彇姘村彛鏃ュ彇姘撮噺婕忔崯鏁版嵁锛圔aseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoActiveCard.class))} + ) + }) + @GetMapping(path = "/getIntakeAmountDayHistory") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory(@RequestBody IntakeAmountDayQueryVo vo) { + try { + QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayHistory(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍙栨按鍙f棩鍙栨按閲忔紡鎹熷垪琛紙鏈�鏂帮級 + * + * @param vo 鏌ヨ鏉′欢 + * @return 绗﹀悎鏉′欢鐨勫彇姘村彛鏃ュ彇姘撮噺婕忔崯鍒楄〃锛堟渶鏂帮級 + */ + @Operation(summary = "鑾峰緱涓�椤靛彇姘村彛鏃ュ彇姘撮噺婕忔崯璁板綍", description = "杩斿洖涓�椤靛彇姘村彛鏃ュ彇姘撮噺婕忔崯鏁版嵁") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛彇姘村彛鏃ュ彇姘撮噺婕忔崯鏁版嵁锛圔aseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoActiveCard.class))} + ) + }) + @GetMapping(path = "/getIntakeAmountDayLast") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast(@RequestBody IntakeAmountDayQueryVo vo) { + try { + QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayLast(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } +} -- Gitblit v1.8.0