From 98b8ea6a01664966ef84eb40a5d2c69ac11a5398 Mon Sep 17 00:00:00 2001 From: caojianbin <1910336823> Date: Tue, 26 Mar 2024 17:41:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=9B=BD=E9=99=85=E5=8C=96,?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=A8=A1=E5=9D=97=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/ActivityController.java | 174 +++++++++++++++++++++ .../controller/ActivitySearchController.java | 92 +++++++++++ .../internationalize/system/entity/Activity.java | 145 +++++++++++++++++ .../system/entity/ActivityBanner.java | 108 +++++++++++++ .../system/entity/ActivitySearch.java | 78 +++++++++ .../system/mapper/ActivityBannerMapper.java | 8 + .../system/mapper/ActivityMapper.java | 17 ++ .../system/mapper/ActivitySearchMapper.java | 17 ++ .../system/service/ActivityBannerService.java | 26 +++ .../service/impl/ActivityBannerServiceImpl.java | 48 ++++++ .../system/mapper/ActivityBannerMapper.xml | 28 ++++ .../system/mapper/ActivityMapper.xml | 36 +++++ 12 files changed, 777 insertions(+) create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Activity.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivityBanner.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivitySearch.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityBannerMapper.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityMapper.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivitySearchMapper.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityBannerService.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityBannerServiceImpl.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityBannerMapper.xml create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityMapper.xml diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java new file mode 100644 index 0000000..ae02b97 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java @@ -0,0 +1,174 @@ +package com.ecell.internationalize.system.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.common.core.utils.uuid.UUID; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.yisai.common.security.utils.SecurityUtils; +import com.yisai.system.common.annotation.SystemLog; +import com.yisai.system.common.constant.FieldConstant; +import com.yisai.system.common.utlis.I18nUtil; +import com.yisai.system.common.utlis.UploadUtil; +import com.yisai.system.entity.Activity; +import com.yisai.system.service.ActivityService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Date; +import java.util.Map; + +/** + *

+ * 活动 前端控制器 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Api(value="活动",tags={"活动/往期活动接口"}) +@RestController +@RequestMapping("/activity") +public class ActivityController { + @Autowired + private ActivityService activityService; + /** + * 活动条件分页查询 + * @Author liy + * @Date 2022/7/14 16:38 + * @param map 分页条件查询体 + * @Return AjaxResult + */ + @ApiOperation("条件分页查询活动信息") + @PostMapping("current/list") + public AjaxResult queryAllByPage(@RequestBody Map map){ + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.findAllByPage(map)); + } + /** + * 活动发布 + * @Author liy + * @Date 2022/7/14 16:38 + * @param activity 实体类 + * @Return AjaxResult + */ + @ApiOperation("活动发布/取消发布") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER,operation = FieldConstant.ACTIVITY_PUBLISH) + @PostMapping("current/changeStatus") + public AjaxResult changeStatusOrDelUser(@RequestBody @ApiParam(name="活动",value="传整个对象,修改其中status字段,(0:取消发布,1:发布)",required=true) Activity activity){ + if (FieldConstant.MATH_ONE.equals(activity.getStatus())){ + activity.setPublishUser("admin"); + activity.setPublishTime(new Date()); + }else { + activity.setPublishUser(null); + activity.setPublishTime(null); + } + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); + } + /** + * 活动删除 + * @Author liy + * @Date 2022/7/14 16:38 + * @param activity 实体类 + * @Return AjaxResult + */ + @ApiOperation("活动删除") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER,operation = FieldConstant.DELETE_OPERATOR) + @PostMapping("current/del") + public AjaxResult del(@RequestBody @ApiParam(name="活动",value="传整个对象,修改其中delFlag字段,(0:删除,1:正常)",required=true) Activity activity){ + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); + } + + /** + * 活动上传/新增 + * @Author liy + * @Date 2022/7/14 16:38 + * @param file 文件 + * @Return AjaxResult + */ + @ApiOperation("活动新增上传") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER,operation = FieldConstant.SAVE_OPERATOR) + @PostMapping("current/save") + public AjaxResult save(@RequestParam("file") MultipartFile file, @RequestParam("activityTitle") String activityTitle, + @RequestParam("sellingPrice") BigDecimal sellingPrice, String priceRepresent, @RequestParam("activityCategory")String activityCategory, + @RequestParam("activityAge")String activityAge, @RequestParam("activityAreas")String activityAreas, @RequestParam("activityQuota")String activityQuota, + Date expiryDate) throws IOException { + String path = UploadUtil.upload(file); + String id= UUID.randomUUID().toString(true); + Activity activity=new Activity(); + activity.setId(id); + activity.setActivityTitle(activityTitle); + activity.setSellingPrice(sellingPrice); + activity.setPriceRepresent(priceRepresent); + activity.setActivityCategory(activityCategory); + activity.setActivityAge(activityAge); + activity.setActivityAreas(activityAreas); + activity.setActivityQuota(activityQuota); + activity.setExpiryDate(expiryDate); + activity.setCreateUser(SecurityUtils.getUsername()); + activity.setBannerImage(path); + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.save(activity)); + } + /** + * 活动上传/修改 + * @Author liy + * @Date 2022/7/14 16:38 + * @param file 文件 + * @Return AjaxResult + */ + @ApiOperation("活动修改上传") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER,operation = FieldConstant.UPDATE_OPERATOR) + @PostMapping("current/update") + public AjaxResult update(@RequestParam(value = "file",required = false) MultipartFile file,@RequestParam("id")String id, @RequestParam("activityTitle") String activityTitle, + @RequestParam("sellingPrice") BigDecimal sellingPrice, String priceRepresent, @RequestParam("activityCategory")String activityCategory, + @RequestParam("activityAge")String activityAge, @RequestParam("activityAreas")String activityAreas, @RequestParam("activityQuota")String activityQuota, + @RequestParam("expiryDate")Date expiryDate) throws IOException { + Activity activity=new Activity(); + if (null!=file) { + String path = UploadUtil.upload(file); + activity.setBannerImage(path); + } + activity.setId(id); + activity.setActivityTitle(activityTitle); + activity.setSellingPrice(sellingPrice); + activity.setPriceRepresent(priceRepresent); + activity.setActivityCategory(activityCategory); + activity.setActivityAge(activityAge); + activity.setActivityAreas(activityAreas); + activity.setActivityQuota(activityQuota); + activity.setExpiryDate(expiryDate); + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); + } + /** + * 往期活动条件分页查询 + * @Author liy + * @Date 2022/7/14 16:38 + * @param map 分页条件查询体 + * @Return AjaxResult + */ + @ApiOperation("往期活动条件分页查询") + @PostMapping("last/list") + public AjaxResult queryLastListByPage(@RequestBody Map map){ + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.queryLastListByPage(map)); + } + /** + * 搜索条件查询接口 + * @Author liy + * @Date 2022/7/14 16:38 + * @param type 实体类 + * @Return AjaxResult + */ + @ApiOperation("搜索条件查询") + @GetMapping("current/query") + public AjaxResult del(@RequestParam @ApiParam(name="搜索类型",value="传type字段,(1:所属类别,2:年龄阶段,3: 活动区域)",required=true) String type){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + String value = FieldConstant.TYPE_MAP.get(type); + queryWrapper.select("DISTINCT "+value).eq("del_flag", FieldConstant.MATH_ONE); + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.getBaseMapper().selectList(queryWrapper)); + } +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java new file mode 100644 index 0000000..fde0acc --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java @@ -0,0 +1,92 @@ +package com.ecell.internationalize.system.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.utils.uuid.UUID; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.yisai.common.security.utils.SecurityUtils; +import com.yisai.system.common.annotation.SystemLog; +import com.yisai.system.common.constant.FieldConstant; +import com.yisai.system.common.utlis.I18nUtil; +import com.yisai.system.entity.ActivitySearch; +import com.yisai.system.service.ActivitySearchService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + *

