xiebin
2022-09-21 4bb38c8854bea3e432c7f7817a98241524870514
新增事件管理记录表相关功能
9 files added
385 ■■■■■ changed files
src/main/java/org/springblade/modules/eventgm/controller/EventgmRecordController.java 125 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/dto/EventgmRecordDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/entity/EventgmRecordEntity.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/mapper/EventgmRecordMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/mapper/EventgmRecordMapper.xml 15 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/service/IEventgmRecordService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/service/impl/EventgmRecordServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/vo/EventgmRecordVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/sql/eventgmrecord.menu.sql 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/eventgm/controller/EventgmRecordController.java
New file
@@ -0,0 +1,125 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.eventgm.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.eventgm.entity.EventgmRecordEntity;
import org.springblade.modules.eventgm.vo.EventgmRecordVO;
import org.springblade.modules.eventgm.service.IEventgmRecordService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 事件记录表 控制器
 *
 * @author aix
 * @since 2022-09-21
 */
@RestController
@AllArgsConstructor
@RequestMapping("eventgmRecord/eventgmRecord")
@Api(value = "事件记录表", tags = "事件记录表接口")
public class EventgmRecordController extends BladeController {
    private final IEventgmRecordService eventgmRecordService;
    /**
     * 事件记录表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入eventgmRecord")
    public R<EventgmRecordEntity> detail(EventgmRecordEntity eventgmRecord) {
        EventgmRecordEntity detail = eventgmRecordService.getOne(Condition.getQueryWrapper(eventgmRecord));
        return R.data(detail);
    }
    /**
     * 事件记录表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入eventgmRecord")
    public R<IPage<EventgmRecordEntity>> list(EventgmRecordEntity eventgmRecord, Query query) {
        IPage<EventgmRecordEntity> pages = eventgmRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(eventgmRecord));
        return R.data(pages);
    }
    /**
     * 事件记录表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入eventgmRecord")
    public R<IPage<EventgmRecordVO>> page(EventgmRecordVO eventgmRecord, Query query) {
        IPage<EventgmRecordVO> pages = eventgmRecordService.selectEventgmRecordPage(Condition.getPage(query), eventgmRecord);
        return R.data(pages);
    }
    /**
     * 事件记录表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入eventgmRecord")
    public R save(@Valid @RequestBody EventgmRecordEntity eventgmRecord) {
        return R.status(eventgmRecordService.save(eventgmRecord));
    }
    /**
     * 事件记录表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入eventgmRecord")
    public R update(@Valid @RequestBody EventgmRecordEntity eventgmRecord) {
        return R.status(eventgmRecordService.updateById(eventgmRecord));
    }
    /**
     * 事件记录表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入eventgmRecord")
    public R submit(@Valid @RequestBody EventgmRecordEntity eventgmRecord) {
        return R.status(eventgmRecordService.saveOrUpdate(eventgmRecord));
    }
    /**
     * 事件记录表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(eventgmRecordService.deleteLogic(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/eventgm/dto/EventgmRecordDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.eventgm.dto;
import org.springblade.modules.eventgm.entity.EventgmRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 事件记录表 数据传输对象实体类
 *
 * @author aix
 * @since 2022-09-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class EventgmRecordDTO extends EventgmRecordEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/eventgm/entity/EventgmRecordEntity.java
New file
@@ -0,0 +1,39 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.eventgm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
 * 事件记录表 实体类
 *
 * @author aix
 * @since 2022-09-21
 */
@Data
@TableName("ins_eventgm_record")
@ApiModel(value = "EventgmRecord对象", description = "事件记录表")
@EqualsAndHashCode(callSuper = true)
public class EventgmRecordEntity extends TenantEntity {
}
src/main/java/org/springblade/modules/eventgm/mapper/EventgmRecordMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.eventgm.mapper;
import org.springblade.modules.eventgm.entity.EventgmRecordEntity;
import org.springblade.modules.eventgm.vo.EventgmRecordVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 事件记录表 Mapper 接口
 *
 * @author aix
 * @since 2022-09-21
 */
public interface EventgmRecordMapper extends BaseMapper<EventgmRecordEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param eventgmRecord
     * @return
     */
    List<EventgmRecordVO> selectEventgmRecordPage(IPage page, EventgmRecordVO eventgmRecord);
}
src/main/java/org/springblade/modules/eventgm/mapper/EventgmRecordMapper.xml
New file
@@ -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="org.springblade.modules.eventgm.mapper.EventgmRecordMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="eventgmRecordResultMap" type="org.springblade.modules.eventgm.entity.EventgmRecordEntity">
    </resultMap>
    <select id="selectEventgmRecordPage" resultMap="eventgmRecordResultMap">
        select * from ins_eventgm_record where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/eventgm/service/IEventgmRecordService.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.eventgm.service;
import org.springblade.modules.eventgm.entity.EventgmRecordEntity;
import org.springblade.modules.eventgm.vo.EventgmRecordVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 事件记录表 服务类
 *
 * @author aix
 * @since 2022-09-21
 */
public interface IEventgmRecordService extends BaseService<EventgmRecordEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param eventgmRecord
     * @return
     */
    IPage<EventgmRecordVO> selectEventgmRecordPage(IPage<EventgmRecordVO> page, EventgmRecordVO eventgmRecord);
}
src/main/java/org/springblade/modules/eventgm/service/impl/EventgmRecordServiceImpl.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.eventgm.service.impl;
import org.springblade.modules.eventgm.entity.EventgmRecordEntity;
import org.springblade.modules.eventgm.vo.EventgmRecordVO;
import org.springblade.modules.eventgm.mapper.EventgmRecordMapper;
import org.springblade.modules.eventgm.service.IEventgmRecordService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 事件记录表 服务实现类
 *
 * @author aix
 * @since 2022-09-21
 */
@Service
public class EventgmRecordServiceImpl extends BaseServiceImpl<EventgmRecordMapper, EventgmRecordEntity> implements IEventgmRecordService {
    @Override
    public IPage<EventgmRecordVO> selectEventgmRecordPage(IPage<EventgmRecordVO> page, EventgmRecordVO eventgmRecord) {
        return page.setRecords(baseMapper.selectEventgmRecordPage(page, eventgmRecord));
    }
}
src/main/java/org/springblade/modules/eventgm/vo/EventgmRecordVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.eventgm.vo;
import org.springblade.modules.eventgm.entity.EventgmRecordEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 事件记录表 视图实体类
 *
 * @author aix
 * @since 2022-09-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class EventgmRecordVO extends EventgmRecordEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/sql/eventgmrecord.menu.sql
New file
@@ -0,0 +1,10 @@
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1572413094965366785', 1123598815738675201, 'eventgmRecord', '事件记录表', 'menu', '/eventgm/eventgmRecord', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1572413094965366786', '1572413094965366785', 'eventgmRecord_add', '新增', 'add', '/eventgm/eventgmRecord/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1572413094965366787', '1572413094965366785', 'eventgmRecord_edit', '修改', 'edit', '/eventgm/eventgmRecord/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1572413094965366788', '1572413094965366785', 'eventgmRecord_delete', '删除', 'delete', '/api/eventgmRecord/eventgmRecord/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
VALUES ('1572413094965366789', '1572413094965366785', 'eventgmRecord_view', '查看', 'view', '/eventgm/eventgmRecord/view', 'file-text', 4, 2, 2, 1, NULL, 0);