Browse Source

直播红娘任务

master
张彭杰 1 month ago
parent
commit
64f2c6296a
35 changed files with 227 additions and 3 deletions
  1. 5
      dating-agency-mall-constant/src/main/java/com/qniao/dam/domian/aggregate/product/constant/ProductSubCategoryEnum.java
  2. 42
      dating-agency-mall-constant/src/main/java/com/qniao/dam/domian/aggregate/product/constant/PurchaseTimeLimitTypeEnum.java
  3. 3
      dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/product/entity/Product.java
  4. 26
      dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/purchaseproductrecord/vobj/PurchaseProductRecord.java
  5. 6
      dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/ProductUserQueryController.java
  6. 54
      dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/response/UserListProductByVipVo.java
  7. 7
      dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/persistent/dao/purchaseproductrecord/PurchaseProductRecordDao.java
  8. 2
      dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/persistent/dao/view/ProductViewDao.java
  9. 2
      dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/ProductQueryService.java
  10. 33
      dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/impl/ProductQueryServiceImpl.java
  11. 5
      dating-agency-mall-server/src/main/java/com/qniao/dam/query/purchaseproductrecord/PurchaseProductRecordQueryService.java
  12. 23
      dating-agency-mall-server/src/main/java/com/qniao/dam/query/purchaseproductrecord/impl/PurchaseProductRecordQueryServiceImpl.java
  13. 0
      dating-agency-mall-server/src/main/resources/mapper/activity/PurchaseProductRecordQueryService.xml
  14. 0
      dating-agency-mall-server/src/main/resources/mapper/bankcard/PurchaseProductRecordQueryService.xml
  15. 0
      dating-agency-mall-server/src/main/resources/mapper/contract/PurchaseProductRecordQueryService.xml
  16. 0
      dating-agency-mall-server/src/main/resources/mapper/externalorder/PurchaseProductRecordQueryService.xml
  17. 0
      dating-agency-mall-server/src/main/resources/mapper/odc/PurchaseProductRecordQueryService.xml
  18. 0
      dating-agency-mall-server/src/main/resources/mapper/ora/PurchaseProductRecordQueryService.xml
  19. 0
      dating-agency-mall-server/src/main/resources/mapper/order/PurchaseProductRecordQueryService.xml
  20. 0
      dating-agency-mall-server/src/main/resources/mapper/par/PurchaseProductRecordQueryService.xml
  21. 0
      dating-agency-mall-server/src/main/resources/mapper/paymentorder/PurchaseProductRecordQueryService.xml
  22. 0
      dating-agency-mall-server/src/main/resources/mapper/pointaccount/PurchaseProductRecordQueryService.xml
  23. 0
      dating-agency-mall-server/src/main/resources/mapper/prc/PurchaseProductRecordQueryService.xml
  24. 22
      dating-agency-mall-server/src/main/resources/mapper/product/PurchaseProductRecordQueryService.xml
  25. 0
      dating-agency-mall-server/src/main/resources/mapper/puc/PurchaseProductRecordQueryService.xml
  26. 0
      dating-agency-mall-server/src/main/resources/mapper/revenuereward/PurchaseProductRecordQueryService.xml
  27. 0
      dating-agency-mall-server/src/main/resources/mapper/rewardconfig/PurchaseProductRecordQueryService.xml
  28. 0
      dating-agency-mall-server/src/main/resources/mapper/right/PurchaseProductRecordQueryService.xml
  29. 0
      dating-agency-mall-server/src/main/resources/mapper/rpa/PurchaseProductRecordQueryService.xml
  30. 0
      dating-agency-mall-server/src/main/resources/mapper/rpaw/PurchaseProductRecordQueryService.xml
  31. 0
      dating-agency-mall-server/src/main/resources/mapper/rpc/PurchaseProductRecordQueryService.xml
  32. 0
      dating-agency-mall-server/src/main/resources/mapper/utc/PurchaseProductRecordQueryService.xml
  33. 0
      dating-agency-mall-server/src/main/resources/mapper/virtualaccount/PurchaseProductRecordQueryService.xml
  34. 0
      dating-agency-mall-server/src/main/resources/mapper/walletaccount/PurchaseProductRecordQueryService.xml
  35. 0
      dating-agency-mall-server/src/main/resources/mapper/withdrawaudit/PurchaseProductRecordQueryService.xml

