| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.ClientTypeEnum; |
| | | import com.ruoyi.common.core.enums.GroupStatusEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.enums.*; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.WebsocketMessageDTO; |
| | | import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.RefundDTO; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.vo.GoodsGroupPurchaseInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.OrderVO; |
| | | import com.ruoyi.system.api.domain.vo.WdGoodsGroupPurchaseVO; |
| | |
| | | goodsGroupPurchaseInfoVO.setGroupSize(one.getGroupSize()); |
| | | goodsGroupPurchaseInfoVO.setLimitNumber(one.getLimitNumber()); |
| | | |
| | | LambdaQueryWrapper<GoodsGroupPurchaseInfo> wrapper6= Wrappers.lambdaQuery(); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getDelFlag,0); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getGroupStatus,0); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getGroupPurchaseId,one.getId()); |
| | | GoodsGroupPurchaseInfo one1 = goodsGroupPurchaseInfoService.getOne(wrapper6); |
| | | if (one1!=null){ |
| | | goodsGroupPurchaseInfoVO.setCurrentNumber(one1.getCurrentNumber()); |
| | | if (one1.getGroupStatus()==0){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.TO_FORM_A_GROUP); |
| | | }else{ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.FORMED_INTO_A_GROUP); |
| | | } |
| | | if (one.getGroupStatus().getCode()==2){ |
| | | LambdaQueryWrapper<GoodsGroupPurchaseInfo> wrapper6= Wrappers.lambdaQuery(); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getDelFlag,0); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getGroupStatus,0); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getGroupPurchaseId,one.getId()); |
| | | GoodsGroupPurchaseInfo one1 = goodsGroupPurchaseInfoService.getOne(wrapper6); |
| | | if (one1!=null){ |
| | | goodsGroupPurchaseInfoVO.setCurrentNumber(one1.getCurrentNumber()); |
| | | if (one1.getGroupStatus()==0){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.TO_FORM_A_GROUP); |
| | | }if(one1.getGroupStatus()==1){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.FORMED_INTO_A_GROUP); |
| | | }if(one1.getGroupStatus()==2){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.GROUP_FAILURE); |
| | | } |
| | | |
| | | }else{ |
| | | goodsGroupPurchaseInfoVO.setCurrentNumber(one.getCurrentNumber()); |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(one.getGroupStatus()); |
| | | } |
| | | }else{ |
| | | goodsGroupPurchaseInfoVO.setCurrentNumber(one.getCurrentNumber()); |
| | | goodsGroupPurchaseInfoVO.setCurrentNumber(one.getGroupSize()); |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(one.getGroupStatus()); |
| | | } |
| | | |
| | | goodsGroupPurchaseInfoVO.setStartTime(one.getStartTime()); |
| | | goodsGroupPurchaseInfoVO.setEndTime(one.getEndTime()); |
| | | goodsGroupPurchaseInfoVO.setDescription(one.getDescription()); |
| | |
| | | if (one7!=null){ |
| | | goodsGroupPurchaseInfoVO.setCurrentNumber(one7.getCurrentNumber()); |
| | | if (one7.getGroupStatus()==0){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.TO_FORM_A_GROUP); |
| | | }else{ |
| | | if (one7.getGroupSize()-one7.getCurrentNumber()<5){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.MS_FAILURE); |
| | | }else{ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.TO_FORM_A_GROUP); |
| | | } |
| | | }if(one7.getGroupStatus()==1){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.FORMED_INTO_A_GROUP); |
| | | }if(one7.getGroupStatus()==2){ |
| | | goodsGroupPurchaseInfoVO.setGroupStatus(GroupStatusEnum.GROUP_FAILURE); |
| | | } |
| | | |
| | | } |
| | |
| | | goodsGroupPurchaseeVO.setPrice(byId.getPrice()); |
| | | goodsGroupPurchaseeVO.setYears(String.valueOf(byId.getYears().getYear())); |
| | | goodsGroupPurchaseeVO.setIsGoodsGroupPurchase(2); |
| | | OrderDTO orderDTO =new OrderDTO(); |
| | | orderDTO.setOrderFrom(OrderFromEnum.GROUP_PURCHASE_ORDERS); |
| | | orderDTO.setGoodsSkuId(goodsGroupPurchaseeVO.getId()); |
| | | orderDTO.setMemberId(homeGoodsSkuDTO.getMemberId()); |
| | | Order orderOne = orderClient.getOrderOne(orderDTO, SecurityConstants.INNER).getData(); |
| | | |
| | | LambdaQueryWrapper<GoodsGroupPurchaseInfo> wrapper6= Wrappers.lambdaQuery(); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getDelFlag,0); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getGroupStatus,0); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getGroupPurchaseId,goodsGroupPurchaseeVO.getId()); |
| | | wrapper6.eq(GoodsGroupPurchaseInfo::getMubre,orderOne.getGroupNo()); |
| | | GoodsGroupPurchaseInfo one1 = goodsGroupPurchaseInfoService.getOne(wrapper6); |
| | | if (one1!=null){ |
| | | goodsGroupPurchaseeVO.setCurrentNumber(one1.getCurrentNumber()); |
| | | if (one1.getGroupStatus()==0){ |
| | | if (one1.getGroupSize()-one1.getCurrentNumber()<5){ |
| | | goodsGroupPurchaseeVO.setGroupStatus(GroupStatusEnum.MS_FAILURE); |
| | | }else{ |
| | | goodsGroupPurchaseeVO.setGroupStatus(GroupStatusEnum.TO_FORM_A_GROUP); |
| | | } |
| | | }if (one1.getGroupStatus()==1){ |
| | | goodsGroupPurchaseeVO.setGroupStatus(GroupStatusEnum.FORMED_INTO_A_GROUP); |
| | | }if (one1.getGroupStatus()==2){ |
| | | goodsGroupPurchaseeVO.setGroupStatus(GroupStatusEnum.GROUP_FAILURE); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |