KKSU
2024-02-04 461588deea7f3a39f17d82736fa821414ed87c1c
确认收货更新用户的会员信息
3 files modified
47 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/quartz/ProfitJob.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java 40 ●●●● patch | view | raw | blame | history
src/test/java/cc/mrbird/febs/ProfitTest.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/quartz/ProfitJob.java
@@ -138,7 +138,7 @@
     * 买单
     * 看是否是开始显示订单的时间段,超出结束时间的买单,全部超时失败
     */
    @Scheduled(cron = "0 0/30 * * * ? ")
    @Scheduled(cron = "0 0/2 * * * ? ")
    public void timeGetOrderBuy() {
        agentService.timeGetOrderBuy();
    }
@@ -147,7 +147,7 @@
     * 买单
     * 看是否是开始显示订单的时间段,超出结束时间的买单,全部超时返还令牌
     */
    @Scheduled(cron = "0 0/30 * * * ? ")
    @Scheduled(cron = "0 0/2 * * * ? ")
    public void timeGetOrderBuyCancel() {
        agentService.timeGetOrderBuyCancel();
    }
src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java
@@ -1049,30 +1049,6 @@
                     * 3、更新卖单子表的数据
                     */
                    agentProducer.sendFcmOrderBuyCancelMsg(mallProductBuyRecord.getId());
//                    Long buyId = mallProductBuyRecord.getBuyId();
//                    Long sellRecordId = mallProductBuyRecord.getSellRecordId();
//                    MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(buyId);
//                    Long memberIdBuy = mallProductBuy.getMemberId();
//                    //冻结账户
//                    MallMember mallMemberBuy = memberMapper.selectById(memberIdBuy);
//                    mallMemberBuy.setIsFrozen(ProductEnum.MEMBER_FROZEN.getValue());
//                    memberMapper.updateById(mallMemberBuy);
//                    //更新买单子表的数据
//                    mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_FAIL.getValue());
//                    mallProductBuyRecordMapper.updateById(mallProductBuyRecord);
//                    //更新买单主表
//                    mallProductBuy.setNftAva(mallProductBuy.getNftAva().add(mallProductBuyRecord.getPickNftCnt()));
//                    mallProductBuyMapper.updateById(mallProductBuy);
//                    //更新卖单子表的数据
//                    MallProductSellRecord mallProductSellRecord = mallProductSellRecordMapper.selectById(sellRecordId);
//                    mallProductSellRecord.setState(ProductEnum.PRODUCT_MATE_STATE_FAIL.getValue());
//                    mallProductSellRecordMapper.updateById(mallProductSellRecord);
//                    //更新卖单主表
//                    Long sellId = mallProductSellRecord.getSellId();
//                    MallProductSell mallProductSell = mallProductSellMapper.selectById(sellId);
//                    mallProductSell.setNftCntAva(mallProductSell.getNftCntAva().add(mallProductSellRecord.getNftCnt()));
//                    mallProductSellMapper.updateById(mallProductSell);
                }
            }
        }
@@ -1119,12 +1095,12 @@
        if(CollUtil.isEmpty(mallProductNfts)){
            return;
        }
        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());
        DateTime nowTime = DateUtil.date();
//        DataDictionaryCustom endTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
//                DataDictionaryEnum.YU_YUE_END_TIME.getType(),
//                DataDictionaryEnum.YU_YUE_END_TIME.getCode()
//        );
//        DateTime endTime = DateUtil.parseTime(endTimeDic.getValue());
        for(MallProductNft mallProductNft : mallProductNfts){
            Long nftId = mallProductNft.getId();
            List<MallProductBuy> mallProductBuys = mallProductBuyMapper.selectListByStateAndProductNFTId(
@@ -1136,9 +1112,9 @@
            }
            for(MallProductBuy mallProductBuy : mallProductBuys){
                /**
                 * 当前时间比结束时间大
                 * 当前时间比创建时间大
                 */
                if(nowTime.compareTo(endTime) >= 0){
                if(nowTime.compareTo(mallProductBuy.getCreatedTime()) >= 0){
                    /**
                     * 返回令牌
                     * 预约记录超时
src/test/java/cc/mrbird/febs/ProfitTest.java
@@ -39,6 +39,9 @@
    @Autowired
    private IAgentService agentService;
    @Test
    public void dynamicProfit(){
    agentService.timeGetOrderBuyCancel();}
//    @Autowired
//    private AgentConsumer agentConsumer;
//