xiebin
2022-09-21 f1d0e4505c8dd01452b054f78eb5f1efbf42a987
任务计划新增设置巡检人员模块
9 files added
432 ■■■■■ changed files
src/main/java/org/springblade/modules/taskinfo/controller/TaskplanUserController.java 125 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/dto/TaskplanUserDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/entity/TaskplanUserEntity.java 76 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/mapper/TaskplanUserMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/mapper/TaskplanUserMapper.xml 21 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/service/ITaskplanUserService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/service/impl/TaskplanUserServiceImpl.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/vo/TaskplanUserVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/sql/taskplanuser.menu.sql 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskinfo/controller/TaskplanUserController.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.taskinfo.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.taskinfo.entity.TaskplanUserEntity;
import org.springblade.modules.taskinfo.vo.TaskplanUserVO;
import org.springblade.modules.taskinfo.service.ITaskplanUserService;
import org.springblade.core.boot.ctrl.BladeController;
/**
 * 设置巡检人员表 控制器
 *
 * @author aix
 * @since 2022-09-21
 */
@RestController
@AllArgsConstructor
@RequestMapping("taskplanUser/taskplanUser")
@Api(value = "设置巡检人员表", tags = "设置巡检人员表接口")
public class TaskplanUserController extends BladeController {
    private final ITaskplanUserService taskplanUserService;
    /**
     * 设置巡检人员表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入taskplanUser")
    public R<TaskplanUserEntity> detail(TaskplanUserEntity taskplanUser) {
        TaskplanUserEntity detail = taskplanUserService.getOne(Condition.getQueryWrapper(taskplanUser));
        return R.data(detail);
    }
    /**
     * 设置巡检人员表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入taskplanUser")
    public R<IPage<TaskplanUserEntity>> list(TaskplanUserEntity taskplanUser, Query query) {
        IPage<TaskplanUserEntity> pages = taskplanUserService.page(Condition.getPage(query), Condition.getQueryWrapper(taskplanUser));
        return R.data(pages);
    }
    /**
     * 设置巡检人员表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入taskplanUser")
    public R<IPage<TaskplanUserVO>> page(TaskplanUserVO taskplanUser, Query query) {
        IPage<TaskplanUserVO> pages = taskplanUserService.selectTaskplanUserPage(Condition.getPage(query), taskplanUser);
        return R.data(pages);
    }
    /**
     * 设置巡检人员表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入taskplanUser")
    public R save(@Valid @RequestBody TaskplanUserEntity taskplanUser) {
        return R.status(taskplanUserService.save(taskplanUser));
    }
    /**
     * 设置巡检人员表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入taskplanUser")
    public R update(@Valid @RequestBody TaskplanUserEntity taskplanUser) {
        return R.status(taskplanUserService.updateById(taskplanUser));
    }
    /**
     * 设置巡检人员表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入taskplanUser")
    public R submit(@Valid @RequestBody TaskplanUserEntity taskplanUser) {
        return R.status(taskplanUserService.saveOrUpdate(taskplanUser));
    }
    /**
     * 设置巡检人员表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(taskplanUserService.deleteLogic(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/taskinfo/dto/TaskplanUserDTO.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.taskinfo.dto;
import org.springblade.modules.taskinfo.entity.TaskplanUserEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 设置巡检人员表 数据传输对象实体类
 *
 * @author aix
 * @since 2022-09-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class TaskplanUserDTO extends TaskplanUserEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/taskinfo/entity/TaskplanUserEntity.java
New file
@@ -0,0 +1,76 @@
/*
 *      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.taskinfo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * 设置巡检人员表 实体类
 *
 * @author aix
 * @since 2022-09-21
 */
@Data
@TableName("ins_taskplan_user")
@ApiModel(value = "TaskplanUser对象", description = "设置巡检人员表")
@EqualsAndHashCode(callSuper = true)
public class TaskplanUserEntity extends BaseEntity {
    /**
     * 巡检计划id
     */
    @ApiModelProperty(value = "巡检计划id")
    private Long planId;
    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private Long userId;
    /**
     * 开始时间
     */
    @DateTimeFormat(
        pattern = "HH:mm:"
    )
    @JsonFormat(
        pattern = "HH:mm"
    )
    @ApiModelProperty(value = "开始时间")
    private Date startTime;
    /**
     * 结束时间
     */
    @DateTimeFormat(
        pattern = "HH:mm:"
    )
    @JsonFormat(
        pattern = "HH:mm"
    )
    @ApiModelProperty(value = "结束时间")
    private Date endTime;
}
src/main/java/org/springblade/modules/taskinfo/mapper/TaskplanUserMapper.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.taskinfo.mapper;
import org.springblade.modules.taskinfo.entity.TaskplanUserEntity;
import org.springblade.modules.taskinfo.vo.TaskplanUserVO;
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 TaskplanUserMapper extends BaseMapper<TaskplanUserEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param taskplanUser
     * @return
     */
    List<TaskplanUserVO> selectTaskplanUserPage(IPage page, TaskplanUserVO taskplanUser);
}
src/main/java/org/springblade/modules/taskinfo/mapper/TaskplanUserMapper.xml
New file
@@ -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.modules.taskinfo.mapper.TaskplanUserMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="taskplanUserResultMap" type="org.springblade.modules.taskinfo.entity.TaskplanUserEntity">
        <result column="id" property="id"/>
        <result column="plan_id" property="planId"/>
        <result column="user_id" property="userId"/>
        <result column="start_time" property="startTime"/>
        <result column="end_time" property="endTime"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <select id="selectTaskplanUserPage" resultMap="taskplanUserResultMap">
        select * from ins_taskplan_user where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/taskinfo/service/ITaskplanUserService.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.taskinfo.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.taskinfo.entity.TaskplanUserEntity;
