admin
2023-02-01 856d99bb5adf7f8670206b01750bc0260b8666d2
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -14,6 +14,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -253,7 +254,7 @@
        if (oldHongBao == null)
            throw new HongBaoException(10, "红包对象不存在");
        // 已经失效,已经领取,领取中,新老状态一致的红包不做处理
        if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU|| oldHongBao.getState() == HongBaoV2.STATE_LINGQUING)
        if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU || oldHongBao.getState() == HongBaoV2.STATE_LINGQUING)
            return false;
        SystemEnum system = userInfoService.getUserSystem(commonOrder.getUserInfo().getId());
@@ -342,7 +343,7 @@
            List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
            if (children != null && children.size() > 0)
                for (HongBaoV2 child : children) {
                    if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING)
                    if (child.getState() == HongBaoV2.STATE_YILINGQU || child.getState() == HongBaoV2.STATE_LINGQUING)
                        continue;
                    HongBaoV2 childUpdate = new HongBaoV2(child.getId());
@@ -567,7 +568,7 @@
            List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
            if (children != null)
                for (HongBaoV2 child : children) {
                    if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING)
                    if (child.getState() == HongBaoV2.STATE_YILINGQU || child.getState() == HongBaoV2.STATE_LINGQUING)
                        continue;
                    HongBaoV2 childUpdate = new HongBaoV2(child.getId());
@@ -656,7 +657,7 @@
                    if (goods != null) {
                        try {
                            if (userSystemCouponService.updateCouponRecordUsed(commonOrder.getUserInfo().getId(),
                                    commonOrder.getOrderNo(), payMent, Long.parseLong(goods.getGoodsId()), commonOrder.getSourceType()))
                                    commonOrder.getOrderNo(), payMent, goods.getGoodsId(), commonOrder.getSourceType()))
                                mianDanMoney = payMent;
                        } catch (NumberFormatException e) {
                            throw new HongBaoException(10, "免单商品处理出错");
@@ -1001,7 +1002,7 @@
            HongBao hb = new HongBao();
            if (goods != null)
                hb.setAuctionId(Long.parseLong(goods.getGoodsId()));
                hb.setAuctionId(TaoBaoUtil.getAuctionId(goods.getGoodsId()));
            hb.setUserInfo(hongBao.getUserInfo());
            hb.setMoney(hongBao.getMoney());
@@ -1169,7 +1170,10 @@
    @Transactional
    @Override
    public void setHongBaoRecieved(Long uid, List<Integer> typeList, Date preGetTime) {
        hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime);
        String getMonth = TimeUtil.getGernalTime(preGetTime.getTime(), "yyyy-MM");
        //前面几个月的可能有未结算的,统一加入到本月结算
        hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime, getMonth);
    }