master
parent
9b9ff71767
commit
cd50dc7d85
|
@ -7,7 +7,7 @@ package com.muyu.common.core.enums.market.team;
|
||||||
* @create: 2024-11-22 01:11
|
* @create: 2024-11-22 01:11
|
||||||
**/
|
**/
|
||||||
public enum TeamOpenTypeEnum {
|
public enum TeamOpenTypeEnum {
|
||||||
//开团 55
|
//开团
|
||||||
OPEN_TEAM("open_team","开团"),
|
OPEN_TEAM("open_team","开团"),
|
||||||
//参团
|
//参团
|
||||||
IN_TEAM("in_team","参团");
|
IN_TEAM("in_team","参团");
|
||||||
|
|
|
@ -97,6 +97,12 @@
|
||||||
<artifactId>marketing-remote</artifactId>
|
<artifactId>marketing-remote</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 商品服务 缓存依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-product-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -18,6 +18,6 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||||
|
|
||||||
|
|
||||||
void add(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
//void add(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,36 @@
|
||||||
package com.muyu.marketing.team.service;
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过活动Id和开团类型查询开团人数数量
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @param teamOpenType 开团类型
|
||||||
|
* @return 开团数量
|
||||||
|
*/
|
||||||
|
public Long getTeamOpenNumberByTeamIdAndType(@RequestParam Long teamId, TeamOpenTypeEnum teamOpenType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据活动Id获取开团数量
|
||||||
|
* @param teamId 团购活动ID
|
||||||
|
* @return 开团数量
|
||||||
|
*/
|
||||||
|
public default Long getTeamOpenNumberByTeamId(Long teamId){
|
||||||
|
return this.getTeamOpenNumberByTeamIdAndType(teamId,TeamOpenTypeEnum.OPEN_TEAM);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据活动Id获取参团数量
|
||||||
|
* @param teamId 团购活动ID
|
||||||
|
* @return 参团数量
|
||||||
|
*/
|
||||||
|
public default Long getTeamInNumberByTeamId(Long teamId){
|
||||||
|
return this.getTeamOpenNumberByTeamIdAndType(teamId,TeamOpenTypeEnum.IN_TEAM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
|
||||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
|
* @param teamId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ActivityTeamProductSkuInfo getDiscountPrice(Long teamId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||||
|
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -21,6 +23,8 @@ import java.util.List;
|
||||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||||
implements ActivityTeamInfoService {
|
implements ActivityTeamInfoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,10 +49,10 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
activityTeamInfoListModel.setId(activityTeamInfo.getId());
|
activityTeamInfoListModel.setId(activityTeamInfo.getId());
|
||||||
activityTeamInfoListModel.setName(activityTeamInfo.getName());
|
activityTeamInfoListModel.setName(activityTeamInfo.getName());
|
||||||
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());
|
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());
|
||||||
activityTeamInfoListModel.setAddTeamNumber(0L);
|
activityTeamInfoListModel.setOpenTeamNumber(activityTeamOpenInfoService.getTeamOpenNumberByTeamId(activityTeamInfo.getId()));
|
||||||
activityTeamInfoListModel.setAttendNumber(0L);
|
activityTeamInfoListModel.setAddTeamNumber(activityTeamOpenInfoService.getTeamInNumberByTeamId(activityTeamInfo.getId()));
|
||||||
|
activityTeamInfoListModel.setAttendNumber(activityTeamInfoListModel.getAttendNumber()+activityTeamInfoListModel.getAttendNumber());
|
||||||
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());
|
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());
|
||||||
activityTeamInfoListModel.setOpenTeamNumber(0L);
|
|
||||||
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());
|
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());
|
||||||
activityTeamInfoListModel.setProductPrice(0.00);
|
activityTeamInfoListModel.setProductPrice(0.00);
|
||||||
activityTeamInfoListModel.setRemainStock(0L);
|
activityTeamInfoListModel.setRemainStock(0L);
|
||||||
|
@ -64,11 +68,11 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
return tableDataInfo;
|
return tableDataInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void add(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
// public void add(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public void add(ActivityTeamInfo activityTeamInfo) {
|
// public void add(ActivityTeamInfo activityTeamInfo) {
|
||||||
|
|
|
@ -1,11 +1,32 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo> implements ActivityTeamOpenInfoService {
|
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
||||||
|
implements ActivityTeamOpenInfoService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过活动Id和开团类型查询开团人数数量
|
||||||
|
*
|
||||||
|
* @param TeamId 活动ID
|
||||||
|
* @param teamOpenType 开团类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Long getTeamOpenNumberByTeamIdAndType(Long TeamId, TeamOpenTypeEnum teamOpenType) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId, TeamId);
|
||||||
|
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,teamOpenType.code());
|
||||||
|
return this.count(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
@ -7,8 +8,31 @@ import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
||||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
|
import com.muyu.product.cache.ProjectSkuCache;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||||
|
implements ActivityTeamProductSkuInfoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProjectSkuCache projectSkuCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
|
*
|
||||||
|
* @param teamId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ActivityTeamProductSkuInfo getDiscountPrice(Long teamId) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
||||||
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.list(queryWrapper);
|
||||||
|
// projectSkuCache.get
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue