| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.FlowTypeNewEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeNewEnum; |
| | | import cc.mrbird.febs.common.enumerates.ProductEnum; |
| | |
| | | private final MallProductBuyRecordMapper mallProductBuyRecordMapper; |
| | | private final IMallMoneyFlowService mallMoneyFlowService; |
| | | private final AgentProducer agentProducer; |
| | | private final MallMemberSpeakMapper mallMemberSpeakMapper; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @Override |
| | | public IPage<AdminMallNewsInfoVo> getNewInfoList(MallNewsInfo mallNewsInfo, QueryRequest request) { |
| | |
| | | public IPage<AdminMallProductBuyVo> getBuyList(MallProductBuy mallProductBuy, QueryRequest request) { |
| | | Page<AdminMallProductBuyVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<AdminMallProductBuyVo> adminMallProductBuyVoIPage = mallProductNftMapper.getBuyList(page, mallProductBuy); |
| | | DateTime nowTime = DateUtil.parseTime(DateUtil.formatTime(DateUtil.date())); |
| | | DataDictionaryCustom endTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.YU_YUE_END_TIME.getType(), |
| | | DataDictionaryEnum.YU_YUE_END_TIME.getCode() |
| | | ); |
| | | DateTime endTime = DateUtil.parseTime(endTimeDic.getValue()); |
| | | /** |
| | | * 当前时间比结束时间大 |
| | | */ |
| | | List<AdminMallProductBuyVo> records = adminMallProductBuyVoIPage.getRecords(); |
| | | if(CollUtil.isNotEmpty(records)){ |
| | | for(AdminMallProductBuyVo adminMallProductBuyVo :records){ |
| | | if(nowTime.compareTo(endTime) >= 0){ |
| | | adminMallProductBuyVo.setButtonState(0); |
| | | }else{ |
| | | adminMallProductBuyVo.setButtonState(1); |
| | | } |
| | | } |
| | | } |
| | | return adminMallProductBuyVoIPage; |
| | | } |
| | | |
| | |
| | | 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()); |
| | |
| | | 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); |
| | |
| | | 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()); |
| | |
| | | mallProductSellMapper.updateById(mallProductSell); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MallMemberSpeak> getSpeakList(MallMemberSpeak mallMemberSpeak, QueryRequest request) { |
| | | Page<MallMemberSpeak> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<MallMemberSpeak> adminMallNewsInfoVoIPage = mallProductSellMapper.getSpeakListInPage(page, mallMemberSpeak); |
| | | return adminMallNewsInfoVoIPage; |
| | | } |
| | | } |