综合管理模块
This commit is contained in:
@ -0,0 +1,106 @@
|
|||||||
|
package org.dromara.personnel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsEquipmentVo;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsEquipmentBo;
|
||||||
|
import org.dromara.personnel.service.IOpsEquipmentService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-设备
|
||||||
|
* 前端访问路由地址为:/personnel/equipment
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/personnel/equipment")
|
||||||
|
public class OpsEquipmentController extends BaseController {
|
||||||
|
|
||||||
|
private final IOpsEquipmentService opsEquipmentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-设备列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:equipment:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<OpsEquipmentVo> list(OpsEquipmentBo bo, PageQuery pageQuery) {
|
||||||
|
return opsEquipmentService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出运维-设备列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:equipment:export")
|
||||||
|
@Log(title = "运维-设备", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(OpsEquipmentBo bo, HttpServletResponse response) {
|
||||||
|
List<OpsEquipmentVo> list = opsEquipmentService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "运维-设备", OpsEquipmentVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运维-设备详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:equipment:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<OpsEquipmentVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(opsEquipmentService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-设备
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:equipment:add")
|
||||||
|
@Log(title = "运维-设备", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody OpsEquipmentBo bo) {
|
||||||
|
return toAjax(opsEquipmentService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-设备
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:equipment:edit")
|
||||||
|
@Log(title = "运维-设备", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsEquipmentBo bo) {
|
||||||
|
return toAjax(opsEquipmentService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除运维-设备
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:equipment:remove")
|
||||||
|
@Log(title = "运维-设备", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(opsEquipmentService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,134 @@
|
|||||||
|
package org.dromara.personnel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingReq;
|
||||||
|
import org.dromara.personnel.domain.dto.SchedulingUserGroupDTO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingVo;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingBo;
|
||||||
|
import org.dromara.personnel.service.IOpsSchedulingService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班
|
||||||
|
* 前端访问路由地址为:/personnel/scheduling
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/personnel/scheduling")
|
||||||
|
public class OpsSchedulingController extends BaseController {
|
||||||
|
|
||||||
|
private final IOpsSchedulingService opsSchedulingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-人员排班列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<OpsSchedulingVo> list(OpsSchedulingBo bo, PageQuery pageQuery) {
|
||||||
|
return opsSchedulingService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-人员排班列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:list")
|
||||||
|
@GetMapping("/getRiLiList")
|
||||||
|
public R<List<SchedulingUserGroupDTO>> getRiLiList(OpsSchedulingReq req) {
|
||||||
|
return R.ok(opsSchedulingService.getRiLiList(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出运维-人员排班列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:export")
|
||||||
|
@Log(title = "运维-人员排班", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(OpsSchedulingBo bo, HttpServletResponse response) {
|
||||||
|
List<OpsSchedulingVo> list = opsSchedulingService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "运维-人员排班", OpsSchedulingVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运维-人员排班详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<OpsSchedulingVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(opsSchedulingService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-人员排班
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:add")
|
||||||
|
@Log(title = "运维-人员排班", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody OpsSchedulingBo bo) {
|
||||||
|
return toAjax(opsSchedulingService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-人员排班
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:edit")
|
||||||
|
@Log(title = "运维-人员排班", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping("/all")
|
||||||
|
public R<Void> allEdit(@RequestBody OpsSchedulingBo bo) {
|
||||||
|
if (bo.getProjectId() == null) {
|
||||||
|
throw new ServiceException("项目id不能为空");
|
||||||
|
}
|
||||||
|
if (bo.getSchedulingDate() == null) {
|
||||||
|
throw new ServiceException("排班日期不能为空");
|
||||||
|
}
|
||||||
|
return toAjax(opsSchedulingService.allEdit(bo));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改运维-人员排班
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:edit")
|
||||||
|
@Log(title = "运维-人员排班", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsSchedulingBo bo) {
|
||||||
|
return toAjax(opsSchedulingService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除运维-人员排班
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:scheduling:remove")
|
||||||
|
@Log(title = "运维-人员排班", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(opsSchedulingService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,106 @@
|
|||||||
|
package org.dromara.personnel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingDateVo;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingDateBo;
|
||||||
|
import org.dromara.personnel.service.IOpsSchedulingDateService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型
|
||||||
|
* 前端访问路由地址为:/personnel/schedulingDate
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/personnel/schedulingDate")
|
||||||
|
public class OpsSchedulingDateController extends BaseController {
|
||||||
|
|
||||||
|
private final IOpsSchedulingDateService opsSchedulingDateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-排班时间类型列表
|
||||||
|
*/
|
||||||
|
// @SaCheckPermission("personnel:schedulingDate:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<OpsSchedulingDateVo> list(OpsSchedulingDateBo bo, PageQuery pageQuery) {
|
||||||
|
return opsSchedulingDateService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出运维-排班时间类型列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:schedulingDate:export")
|
||||||
|
@Log(title = "运维-排班时间类型", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(OpsSchedulingDateBo bo, HttpServletResponse response) {
|
||||||
|
List<OpsSchedulingDateVo> list = opsSchedulingDateService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "运维-排班时间类型", OpsSchedulingDateVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运维-排班时间类型详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:schedulingDate:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<OpsSchedulingDateVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(opsSchedulingDateService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-排班时间类型
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:schedulingDate:add")
|
||||||
|
@Log(title = "运维-排班时间类型", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody OpsSchedulingDateBo bo) {
|
||||||
|
return toAjax(opsSchedulingDateService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-排班时间类型
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:schedulingDate:edit")
|
||||||
|
@Log(title = "运维-排班时间类型", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsSchedulingDateBo bo) {
|
||||||
|
return toAjax(opsSchedulingDateService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除运维-排班时间类型
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("personnel:schedulingDate:remove")
|
||||||
|
@Log(title = "运维-排班时间类型", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(opsSchedulingDateService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package org.dromara.personnel.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-设备对象 ops_equipment
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ops_equipment")
|
||||||
|
public class OpsEquipment extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属电站
|
||||||
|
*/
|
||||||
|
private String affiliationPowerStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通讯协议
|
||||||
|
*/
|
||||||
|
private String commProtocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP地址
|
||||||
|
*/
|
||||||
|
private String ipAdd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后在线时间
|
||||||
|
*/
|
||||||
|
private Date lastOnlineTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package org.dromara.personnel.domain;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班对象 ops_scheduling
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ops_scheduling")
|
||||||
|
public class OpsScheduling extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维人员id
|
||||||
|
*/
|
||||||
|
private Long opsUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班类型ID
|
||||||
|
*/
|
||||||
|
private Long schedulingType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班日期
|
||||||
|
*/
|
||||||
|
private LocalDate schedulingDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班开始时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime schedulingStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班结束时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime schedulingEndTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package org.dromara.personnel.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型对象 ops_scheduling_date
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ops_scheduling_date")
|
||||||
|
public class OpsSchedulingDate extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班名称
|
||||||
|
*/
|
||||||
|
private String schedulingName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private LocalTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalTime endTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package org.dromara.personnel.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.OpsEquipment;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-设备业务对象 ops_equipment
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = OpsEquipment.class, reverseConvertGenerate = false)
|
||||||
|
public class OpsEquipmentBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "设备名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "设备类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属电站
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "所属电站不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String affiliationPowerStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通讯协议
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "通讯协议不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String commProtocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP地址
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "IP地址不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String ipAdd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后在线时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "最后在线时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date lastOnlineTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
package org.dromara.personnel.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.OpsScheduling;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班业务对象 ops_scheduling
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = OpsScheduling.class, reverseConvertGenerate = false)
|
||||||
|
public class OpsSchedulingBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "id不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "项目id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维人员id
|
||||||
|
*/
|
||||||
|
private Long opsUserId;
|
||||||
|
|
||||||
|
@NotNull(message = "运维人员列表不能为null",groups = { AddGroup.class})
|
||||||
|
@Size(min = 1, message = "运维人员列表至少包含一个元素")
|
||||||
|
private List<SchedulingUserTypeBo> userTypeBos;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班类型id
|
||||||
|
*/
|
||||||
|
// @NotBlank(message = "排班类型id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long schedulingType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班日期
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "排班日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private LocalDate schedulingDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班开始时间
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "排班开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private LocalDateTime schedulingStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班结束时间
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "排班结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private LocalDateTime schedulingEndTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
package org.dromara.personnel.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.OpsSchedulingDate;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型业务对象 ops_scheduling_date
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = OpsSchedulingDate.class, reverseConvertGenerate = false)
|
||||||
|
public class OpsSchedulingDateBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "排班名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String schedulingName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private LocalTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private LocalTime endTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package org.dromara.personnel.domain.bo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.personnel.domain.OpsScheduling;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班业务对象 ops_scheduling
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OpsSchedulingReq implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班开始日期
|
||||||
|
*/
|
||||||
|
private LocalDate schedulingStartDate;
|
||||||
|
/**
|
||||||
|
* 排班结束日期
|
||||||
|
*/
|
||||||
|
private LocalDate schedulingEndDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package org.dromara.personnel.domain.bo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.personnel.domain.OpsSchedulingDate;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型业务对象 ops_scheduling_date
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SchedulingUserTypeBo implements Serializable {
|
||||||
|
/**
|
||||||
|
* 运维人员id
|
||||||
|
*/
|
||||||
|
private Long opsUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班类型id
|
||||||
|
*/
|
||||||
|
private Long schedulingType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package org.dromara.personnel.domain.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SchedulingUserGroupDTO implements Serializable {
|
||||||
|
private Long opsUserId; // 运维人员ID
|
||||||
|
private String opsUserName; // 运维人员ID
|
||||||
|
private List<UserTypePairDTO> userTypePairs; // 日期-类型对应列表
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package org.dromara.personnel.domain.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内层DTO:存储单个运维人员与排班类型的对应关系
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserTypePairDTO implements Serializable {
|
||||||
|
private LocalDate schedulingDate; // 排班日期
|
||||||
|
private Long schedulingType; // 对应的排班类型ID
|
||||||
|
private String schedulingTypeName; // 对应的排班类型ID
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package org.dromara.personnel.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.dromara.personnel.domain.OpsEquipment;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-设备视图对象 ops_equipment
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = OpsEquipment.class)
|
||||||
|
public class OpsEquipmentVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备id")
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备名称")
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备类型")
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属电站
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "所属电站")
|
||||||
|
private String affiliationPowerStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通讯协议
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "通讯协议")
|
||||||
|
private String commProtocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "IP地址")
|
||||||
|
private String ipAdd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后在线时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "最后在线时间")
|
||||||
|
private Date lastOnlineTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package org.dromara.personnel.domain.vo;
|
||||||
|
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.dromara.personnel.domain.OpsSchedulingDate;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型视图对象 ops_scheduling_date
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = OpsSchedulingDate.class)
|
||||||
|
public class OpsSchedulingDateVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "排班名称")
|
||||||
|
private String schedulingName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "开始时间")
|
||||||
|
private LocalTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "结束时间")
|
||||||
|
private LocalTime endTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package org.dromara.personnel.domain.vo;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.dromara.personnel.domain.OpsScheduling;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班视图对象 ops_scheduling
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = OpsScheduling.class)
|
||||||
|
public class OpsSchedulingVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维人员id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "运维人员id")
|
||||||
|
private Long opsUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班类型ID
|
||||||
|
*/
|
||||||
|
private Long schedulingType;
|
||||||
|
|
||||||
|
private String schedulingTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "排班日期")
|
||||||
|
private LocalDate schedulingDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班开始时间
|
||||||
|
*/
|
||||||
|
// @ExcelProperty(value = "排班开始时间")
|
||||||
|
private LocalDateTime schedulingStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排班结束时间
|
||||||
|
*/
|
||||||
|
// @ExcelProperty(value = "排班结束时间")
|
||||||
|
private LocalDateTime schedulingEndTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.personnel.mapper;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.OpsEquipment;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsEquipmentVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-设备Mapper接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
public interface OpsEquipmentMapper extends BaseMapperPlus<OpsEquipment, OpsEquipmentVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.personnel.mapper;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.OpsSchedulingDate;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingDateVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型Mapper接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
public interface OpsSchedulingDateMapper extends BaseMapperPlus<OpsSchedulingDate, OpsSchedulingDateVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
package org.dromara.personnel.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.dromara.personnel.domain.OpsScheduling;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingReq;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班Mapper接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
public interface OpsSchedulingMapper extends BaseMapperPlus<OpsScheduling, OpsSchedulingVo> {
|
||||||
|
|
||||||
|
List<OpsSchedulingVo> getRiLiList(@Param("req") OpsSchedulingReq req);
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package org.dromara.personnel.service;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.OpsEquipment;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsEquipmentVo;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsEquipmentBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-设备Service接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
public interface IOpsEquipmentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-设备
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-设备
|
||||||
|
*/
|
||||||
|
OpsEquipmentVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-设备列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-设备分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<OpsEquipmentVo> queryPageList(OpsEquipmentBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-设备列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-设备列表
|
||||||
|
*/
|
||||||
|
List<OpsEquipmentVo> queryList(OpsEquipmentBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-设备
|
||||||
|
*
|
||||||
|
* @param bo 运维-设备
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(OpsEquipmentBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-设备
|
||||||
|
*
|
||||||
|
* @param bo 运维-设备
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(OpsEquipmentBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-设备信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package org.dromara.personnel.service;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.OpsSchedulingDate;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingDateVo;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingDateBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型Service接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
public interface IOpsSchedulingDateService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-排班时间类型
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-排班时间类型
|
||||||
|
*/
|
||||||
|
OpsSchedulingDateVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-排班时间类型列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-排班时间类型分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<OpsSchedulingDateVo> queryPageList(OpsSchedulingDateBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-排班时间类型列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-排班时间类型列表
|
||||||
|
*/
|
||||||
|
List<OpsSchedulingDateVo> queryList(OpsSchedulingDateBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-排班时间类型
|
||||||
|
*
|
||||||
|
* @param bo 运维-排班时间类型
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(OpsSchedulingDateBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-排班时间类型
|
||||||
|
*
|
||||||
|
* @param bo 运维-排班时间类型
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(OpsSchedulingDateBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-排班时间类型信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package org.dromara.personnel.service;
|
||||||
|
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingReq;
|
||||||
|
import org.dromara.personnel.domain.dto.SchedulingUserGroupDTO;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingVo;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班Service接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
public interface IOpsSchedulingService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-人员排班
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-人员排班
|
||||||
|
*/
|
||||||
|
OpsSchedulingVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-人员排班列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-人员排班分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<OpsSchedulingVo> queryPageList(OpsSchedulingBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-人员排班列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-人员排班列表
|
||||||
|
*/
|
||||||
|
List<OpsSchedulingVo> queryList(OpsSchedulingBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-人员排班
|
||||||
|
*
|
||||||
|
* @param bo 运维-人员排班
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(OpsSchedulingBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-人员排班
|
||||||
|
*
|
||||||
|
* @param bo 运维-人员排班
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(OpsSchedulingBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-人员排班信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日历查询运维-人员排班列表
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SchedulingUserGroupDTO> getRiLiList(OpsSchedulingReq req);
|
||||||
|
|
||||||
|
Boolean allEdit(OpsSchedulingBo bo);
|
||||||
|
}
|
||||||
@ -0,0 +1,139 @@
|
|||||||
|
package org.dromara.personnel.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsEquipmentBo;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsEquipmentVo;
|
||||||
|
import org.dromara.personnel.domain.OpsEquipment;
|
||||||
|
import org.dromara.personnel.mapper.OpsEquipmentMapper;
|
||||||
|
import org.dromara.personnel.service.IOpsEquipmentService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-设备Service业务层处理
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class OpsEquipmentServiceImpl implements IOpsEquipmentService {
|
||||||
|
|
||||||
|
private final OpsEquipmentMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-设备
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-设备
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OpsEquipmentVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-设备列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-设备分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<OpsEquipmentVo> queryPageList(OpsEquipmentBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OpsEquipment> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<OpsEquipmentVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-设备列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-设备列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OpsEquipmentVo> queryList(OpsEquipmentBo bo) {
|
||||||
|
LambdaQueryWrapper<OpsEquipment> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<OpsEquipment> buildQueryWrapper(OpsEquipmentBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<OpsEquipment> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(OpsEquipment::getId);
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeviceId()), OpsEquipment::getDeviceId, bo.getDeviceId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getDeviceName()), OpsEquipment::getDeviceName, bo.getDeviceName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeviceType()), OpsEquipment::getDeviceType, bo.getDeviceType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAffiliationPowerStation()), OpsEquipment::getAffiliationPowerStation, bo.getAffiliationPowerStation());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCommProtocol()), OpsEquipment::getCommProtocol, bo.getCommProtocol());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getIpAdd()), OpsEquipment::getIpAdd, bo.getIpAdd());
|
||||||
|
lqw.eq(bo.getLastOnlineTime() != null, OpsEquipment::getLastOnlineTime, bo.getLastOnlineTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), OpsEquipment::getStatus, bo.getStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-设备
|
||||||
|
*
|
||||||
|
* @param bo 运维-设备
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(OpsEquipmentBo bo) {
|
||||||
|
OpsEquipment add = MapstructUtils.convert(bo, OpsEquipment.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-设备
|
||||||
|
*
|
||||||
|
* @param bo 运维-设备
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(OpsEquipmentBo bo) {
|
||||||
|
OpsEquipment update = MapstructUtils.convert(bo, OpsEquipment.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(OpsEquipment entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-设备信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,134 @@
|
|||||||
|
package org.dromara.personnel.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingDateBo;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingDateVo;
|
||||||
|
import org.dromara.personnel.domain.OpsSchedulingDate;
|
||||||
|
import org.dromara.personnel.mapper.OpsSchedulingDateMapper;
|
||||||
|
import org.dromara.personnel.service.IOpsSchedulingDateService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-排班时间类型Service业务层处理
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class OpsSchedulingDateServiceImpl implements IOpsSchedulingDateService {
|
||||||
|
|
||||||
|
private final OpsSchedulingDateMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-排班时间类型
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-排班时间类型
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OpsSchedulingDateVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-排班时间类型列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-排班时间类型分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<OpsSchedulingDateVo> queryPageList(OpsSchedulingDateBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OpsSchedulingDate> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<OpsSchedulingDateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-排班时间类型列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-排班时间类型列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OpsSchedulingDateVo> queryList(OpsSchedulingDateBo bo) {
|
||||||
|
LambdaQueryWrapper<OpsSchedulingDate> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<OpsSchedulingDate> buildQueryWrapper(OpsSchedulingDateBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<OpsSchedulingDate> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(OpsSchedulingDate::getId);
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getSchedulingName()), OpsSchedulingDate::getSchedulingName, bo.getSchedulingName());
|
||||||
|
lqw.eq(bo.getStartTime() != null, OpsSchedulingDate::getStartTime, bo.getStartTime());
|
||||||
|
lqw.eq(bo.getEndTime() != null, OpsSchedulingDate::getEndTime, bo.getEndTime());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-排班时间类型
|
||||||
|
*
|
||||||
|
* @param bo 运维-排班时间类型
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(OpsSchedulingDateBo bo) {
|
||||||
|
OpsSchedulingDate add = MapstructUtils.convert(bo, OpsSchedulingDate.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-排班时间类型
|
||||||
|
*
|
||||||
|
* @param bo 运维-排班时间类型
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(OpsSchedulingDateBo bo) {
|
||||||
|
OpsSchedulingDate update = MapstructUtils.convert(bo, OpsSchedulingDate.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(OpsSchedulingDate entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-排班时间类型信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,209 @@
|
|||||||
|
package org.dromara.personnel.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingReq;
|
||||||
|
import org.dromara.personnel.domain.bo.SchedulingUserTypeBo;
|
||||||
|
import org.dromara.personnel.domain.dto.SchedulingUserGroupDTO;
|
||||||
|
import org.dromara.personnel.domain.dto.UserTypePairDTO;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingDateVo;
|
||||||
|
import org.dromara.personnel.service.IOpsSchedulingDateService;
|
||||||
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.personnel.domain.bo.OpsSchedulingBo;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsSchedulingVo;
|
||||||
|
import org.dromara.personnel.domain.OpsScheduling;
|
||||||
|
import org.dromara.personnel.mapper.OpsSchedulingMapper;
|
||||||
|
import org.dromara.personnel.service.IOpsSchedulingService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-人员排班Service业务层处理
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class OpsSchedulingServiceImpl implements IOpsSchedulingService {
|
||||||
|
|
||||||
|
private final OpsSchedulingMapper baseMapper;
|
||||||
|
private final IOpsSchedulingDateService schedulingDateService;
|
||||||
|
private final RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-人员排班
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-人员排班
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OpsSchedulingVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-人员排班列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-人员排班分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<OpsSchedulingVo> queryPageList(OpsSchedulingBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OpsScheduling> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<OpsSchedulingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-人员排班列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-人员排班列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OpsSchedulingVo> queryList(OpsSchedulingBo bo) {
|
||||||
|
LambdaQueryWrapper<OpsScheduling> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<OpsScheduling> buildQueryWrapper(OpsSchedulingBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<OpsScheduling> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(OpsScheduling::getId);
|
||||||
|
lqw.eq(bo.getOpsUserId() != null, OpsScheduling::getOpsUserId, bo.getOpsUserId());
|
||||||
|
lqw.eq(bo.getSchedulingType() != null, OpsScheduling::getSchedulingType, bo.getSchedulingType());
|
||||||
|
lqw.eq(bo.getSchedulingDate() != null, OpsScheduling::getSchedulingDate, bo.getSchedulingDate());
|
||||||
|
lqw.eq(bo.getSchedulingStartTime() != null, OpsScheduling::getSchedulingStartTime, bo.getSchedulingStartTime());
|
||||||
|
lqw.eq(bo.getSchedulingEndTime() != null, OpsScheduling::getSchedulingEndTime, bo.getSchedulingEndTime());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-人员排班
|
||||||
|
*
|
||||||
|
* @param bo 运维-人员排班
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(OpsSchedulingBo bo) {
|
||||||
|
List<OpsScheduling> opsSchedulings = new ArrayList<>();
|
||||||
|
for (SchedulingUserTypeBo userTypeBo : bo.getUserTypeBos()) {
|
||||||
|
OpsSchedulingDateVo opsSchedulingDateVo = schedulingDateService.queryById(userTypeBo.getSchedulingType());
|
||||||
|
if (opsSchedulingDateVo == null) {
|
||||||
|
throw new ServiceException("排班类型不存在");
|
||||||
|
}
|
||||||
|
OpsScheduling opsScheduling = new OpsScheduling();
|
||||||
|
if (userTypeBo.getOpsUserId() == null) {
|
||||||
|
throw new ServiceException("运维人员不能为空");
|
||||||
|
}
|
||||||
|
if (userTypeBo.getSchedulingType() == null) {
|
||||||
|
throw new ServiceException("排班类型不能为空");
|
||||||
|
}
|
||||||
|
opsScheduling.setOpsUserId(userTypeBo.getOpsUserId());
|
||||||
|
opsScheduling.setSchedulingType(userTypeBo.getSchedulingType());
|
||||||
|
opsScheduling.setSchedulingDate(bo.getSchedulingDate());
|
||||||
|
if (bo.getSchedulingDate().isBefore(LocalDate.now())){
|
||||||
|
throw new ServiceException("排班日期应大于等于当前日期");
|
||||||
|
}
|
||||||
|
opsScheduling.setSchedulingStartTime(bo.getSchedulingDate().atTime(opsSchedulingDateVo.getStartTime()));
|
||||||
|
opsScheduling.setSchedulingEndTime(bo.getSchedulingDate().atTime(opsSchedulingDateVo.getEndTime()));
|
||||||
|
opsSchedulings.add(opsScheduling);
|
||||||
|
}
|
||||||
|
return baseMapper.insertBatch(opsSchedulings);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-人员排班
|
||||||
|
*
|
||||||
|
* @param bo 运维-人员排班
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean allEdit(OpsSchedulingBo bo) {
|
||||||
|
baseMapper.delete(new LambdaQueryWrapper<OpsScheduling>()
|
||||||
|
.eq(OpsScheduling::getSchedulingDate,bo.getSchedulingDate())
|
||||||
|
.eq(OpsScheduling::getProjectId,bo.getProjectId()));
|
||||||
|
return insertByBo(bo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean updateByBo(OpsSchedulingBo bo) {
|
||||||
|
OpsScheduling update = MapstructUtils.convert(bo, OpsScheduling.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(OpsScheduling entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-人员排班信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目和日期范围获取所有排班信息
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SchedulingUserGroupDTO> getRiLiList(OpsSchedulingReq req) {
|
||||||
|
//根据项目和日期范围获取所有排班信息并根据日期正序排序
|
||||||
|
List<OpsSchedulingVo> opsSchedulings = baseMapper.getRiLiList(req);
|
||||||
|
List<SchedulingUserGroupDTO> schedulingDateGroupDTOS = new ArrayList<>();
|
||||||
|
//过滤掉空白日期,并根据日期分组
|
||||||
|
Map<Long, List<OpsSchedulingVo>> map = opsSchedulings.stream()
|
||||||
|
.filter(opsScheduling -> opsScheduling.getSchedulingDate() != null)
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
OpsSchedulingVo::getOpsUserId,
|
||||||
|
Collectors.toList()));
|
||||||
|
//将分组内容拼装成对象
|
||||||
|
for (Map.Entry<Long, List<OpsSchedulingVo>> entry : map.entrySet()) {
|
||||||
|
SchedulingUserGroupDTO dto = new SchedulingUserGroupDTO();
|
||||||
|
List<UserTypePairDTO> userTypePairDTOS = new ArrayList<>();
|
||||||
|
dto.setOpsUserId(entry.getKey());
|
||||||
|
dto.setOpsUserName(remoteUserService.selectNicknameById(entry.getKey()));
|
||||||
|
entry.getValue().forEach(schedulingDate -> {
|
||||||
|
UserTypePairDTO pairDTO = new UserTypePairDTO();
|
||||||
|
pairDTO.setSchedulingDate(schedulingDate.getSchedulingDate());
|
||||||
|
pairDTO.setSchedulingType(schedulingDate.getSchedulingType());
|
||||||
|
pairDTO.setSchedulingTypeName(schedulingDate.getSchedulingTypeName());
|
||||||
|
});
|
||||||
|
dto.setUserTypePairs(userTypePairDTOS);
|
||||||
|
schedulingDateGroupDTOS.add(dto);
|
||||||
|
}
|
||||||
|
return schedulingDateGroupDTOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?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.dromara.personnel.mapper.OpsEquipmentMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?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.dromara.personnel.mapper.OpsSchedulingDateMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?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.dromara.personnel.mapper.OpsSchedulingMapper">
|
||||||
|
|
||||||
|
<select id="getRiLiList" resultType="org.dromara.personnel.domain.vo.OpsSchedulingVo">
|
||||||
|
SELECT
|
||||||
|
os.id AS id,
|
||||||
|
os.project_id as projectId,
|
||||||
|
os.ops_user_id as opsUserId,
|
||||||
|
os.scheduling_type as schedulingType,
|
||||||
|
os.scheduling_date as schedulingDate,
|
||||||
|
os.scheduling_start_time as schedulingStartTime,
|
||||||
|
os.scheduling_end_time as schedulingEndTime,
|
||||||
|
osd.scheduling_name as schedulingTypeName
|
||||||
|
FROM
|
||||||
|
ops_scheduling os
|
||||||
|
LEFT JOIN ops_scheduling_date osd ON os.scheduling_type = osd.id
|
||||||
|
WHERE os.project_id = #{req.projectId}
|
||||||
|
AND os.scheduling_date BETWEEN CAST(#{req.schedulingStartDate} AS DATE) AND CAST(#{req.schedulingEndDate} AS DATE)
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user