liurunyu
2025-04-24 7aab004601e77890b158f19d1735594a8326feaa
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/lossDay/LossDayCtrl.java
New file
@@ -0,0 +1,95 @@
package com.dy.pipIrrRemote.records.lossDay;
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.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voRm.VoLossDay;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo;
import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDaySv;
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.*;
import java.util.List;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  15:29
 * @LastEditTime :2024/7/24  15:29
 * @Description
 */
@Slf4j
@Tag(name = "漏损记录查询", description = "漏损记录查询")
@RestController
@RequestMapping(path = "lossDay")
public class LossDayCtrl {
    @Autowired
    private LossDaySv lossDaySv;
    /**
     * 根据指定条件获取漏损记录列表(历史)
     *
     * @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 = "/getLossDayHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayHistory( LossDayQueryVo vo) {
        try {
            QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayHistory(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 = "/getLossDayLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayLast( LossDayQueryVo vo) {
        try {
            QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取漏损记录记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}