Administrator
2023-12-15 2368b6f47ba2866e860c3476bb227572b94e3896
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
@@ -5,11 +5,14 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoSe.*;
import com.dy.pipIrrGlobal.pojoSe.SeActiveCard;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrSell.clientCard.CardStateENUM;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.recharge.DtoRecharge;
import com.dy.pipIrrSell.recharge.RechargeCtrl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -46,6 +49,8 @@
public class ActiveCardCtrl {
    private final ActiveCardSv activeCardSv;
    private final ClientCardSv clientCardSv;
    private final RechargeCtrl rechargeCtrl;
    @Operation(summary = "获得一页开卡记录", description = "返回一页开卡数据")
    @ApiResponses(value = {
@@ -91,6 +96,7 @@
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardCost         卡片费用
         * amount           充值金额
         * reissueAmount    补卡金额,补卡时使用
         * paymentId        支付方式编号
         * remarks          备注
@@ -101,6 +107,7 @@
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        Integer cardCost = po.getCardCost();
        Float amount = po.getAmount();
        Long paymentId = po.getPaymentId();
        String remarks = po.getRemarks();
        Long operator = po.getOperator();
@@ -140,6 +147,17 @@
            return BaseResponseUtils.buildFail("开卡失败-开卡记录写入异常");
        }
        if(amount != null && amount > 0) {
            DtoRecharge dtoRecharge = RechargeDtoMapper.INSTANCT.po2vo(po);
            dtoRecharge.setMoney(0f);
            dtoRecharge.setGift(0f);
            BaseResponse<Boolean> job = rechargeCtrl.addRecharge(dtoRecharge);
            if(!job.getCode().equals("0001")) {
                return BaseResponseUtils.buildFail("开卡成功,但充值失败");
            }
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }