2204-11-20 (DDD)
parent
0bd4aa8d46
commit
056c0e5124
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,17 +1,50 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.model.QueryModel;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* 团购活动 列表查询 结果模型
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class ActivityTeamInfoListModel {
|
||||
@Builder
|
||||
@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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
public class ActivityTeamInfoListReq {
|
||||
}
|
|
@ -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;
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
}
|
|
@ -1,7 +1,39 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* 拼团
|
||||
* @author muyu
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("team")
|
||||
public class ActivityTeamInfoController {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamInfoService activityTeamInfoService;
|
||||
|
||||
/**
|
||||
* 拼团 活动表
|
||||
*/
|
||||
@ApiOperation("获取拼团列表")
|
||||
@PostMapping("/list")
|
||||
public Result<TableDataInfo<ActivityTeamInfoListResp>> ActivityTeamInfoList(TeamInfoListReq teamInfoListReq){
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
|
|||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/** 团购活动执行*/
|
||||
@RestController
|
||||
public class ActivityTeamOpenInfoController {
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
|
|||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/** 商品拼团规格信息*/
|
||||
@RestController
|
||||
public class ActivityTeamProductSkuInfoController {
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
|
|||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/** 拼团免单策略*/
|
||||
@RestController
|
||||
public class TeamStrategyExemptionController {
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.muyu.marketing.controller;
|
|||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/** 百人策略*/
|
||||
@RestController
|
||||
public class TeamStrategyExemptionHundredController {
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.controller;
|
|||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/** 普通策略*/
|
||||
@RestController
|
||||
public class TeamStrategyExemptionOrdinaryController {
|
||||
}
|
||||
|
|
|
@ -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> {
|
||||
|
||||
}
|
|
@ -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> {
|
||||
}
|
|
@ -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> {
|
||||
}
|
|
@ -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> {
|
||||
}
|
|
@ -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> {
|
||||
}
|
|
@ -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> {
|
||||
}
|
|
@ -1,4 +1,15 @@
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,72 @@
|
|||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拼团
|
||||
* @author muyu
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
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;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamOpenInfoServiceImpl {
|
||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
||||
implements ActivityTeamOpenInfoService {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
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;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamProductSkuInfoServiceImpl {
|
||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||
implements ActivityTeamProductSkuInfoService {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
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;
|
||||
|
||||
@Service
|
||||
public class TeamStrategyExemptionHundredServiceImpl {
|
||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||
implements TeamStrategyExemptionHundredService {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
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;
|
||||
|
||||
@Service
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl {
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||
implements TeamStrategyExemptionOrdinaryService {
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
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;
|
||||
|
||||
|
||||
@Service
|
||||
public class TeamStrategyExemptionServiceImpl {
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||
implements TeamStrategyExemptionService {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue