2204-11-20 (DDD)

yingxiao
笨蛋 2024-11-21 02:02:45 +08:00
parent 0bd4aa8d46
commit 056c0e5124
25 changed files with 412 additions and 16 deletions

View File

@ -0,0 +1,62 @@
package com.muyu.common.core.model;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.muyu.common.core.web.page.PageDomain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
import java.util.OptionalInt;
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class QueryModel<T> {
/**
*
*/
private Integer pageNum;
/**
*
*/
private Integer pageSize;
/**
*
*/
private String orderByColum;
/**
*
* @param domain
*/
private Boolean isAec =true;
/**
*
*/
public <T> T domainBuild(PageDomain domain) {
this.pageNum=domain.getPageNum();
this.pageSize=domain.getPageSize();
this.orderByColum=domain.getOrderByColumn();
this.isAec="asc".equals(domain.getIsAsc());
return (T) this;
}
/***
*
* @return
*/
public Page<T> buildPage(){
Page<T> page = Page.of(this.getPageNum(), this.getPageSize());
page.setOrders(List.of(this.getIsAec() ? OrderItem.asc(this.getOrderByColum()): OrderItem.desc(this.getOrderByColum())));
return page;
}
}

View File

@ -1,17 +1,50 @@
package com.muyu.marketing.domain.model; package com.muyu.marketing.domain.model;
import lombok.AllArgsConstructor; import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Data; import com.baomidou.mybatisplus.annotation.TableId;
import lombok.NoArgsConstructor; import com.muyu.common.core.model.QueryModel;
import com.muyu.marketing.domain.ActivityTeamInfo;
import lombok.*;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import java.sql.Timestamp;
/** /**
* *
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@SuperBuilder @Builder
public class ActivityTeamInfoListModel { @EqualsAndHashCode(callSuper = true)
public class ActivityTeamInfoListModel extends QueryModel {
@TableId(type = IdType.AUTO)
/** 主键*/
private long id;
/** 拼团名称*/
private String name;
/** 商品ID*/
private long productId;
/** 商品活动图*/
private String productImage;
/** 活动简介*/
private String introduction;
/** 单位*/
private String unit;
/** 轮播图*/
private String imageList;
/** 活动结束时间*/
private Timestamp endTime;
/** 活动排序*/
private long sort;
/** 活动详情*/
private String content;
/** 活动状态*/
private String status;
/** 策略类型*/
private String strategyType;
/** 策略ID*/
private long strategyId;
} }

View File

@ -0,0 +1,24 @@
package com.muyu.marketing.domain.model;
import com.muyu.common.core.model.QueryModel;
import lombok.*;
import lombok.experimental.SuperBuilder;
/**
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
public class ActivityTeamInfoListQueryModel extends QueryModel {
/**
*
*/
private String name;
/**
*
*/
private String status;
}

View File

@ -1,4 +0,0 @@
package com.muyu.marketing.domain.req;
public class ActivityTeamInfoListReq {
}

View File

@ -0,0 +1,28 @@
package com.muyu.marketing.domain.req;
import com.muyu.common.core.web.page.PageDomain;
import io.swagger.annotations.ApiModel;
import lombok.*;
import lombok.experimental.SuperBuilder;
/**
* req
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "ActivityTeamInfoListReq", description = "拼团")
@EqualsAndHashCode(callSuper = true)
public class TeamInfoListReq extends PageDomain {
/**
*
*/
private String name;
/**
*
*/
private String status;
}

View File

@ -0,0 +1,51 @@
package com.muyu.marketing.domain.resp;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.sql.Timestamp;
/**
* resp
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "ActivityTeamInfoListReq", description = "拼团")
public class ActivityTeamInfoListResp {
@TableId(type = IdType.AUTO)
/** 主键*/
private long id;
/** 拼团名称*/
private String name;
/** 商品ID*/
private long productId;
/** 商品活动图*/
private String productImage;
/** 活动简介*/
private String introduction;
/** 单位*/
private String unit;
/** 轮播图*/
private String imageList;
/** 活动结束时间*/
private Timestamp endTime;
/** 活动排序*/
private long sort;
/** 活动详情*/
private String content;
/** 活动状态*/
private String status;
/** 策略类型*/
private String strategyType;
/** 策略ID*/
private long strategyId;
}

View File

@ -1,7 +1,39 @@
package com.muyu.marketing.controller; package com.muyu.marketing.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.marketing.domain.req.TeamInfoListReq;
import com.muyu.marketing.domain.resp.ActivityTeamInfoListResp;
import com.muyu.marketing.service.ActivityTeamInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/**
*
* @author muyu
*/
@RestController @RestController
@RequestMapping("team")
public class ActivityTeamInfoController { public class ActivityTeamInfoController {
@Autowired
private ActivityTeamInfoService activityTeamInfoService;
/**
*
*/
@ApiOperation("获取拼团列表")
@PostMapping("/list")
public Result<TableDataInfo<ActivityTeamInfoListResp>> ActivityTeamInfoList(TeamInfoListReq teamInfoListReq){
return Result.success();
}
} }

View File

@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** 团购活动执行*/
@RestController @RestController
public class ActivityTeamOpenInfoController { public class ActivityTeamOpenInfoController {
} }

View File

@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** 商品拼团规格信息*/
@RestController @RestController
public class ActivityTeamProductSkuInfoController { public class ActivityTeamProductSkuInfoController {
} }

View File

@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** 拼团免单策略*/
@RestController @RestController
public class TeamStrategyExemptionController { public class TeamStrategyExemptionController {
} }

View File

@ -2,6 +2,8 @@ package com.muyu.marketing.controller;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** 百人策略*/
@RestController @RestController
public class TeamStrategyExemptionHundredController { public class TeamStrategyExemptionHundredController {
} }

