From 65a6ad9b4e312a9f195e1015a84fa7db015e6358 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Wed, 17 Mar 2021 16:16:50 +0800
Subject: [PATCH] 1.操作信息添加
---
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/dto/OperationDTO.java | 34 ++++
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.java | 42 +++++
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/entity/Operation.java | 74 +++++++++
blade-service/blade-jfpts/src/main/java/sql/operation.menu.mysql | 10 +
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.xml | 21 ++
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/controller/OperationController.java | 126 +++++++++++++++
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/IOperationService.java | 41 +++++
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/vo/OperationVO.java | 36 ++++
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/impl/OperationServiceImpl.java | 41 +++++
9 files changed, 425 insertions(+), 0 deletions(-)
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/controller/OperationController.java b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/controller/OperationController.java
new file mode 100644
index 0000000..866fcd5
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/controller/OperationController.java
@@ -0,0 +1,126 @@
+/*
+ * 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.jfpt.operation.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.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.jfpt.operation.entity.Operation;
+import org.springblade.jfpt.operation.vo.OperationVO;
+import org.springblade.jfpt.operation.service.IOperationService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2021-03-17
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/operation")
+@Api(value = "", tags = "接口")
+public class OperationController extends BladeController {
+
+ private final IOperationService operationService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入operation")
+ public R<Operation> detail(Operation operation) {
+ Operation detail = operationService.getOne(Condition.getQueryWrapper(operation));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入operation")
+ public R<IPage<Operation>> list(Operation operation, Query query) {
+ IPage<Operation> pages = operationService.page(Condition.getPage(query), Condition.getQueryWrapper(operation));
+ return R.data(pages);
+ }
+
+ /**
+ * 自定义分页
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入operation")
+ public R<IPage<OperationVO>> page(OperationVO operation, Query query) {
+ IPage<OperationVO> pages = operationService.selectOperationPage(Condition.getPage(query), operation);
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "新增", notes = "传入operation")
+ public R save( Operation operation) {
+ return R.status(operationService.save(operation));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "修改", notes = "传入operation")
+ public R update(@Valid @RequestBody Operation operation) {
+ return R.status(operationService.updateById(operation));
+ }
+
+ /**
+ * 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "新增或修改", notes = "传入operation")
+ public R submit(@Valid @RequestBody Operation operation) {
+ return R.status(operationService.saveOrUpdate(operation));
+ }
+
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 8)
+ @ApiOperation(value = "删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(operationService.removeByIds(Func.toLongList(ids)));
+ }
+
+
+}
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/dto/OperationDTO.java b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/dto/OperationDTO.java
new file mode 100644
index 0000000..2027d21
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/dto/OperationDTO.java
@@ -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.jfpt.operation.dto;
+
+import org.springblade.jfpt.operation.entity.Operation;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-03-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OperationDTO extends Operation {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/entity/Operation.java b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/entity/Operation.java
new file mode 100644
index 0000000..8e9314b
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/entity/Operation.java
@@ -0,0 +1,74 @@
+/*
+ * 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.jfpt.operation.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-03-17
+ */
+@Data
+@TableName("sys_operation")
+@ApiModel(value = "Operation对象", description = "Operation对象")
+public class Operation implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+ /**
+ * 操作人员编码
+ */
+ @ApiModelProperty(value = "操作人员编码")
+ private String snumber;
+ /**
+ * 姓名
+ */
+ @ApiModelProperty(value = "姓名")
+ private String sname;
+ /**
+ * 警单id
+ */
+ @ApiModelProperty(value = "警单id")
+ private String jid;
+ /**
+ * 操作类型
+ */
+ @ApiModelProperty(value = "操作类型")
+ private String zc;
+ /**
+ * 操作时间
+ */
+ @ApiModelProperty(value = "操作时间")
+ @TableField("zcTime")
+ private String zctime;
+
+ @TableLogic
+ private Integer isDelete;
+
+
+}
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.java b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.java
new file mode 100644
index 0000000..94dae65
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.java
@@ -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.jfpt.operation.mapper;
+
+import org.springblade.jfpt.operation.entity.Operation;
+import org.springblade.jfpt.operation.vo.OperationVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-03-17
+ */
+public interface OperationMapper extends BaseMapper<Operation> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param operation
+ * @return
+ */
+ List<OperationVO> selectOperationPage(IPage page, OperationVO operation);
+
+}
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.xml b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.xml
new file mode 100644
index 0000000..53c8221
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/mapper/OperationMapper.xml
@@ -0,0 +1,21 @@
+<?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.jfpt.operation.mapper.OperationMapper">
+
+ <!-- 通用查询映射结果 -->
+ <resultMap id="operationResultMap" type="org.springblade.jfpt.operation.entity.Operation">
+ <id column="id" property="id"/>
+ <result column="snumber" property="snumber"/>
+ <result column="sname" property="sname"/>
+ <result column="jid" property="jid"/>
+ <result column="zc" property="zc"/>
+ <result column="zcTime" property="zctime"/>
+ <result column="is_delete" property="isDelete"/>
+ </resultMap>
+
+
+ <select id="selectOperationPage" resultMap="operationResultMap">
+ select * from sys_operation where is_deleted = 0
+ </select>
+
+</mapper>
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/IOperationService.java b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/IOperationService.java
new file mode 100644
index 0000000..de191e7
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/IOperationService.java
@@ -0,0 +1,41 @@
+/*
+ * 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.jfpt.operation.service;
+
+import org.springblade.jfpt.operation.entity.Operation;
+import org.springblade.jfpt.operation.vo.OperationVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 服务类
+ *
+ * @author BladeX
+ * @since 2021-03-17
+ */
+public interface IOperationService extends IService<Operation> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param operation
+ * @return
+ */
+ IPage<OperationVO> selectOperationPage(IPage<OperationVO> page, OperationVO operation);
+
+}
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/impl/OperationServiceImpl.java b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/impl/OperationServiceImpl.java
new file mode 100644
index 0000000..b4c4553
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/service/impl/OperationServiceImpl.java
@@ -0,0 +1,41 @@
+/*
+ * 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.jfpt.operation.service.impl;
+
+import org.springblade.jfpt.operation.entity.Operation;
+import org.springblade.jfpt.operation.vo.OperationVO;
+import org.springblade.jfpt.operation.mapper.OperationMapper;
+import org.springblade.jfpt.operation.service.IOperationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-03-17
+ */
+@Service
+public class OperationServiceImpl extends ServiceImpl<OperationMapper, Operation> implements IOperationService {
+
+ @Override
+ public IPage<OperationVO> selectOperationPage(IPage<OperationVO> page, OperationVO operation) {
+ return page.setRecords(baseMapper.selectOperationPage(page, operation));
+ }
+
+}
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/vo/OperationVO.java b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/vo/OperationVO.java
new file mode 100644
index 0000000..e240459
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/operation/vo/OperationVO.java
@@ -0,0 +1,36 @@
+/*
+ * 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.jfpt.operation.vo;
+
+import org.springblade.jfpt.operation.entity.Operation;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-03-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "OperationVO对象", description = "OperationVO对象")
+public class OperationVO extends Operation {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/blade-service/blade-jfpts/src/main/java/sql/operation.menu.mysql b/blade-service/blade-jfpts/src/main/java/sql/operation.menu.mysql
new file mode 100644
index 0000000..84c5335
--- /dev/null
+++ b/blade-service/blade-jfpts/src/main/java/sql/operation.menu.mysql
@@ -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 ('1372071690675388423', 1123598815738675201, 'operation', '操作信息', 'menu', '/jfpts/operation', 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 ('1372071690675388424', '1372071690675388423', 'operation_add', '新增', 'add', '/jfpts/operation/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 ('1372071690675388425', '1372071690675388423', 'operation_edit', '修改', 'edit', '/jfpts/operation/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 ('1372071690675388426', '1372071690675388423', 'operation_delete', '删除', 'delete', '/api/blade-jfpts/operation/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 ('1372071690675388427', '1372071690675388423', 'operation_view', '查看', 'view', '/jfpts/operation/view', 'file-text', 4, 2, 2, 1, NULL, 0);
--
Gitblit v1.9.3