wuzeyu
2024-01-27 8e330754825e837be6b6d71939c5ae9574b70109
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java
@@ -7,6 +7,9 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import com.dy.pipIrrGlobal.voSe.VoCardInfo;
import com.dy.pipIrrGlobal.voSe.VoCards;
import com.dy.pipIrrSell.clientCard.qo.QoCards;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -87,4 +90,60 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据水卡编号获取卡片状态
     * @param cardNum
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/cardstate")
    @SsoAop()
    public BaseResponse<String> getCardStateByCardNum(@RequestParam("cardNum") Long cardNum){
        try {
            String stateName = clientCardSv.getCardStateByCardNum(cardNum);
            return BaseResponseUtils.buildSuccess(stateName);
        } 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 = BaClient.class))}
            )
    })
    @GetMapping(path = "getcards")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCards>>> getcards(QoCards vo){
        try {
            QueryResultVo<List<VoCards>> res = clientCardSv.getCards(vo);
            if(res.itemTotal != null && res.itemTotal > 0) {
                return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(SellResultCode.THE_CARD_NOT_EXIST.getMessage());
            }
        } catch (Exception e) {
            log.error("查询农户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}