法规月报管理
This commit is contained in:
+2
-1
@@ -7,7 +7,8 @@ package com.jero.modules.dummy.enums;
|
||||
*/
|
||||
public enum InventoryStateEnum {
|
||||
ISSUE("已发布","1"),
|
||||
DRAFT("草稿","2");
|
||||
DRAFT("草稿","2"),
|
||||
TO_BE_RELEASED("待发布","3");
|
||||
|
||||
|
||||
|
||||
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.jero.modules.report.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.report.entity.LawsMonthlyReportManageEO;
|
||||
import com.jero.modules.report.service.ILawsMonthlyReportManageEOService;
|
||||
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-06-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="法规月报管理")
|
||||
@RestController
|
||||
@RequestMapping("/report/lawsMonthlyReportManageEO")
|
||||
@Slf4j
|
||||
public class LawsMonthlyReportManageEOController extends JeroController<LawsMonthlyReportManageEO, ILawsMonthlyReportManageEOService> {
|
||||
@Autowired
|
||||
private ILawsMonthlyReportManageEOService lawsMonthlyReportManageEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsMonthlyReportManageEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "法规月报管理-分页列表查询")
|
||||
@ApiOperation(value="法规月报管理-分页列表查询", notes="法规月报管理-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(LawsMonthlyReportManageEO lawsMonthlyReportManageEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsMonthlyReportManageEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsMonthlyReportManageEO, req.getParameterMap());
|
||||
Page<LawsMonthlyReportManageEO> page = new Page<LawsMonthlyReportManageEO>(pageNo, pageSize);
|
||||
IPage<LawsMonthlyReportManageEO> pageList = lawsMonthlyReportManageEOService.getPageInfo(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "法规月报管理-列表查询")
|
||||
@ApiOperation(value="法规月报管理-列表查询", notes="法规月报管理-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsMonthlyReportManageEO>> queryList() {
|
||||
List<LawsMonthlyReportManageEO> list = lawsMonthlyReportManageEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param lawsMonthlyReportManageEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "法规月报管理-添加")
|
||||
@ApiOperation(value="法规月报管理-添加", notes="法规月报管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody LawsMonthlyReportManageEO lawsMonthlyReportManageEO) {
|
||||
lawsMonthlyReportManageEOService.add(lawsMonthlyReportManageEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsMonthlyReportManageEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "法规月报管理-编辑")
|
||||
@ApiOperation(value="法规月报管理-编辑", notes="法规月报管理-编辑")
|
||||
@GetMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody LawsMonthlyReportManageEO lawsMonthlyReportManageEO) {
|
||||
lawsMonthlyReportManageEOService.editById(lawsMonthlyReportManageEO);
|
||||
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) {
|
||||
lawsMonthlyReportManageEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "法规月报管理-批量删除")
|
||||
@ApiOperation(value="法规月报管理-批量删除", notes="法规月报管理-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.lawsMonthlyReportManageEOService.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) {
|
||||
LawsMonthlyReportManageEO lawsMonthlyReportManageEO = lawsMonthlyReportManageEOService.queryById(id);
|
||||
if(lawsMonthlyReportManageEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(lawsMonthlyReportManageEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param lawsMonthlyReportManageEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, LawsMonthlyReportManageEO lawsMonthlyReportManageEO) {
|
||||
return super.exportXls(request, lawsMonthlyReportManageEO, LawsMonthlyReportManageEO.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, LawsMonthlyReportManageEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.jero.modules.report.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 法规月报管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-06-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_monthly_report_manage")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_monthly_report_manage对象", description="法规月报管理")
|
||||
public class LawsMonthlyReportManageEO 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 name;
|
||||
|
||||
/**月报语种*/
|
||||
@Excel(name = "月报语种", width = 15)
|
||||
@ApiModelProperty(value = "月报语种")
|
||||
private java.lang.String language;
|
||||
|
||||
/**发布状态*/
|
||||
@Excel(name = "发布状态", width = 15)
|
||||
@ApiModelProperty(value = "发布状态")
|
||||
private java.lang.String issueStatus;
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.report.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportManageEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 法规月报管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-06-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsMonthlyReportManageEOMapper extends BaseMapper<LawsMonthlyReportManageEO> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?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.report.mapper.LawsMonthlyReportManageEOMapper">
|
||||
<resultMap id="LawsMonthlyReportManageEOResultMap" type="com.jero.modules.report.entity.LawsMonthlyReportManageEO">
|
||||
<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="name" property="name" />
|
||||
<result column="language" property="language" />
|
||||
<result column="issue_status" property="issueStatus" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package com.jero.modules.report.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportManageEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 法规月报管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-06-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsMonthlyReportManageEOService extends IService<LawsMonthlyReportManageEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsMonthlyReportManageEO
|
||||
* @return
|
||||
*/
|
||||
void add(LawsMonthlyReportManageEO lawsMonthlyReportManageEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsMonthlyReportManageEO
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsMonthlyReportManageEO lawsMonthlyReportManageEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsMonthlyReportManageEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<LawsMonthlyReportManageEO> queryList();
|
||||
|
||||
IPage<LawsMonthlyReportManageEO> getPageInfo(Page<LawsMonthlyReportManageEO> page, QueryWrapper<LawsMonthlyReportManageEO> queryWrapper);
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.jero.modules.report.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.dummy.enums.InventoryStateEnum;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportManageEO;
|
||||
import com.jero.modules.report.mapper.LawsMonthlyReportManageEOMapper;
|
||||
import com.jero.modules.report.service.ILawsMonthlyReportManageEOService;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
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-06-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class LawsMonthlyReportManageEOServiceImpl extends ServiceImpl<LawsMonthlyReportManageEOMapper, LawsMonthlyReportManageEO> implements ILawsMonthlyReportManageEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsMonthlyReportManageEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsMonthlyReportManageEO lawsMonthlyReportManageEO) {
|
||||
Date now = new Date();
|
||||
lawsMonthlyReportManageEO.setCreateTime(now);
|
||||
lawsMonthlyReportManageEO.setUpdateTime(now);
|
||||
save(lawsMonthlyReportManageEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsMonthlyReportManageEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsMonthlyReportManageEO lawsMonthlyReportManageEO) {
|
||||
Date now = new Date();
|
||||
lawsMonthlyReportManageEO.setUpdateTime(now);
|
||||
saveOrUpdate(lawsMonthlyReportManageEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过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 LawsMonthlyReportManageEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsMonthlyReportManageEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<LawsMonthlyReportManageEO> getPageInfo(Page<LawsMonthlyReportManageEO> page, QueryWrapper<LawsMonthlyReportManageEO> queryWrapper) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
queryWrapper.and(query->{
|
||||
query.in("create_by",sysUser.getUsername()).in("state", InventoryStateEnum.TO_BE_RELEASED.getValue())
|
||||
.or().in("issue_status",InventoryStateEnum.ISSUE.getValue());
|
||||
});
|
||||
Page<LawsMonthlyReportManageEO> pageInfo = this.page(page, queryWrapper);
|
||||
return pageInfo;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user