fix():开团业务
parent
906e79ab91
commit
a7e609ad50
|
@ -31,7 +31,7 @@ public class ActivityTeamInfoDetailResp {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
private Long projectId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred>, ActivityTeamStrategy {
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.team.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||
public interface TeamStrategyExemptionOrdinaryService extends ActivityTeamStrategy,IService<TeamStrategyExemptionOrdinary> {
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
||||
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
||||
}
|
||||
|
|
|
@ -205,11 +205,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* 查询拼团活动列表
|
||||
* @param activityTeamInfo
|
||||
* @return
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,10 +7,36 @@ import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
|||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Service("team_strategy_exemption_hundred")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||
implements TeamStrategyExemptionHundredService {
|
||||
implements TeamStrategyExemptionHundredService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-百人团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,36 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionOrdinaryService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Service("team_strategy_exemption_ordinary")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||
implements TeamStrategyExemptionOrdinaryService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-普通团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,36 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Service("team_strategy_exemption")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||
implements TeamStrategyExemptionService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-免单团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.marketing.team.strategy;
|
||||
|
||||
/**
|
||||
* 团购活动策略
|
||||
*/
|
||||
public interface ActivityTeamStrategy {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
* @param activityTeamId 活动拼团id
|
||||
*/
|
||||
public void openTeam(Long activityTeamId);
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
* @param teamId 拼团id
|
||||
*/
|
||||
public void applyTeam(Long teamId);
|
||||
|
||||
/**
|
||||
* 加团
|
||||
* @param teamId 拼团id
|
||||
* @param orderNumber 订单号
|
||||
*/
|
||||
public void addTeam(Long teamId, String orderNumber);
|
||||
|
||||
/**
|
||||
* 退团
|
||||
* @param teamId 拼团id
|
||||
*/
|
||||
public void backTeam(Long teamId);
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
* @param teamId 拼团id
|
||||
*/
|
||||
public void settle(Long teamId);
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.marketing.team.strategy.impl;
|
||||
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.SpringUtils;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Primary
|
||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
String activityTeamType = null;
|
||||
if (activityTeamId==null){
|
||||
throw new ServiceException("activityTeamId 不能为空");
|
||||
}else if (activityTeamId==1){
|
||||
activityTeamType="team_strategy_exemption_hundred";
|
||||
}else if (activityTeamId==2){
|
||||
activityTeamType="team_strategy_exemption_ordinary";
|
||||
}else if (activityTeamId==3){
|
||||
activityTeamType="team_strategy_exemption";
|
||||
}
|
||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
||||
activityTeamStrategy.openTeam(activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.test;
|
||||
|
||||
import com.muyu.marketing.MuYuMarketIngApplication;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
import io.jsonwebtoken.lang.Classes;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest(classes= MuYuMarketIngApplication.class)
|
||||
public class TeamStrategyTest {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamStrategy activityTeamStrategy;
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
activityTeamStrategy.openTeam(1L);
|
||||
activityTeamStrategy.openTeam(2L);
|
||||
activityTeamStrategy.openTeam(3L);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.muyu.product.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -32,7 +33,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "商品评论")
|
||||
//@Api(tags = "商品评论")
|
||||
@RestController
|
||||
@RequestMapping("/comment")
|
||||
public class CommentInfoController extends BaseController {
|
||||
|
@ -42,10 +43,10 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 查询商品评论列表
|
||||
*/
|
||||
@ApiOperation("获取商品评论列表")
|
||||
@RequiresPermissions("product:comment:list")
|
||||
// @ApiOperation("获取商品评论列表")
|
||||
// @RequiresPermissions("product:comment:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) {
|
||||
public Result<TableDataInfo<CommentInfo>> list(@RequestBody CommentInfoQueryReq commentInfoQueryReq) {
|
||||
startPage();
|
||||
List<CommentInfo> list = commentInfoService.list(CommentInfo.queryBuild(commentInfoQueryReq));
|
||||
return getDataTable(list);
|
||||
|
@ -54,8 +55,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 导出商品评论列表
|
||||
*/
|
||||
@ApiOperation("导出商品评论列表")
|
||||
@RequiresPermissions("product:comment:export")
|
||||
// @ApiOperation("导出商品评论列表")
|
||||
// @RequiresPermissions("product:comment:export")
|
||||
@Log(title = "商品评论", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CommentInfo commentInfo) {
|
||||
|
@ -67,8 +68,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 获取商品评论详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品评论详细信息")
|
||||
@RequiresPermissions("product:comment:query")
|
||||
// @ApiOperation("获取商品评论详细信息")
|
||||
// @RequiresPermissions("product:comment:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<CommentInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
@ -78,8 +79,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 新增商品评论
|
||||
*/
|
||||
@RequiresPermissions("product:comment:add")
|
||||
@Log(title = "商品评论", businessType = BusinessType.INSERT)
|
||||
// @RequiresPermissions("product:comment:add")
|
||||
// @Log(title = "商品评论", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增商品评论")
|
||||
public Result<String> add(@RequestBody CommentInfoSaveReq commentInfoSaveReq) {
|
||||
|
@ -89,8 +90,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 修改商品评论
|
||||
*/
|
||||
@RequiresPermissions("product:comment:edit")
|
||||
@Log(title = "商品评论", businessType = BusinessType.UPDATE)
|
||||
// @RequiresPermissions("product:comment:edit")
|
||||
// @Log(title = "商品评论", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改商品评论")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CommentInfoEditReq commentInfoEditReq) {
|
||||
|
@ -108,4 +109,16 @@ public class CommentInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(commentInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品Id查询评论
|
||||
*/
|
||||
@GetMapping("/getCommentByProjectId/{projectId}")
|
||||
public Result getCommentByProjectId(@PathVariable Long projectId){
|
||||
//查询条件
|
||||
LambdaQueryWrapper<CommentInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CommentInfo::getProjectId,projectId);
|
||||
//查询
|
||||
return Result.success(commentInfoService.list(lambdaQueryWrapper));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "评论点赞")
|
||||
//@Api(tags = "评论点赞")
|
||||
@RestController
|
||||
@RequestMapping("/commentLike")
|
||||
public class CommentLikeInfoController extends BaseController {
|
||||
|
@ -42,8 +42,8 @@ public class CommentLikeInfoController extends BaseController {
|
|||
/**
|
||||
* 查询评论点赞列表
|
||||
*/
|
||||
@ApiOperation("获取评论点赞列表")
|
||||
@RequiresPermissions("product:commentLike:list")
|
||||
// @ApiOperation("获取评论点赞列表")
|
||||
// @RequiresPermissions("product:commentLike:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CommentLikeInfo>> list(CommentLikeInfoQueryReq commentLikeInfoQueryReq) {
|
||||
startPage();
|
||||
|
@ -54,8 +54,8 @@ public class CommentLikeInfoController extends BaseController {
|
|||
/**
|
||||
* 导出评论点赞列表
|
||||
*/
|
||||
@ApiOperation("导出评论点赞列表")
|
||||
@RequiresPermissions("product:commentLike:export")
|
||||
// @ApiOperation("导出评论点赞列表")
|
||||
// @RequiresPermissions("product:commentLike:export")
|
||||
@Log(title = "评论点赞", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CommentLikeInfo commentLikeInfo) {
|
||||
|
@ -68,7 +68,7 @@ public class CommentLikeInfoController extends BaseController {
|
|||
* 获取评论点赞详细信息
|
||||
*/
|
||||
@ApiOperation("获取评论点赞详细信息")
|
||||
@RequiresPermissions("product:commentLike:query")
|
||||
// @RequiresPermissions("product:commentLike:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<CommentLikeInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -130,4 +131,15 @@ public class ProjectSkuInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(projectSkuInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品Id查询规格
|
||||
*/
|
||||
@GetMapping("getProductSKUByProductId/{productId}")
|
||||
public Result getProductSKUByProductId(@PathVariable Integer productId){
|
||||
LambdaQueryWrapper<ProjectSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProjectSkuInfo::getProjectId, productId);
|
||||
List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(lambdaQueryWrapper);
|
||||
return Result.success(projectSkuInfoList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ public interface CommentInfoService extends IService<CommentInfo> {
|
|||
*/
|
||||
public List<CommentInfo> list(CommentInfo commentInfo);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -54,4 +54,12 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
|
|||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<CommentInfo> getByProjectId(Long id) {
|
||||
// LambdaQueryWrapper<CommentInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(CommentInfo::getProjectId, id);
|
||||
// List<CommentInfo> list = this.list(lambdaQueryWrapper);
|
||||
// return list;
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue