zhubaomin
2024-10-24 e5ac29afd5569196a54bd4f77457848afc7adf55
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java
@@ -11,7 +11,6 @@
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;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -42,7 +41,7 @@
    private final ClientCardSv clientCardSv;
    /**
     * 获取指定用户名下全部水卡
     * 获取指定用户名下全部水卡(物理卡+虚拟卡)
     * @param clientId
     * @return
     */
@@ -136,15 +135,6 @@
    @GetMapping(path = "getcards")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCards>>> getcards(QoCards vo){
        // 如果传入的是10位的水卡编号,升为17位水卡编号
        if(vo != null && vo.getCardNum() != null) {
            String cardNumS = String.valueOf(vo.getCardNum()).trim();
            if(cardNumS.length() == 10) {
                cardNumS = "100000" + cardNumS.substring(0,6) + "0" + cardNumS.substring(6);
                vo.setCardNum(Long.parseLong(cardNumS));
            }
        }
        try {
            QueryResultVo<List<VoCards>> res = clientCardSv.getCards(vo);
            return BaseResponseUtils.buildSuccess(res);
@@ -173,11 +163,8 @@
    public BaseResponse<QueryResultVo<List<VoCards>>> getUnreplaced(QoCards vo){
        try {
            QueryResultVo<List<VoCards>> res = clientCardSv.getUnreplaced(vo);
            if(res.itemTotal != null && res.itemTotal > 0) {
                return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(SellResultCode.THE_CARD_NOT_EXIST.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询农户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -194,11 +181,12 @@
    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());
            }
            return BaseResponseUtils.buildSuccess(res);
            //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()) ;