12.3功能修改

1127/wangyaowen
wangyaowen050211 2024-12-03 14:31:23 +08:00
parent 39c0db585e
commit 6e2314ab3b
15 changed files with 144 additions and 23 deletions

View File

@ -0,0 +1,32 @@
:
,

View File

@ -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);
};
}
}

View File

@ -7,6 +7,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.function.Function; import java.util.function.Function;
@ -77,6 +78,12 @@ public class ActivityTeamDetailModel {
* *
*/ */
private String strategyType; private String strategyType;
private BigDecimal productPrice;
/**
*
*/
private Long remainStock;
/** /**
* ID * ID
*/ */

View File

@ -8,6 +8,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -52,6 +53,12 @@ public class TeamInfoFindByIdResp {
*/ */
private String imageList; private String imageList;
private BigDecimal productPrice;
/**
*
*/
private Long remainStock;
/** /**
* *
*/ */
@ -77,6 +84,9 @@ public class TeamInfoFindByIdResp {
* *
*/ */
private String strategyType; private String strategyType;
/** /**
* ID * ID
*/ */
@ -102,6 +112,8 @@ public class TeamInfoFindByIdResp {
.status(activityTeamDetailModel.getStatus()) .status(activityTeamDetailModel.getStatus())
.strategyType(activityTeamDetailModel.getStrategyType()) .strategyType(activityTeamDetailModel.getStrategyType())
.strategyId(activityTeamDetailModel.getStrategyId()) .strategyId(activityTeamDetailModel.getStrategyId())
.remainStock(activityTeamDetailModel.getRemainStock())
.productPrice(activityTeamDetailModel.getProductPrice())
.build(); .build();
} }
} }

View File

@ -1,9 +1,6 @@
package com.muyu.marketing.team.controller; package com.muyu.marketing.team.controller;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo; 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.model.*;
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq; import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq; 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 com.muyu.marketing.team.service.ActivityTeamInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* *
*
* @author DongZeLiang * @author DongZeLiang
* @date 2024-11-20 14:25 * @date 2024-11-20 14:25
*/ */
@RestController @RestController
@RequestMapping("/team") @RequestMapping("/team")
public class ActivityTeamController { public class ActivityTeamController {
@Autowired @Autowired
private ActivityTeamInfoService activityTeamInfoService;; private ActivityTeamInfoService activityTeamInfoService;;
/** /**
* *
* @param teamInfoListReq * @param teamInfoListReq
@ -46,8 +38,6 @@ public class ActivityTeamController {
}} }}
); );
} }
/** /**
* *
* @param activityTeamInfoSaveReq * @param activityTeamInfoSaveReq
@ -58,7 +48,6 @@ public class ActivityTeamController {
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq)); activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
return Result.success(); return Result.success();
} }
@PostMapping("/findById/{id}") @PostMapping("/findById/{id}")
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){ public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id))); return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
@ -68,7 +57,6 @@ public class ActivityTeamController {
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq)); activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
return Result.success(); return Result.success();
} }
@PostMapping("/updActivityTeamInfo") @PostMapping("/updActivityTeamInfo")
public Result updActivityTeamInfo (@RequestBody ActivityTeamUpdProductUpdReq activityTeamUpdProductUpdReq){ public Result updActivityTeamInfo (@RequestBody ActivityTeamUpdProductUpdReq activityTeamUpdProductUpdReq){
boolean a= activityTeamInfoService.updproduct(ActivityUpdTeamModel.update(activityTeamUpdProductUpdReq)); boolean a= activityTeamInfoService.updproduct(ActivityUpdTeamModel.update(activityTeamUpdProductUpdReq));

View File

@ -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);
}

View File

@ -0,0 +1,7 @@
package com.muyu.marketing.team.satery.impl;
public class ActivityTeamStrateyImpl {
}

View File

@ -1,10 +1,8 @@
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.common.core.enums.market.team.TeamOpenTypeEnum;
import com.muyu.marketing.domain.ActivityTeamOpenInfo; import com.muyu.marketing.domain.ActivityTeamOpenInfo;
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo; import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> { public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
/** /**

View File

@ -108,7 +108,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel)); boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
io.jsonwebtoken.lang.Assert.isTrue(update,"修改失败"); io.jsonwebtoken.lang.Assert.isTrue(update,"修改失败");
activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdModel.getActivityTeamProductSkuModelList()); activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdModel.getActivityTeamProductSkuModelList());
return update; return update;
} }
@ -117,17 +116,12 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
public boolean updproduct(ActivityUpdTeamModel update) { public boolean updproduct(ActivityUpdTeamModel update) {
boolean b = this.updateById(ActivityTeamInfo.activityUpdTeamModel(update)); boolean b = this.updateById(ActivityTeamInfo.activityUpdTeamModel(update));
io.jsonwebtoken.lang.Assert.isTrue(b,"修改失败"); io.jsonwebtoken.lang.Assert.isTrue(b,"修改失败");
List<ActivityTeamUpdModel> activityTeamUpdModels = update.getActivityTeamUpdModels(); List<ActivityTeamUpdModel> activityTeamUpdModels = update.getActivityTeamUpdModels();
List<ActivityTeamAddModel> activityTeamAddModels = update.getActivityTeamAddModels(); List<ActivityTeamAddModel> activityTeamAddModels = update.getActivityTeamAddModels();
List<Long> ids = update.getIds(); List<Long> ids = update.getIds();
activityTeamProductSkuInfoService.updtoBath(activityTeamUpdModels); activityTeamProductSkuInfoService.updtoBath(activityTeamUpdModels);
activityTeamProductSkuInfoService.addBath(activityTeamAddModels); activityTeamProductSkuInfoService.addBath(activityTeamAddModels);
activityTeamProductSkuInfoService.delBath(ids); activityTeamProductSkuInfoService.delBath(ids);
return b; return b;
} }
} }

View File

@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo> public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
implements ActivityTeamOpenInfoService { implements ActivityTeamOpenInfoService {
/** /**
* ID * ID
* *

View File

@ -51,7 +51,6 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
} }
return discountPriceModelOptional.get(); return discountPriceModelOptional.get();
} }
/** /**
* ID * ID
* *

View File

@ -7,6 +7,8 @@ spring:
application: application:
# 应用名称 # 应用名称
name: muyu-activity name: muyu-activity
main:
allow-circular-references: true
profiles: profiles:
# 环境配置 # 环境配置
active: dev active: dev

View File

@ -86,6 +86,11 @@ public class CommentInfoController extends BaseController {
return toAjax(commentInfoService.save(CommentInfo.saveBuild(commentInfoSaveReq))); return toAjax(commentInfoService.save(CommentInfo.saveBuild(commentInfoSaveReq)));
} }
@PostMapping("/tocomment/{id}")
public Result<List<CommentInfo>> commentInfoResult(@PathVariable Long id){
return Result.success(commentInfoService.commentInfoId(id));
}
/** /**
* *
*/ */

View File

@ -19,4 +19,5 @@ public interface CommentInfoService extends IService<CommentInfo> {
*/ */
public List<CommentInfo> list(CommentInfo commentInfo); public List<CommentInfo> list(CommentInfo commentInfo);
List<CommentInfo> commentInfoId(Long id);
} }

View File

@ -54,4 +54,13 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
return list(queryWrapper); return list(queryWrapper);
} }
@Override
public List<CommentInfo> commentInfoId(Long id) {
LambdaQueryWrapper<CommentInfo> commentInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
commentInfoLambdaQueryWrapper.eq(CommentInfo::getProjectId,id);
List<CommentInfo> list = this.list(commentInfoLambdaQueryWrapper);
return list;
}
} }