首页文档动态
This commit is contained in:
+170
@@ -0,0 +1,170 @@
|
||||
package com.jero.modules.home.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.jero.modules.home.service.IHomeDocumentDynamicEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="文档动态")
|
||||
@RestController
|
||||
@RequestMapping("/home/homeDocumentDynamicEO")
|
||||
@Slf4j
|
||||
public class HomeDocumentDynamicEOController extends JeroController<HomeDocumentDynamicEO, IHomeDocumentDynamicEOService> {
|
||||
@Autowired
|
||||
private IHomeDocumentDynamicEOService homeDocumentDynamicEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-分页列表查询")
|
||||
@ApiOperation(value="文档动态-分页列表查询", notes="文档动态-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(HomeDocumentDynamicEO homeDocumentDynamicEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<HomeDocumentDynamicEO> queryWrapper = QueryGenerator.initQueryWrapper(homeDocumentDynamicEO, req.getParameterMap());
|
||||
Page<HomeDocumentDynamicEO> page = new Page<HomeDocumentDynamicEO>(pageNo, pageSize);
|
||||
IPage<HomeDocumentDynamicEO> pageList = homeDocumentDynamicEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-列表查询")
|
||||
@ApiOperation(value="文档动态-列表查询", notes="文档动态-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<HomeDocumentDynamicEO>> queryList() {
|
||||
List<HomeDocumentDynamicEO> list = homeDocumentDynamicEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-添加")
|
||||
@ApiOperation(value="文档动态-添加", notes="文档动态-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
homeDocumentDynamicEOService.add(homeDocumentDynamicEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-编辑")
|
||||
@ApiOperation(value="文档动态-编辑", notes="文档动态-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
homeDocumentDynamicEOService.editById(homeDocumentDynamicEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-通过id删除")
|
||||
@ApiOperation(value="文档动态-通过id删除", notes="文档动态-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
homeDocumentDynamicEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-批量删除")
|
||||
@ApiOperation(value="文档动态-批量删除", notes="文档动态-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.homeDocumentDynamicEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-通过id查询")
|
||||
@ApiOperation(value="文档动态-通过id查询", notes="文档动态-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
HomeDocumentDynamicEO homeDocumentDynamicEO = homeDocumentDynamicEOService.queryById(id);
|
||||
if(homeDocumentDynamicEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(homeDocumentDynamicEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param homeDocumentDynamicEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
return super.exportXls(request, homeDocumentDynamicEO, HomeDocumentDynamicEO.class, "文档动态");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, HomeDocumentDynamicEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.jero.modules.home.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("home_document_dynamic")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="home_document_dynamic对象", description="文档动态")
|
||||
public class HomeDocumentDynamicEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**消息内容*/
|
||||
@Excel(name = "消息内容", width = 15)
|
||||
@ApiModelProperty(value = "消息内容")
|
||||
private java.lang.String content;
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.home.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface HomeDocumentDynamicEOMapper extends BaseMapper<HomeDocumentDynamicEO> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?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.jero.modules.home.mapper.HomeDocumentDynamicEOMapper">
|
||||
<resultMap id="HomeDocumentDynamicEOResultMap" type="com.jero.modules.home.entity.HomeDocumentDynamicEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="content" property="content" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.home.service;
|
||||
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IHomeDocumentDynamicEOService extends IService<HomeDocumentDynamicEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
void add(HomeDocumentDynamicEO homeDocumentDynamicEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
void editById(HomeDocumentDynamicEO homeDocumentDynamicEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HomeDocumentDynamicEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<HomeDocumentDynamicEO> queryList();
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.jero.modules.home.service.impl;
|
||||
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.jero.modules.home.mapper.HomeDocumentDynamicEOMapper;
|
||||
import com.jero.modules.home.service.IHomeDocumentDynamicEOService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class HomeDocumentDynamicEOServiceImpl extends ServiceImpl<HomeDocumentDynamicEOMapper, HomeDocumentDynamicEO> implements IHomeDocumentDynamicEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
Date now = new Date();
|
||||
homeDocumentDynamicEO.setCreateTime(now);
|
||||
homeDocumentDynamicEO.setUpdateTime(now);
|
||||
save(homeDocumentDynamicEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
Date now = new Date();
|
||||
homeDocumentDynamicEO.setUpdateTime(now);
|
||||
saveOrUpdate(homeDocumentDynamicEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HomeDocumentDynamicEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<HomeDocumentDynamicEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user