liurunyu
2024-08-20 b65cbfb8452a95575f0dc637b55ed49f058597fe
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java
@@ -8,7 +8,9 @@
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import com.dy.pipIrrGlobal.voSe.VoCardInfo;
import com.dy.pipIrrGlobal.voSe.VoCards;
import com.dy.pipIrrGlobal.voSe.VoCards2;
import com.dy.pipIrrSell.clientCard.qo.QoCards;
import com.dy.pipIrrSell.clientCard.qo.QoCards2;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
@@ -136,13 +138,57 @@
    public BaseResponse<QueryResultVo<List<VoCards>>> getcards(QoCards vo){
        try {
            QueryResultVo<List<VoCards>> res = clientCardSv.getCards(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 = BaClient.class))}
            )
    })
    @GetMapping(path = "getUnreplaced")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCards>>> getUnreplaced(QoCards vo){
        try {
            QueryResultVo<List<VoCards>> res = clientCardSv.getUnreplaced(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询农户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据农户姓名、电话查询正常状态的水卡列表
     * @param vo
     * @return
     */
    @GetMapping(path = "getCardsByClientNameAndPhone")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCards2>>> getCardsByClientNameAndPhone(QoCards2 vo){
        try {
            QueryResultVo<List<VoCards2>> res = clientCardSv.getCardsByClientNameAndPhone(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);
            log.error("查询水卡异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }