KKSU
2023-12-11 b6ad0f29932c0a4f6053a765723aa4d80adcc706
src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java
@@ -314,19 +314,19 @@
        if(ObjectUtil.isEmpty(mallProductBuyRecord)){
            throw new FebsException("记录不存在");
        }
        Integer state = mallProductBuyRecord.getState();
        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
            throw new FebsException("记录不是待支付状态");
        }
//        Integer state = mallProductBuyRecord.getState();
//        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
//            throw new FebsException("记录不是待支付状态");
//        }
        MallProductSellRecord mallProductSellRecord = mallProductSellRecordMapper.selectById(mallProductBuyRecord.getSellRecordId());
        if(ObjectUtil.isEmpty(mallProductSellRecord)){
            throw new FebsException("记录不存在");
        }
        Integer stateSell = mallProductSellRecord.getState();
        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != stateSell){
            throw new FebsException("记录不是待支付状态");
        }
//        Integer stateSell = mallProductSellRecord.getState();
//        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != stateSell){
//            throw new FebsException("记录不是待支付状态");
//        }
        DateTime payTime = DateUtil.date();
        mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue());
@@ -365,19 +365,19 @@
        if(ObjectUtil.isEmpty(mallProductBuyRecord)){
            throw new FebsException("记录不存在");
        }
        Integer state = mallProductBuyRecord.getState();
        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != state){
            throw new FebsException("记录不是已支付状态");
        }
//        Integer state = mallProductBuyRecord.getState();
//        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != state){
//            throw new FebsException("记录不是已支付状态");
//        }
        Long sellRecordId = mallProductBuyRecord.getSellRecordId();
        MallProductSellRecord mallProductSellRecord = mallProductSellRecordMapper.selectById(mallProductBuyRecord.getSellRecordId());
        if(ObjectUtil.isEmpty(mallProductSellRecord)){
            throw new FebsException("记录不存在");
        }
        Integer stateSell = mallProductSellRecord.getState();
        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != stateSell){
            throw new FebsException("记录不是已支付状态");
        }
//        Integer stateSell = mallProductSellRecord.getState();
//        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != stateSell){
//            throw new FebsException("记录不是已支付状态");
//        }
        mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_CONFIRM.getValue());
        mallProductBuyRecordMapper.updateById(mallProductBuyRecord);
@@ -395,10 +395,10 @@
        if(ObjectUtil.isEmpty(mallProductBuyRecord)){
            throw new FebsException("记录不存在");
        }
        Integer state = mallProductBuyRecord.getState();
        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
            throw new FebsException("记录不是待支付状态");
        }
//        Integer state = mallProductBuyRecord.getState();
//        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
//            throw new FebsException("记录不是待支付状态");
//        }
        Long sellRecordId = mallProductBuyRecord.getSellRecordId();
        //更新买单子表的数据
        mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_FAIL.getValue());