diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoDetailResp.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoDetailResp.java index d039e48..48010d9 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoDetailResp.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoDetailResp.java @@ -31,7 +31,7 @@ public class ActivityTeamInfoDetailResp { /** * 商品ID */ - private Long productId; + private Long projectId; /** * 商品活动图 */ diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionHundredService.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionHundredService.java index e8f4444..e655a94 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionHundredService.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionHundredService.java @@ -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 { +public interface TeamStrategyExemptionHundredService extends IService, ActivityTeamStrategy { } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionOrdinaryService.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionOrdinaryService.java index 307cf36..f81b105 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionOrdinaryService.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionOrdinaryService.java @@ -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 { +public interface TeamStrategyExemptionOrdinaryService extends ActivityTeamStrategy,IService { } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionService.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionService.java index 2176bc8..09866e5 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionService.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/TeamStrategyExemptionService.java @@ -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 { +public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService { } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java index ff79dd7..39c5581 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java @@ -205,11 +205,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl - 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) { + + } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionOrdinaryServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionOrdinaryServiceImpl.java index 5125ec4..ec40a7a 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionOrdinaryServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionOrdinaryServiceImpl.java @@ -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 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) { + + } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionServiceImpl.java index 829f618..e647f37 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/TeamStrategyExemptionServiceImpl.java @@ -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 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) { + + } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/strategy/ActivityTeamStrategy.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/strategy/ActivityTeamStrategy.java new file mode 100644 index 0000000..f5dcec2 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/strategy/ActivityTeamStrategy.java @@ -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); +} diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/strategy/impl/ActivityTeamStrategyImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/strategy/impl/ActivityTeamStrategyImpl.java new file mode 100644 index 0000000..f8fb3a5 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/strategy/impl/ActivityTeamStrategyImpl.java @@ -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) { + + } +} diff --git a/muyu-modules/muyu-marketing/marketing-server/src/test/java/com/muyu/test/TeamStrategyTest.java b/muyu-modules/muyu-marketing/marketing-server/src/test/java/com/muyu/test/TeamStrategyTest.java new file mode 100644 index 0000000..39ca058 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-server/src/test/java/com/muyu/test/TeamStrategyTest.java @@ -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); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentInfoController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentInfoController.java index 9500949..428b678 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentInfoController.java @@ -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> list(CommentInfoQueryReq commentInfoQueryReq) { + public Result> list(@RequestBody CommentInfoQueryReq commentInfoQueryReq) { startPage(); List 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 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 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 edit(@PathVariable Long id, @RequestBody CommentInfoEditReq commentInfoEditReq) { @@ -108,4 +109,16 @@ public class CommentInfoController extends BaseController { public Result remove(@PathVariable List ids) { return toAjax(commentInfoService.removeBatchByIds(ids)); } + + /** + * 根据商品Id查询评论 + */ + @GetMapping("/getCommentByProjectId/{projectId}") + public Result getCommentByProjectId(@PathVariable Long projectId){ + //查询条件 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(CommentInfo::getProjectId,projectId); + //查询 + return Result.success(commentInfoService.list(lambdaQueryWrapper)); + } } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentLikeInfoController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentLikeInfoController.java index 9e7b5b6..88faf24 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentLikeInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CommentLikeInfoController.java @@ -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> 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 getInfo(@PathVariable("id") Long id) { diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectSkuInfoController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectSkuInfoController.java index 6ad77df..0d9bc46 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectSkuInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectSkuInfoController.java @@ -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 remove(@PathVariable List ids) { return toAjax(projectSkuInfoService.removeBatchByIds(ids)); } + + /** + * 根据商品Id查询规格 + */ + @GetMapping("getProductSKUByProductId/{productId}") + public Result getProductSKUByProductId(@PathVariable Integer productId){ + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(ProjectSkuInfo::getProjectId, productId); + List projectSkuInfoList = projectSkuInfoService.list(lambdaQueryWrapper); + return Result.success(projectSkuInfoList); + } } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/CommentInfoService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/CommentInfoService.java index 54fbcca..a6634b0 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/CommentInfoService.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/CommentInfoService.java @@ -19,4 +19,5 @@ public interface CommentInfoService extends IService { */ public List list(CommentInfo commentInfo); + } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CommentInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CommentInfoServiceImpl.java index 365a5c4..578f4f2 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CommentInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CommentInfoServiceImpl.java @@ -54,4 +54,12 @@ public class CommentInfoServiceImpl extends ServiceImpl getByProjectId(Long id) { +// LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); +// lambdaQueryWrapper.eq(CommentInfo::getProjectId, id); +// List list = this.list(lambdaQueryWrapper); +// return list; +// } }