diff --git a/doc/参团开团数据.java b/doc/参团开团数据.java new file mode 100644 index 0000000..81a4018 --- /dev/null +++ b/doc/参团开团数据.java @@ -0,0 +1,32 @@ +参团: + 商品列表 + 商品列表接口 + 选择商品 + 商品详情接口 + 一键参团 + 添加数据,修改库存接口 + 前端数据回显 + 回显接口 + 生成订单 + + 通过时间统计订单 判断是否成功 + + + +拼团商品详情 + 商品详情接口 + 评价接口 + 统计接口 + + + + + + + + + + + + + diff --git a/muyu-gateway/src/main/java/com/muyu/gateway/config/CorsConfig.java b/muyu-gateway/src/main/java/com/muyu/gateway/config/CorsConfig.java new file mode 100644 index 0000000..1dd71ed --- /dev/null +++ b/muyu-gateway/src/main/java/com/muyu/gateway/config/CorsConfig.java @@ -0,0 +1,58 @@ +package com.muyu.gateway.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.http.server.reactive.ServerHttpResponse; +import org.springframework.web.cors.reactive.CorsUtils; +import org.springframework.web.server.ServerWebExchange; +import org.springframework.web.server.WebFilter; +import org.springframework.web.server.WebFilterChain; +import reactor.core.publisher.Mono; + +/** + * 跨域配置 + * + * @author ruoyi + */ +@Configuration +public class CorsConfig +{ + /** + * 这里为支持的请求头,如果有自定义的header字段请自己添加 + */ + private static final String ALLOWED_HEADERS = "X-Requested-With, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, Admin-Token, App-Token"; + private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD"; + private static final String ALLOWED_ORIGIN = "*"; + private static final String ALLOWED_EXPOSE = "*"; + private static final String MAX_AGE = "18000L"; + + @Bean + public WebFilter corsFilter() + { + return (ServerWebExchange ctx, WebFilterChain chain) -> { + ServerHttpRequest request = ctx.getRequest(); + if (CorsUtils.isCorsRequest(request)) + { + ServerHttpResponse response = ctx.getResponse(); + HttpHeaders headers = response.getHeaders(); + headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS); + headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS); + headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN); + headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE); + headers.add("Access-Control-Max-Age", MAX_AGE); + headers.add("Access-Control-Allow-Credentials", "true"); + if (request.getMethod() == HttpMethod.OPTIONS) + { + response.setStatusCode(HttpStatus.OK); + return Mono.empty(); + } + } + return chain.filter(ctx); + }; + } +} + diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamDetailModel.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamDetailModel.java index 298209d..ce9627b 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamDetailModel.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamDetailModel.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.function.Function; @@ -77,6 +78,12 @@ public class ActivityTeamDetailModel { * 策略类型 */ private String strategyType; + + private BigDecimal productPrice; + /** + * 剩余库存 + */ + private Long remainStock; /** * 策略ID */ diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoFindByIdResp.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoFindByIdResp.java index 85466f6..a30dded 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoFindByIdResp.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoFindByIdResp.java @@ -8,6 +8,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -52,6 +53,12 @@ public class TeamInfoFindByIdResp { */ private String imageList; + + private BigDecimal productPrice; + /** + * 剩余库存 + */ + private Long remainStock; /** * 活动结束时间 */ @@ -77,6 +84,9 @@ public class TeamInfoFindByIdResp { * 策略类型 */ private String strategyType; + + + /** * 策略ID */ @@ -102,6 +112,8 @@ public class TeamInfoFindByIdResp { .status(activityTeamDetailModel.getStatus()) .strategyType(activityTeamDetailModel.getStrategyType()) .strategyId(activityTeamDetailModel.getStrategyId()) + .remainStock(activityTeamDetailModel.getRemainStock()) + .productPrice(activityTeamDetailModel.getProductPrice()) .build(); } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java index ac575d7..e1d28db 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java @@ -1,9 +1,6 @@ package com.muyu.marketing.team.controller; - - import com.muyu.common.core.domain.Result; import com.muyu.common.core.web.page.TableDataInfo; -import com.muyu.marketing.domain.ActivityTeamInfo; import com.muyu.marketing.domain.model.*; import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq; import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq; @@ -14,22 +11,17 @@ import com.muyu.marketing.domain.resp.TeamInfoListResp; import com.muyu.marketing.team.service.ActivityTeamInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; - import java.util.List; - /** * 营销团购活动控制层 - * * @author DongZeLiang * @date 2024-11-20 14:25 */ @RestController @RequestMapping("/team") public class ActivityTeamController { - @Autowired private ActivityTeamInfoService activityTeamInfoService;; - /** * 查询营销团购活动列表 * @param teamInfoListReq 活动查询入参 @@ -46,8 +38,6 @@ public class ActivityTeamController { }} ); } - - /** * 添加团购活动 * @param activityTeamInfoSaveReq 添加请求对象 @@ -58,7 +48,6 @@ public class ActivityTeamController { activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq)); return Result.success(); } - @PostMapping("/findById/{id}") public Result findTeamById(@PathVariable Long id){ return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id))); @@ -68,7 +57,6 @@ public class ActivityTeamController { activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq)); return Result.success(); } - @PostMapping("/updActivityTeamInfo") public Result updActivityTeamInfo (@RequestBody ActivityTeamUpdProductUpdReq activityTeamUpdProductUpdReq){ boolean a= activityTeamInfoService.updproduct(ActivityUpdTeamModel.update(activityTeamUpdProductUpdReq)); diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/satery/ActivityTeamStratey.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/satery/ActivityTeamStratey.java new file mode 100644 index 0000000..4b8773a --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/satery/ActivityTeamStratey.java @@ -0,0 +1,10 @@ +package com.muyu.marketing.team.satery; + +public interface ActivityTeamStratey { + public void openTeam(Long activityTeamId); + public void ApplyTeam(Long activityTeamId); + public void addTeam(Long teamId,Long number); + public void backTeam(Long teamId); + public void settle(Long team); + +} diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/satery/impl/ActivityTeamStrateyImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/satery/impl/ActivityTeamStrateyImpl.java new file mode 100644 index 0000000..738dc3c --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/satery/impl/ActivityTeamStrateyImpl.java @@ -0,0 +1,7 @@ +package com.muyu.marketing.team.satery.impl; + +public class ActivityTeamStrateyImpl { + + + +} diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamOpenInfoService.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamOpenInfoService.java index dcd70eb..da023a8 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamOpenInfoService.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamOpenInfoService.java @@ -1,10 +1,8 @@ package com.muyu.marketing.team.service; - 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.ActivityTeamProductSkuInfo; - public interface ActivityTeamOpenInfoService extends 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 ef6c607..57cf2d7 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 @@ -108,7 +108,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl activityTeamUpdModels = update.getActivityTeamUpdModels(); List activityTeamAddModels = update.getActivityTeamAddModels(); List ids = update.getIds(); - activityTeamProductSkuInfoService.updtoBath(activityTeamUpdModels); activityTeamProductSkuInfoService.addBath(activityTeamAddModels); activityTeamProductSkuInfoService.delBath(ids); - return b; - - } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamOpenInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamOpenInfoServiceImpl.java index 7111bf7..94171da 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamOpenInfoServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamOpenInfoServiceImpl.java @@ -11,7 +11,6 @@ import org.springframework.stereotype.Service; @Service public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl implements ActivityTeamOpenInfoService { - /** * 通过活动ID和开团类型查询开团数量 * diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java index a386c9d..29d3a8e 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java @@ -51,7 +51,6 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl> commentInfoResult(@PathVariable Long id){ + return Result.success(commentInfoService.commentInfoId(id)); + } + /** * 修改商品评论 */ 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..5389f53 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); + List commentInfoId(Long id); } 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..a9f0d27 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,13 @@ public class CommentInfoServiceImpl extends ServiceImpl commentInfoId(Long id) { + LambdaQueryWrapper commentInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + commentInfoLambdaQueryWrapper.eq(CommentInfo::getProjectId,id); + List list = this.list(commentInfoLambdaQueryWrapper); + return list; + + } }