master
‘mahaoran’ 2024-12-03 11:59:51 +08:00
parent 1b75139b17
commit e2d2634ee8
6 changed files with 20 additions and 18 deletions

View File

@ -1,7 +0,0 @@
package com.muyu;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -7,6 +7,8 @@ import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -22,6 +24,7 @@ import org.hibernate.validator.constraints.Length;
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(value = "activity_team_open_info")
public class ActivityTeamOpenInfo implements Serializable {
/**

View File

@ -1,5 +1,7 @@
package com.muyu.marketing.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
@ -15,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.concurrent.Phaser;
@Api(tags = "商品拼团信息")
@RestController
@RequestMapping("/team")
@ -27,16 +31,16 @@ public class ActivityTeamController {
* @return
*/
@PostMapping("list")
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoReqListReq teamInfoReqListReq){
public Result<PageInfo<TeamInfoListResp>> list(@RequestBody TeamInfoReqListReq teamInfoReqListReq){
PageHelper.startPage(teamInfoReqListReq.getPageNum(),teamInfoReqListReq.getPageSize());
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoReqListReq.buildQueryModel());
List<TeamInfoListResp> respList = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModelBuild).toList();
return Result.success(
new TableDataInfo<>(){{
setRows(respList);
setTotal(tableDataInfo.getTotal());
}}
);
PageInfo<TeamInfoListResp> pageInfo = new PageInfo<>(respList);
return Result.success(pageInfo);
// new TableDataInfo<>(){{
// setRows(respList);
// setTotal(tableDataInfo.getTotal());
// }}
}
/**

View File

@ -14,7 +14,7 @@ public class ActivityOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInf
public Long getTeamOpenNumberByTeamIdAndType(Long teamId) {
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,teamId);
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.OPEN_TEAM.Code());
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.OPEN_TEAM.Label());
return this.count(queryWrapper);
}
@ -22,7 +22,7 @@ public class ActivityOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInf
public Long getTeamInNumberByTeamIdAndType(Long teamId) {
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,teamId);
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.IN_TEAM.Code());
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.IN_TEAM.Label());
return this.count(queryWrapper);
}
}

View File

@ -52,7 +52,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
(activityTeamInfoListModelBuilder) -> {
Long openNumberByTeamIdAndType = activityOpenInfoService.getTeamOpenNumberByTeamIdAndType(activityTeamInfo.getId());
Long inNumberByTeamIdAndType = activityOpenInfoService.getTeamInNumberByTeamIdAndType(activityTeamInfo.getId());
// TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
// TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
return activityTeamInfoListModelBuilder

View File

@ -29,6 +29,8 @@ import java.util.List;
import java.util.function.Function;
import java.util.stream.Stream;
import static com.muyu.common.core.utils.PageUtils.startPage;
/**
* Service
*