5
dating-agency-mall-constant/src/main/java/com/qniao/dam/domian/aggregate/product/constant/ProductSubCategoryEnum.java

@ -30,6 +30,11 @@ public enum ProductSubCategoryEnum {
VIP(601, "会员"),
VIP_TRIAL_CARD(602, "VIP体验卡"),
VIP_MONTHLY_CARD(603, "VIP月卡"),
VIP_QUARTERLY_CARD(604, "VIP季卡"),
VIP_YEARLY_CARD(605, "VIP年卡"),
CONTRACT_LOVE(701, "包恋爱"),
CONTRACTED_MARRIAGE(801, "包领证"),

42
dating-agency-mall-constant/src/main/java/com/qniao/dam/domian/aggregate/product/constant/PurchaseTimeLimitTypeEnum.java

@ -0,0 +1,42 @@
package com.qniao.dam.domian.aggregate.product.constant;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
/**
* @author Derran
* @date 2023/3/13 14:26
**/
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PurchaseTimeLimitTypeEnum {
/**
* 1 仅限首次
*/
FIRST_TIME_ONLY(1, "仅限首次"),
UNLIMITED(-1, "正常销售");
@EnumValue
@JsonValue
private final Integer value;
private final String desc;
PurchaseTimeLimitTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
@JsonCreator
public static PurchaseTimeLimitTypeEnum get(Integer v) {
for (PurchaseTimeLimitTypeEnum e : PurchaseTimeLimitTypeEnum.values()) {
if (e.getValue().equals(v)) {
return e;
}
}
return null;
}
}

3
dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/product/entity/Product.java

@ -57,5 +57,8 @@ public class Product extends Entity<Product> {
@ApiModelProperty("是否展示 0 展示 1 不展示")
private Integer display;
@ApiModelProperty("购买次数限制")
private PurchaseTimeLimitTypeEnum purchaseTimeLimit;
private transient List<ProductSpec> productSpecList;
}

26
dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/purchaseproductrecord/vobj/PurchaseProductRecord.java

@ -0,0 +1,26 @@
package com.qniao.dam.domain.aggregate.purchaseproductrecord.vobj;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qniao.domain.ValueObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("da_purchase_product_record")
public class PurchaseProductRecord extends ValueObject<PurchaseProductRecord> {
@ApiModelProperty("用户标识")
private Long userId;
@ApiModelProperty("产品标识")
private Long productId;
@ApiModelProperty("产品规格标识")
private Long productSpecId;
@ApiModelProperty("订单标识")
private Long orderId;
}

6
dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/ProductUserQueryController.java

@ -86,6 +86,12 @@ public class ProductUserQueryController {
return PageUtil.convert(productQueryService.pageProductByMatchmakingCorner(pageUtil, queryParam), UserPageProductByMatchmakerVo.class);
}
@GetMapping("page/product/by/vip")
@ApiOperation("用户获取VIP分页列表")
public List<UserListProductByVipVo> userListProductByVip(@RequestParam("userId") Long userId) {
return productQueryService.listProductByVip(userId);
}
@GetMapping("get/product/by/customer/list")
@ApiOperation("客户获取商品列表")
public List<UserPageProductByCustomerGroupVo> getPageProductByCustomer() {

54
dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/response/UserListProductByVipVo.java

@ -0,0 +1,54 @@
package com.qniao.dam.api.query.product.user.response;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qniao.dam.domian.aggregate.product.constant.ProductMainCategoryEnum;
import com.qniao.dam.domian.aggregate.product.constant.ProductSubCategoryEnum;
import com.qniao.dam.domian.aggregate.product.constant.PurchaseTimeLimitTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class UserListProductByVipVo {
@ApiModelProperty("商品标识")
@JsonSerialize(using = ToStringSerializer.class)
private Long productId;
@ApiModelProperty("商品规格标识")
@JsonSerialize(using = ToStringSerializer.class)
private Long productSpecId;
@ApiModelProperty("产品主分类")
private ProductMainCategoryEnum mainCategory;
@ApiModelProperty("产品次分类")
private ProductSubCategoryEnum subCategory;
@ApiModelProperty("产品标题")
private String productTitle;
@ApiModelProperty("产品描述")
private String productDesc;
@ApiModelProperty("详情描述")
private String detailDesc;
@ApiModelProperty("原价")
private BigDecimal unitOriginalPrice;
@ApiModelProperty("售价")
private BigDecimal unitSellingPrice;
@ApiModelProperty("有效期")
private String validityPeriodValue;
@ApiModelProperty("购买次数限制")
private PurchaseTimeLimitTypeEnum purchaseTimeLimit;
//会员权益
}

7
dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/persistent/dao/purchaseproductrecord/PurchaseProductRecordDao.java

@ -0,0 +1,7 @@
package com.qniao.dam.infrastructure.persistent.dao.purchaseproductrecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qniao.dam.domain.aggregate.purchaseproductrecord.vobj.PurchaseProductRecord;
public interface PurchaseProductRecordDao extends BaseMapper<PurchaseProductRecord> {
}

2
dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/persistent/dao/view/ProductViewDao.java

@ -37,4 +37,6 @@ public interface ProductViewDao {
List<UserGiftProductVo> listGiftProduct();
UserGetProductByCategoryVo getProductByCategory(@Param("subCategory") Integer subCategory);
List<UserListProductByVipVo> listProductByVip();
}

2
dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/ProductQueryService.java

@ -13,7 +13,6 @@ import com.qniao.dam.domian.aggregate.product.constant.ProductSubCategoryEnum;
import com.qniao.dam.domian.aggregate.productspec.constant.ProductSpecTermNameEnum;
import com.qniao.framework.utils.PageUtil;
import java.math.BigDecimal;
import java.util.List;
public interface ProductQueryService {
@ -51,4 +50,5 @@ public interface ProductQueryService {
UserGetProductByCategoryVo getProductByCategory(Integer subCategory);
List<UserListProductByVipVo> listProductByVip(Long userId);
}

33
dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/impl/ProductQueryServiceImpl.java

@ -12,9 +12,9 @@ import com.qniao.dam.domain.aggregate.externalproduct.valueobj.ExternalProductRe
import com.qniao.dam.domain.aggregate.product.entity.Product;
import com.qniao.dam.domain.aggregate.productspec.entity.ProductSpec;
import com.qniao.dam.domain.aggregate.productspec.valueobj.ProductSpecTerm;
import com.qniao.dam.domian.aggregate.product.constant.ProductMainCategoryEnum;
import com.qniao.dam.domian.aggregate.product.constant.ProductSubCategoryEnum;
import com.qniao.dam.domian.aggregate.product.constant.ProductTypeEnum;
import com.qniao.dam.domian.aggregate.product.constant.PurchaseTimeLimitTypeEnum;
import com.qniao.dam.domian.aggregate.productspec.constant.ProductSpecTermNameEnum;
import com.qniao.dam.domian.aggregate.productspec.constant.ProductSpecTermUnitEnum;
import com.qniao.dam.infrastructure.persistent.dao.domain.ExternalProductRelDao;
@ -23,10 +23,10 @@ import com.qniao.dam.infrastructure.persistent.dao.domain.ProductSpecDao;
import com.qniao.dam.infrastructure.persistent.dao.domain.ProductSpecTermDao;
import com.qniao.dam.infrastructure.persistent.dao.view.ProductViewDao;
import com.qniao.dam.query.product.ProductQueryService;
import com.qniao.dam.query.purchaseproductrecord.PurchaseProductRecordQueryService;
import com.qniao.das.domian.aggregate.marriageinformation.constant.GenderEnum;
import com.qniao.framework.utils.PageUtil;
import com.qniao.framework.utils.TypeConvertUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -48,6 +48,8 @@ public class ProductQueryServiceImpl implements ProductQueryService {
private ExternalProductRelDao externalProductRelDao;
@Resource
private ProductSpecTermDao productSpecTermDao;
@Resource
private PurchaseProductRecordQueryService purchaseProductRecordQueryService;
@Value("${service-phone}")
private String servicePhone;
@ -120,6 +122,33 @@ public class ProductQueryServiceImpl implements ProductQueryService {
return productViewDao.getProductByCategory(subCategory);
}
@Override
public List<UserListProductByVipVo> listProductByVip(Long userId) {
List<UserListProductByVipVo> list = productViewDao.listProductByVip();
list = eliminatePurchaseTimeLimit(list, userId);
return list;
}
private List<UserListProductByVipVo> eliminatePurchaseTimeLimit(List<UserListProductByVipVo> list,
Long userId) {
List<UserListProductByVipVo> resultList = new ArrayList<>();
if (CollUtil.isNotEmpty(list)) {
list.forEach(record -> {
if (Objects.nonNull(record.getPurchaseTimeLimit())) {
if (PurchaseTimeLimitTypeEnum.UNLIMITED.equals(record.getPurchaseTimeLimit())) {
resultList.add(record);
} else {
int count = purchaseProductRecordQueryService.countPurchasedBy(record.getProductSpecId(), userId);
if (count < record.getPurchaseTimeLimit().getValue()) {
list.add(record);
}
}
}
});
}
return resultList;
}
@Override
public Product queryBy(Long userId, Long miId, ProductSubCategoryEnum subCategory) {
return productDao.selectOne(new LambdaQueryWrapper<Product>()

5
dating-agency-mall-server/src/main/java/com/qniao/dam/query/purchaseproductrecord/PurchaseProductRecordQueryService.java

@ -0,0 +1,5 @@
package com.qniao.dam.query.purchaseproductrecord;
public interface PurchaseProductRecordQueryService {
int countPurchasedBy(Long productSpecId, Long userId);
}

23
dating-agency-mall-server/src/main/java/com/qniao/dam/query/purchaseproductrecord/impl/PurchaseProductRecordQueryServiceImpl.java

@ -0,0 +1,23 @@
package com.qniao.dam.query.purchaseproductrecord.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qniao.dam.domain.aggregate.purchaseproductrecord.vobj.PurchaseProductRecord;
import com.qniao.dam.infrastructure.persistent.dao.purchaseproductrecord.PurchaseProductRecordDao;
import com.qniao.dam.query.purchaseproductrecord.PurchaseProductRecordQueryService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class PurchaseProductRecordQueryServiceImpl implements PurchaseProductRecordQueryService {
@Resource
private PurchaseProductRecordDao purchaseProductRecordDao;
@Override
public int countPurchasedBy(Long productSpecId, Long userId) {
return purchaseProductRecordDao.selectCount(new LambdaQueryWrapper<PurchaseProductRecord>()
.eq(PurchaseProductRecord::getProductSpecId, productSpecId)
.eq(PurchaseProductRecord::getUserId, userId));
}
}

dating-agency-mall-server/src/main/resources/mapper/activity/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/activity/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/bankcard/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/bankcard/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/contract/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/contract/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/externalorder/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/externalorder/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/odc/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/odc/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/ora/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/ora/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/order/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/order/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/par/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/par/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/paymentorder/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/paymentorder/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/pointaccount/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/pointaccount/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/prc/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/prc/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/product/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/product/PurchaseProductRecordQueryService.xml

@ -260,5 +260,27 @@
limit 1
</select>
<select id="listProductByVip"
resultType="com.qniao.dam.api.query.product.user.response.UserListProductByVipVo">
select
dp.id as productId,
dps.id as productSpecId,
dp.main_category,
dp.sub_category,
dp.product_title,
dp.product_desc,
dp.detail_desc,
dps.unit_original_price,
dps.unit_selling_price,
dp.purchase_time_limit,
dpst1.`value` as validityPeriodValue
from da_product as dp
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =dps.id and
dpst1.`name`=3
where dp.is_delete=0 and dp.main_category=6 and dp.`status`=1
ORDER BY dps.unit_original_price ASC
</select>
</mapper>

dating-agency-mall-server/src/main/resources/mapper/puc/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/puc/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/revenuereward/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/revenuereward/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/rewardconfig/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/rewardconfig/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/right/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/right/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/rpa/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/rpa/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/rpaw/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/rpaw/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/rpc/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/rpc/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/utc/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/utc/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/virtualaccount/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/virtualaccount/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/walletaccount/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/walletaccount/PurchaseProductRecordQueryService.xml

dating-agency-mall-server/src/main/resources/mapper/withdrawaudit/RecommendationRelationQueryService.xml → dating-agency-mall-server/src/main/resources/mapper/withdrawaudit/PurchaseProductRecordQueryService.xml

Loading…
Cancel
Save