View File

@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** 普通策略*/
@RestController @RestController
public class TeamStrategyExemptionOrdinaryController { public class TeamStrategyExemptionOrdinaryController {
} }

View File

@ -0,0 +1,14 @@
package com.muyu.marketing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.marketing.domain.ActivityTeamInfo;
import org.apache.ibatis.annotations.Mapper;
/**
*
* @author muyu
*/
@Mapper
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
}

View File

@ -0,0 +1,9 @@
package com.muyu.marketing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
}

View File

@ -0,0 +1,9 @@
package com.muyu.marketing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
}

View File

@ -0,0 +1,9 @@
package com.muyu.marketing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
}

View File

@ -0,0 +1,9 @@
package com.muyu.marketing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.marketing.domain.TeamStrategyExemption;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
}

View File

@ -0,0 +1,9 @@
package com.muyu.marketing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
}

View File

@ -1,4 +1,15 @@
package com.muyu.marketing.service; package com.muyu.marketing.service;
public interface ActivityTeamInfoService { import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.marketing.domain.ActivityTeamInfo;
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
import java.util.List;
/** 拼团*/
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
TableDataInfo<ActivityTeamInfoListModel> tabDateInfo(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
} }

View File

@ -1,7 +1,72 @@
package com.muyu.marketing.service.impl; package com.muyu.marketing.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.marketing.domain.ActivityTeamInfo;
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
import com.muyu.marketing.domain.resp.ActivityTeamInfoListResp;
import com.muyu.marketing.mapper.ActivityTeamInfoMapper;
import com.muyu.marketing.service.ActivityTeamInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author muyu
*/
@Service @Service
public class ActivityTeamInfoServiceImpl { public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper,ActivityTeamInfo>
implements ActivityTeamInfoService {
@Autowired
private ActivityTeamInfoMapper activityTeamInfoMapper;
/**
*
*/
@Override
public TableDataInfo<ActivityTeamInfoListModel> tabDateInfo(ActivityTeamInfoListQueryModel teamInfoListQueryModel) {
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(StringUtils.isNotEmpty(teamInfoListQueryModel.getName()),ActivityTeamInfo::getName,teamInfoListQueryModel.getName());
queryWrapper.like(StringUtils.isNotEmpty(teamInfoListQueryModel.getStatus()),ActivityTeamInfo::getStatus,teamInfoListQueryModel.getStatus());
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(teamInfoListQueryModel.buildPage(), queryWrapper);
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
ArrayList<ActivityTeamInfoListModel> activityTeamInfoListModels = new ArrayList<>();
for (ActivityTeamInfo activityTeamInfo : activityTeamInfoList) {
ActivityTeamInfoListModel activityTeamInfoListModel = new ActivityTeamInfoListModel();
activityTeamInfoListModel.setId(activityTeamInfo.getId());
activityTeamInfoListModel.setName(activityTeamInfo.getName());
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());
activityTeamInfoListModel.setIntroduction(activityTeamInfo.getIntroduction());
activityTeamInfoListModel.setUnit(activityTeamInfo.getUnit());
activityTeamInfoListModel.setImageList(activityTeamInfo.getImageList());
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());
activityTeamInfoListModel.setSort(activityTeamInfo.getSort());
activityTeamInfoListModel.setContent(activityTeamInfo.getContent());
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());
activityTeamInfoListModel.setStrategyType(activityTeamInfo.getStrategyType());
activityTeamInfoListModel.setStrategyId(activityTeamInfo.getStrategyId());
activityTeamInfoListModels.add(activityTeamInfoListModel);
}
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
tableDataInfo.setRows(activityTeamInfoListModels);
return tableDataInfo;
}
} }

View File

@ -1,7 +1,13 @@
package com.muyu.marketing.service.impl; package com.muyu.marketing.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
import com.muyu.marketing.mapper.ActivityTeamOpenInfoMapper;
import com.muyu.marketing.service.ActivityTeamOpenInfoService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class ActivityTeamOpenInfoServiceImpl { public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
implements ActivityTeamOpenInfoService {
} }

View File

@ -1,7 +1,13 @@
package com.muyu.marketing.service.impl; package com.muyu.marketing.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
import com.muyu.marketing.mapper.ActivityTeamProductSkuInfoMapper;
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class ActivityTeamProductSkuInfoServiceImpl { public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
implements ActivityTeamProductSkuInfoService {
} }

View File

@ -1,7 +1,13 @@
package com.muyu.marketing.service.impl; package com.muyu.marketing.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
import com.muyu.marketing.mapper.TeamStrategyExemptionHundredMapper;
import com.muyu.marketing.service.TeamStrategyExemptionHundredService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class TeamStrategyExemptionHundredServiceImpl { public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
implements TeamStrategyExemptionHundredService {
} }

View File

@ -1,7 +1,12 @@
package com.muyu.marketing.service.impl; package com.muyu.marketing.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
import com.muyu.marketing.mapper.TeamStrategyExemptionOrdinaryMapper;
import com.muyu.marketing.service.TeamStrategyExemptionOrdinaryService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class TeamStrategyExemptionOrdinaryServiceImpl { public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
implements TeamStrategyExemptionOrdinaryService {
} }

View File

@ -1,7 +1,13 @@
package com.muyu.marketing.service.impl; package com.muyu.marketing.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.marketing.domain.TeamStrategyExemption;
import com.muyu.marketing.mapper.TeamStrategyExemptionMapper;
import com.muyu.marketing.service.TeamStrategyExemptionService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class TeamStrategyExemptionServiceImpl { public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
implements TeamStrategyExemptionService {
} }