diff --git a/ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml b/ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml index cff67f7..9f128fc 100644 --- a/ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml +++ b/ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml @@ -65,4 +65,4 @@ management: include: '*' logging: level: - com.yisai.system.security.mapper: debug + com.ecell.internationalize.system.security.mapper: debug diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertController.java new file mode 100644 index 0000000..e4e9537 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertController.java @@ -0,0 +1,91 @@ +package com.ecell.internationalize.system.controller; +import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; +import com.ecell.internationalize.common.core.utils.uuid.UUID; +import com.ecell.internationalize.common.core.web.domain.AjaxResult; +import com.ecell.internationalize.common.security.utils.SecurityUtils; +import com.ecell.internationalize.common.system.annotation.SystemLog; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.system.entity.Advert; +import com.ecell.internationalize.system.service.AdvertService; +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; +import java.util.Map; + +/** + *

+ * 广告 前端控制器 + *

+ * + * @author liy + * @since 2022-07-14 + */ +@Api(value="广告配置",tags={"广告配置接口"}) +@RestController +@RequestMapping("/advert") +public class AdvertController { + @Autowired + private AdvertService advertService; + /** + * 广告配置分页查询 + * @Author liy + * @Date 2022/7/15 16:38 + * @param map 分页条件查询体 + * @Return AjaxResult + */ + @ApiOperation("条件分页查询广告配置信息") + @PostMapping("config/list") + public AjaxResult queryAllByPage(@RequestBody Map map){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertService.findAllByPage(map)); + } + /** + * 广告配置删除 + * @Author liy + * @Date 2022/7/15 16:38 + * @param advert 实体类 + * @Return AjaxResult + */ + @ApiOperation("广告配置删除") + @SystemLog(msg =FieldConstant.ADVERT_MANAGE,operation = FieldConstant.DELETE_OPERATOR) + @PostMapping("config/del") + public AjaxResult changeStatusOrDelUser(@RequestBody @ApiParam(value="传整个对象,修改其中delFlag字段,(0:删除,1:正常)",required=true) Advert advert){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertService.updateById(advert)); + } + /** + * 新增广告配置 + * @Author liy + * @Date 2022/7/15 17:38 + * @param advert 类别实体 + * @Return AjaxResult + */ + @ApiOperation("新增广告配置") + @SystemLog(msg =FieldConstant.ADVERT_MANAGE,operation = FieldConstant.SAVE_OPERATOR) + @PostMapping("config/save") + public AjaxResult save(@RequestBody @Valid Advert advert){ + String id= UUID.randomUUID().toString(true); + advert.setId(id); + advert.setCreateUser(SecurityUtils.getUsername()); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertService.save(advert)); + } + /** + * 修改广告配置 + * @Author liy + * @Date 2022/7/15 17:38 + * @param advert 类别实体 + * @Return AjaxResult + */ + @ApiOperation("修改广告配置") + @SystemLog(msg =FieldConstant.ADVERT_MANAGE,operation = FieldConstant.UPDATE_OPERATOR) + @PostMapping("config/update") + public AjaxResult update(@RequestBody @Valid Advert advert){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertService.updateById(advert)); + } +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertRollController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertRollController.java new file mode 100644 index 0000000..384b7cf --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertRollController.java @@ -0,0 +1,101 @@ +package com.ecell.internationalize.system.controller; +import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; +import com.ecell.internationalize.common.core.utils.uuid.UUID; +import com.ecell.internationalize.common.core.web.domain.AjaxResult; +import com.ecell.internationalize.common.security.utils.SecurityUtils; +import com.ecell.internationalize.common.system.annotation.SystemLog; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.common.system.utlis.UploadUtil; +import com.ecell.internationalize.system.entity.AdvertRoll; +import com.ecell.internationalize.system.service.AdvertRollService; +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.util.Map; + +/** + *

+ * 文字滚动广告列表 前端控制器 + *

+ * + * @author liy + * @since 2022-07-14 + */ +@Api(value="文字滚动广告列表",tags={"文字滚动广告列表接口"}) +@RestController +@RequestMapping("/advert_roll") +public class AdvertRollController { + @Autowired + private AdvertRollService advertRollService; + /** + * 文字滚动广告条件分页查询 + * @Author liy + * @Date 2022/7/15 16:38 + * @param map 分页条件查询体 + * @Return AjaxResult + */ + @ApiOperation("条件分页查询文字滚动广告信息") + @PostMapping("roll/list") + public AjaxResult queryAllByPage(@RequestBody Map map){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertRollService.findAllByPage(map)); + } + /** + * 文字滚动广告删除 + * @Author liy + * @Date 2022/7/15 16:38 + * @param advertRoll 实体类 + * @Return AjaxResult + */ + @ApiOperation("文字滚动广告删除") + @SystemLog(msg =FieldConstant.WORD_ROLL_ADVERT,operation = FieldConstant.DELETE_OPERATOR) + @PostMapping("roll/del") + public AjaxResult changeStatusOrDelUser(@RequestBody @ApiParam(value="传整个对象,修改其中delFlag字段,(0:删除,1:正常)",required=true) AdvertRoll advertRoll){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertRollService.updateById(advertRoll)); + } + /** + * 文字滚动广告上传/新增 + * @Author liy + * @Date 2022/7/15 16:38 + * @param file 文件 + * @Return AjaxResult + */ + @ApiOperation("文字滚动广告新增上传") + @SystemLog(msg =FieldConstant.WORD_ROLL_ADVERT,operation = FieldConstant.SAVE_OPERATOR) + @PostMapping("roll/save") + public AjaxResult save(@RequestParam("file") MultipartFile file, @RequestParam("title") String title) throws IOException { + String path = UploadUtil.upload(file); + String id= UUID.randomUUID().toString(true); + AdvertRoll advertRoll=new AdvertRoll(); + advertRoll.setId(id); + advertRoll.setCreateUser(SecurityUtils.getUsername()); + advertRoll.setTitle(title); + advertRoll.setIconImage(path); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertRollService.save(advertRoll)); + } + /** + * 文字滚动广告上传/修改 + * @Author liy + * @Date 2022/7/15 16:38 + * @param file 文件 + * @Return AjaxResult + */ + @ApiOperation("文字滚动广告修改上传") + @SystemLog(msg =FieldConstant.WORD_ROLL_ADVERT,operation = FieldConstant.UPDATE_OPERATOR) + @PostMapping("roll/update") + public AjaxResult update(@RequestParam(value = "file",required = false) MultipartFile file, @RequestParam("id")String id, @RequestParam("title") String title) throws IOException { + AdvertRoll advertRoll=new AdvertRoll(); + if (null!=file) { + String path = UploadUtil.upload(file); + advertRoll.setIconImage(path); + } + advertRoll.setId(id); + advertRoll.setTitle(title); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),advertRollService.updateById(advertRoll)); + } +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/AdvertRoll.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/AdvertRoll.java new file mode 100644 index 0000000..7101feb --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/AdvertRoll.java @@ -0,0 +1,94 @@ +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 java.io.Serializable; +import java.util.Date; + +/** + *

+ * 文字滚动广告列表 + *

+ * + * @author liy + * @since 2022-07-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("advert_roll") +public class AdvertRoll implements Serializable { + +private static final long serialVersionUID=1L; + + /** + * 主键Id + */ + @TableId("id") + private String id; + + /** + * 删除标识(0:已删除,1:正常) + */ + private String delFlag; + + /** + * 创建人 + */ + 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; + + /** + * 标题 + */ + private String title; + + /** + * icon 小图标 存放的文件名 + */ + private String iconImage; + + /** + * 点击数 + */ + private Integer clickCount; + + /** + * 跳转链接 + */ + private String url; + + /** + * 小程序ID + */ + private String appletId; + + /** + * 小程序跳转的商品Id + */ + private String appletPath; + + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/AlarmVO.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/AlarmVO.java new file mode 100644 index 0000000..4b9f192 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/AlarmVO.java @@ -0,0 +1,25 @@ +package com.ecell.internationalize.system.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author borui + */ +@Data +public class AlarmVO { + @ApiModelProperty(example = "标签") + private String tag; + + @ApiModelProperty(example = "响铃时间") + private String alarmTime; + + @ApiModelProperty(example = "重复星期数为'0', '1'组成的7位长度字符串, 表示周一至周日是否有效,eg: '0000011'为周六日有效, '1110000'为周一二三有效") + private String alarmWeek; + + @ApiModelProperty(example = "是否开启 0关闭,1开启,默认1") + private String alarmStatus; + + @ApiModelProperty(example = "设备imei") + private String imei; +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertMapper.java new file mode 100644 index 0000000..8907e2a --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertMapper.java @@ -0,0 +1,17 @@ +package com.ecell.internationalize.system.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ecell.internationalize.system.entity.Advert; + +/** + *

+ * 广告 Mapper 接口 + *

+ * + * @author liy + * @since 2022-07-14 + */ +public interface AdvertMapper extends BaseMapper { + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertRollMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertRollMapper.java new file mode 100644 index 0000000..58b3937 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertRollMapper.java @@ -0,0 +1,16 @@ +package com.ecell.internationalize.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ecell.internationalize.system.entity.AdvertRoll; + +/** + *

+ * 文字滚动广告列表 Mapper 接口 + *

+ * + * @author liy + * @since 2022-07-14 + */ +public interface AdvertRollMapper extends BaseMapper { + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertRollService.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertRollService.java new file mode 100644 index 0000000..1482a79 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertRollService.java @@ -0,0 +1,27 @@ +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.AdvertRoll; + +import java.util.Map; + +/** + *

+ * 文字滚动广告列表 服务类 + *

+ * + * @author liy + * @since 2022-07-14 + */ +public interface AdvertRollService extends IService { + + /** + * 文字滚动广告分页查询 + * @Author liy + * @Date 2022/7/15 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/AdvertService.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertService.java new file mode 100644 index 0000000..0056c56 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertService.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.Advert; + +import java.util.Map; + +/** + *

+ * 广告 服务类 + *

+ * + * @author liy + * @since 2022-07-14 + */ +public interface AdvertService extends IService { + /** + * 广告配置分页查询 + * @Author liy + * @Date 2022/7/15 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/AdvertRollServiceImpl.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertRollServiceImpl.java new file mode 100644 index 0000000..72af06c --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertRollServiceImpl.java @@ -0,0 +1,42 @@ +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.AdvertRoll; +import com.ecell.internationalize.system.mapper.AdvertRollMapper; +import com.ecell.internationalize.system.service.AdvertRollService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + *

+ * 文字滚动广告列表 服务实现类 + *

+ * + * @author liy + * @since 2022-07-14 + */ +@Service +public class AdvertRollServiceImpl extends ServiceImpl implements AdvertRollService { + @Autowired + private AdvertRollMapper advertRollMapper; + /** + * 文字滚动广告分页查询 + * @Author liy + * @Date 2022/7/15 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<>(); + queryWrapper.eq(AdvertRoll::getDelFlag, FieldConstant.MATH_ONE); + return advertRollMapper.selectPage(page,queryWrapper); + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertServiceImpl.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertServiceImpl.java new file mode 100644 index 0000000..872d1c0 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertServiceImpl.java @@ -0,0 +1,43 @@ +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.Advert; +import com.ecell.internationalize.system.mapper.AdvertMapper; +import com.ecell.internationalize.system.service.AdvertService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + *

+ * 广告 服务实现类 + *

+ * + * @author liy + * @since 2022-07-14 + */ +@Service +public class AdvertServiceImpl extends ServiceImpl implements AdvertService { + @Autowired + private AdvertMapper advertMapper; + /** + * 广告配置分页查询 + * @Author liy + * @Date 2022/7/15 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<>(); + queryWrapper.eq(Advert::getDelFlag, FieldConstant.MATH_ONE); + queryWrapper.orderByAsc(Advert::getAdvertOrder); + return advertMapper.selectPage(page,queryWrapper); + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertMapper.xml b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertMapper.xml new file mode 100644 index 0000000..5b08993 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + id, advert_order, advert_name, advert_short_name, status, start_time_first, start_time_second, start_time_third, end_time_first, end_time_second, end_time_third, create_user, create_time, update_user, update_time ,del_flag + + + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertRollMapper.xml b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertRollMapper.xml new file mode 100644 index 0000000..c58f9f3 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertRollMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + id, del_flag, create_user, create_time, update_user, update_time, title, icon_image, click_count, url, applet_id, applet_path + + +