Administrator
2024-01-23 f27bcdd3a3dcc85fdb8334399240d27d7f964c01
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java
@@ -5,6 +5,7 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import com.dy.pipIrrGlobal.pojoSe.SeCardOperate;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.util.Constant;
@@ -13,6 +14,8 @@
import com.dy.pipIrrSell.cardOperate.dto.*;
import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM;
import com.dy.pipIrrSell.cardOperate.qo.QoRecharge;
import com.dy.pipIrrSell.cardOperate.qo.QoTransaction;
import com.dy.pipIrrSell.cardOperate.qo.QoTransactionStatistics;
import com.dy.pipIrrSell.clientCard.CardStateENUM;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
@@ -364,11 +367,13 @@
        /**
         * 添加注销记录
         * 支付方式为现金
         */
        SeCardOperate seCardOperate = new SeCardOperate();
        seCardOperate.setCardId(cardId);
        seCardOperate.setClientId(clientId);
        seCardOperate.setTradeAmount(-refund);
        seCardOperate.setPaymentId(1L);
        seCardOperate.setOperateType(OperateTypeENUM.CANCEL.getCode());
        seCardOperate.setRemarks(remarks);
        seCardOperate.setOperator(operator);
@@ -750,4 +755,53 @@
            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 = "getTransactions")
    @SsoAop()
    public BaseResponse<Map> getOperates(QoTransaction vo){
        try {
            Map res = cardOperateSv.getTransactions(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询交易记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    @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 = "getStatistics")
    @SsoAop()
    public BaseResponse<Map> getStatistics(QoTransactionStatistics vo){
        try {
            Map res = cardOperateSv.getTransactionStatistics(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询交易汇总记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}