+ * 热门搜索 前端控制器 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Api(value="热门搜索",tags={"热门搜索接口"}) +@RestController +@RequestMapping("/activity_search") +public class ActivitySearchController { + @Autowired + private ActivitySearchService activitySearchService; + /** + * 热门搜索分页查询 + * @Author liy + * @Date 2022/7/14 10:38 + * @param page 分页 + * @Return AjaxResult + */ + @ApiOperation("条件分页查询热门搜索信息") + @PostMapping("search/list") + public AjaxResult queryAll(@RequestBody Page page){ + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.findAllByPage(page)); + } + /** + * 新增热门搜索 + * @Author liy + * @Date 2022/7/14 10:38 + * @param activitySearch 实体 + * @Return AjaxResult + */ + @ApiOperation("新增热门搜索") + @SystemLog(msg =FieldConstant.HOT_SEARCH,operation = FieldConstant.SAVE_OPERATOR) + @PostMapping("search/save") + public AjaxResult saveSearch(@RequestBody @Valid ActivitySearch activitySearch){ + String id= UUID.randomUUID().toString(true); + activitySearch.setId(id); + activitySearch.setCreateUser(SecurityUtils.getUsername()); + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.save(activitySearch)); + } + /** + * 修改热门搜索 + * @Author liy + * @Date 2022/7/14 10:38 + * @param activitySearch 实体 + * @Return AjaxResult + */ + @ApiOperation("修改热门搜索") + @SystemLog(msg =FieldConstant.HOT_SEARCH,operation = FieldConstant.UPDATE_OPERATOR) + @PostMapping("search/update") + public AjaxResult updateSearch(@RequestBody @Valid ActivitySearch activitySearch){ + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.updateById(activitySearch)); + } + /** + * 删除热门搜索 + * @Author liy + * @Date 2022/7/14 10:38 + * @param activitySearch 实体 + * @Return AjaxResult + */ + @ApiOperation("删除热门搜索") + @SystemLog(msg =FieldConstant.HOT_SEARCH,operation = FieldConstant.DELETE_OPERATOR) + @PostMapping("search/del") + public AjaxResult delCategory(@RequestBody @ApiParam(value="传整个对象,修改其中delFlag字段,(0:删除,1:正常)",required=true) ActivitySearch activitySearch){ + return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.updateById(activitySearch)); + } +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Activity.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Activity.java new file mode 100644 index 0000000..c59186b --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Activity.java @@ -0,0 +1,145 @@ +package com.ecell.internationalize.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 活动 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("activity") +public class Activity implements Serializable { + +private static final long serialVersionUID=1L; + + /** + * 主键Id + */ + @TableId("id") + private String id; + + /** + * 排序号 + */ + private Integer activityOrder; + + /** + * 原价 + */ + private BigDecimal originalPrice; + + /** + * banner图 + */ + private String bannerImage; + + /** + * 活动截至日期 + */ + private Date expiryDate; + + /** + * 活动类别 + */ + private String activityCategory; + + /** + * 活动标题 + */ + private String activityTitle; + + /** + * 售价 + */ + private BigDecimal sellingPrice; + + /** + * 活动价提前描述 + */ + private String priceRepresent; + + /** + * 活动年龄段 + */ + private String activityAge; + + /** + * 活动区域 + */ + private String activityAreas; + + /** + * 活动名额 + */ + private String activityQuota; + + /** + * 活动链接 + */ + private String activityUrl; + + /** + * 点击数 + */ + private Integer clickCount; + + /** + * 创建人 + */ + private String createUser; + /** + * 创建时间 + */ + @TableField(value = "create_time",fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + /** + * 修改人 + */ + private String updateUser; + /** + * 修改时间 + */ + @TableField(value = "update_time",fill = FieldFill.UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 删除标识(0:已删除,1:正常) + */ + private String delFlag; + + /** + * 发布者 + */ + @TableField(value = "publish_user", strategy = FieldStrategy.IGNORED) + private String publishUser; + + /** + * 发布时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(value = "publish_time", strategy = FieldStrategy.IGNORED) + private Date publishTime; + + /** + * 是否发布(0:待发布,1:已发布),默认0 + */ + private String status; + + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivityBanner.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivityBanner.java new file mode 100644 index 0000000..2606d0f --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivityBanner.java @@ -0,0 +1,108 @@ +package com.ecell.internationalize.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 活动banner图 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("activity_banner") +public class ActivityBanner implements Serializable { + +private static final long serialVersionUID=1L; + + /** + * 主键Id + */ + @TableId("id") + private String id; + + /** + * 排序号 + */ + @NotNull(message = "排序序号不能为空") + private Integer bannerOrder; + + /** + * 是否发布(0:待发布,1:已发布),默认0 + */ + private String status; + + /** + * 点击数 + */ + private Integer clickCount; + + /** + * banner图链接 + */ + private String link; + + /** + * banner图标题 + */ + @NotBlank(message = "banner图标题不能为空") + private String title; + + /** + * banner图 + */ + private String banner; + + /** + * 创建人 + */ + private String createUser; + /** + * 创建时间 + */ + @TableField(value = "create_time",fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + /** + * 修改人 + */ + private String updateUser; + /** + * 修改时间 + */ + @TableField(value = "update_time",fill = FieldFill.UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 删除标识(0:已删除,1:正常) + */ + private String delFlag; + + /** + * 发布者 + */ + @TableField(value = "publish_user", strategy = FieldStrategy.IGNORED) + private String publishUser; + + /** + * 发布时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(value = "publish_time", strategy = FieldStrategy.IGNORED) + private Date publishTime; + + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivitySearch.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivitySearch.java new file mode 100644 index 0000000..5faea42 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/ActivitySearch.java @@ -0,0 +1,78 @@ +package com.ecell.internationalize.system.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("activity_search") +public class ActivitySearch implements Serializable { + +private static final long serialVersionUID=1L; + + /** + * 主键Id + */ + @TableId("id") + private String id; + + /** + * 排序 + */ + @NotNull(message = "排序序号不能为空") + private Integer searchOrder; + + /** + * 热门搜索内容 + */ + @NotBlank(message = "热门搜索内容不能为空") + private String searchName; + + /** + * 创建人 + */ + private String createUser; + /** + * 创建时间 + */ + @TableField(value = "create_time",fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + /** + * 修改人 + */ + private String updateUser; + /** + * 修改时间 + */ + @TableField(value = "update_time",fill = FieldFill.UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 删除标识(0:已删除,1:正常) + */ + private String delFlag; + + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityBannerMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityBannerMapper.java new file mode 100644 index 0000000..fc0eab5 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityBannerMapper.java @@ -0,0 +1,8 @@ +package com.ecell.internationalize.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ecell.internationalize.system.entity.ActivityBanner; + +public interface ActivityBannerMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityMapper.java new file mode 100644 index 0000000..19ccb38 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivityMapper.java @@ -0,0 +1,17 @@ +package com.ecell.internationalize.system.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ecell.internationalize.system.entity.Activity; + +/** + *

+ * 活动 Mapper 接口 + *

+ * + * @author liy + * @since 2022-07-13 + */ +public interface ActivityMapper extends BaseMapper { + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivitySearchMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivitySearchMapper.java new file mode 100644 index 0000000..b0340f5 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/ActivitySearchMapper.java @@ -0,0 +1,17 @@ +package com.ecell.internationalize.system.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ecell.internationalize.system.entity.ActivitySearch; + +/** + *

+ * Mapper 接口 + *

+ * + * @author liy + * @since 2022-07-13 + */ +public interface ActivitySearchMapper extends BaseMapper { + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityBannerService.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityBannerService.java new file mode 100644 index 0000000..468866f --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityBannerService.java @@ -0,0 +1,26 @@ +package com.ecell.internationalize.system.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ecell.internationalize.system.entity.ActivityBanner; + +import java.util.Map; + +/** + *

+ * 活动banner图 服务类 + *

+ * + * @author liy + * @since 2022-07-13 + */ +public interface ActivityBannerService extends IService { + /** + * 活动Banner分页查询 + * @Author liy + * @Date 2022/7/14 16:42 + * @param map 分页查询体 + * @return IPage + */ + IPage findAllByPage(Map map); +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityBannerServiceImpl.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityBannerServiceImpl.java new file mode 100644 index 0000000..93e903c --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityBannerServiceImpl.java @@ -0,0 +1,48 @@ +package com.ecell.internationalize.system.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.system.entity.ActivityBanner; +import com.ecell.internationalize.system.mapper.ActivityBannerMapper; +import com.ecell.internationalize.system.service.ActivityBannerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + *

+ * 活动banner图 服务实现类 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Service +public class ActivityBannerServiceImpl extends ServiceImpl implements ActivityBannerService { + @Autowired + private ActivityBannerMapper activityBannerMapper; + /** + * 活动Banner分页查询 + * @Author liy + * @Date 2022/7/14 16:42 + * @param map 分页查询体 + * @return IPage + */ + @Override + public IPage findAllByPage(Map map) { + Page page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString())); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (map.containsKey(FieldConstant.BANNER_TITLE)&&null!=map.get(FieldConstant.BANNER_TITLE).toString()){ + queryWrapper.eq(ActivityBanner::getTitle,map.get(FieldConstant.BANNER_TITLE).toString()); + } + if (map.containsKey(FieldConstant.STATUS)&&null!=map.get(FieldConstant.STATUS).toString()){ + queryWrapper.eq(ActivityBanner::getStatus,map.get(FieldConstant.STATUS).toString()); + } + queryWrapper.eq(ActivityBanner::getDelFlag, FieldConstant.MATH_ONE); + queryWrapper.orderByAsc(ActivityBanner::getBannerOrder); + return activityBannerMapper.selectPage(page,queryWrapper); + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityBannerMapper.xml b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityBannerMapper.xml new file mode 100644 index 0000000..f80850a --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityBannerMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + id, banner_order, status, click_count, link, title, banner, create_user, create_time, update_user, update_time, del_flag, publish_user, publish_time + + + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityMapper.xml b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityMapper.xml new file mode 100644 index 0000000..de41cbb --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivityMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, activity_order, original_price, banner_image, expiry_date, activity_category, activity_title, selling_price, price_represent, activity_age, activity_areas, activity_quota, activity_url, click_count, create_user, create_time, update_user, update_time, del_flag, publish_user, publish_time ,status + + +