Browse Source

重构国际化,系统模块部分开发TWO

master
caojianbin 8 months ago
parent
commit
f91af34361
  1. 2
      ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml
  2. 91
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertController.java
  3. 101
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertRollController.java
  4. 94
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/AdvertRoll.java
  5. 25
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/AlarmVO.java
  6. 17
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertMapper.java
  7. 16
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertRollMapper.java
  8. 27
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertRollService.java
  9. 26
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertService.java
  10. 42
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertRollServiceImpl.java
  11. 43
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertServiceImpl.java
  12. 30
      ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertMapper.xml
  13. 26
      ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertRollMapper.xml

2
ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml

@ -65,4 +65,4 @@ management: @@ -65,4 +65,4 @@ management:
include: '*'
logging:
level:
com.yisai.system.security.mapper: debug
com.ecell.internationalize.system.security.mapper: debug

91
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertController.java

@ -0,0 +1,91 @@ @@ -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;
/**
* <p>
* 广告 前端控制器
* </p>
*
* @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<String,Object> 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));
}
}

101
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/AdvertRollController.java

@ -0,0 +1,101 @@ @@ -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;
/**
* <p>
* 文字滚动广告列表 前端控制器
* </p>
*
* @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<String,Object> 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));
}
}

94
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/AdvertRoll.java

@ -0,0 +1,94 @@ @@ -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;
/**
* <p>
* 文字滚动广告列表
* </p>
*
* @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;
}

25
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/AlarmVO.java

@ -0,0 +1,25 @@ @@ -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;
}

17
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertMapper.java

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
package com.ecell.internationalize.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ecell.internationalize.system.entity.Advert;
/**
* <p>
* 广告 Mapper 接口
* </p>
*
* @author liy
* @since 2022-07-14
*/
public interface AdvertMapper extends BaseMapper<Advert> {
}

16
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/AdvertRollMapper.java

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
package com.ecell.internationalize.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ecell.internationalize.system.entity.AdvertRoll;
/**
* <p>
* 文字滚动广告列表 Mapper 接口
* </p>
*
* @author liy
* @since 2022-07-14
*/
public interface AdvertRollMapper extends BaseMapper<AdvertRoll> {
}

27
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertRollService.java

@ -0,0 +1,27 @@ @@ -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;
/**
* <p>
* 文字滚动广告列表 服务类
* </p>
*
* @author liy
* @since 2022-07-14
*/
public interface AdvertRollService extends IService<AdvertRoll> {
/**
* 文字滚动广告分页查询
* @Author liy
* @Date 2022/7/15 16:42
* @param map 分页查询体
* @return IPage
*/
IPage<AdvertRoll> findAllByPage(Map<String,Object> map);
}

26
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/AdvertService.java

@ -0,0 +1,26 @@ @@ -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;
/**
* <p>
* 广告 服务类
* </p>
*
* @author liy
* @since 2022-07-14
*/
public interface AdvertService extends IService<Advert> {
/**
* 广告配置分页查询
* @Author liy
* @Date 2022/7/15 16:42
* @param map 分页查询体
* @return IPage
*/
IPage<Advert> findAllByPage(Map<String,Object> map);
}

42
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertRollServiceImpl.java

@ -0,0 +1,42 @@ @@ -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;
/**
* <p>
* 文字滚动广告列表 服务实现类
* </p>
*
* @author liy
* @since 2022-07-14
*/
@Service
public class AdvertRollServiceImpl extends ServiceImpl<AdvertRollMapper, AdvertRoll> implements AdvertRollService {
@Autowired
private AdvertRollMapper advertRollMapper;
/**
* 文字滚动广告分页查询
* @Author liy
* @Date 2022/7/15 16:42
* @param map 分页查询体
* @return IPage
*/
@Override
public IPage<AdvertRoll> findAllByPage(Map<String, Object> map) {
Page<AdvertRoll> page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString()));
LambdaQueryWrapper<AdvertRoll> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AdvertRoll::getDelFlag, FieldConstant.MATH_ONE);
return advertRollMapper.selectPage(page,queryWrapper);
}
}

43
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/AdvertServiceImpl.java

@ -0,0 +1,43 @@ @@ -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;
/**
* <p>
* 广告 服务实现类
* </p>
*
* @author liy
* @since 2022-07-14
*/
@Service
public class AdvertServiceImpl extends ServiceImpl<AdvertMapper, Advert> implements AdvertService {
@Autowired
private AdvertMapper advertMapper;
/**
* 广告配置分页查询
* @Author liy
* @Date 2022/7/15 16:42
* @param map 分页查询体
* @return IPage
*/
@Override
public IPage<Advert> findAllByPage(Map<String, Object> map) {
Page<Advert> page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString()));
LambdaQueryWrapper<Advert> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Advert::getDelFlag, FieldConstant.MATH_ONE);
queryWrapper.orderByAsc(Advert::getAdvertOrder);
return advertMapper.selectPage(page,queryWrapper);
}
}

30
ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertMapper.xml

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ecell.internationalize.system.mapper.AdvertMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.ecell.internationalize.system.entity.Advert">
<id column="id" property="id" />
<result column="advert_order" property="advertOrder" />
<result column="advert_name" property="advertName" />
<result column="advert_short_name" property="advertShortName" />
<result column="status" property="status" />
<result column="del_flag" property="delFlag" />
<result column="start_time_first" property="startTimeFirst" />
<result column="start_time_second" property="startTimeSecond" />
<result column="start_time_third" property="startTimeThird" />
<result column="end_time_first" property="endTimeFirst" />
<result column="end_time_second" property="endTimeSecond" />
<result column="end_time_third" property="endTimeThird" />
<result column="create_user" property="createUser" />
<result column="create_time" property="createTime" />
<result column="update_user" property="updateUser" />
<result column="update_time" property="updateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
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
</sql>
</mapper>

26
ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/AdvertRollMapper.xml

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ecell.internationalize.system.mapper.AdvertRollMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.ecell.internationalize.system.entity.AdvertRoll">
<id column="id" property="id" />
<result column="del_flag" property="delFlag" />
<result column="create_user" property="createUser" />
<result column="create_time" property="createTime" />
<result column="update_user" property="updateUser" />
<result column="update_time" property="updateTime" />
<result column="title" property="title" />
<result column="icon_image" property="iconImage" />
<result column="click_count" property="clickCount" />
<result column="url" property="url" />
<result column="applet_id" property="appletId" />
<result column="applet_path" property="appletPath" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, del_flag, create_user, create_time, update_user, update_time, title, icon_image, click_count, url, applet_id, applet_path
</sql>
</mapper>
Loading…
Cancel
Save