fix
Hentua
2023-06-06 a0b38fde518eb0f1970c31c5d64ed9f821f459aa
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -3,6 +3,7 @@
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.enumerates.*;
import cc.mrbird.febs.common.exception.FebsException;
import cc.mrbird.febs.common.exception.GeneratorException;
import cc.mrbird.febs.common.utils.AppContants;
import cc.mrbird.febs.common.utils.LoginUserUtil;
import cc.mrbird.febs.common.utils.MallUtils;
@@ -23,6 +24,8 @@
import cc.mrbird.febs.pay.service.UnipayService;
import cc.mrbird.febs.rabbit.producter.AgentProducer;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
@@ -142,6 +145,14 @@
                if (MallGoods.ISSALE_STATUS_DISABLED.equals(mallGoods.getIsSale())) {
                    throw new FebsException(mallGoods.getGoodsName() + "已下架");
                }
                if (mallGoods.getRulesTimes() != null && mallGoods.getRulesCnt() != null) {
                    DateTime startDate = DateUtil.offset(new Date(), DateField.DAY_OF_YEAR, -mallGoods.getRulesTimes());
                    List<MallOrderInfo> orderInfos = this.baseMapper.selectScoreOrderListInDate(DateUtil.beginOfDay(startDate), DateUtil.endOfDay(new Date()), mallGoods.getId());
                    if (CollUtil.isNotEmpty(orderInfos) && orderInfos.size() >= mallGoods.getRulesCnt()) {
                        throw new FebsException("超出领取最大限制");
                    }
                }
                BigDecimal amount = mallGoods.getScore().multiply(BigDecimal.valueOf(item.getCnt()));
@@ -529,16 +540,15 @@
            orderDetailVo.setRemainTime(remainTime);
        }
        if(2 == deliverType){
            MallShopApply mallShopApply = mallShopApplyMapper.selectById(orderInfo.getShopId());
            MallShop mallShopApply = mallShopMapper.selectById(orderInfo.getShopId());
            if(ObjectUtil.isNotEmpty(mallShopApply)){
                ApiShopApplyVo apiShopApplyVo = new ApiShopApplyVo();
                apiShopApplyVo.setName(mallShopApply.getName());
                apiShopApplyVo.setName(mallShopApply.getShopName());
                apiShopApplyVo.setPhone(mallShopApply.getPhone());
                apiShopApplyVo.setSaleArea(mallShopApply.getSaleArea());
                apiShopApplyVo.setLatitude(mallShopApply.getLatitude());
                apiShopApplyVo.setLongitude(mallShopApply.getLongitude());
                apiShopApplyVo.setLatitude(mallShopApply.getLatitude().toPlainString());
                apiShopApplyVo.setLongitude(mallShopApply.getLongitude().toPlainString());
                apiShopApplyVo.setShopName(mallShopApply.getShopName());
                apiShopApplyVo.setAddress(mallShopApply.getAddress());
                apiShopApplyVo.setAddress(mallShopApply.getShopAddress());
                orderDetailVo.setApiShopApplyVo(apiShopApplyVo);
            }
        }