import org.springblade.modules.taskinfo.vo.TaskplanUserVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 设置巡检人员表 服务类
 *
 * @author aix
 * @since 2022-09-21
 */
public interface ITaskplanUserService extends BaseService<TaskplanUserEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param taskplanUser
     * @return
     */
    IPage<TaskplanUserVO> selectTaskplanUserPage(IPage<TaskplanUserVO> page, TaskplanUserVO taskplanUser);
}
src/main/java/org/springblade/modules/taskinfo/service/impl/TaskplanUserServiceImpl.java
New file
@@ -0,0 +1,46 @@
/*
 *      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.taskinfo.service.impl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import org.springblade.modules.taskinfo.entity.TaskplanUserEntity;
import org.springblade.modules.taskinfo.vo.TaskplanUserVO;
import org.springblade.modules.taskinfo.mapper.TaskplanUserMapper;
import org.springblade.modules.taskinfo.service.ITaskplanUserService;
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 TaskplanUserServiceImpl extends BaseServiceImpl<TaskplanUserMapper, TaskplanUserEntity> implements ITaskplanUserService {
    @Override
    public IPage<TaskplanUserVO> selectTaskplanUserPage(IPage<TaskplanUserVO> page, TaskplanUserVO taskplanUser) {
        return page.setRecords(baseMapper.selectTaskplanUserPage(page, taskplanUser));
    }
    @Override
    public boolean save(TaskplanUserEntity entity) {
        return SqlHelper.retBool(baseMapper.insert(entity));
    }
}
src/main/java/org/springblade/modules/taskinfo/vo/TaskplanUserVO.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.taskinfo.vo;
import org.springblade.modules.taskinfo.entity.TaskplanUserEntity;
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 TaskplanUserVO extends TaskplanUserEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/sql/taskplanuser.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 ('1572488547805782017', 1123598815738675201, 'taskplanUser', '设置巡检人员表', 'menu', '/taskinfo/taskplanUser', 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 ('1572488547805782018', '1572488547805782017', 'taskplanUser_add', '新增', 'add', '/taskinfo/taskplanUser/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 ('1572488547805782019', '1572488547805782017', 'taskplanUser_edit', '修改', 'edit', '/taskinfo/taskplanUser/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 ('1572488547805782020', '1572488547805782017', 'taskplanUser_delete', '删除', 'delete', '/api/taskplanUser/taskplanUser/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 ('1572488547805782021', '1572488547805782017', 'taskplanUser_view', '查看', 'view', '/taskinfo/taskplanUser/view', 'file-text', 4, 2, 2, 1, NULL, 0);