Browse Source

新增基础接口

ops-management-platform-backend-dev
gjh 2 weeks ago
parent
commit
817c9d10f0
  1. 22
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractInfoController.java
  2. 105
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PerformanceManagementController.java
  3. 3
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/RoutineInspectionInfoController.java
  4. 1
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/InspectionPlanInfo.java
  5. 4
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/MaterialInfo.java
  6. 72
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/PerformanceManagement.java
  7. 9
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/InspectionPlanInfoBo.java
  8. 2
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/MaterialInfoBo.java
  9. 72
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/PerformanceManagementBo.java
  10. 1
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/dto/RoutineInspectionDto.java
  11. 9
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractSelectVo.java
  12. 10
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/InspectionPlanInfoVo.java
  13. 5
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/MaterialInfoVo.java
  14. 83
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PerformanceManagementVo.java
  15. 15
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/PerformanceManagementMapper.java
  16. 6
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractInfoService.java
  17. 68
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPerformanceManagementService.java
  18. 2
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IRoutineInspectionInfoService.java
  19. 46
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractInfoServiceImpl.java
  20. 6
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/InspectionPlanInfoServiceImpl.java
  21. 135
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PerformanceManagementServiceImpl.java
  22. 6
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/RoutineInspectionInfoServiceImpl.java

22
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractInfoController.java

@ -1,6 +1,7 @@
package org.dromara.platform.controller;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
@ -8,6 +9,8 @@ import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.apache.ibatis.annotations.Param;
import org.dromara.platform.domain.ContractInfo;
import org.dromara.platform.domain.vo.ContractSelectVo;
import org.dromara.platform.domain.vo.ProjectSelectVo;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
@ -113,4 +116,23 @@ public class ContractInfoController extends BaseController {
@Param("projectId") String projectId) {
return R.ok(contractInfoService.queryContractInfoByProjectId(projectId));
}
/**
* 获取项目名称下拉框
*/
@SaCheckPermission("platform:contractInfo:getNames")
@GetMapping("/getNames")
public R<List<ContractSelectVo>> getNames() {
List<ContractSelectVo> rs = contractInfoService.getNames();
return R.ok(rs);
}
@SaCheckPermission("platform:contractInfo:getContractNamesByProjectName")
@PostMapping("/getContractNamesByProjectName")
public R<List<ContractSelectVo>> getContractNamesByProjectName(@RequestBody Map<String, String> requestBody) {
String projectName = requestBody.get("projectName");
List<ContractSelectVo> rs = contractInfoService.getContractNamesByProjectName(projectName);
return R.ok(rs);
}
}

105
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PerformanceManagementController.java

@ -0,0 +1,105 @@
package org.dromara.platform.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.platform.domain.vo.PerformanceManagementVo;
import org.dromara.platform.domain.bo.PerformanceManagementBo;
import org.dromara.platform.service.IPerformanceManagementService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* 考核管理
*
* @author gejunhao
* @date 2025-04-21
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/platform/management")
public class PerformanceManagementController extends BaseController {
private final IPerformanceManagementService performanceManagementService;
/**
* 查询考核管理列表
*/
@SaCheckPermission("platform:management:list")
@GetMapping("/list")
public TableDataInfo<PerformanceManagementVo> list(PerformanceManagementBo bo, PageQuery pageQuery) {
return performanceManagementService.queryPageList(bo, pageQuery);
}
/**
* 导出考核管理列表
*/
@SaCheckPermission("platform:management:export")
@Log(title = "考核管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(PerformanceManagementBo bo, HttpServletResponse response) {
List<PerformanceManagementVo> list = performanceManagementService.queryList(bo);
ExcelUtil.exportExcel(list, "考核管理", PerformanceManagementVo.class, response);
}
/**
* 获取考核管理详细信息
*
* @param id 主键
*/
@SaCheckPermission("platform:management:query")
@GetMapping("/{id}")
public R<PerformanceManagementVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable String id) {
return R.ok(performanceManagementService.queryById(id));
}
/**
* 新增考核管理
*/
@SaCheckPermission("platform:management:add")
@Log(title = "考核管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody PerformanceManagementBo bo) {
return toAjax(performanceManagementService.insertByBo(bo));
}
/**
* 修改考核管理
*/
@SaCheckPermission("platform:management:edit")
@Log(title = "考核管理", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PerformanceManagementBo bo) {
return toAjax(performanceManagementService.updateByBo(bo));
}
/**
* 删除考核管理
*
* @param ids 主键串
*/
@SaCheckPermission("platform:management:remove")
@Log(title = "考核管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable String[] ids) {
return toAjax(performanceManagementService.deleteWithValidByIds(List.of(ids), true));
}
}

3
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/RoutineInspectionInfoController.java

@ -167,13 +167,14 @@ public class RoutineInspectionInfoController extends BaseController {
String deliverContent = routineInspectionDto.getDeliverContent();
Date scheduleStartDate = routineInspectionDto.getScheduleStartDate();
Date scheduleEndDate = routineInspectionDto.getScheduleEndDate();
String code = routineInspectionDto.getCode();
routineInspectionInfoService.createSpecialInspection( projectName,
contractName,
description,
serviceProject,
ioCompany,
pointName,deliverContent,scheduleStartDate,scheduleEndDate
pointName,deliverContent,scheduleStartDate,scheduleEndDate,code
);
return R.ok("创建成功!");
}

1
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/InspectionPlanInfo.java

@ -105,4 +105,5 @@ public class InspectionPlanInfo extends TenantEntity {
*/
private String deliverContent;
private String code;
}

4
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/MaterialInfo.java

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.util.Date;
/**
* 材料库-信息对象 material_info
@ -62,6 +63,9 @@ public class MaterialInfo extends TenantEntity {
*/
private Long status;
private Double price;
/**
* 删除标志0代表存在 2代表删除
*/

72
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/PerformanceManagement.java

@ -0,0 +1,72 @@
package org.dromara.platform.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 考核管理对象 performance_management
*
* @author gejunhao
* @date 2025-04-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("performance_management")
public class PerformanceManagement extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 唯一标识符
*/
@TableId(value = "id")
private String id;
/**
* 类型
*/
private String type;
/**
* 评分大类
*/
private String largeRating;
/**
* 评分小类
*/
private String smallRating;
/**
* 分值
*/
private Long rating;
/**
* 扣分标准
*/
private String standards;
/**
* 考核类型
*/
private String checkType;
/**
* 当前状态
*/
private Long status;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
}

9
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/InspectionPlanInfoBo.java

@ -93,6 +93,13 @@ public class InspectionPlanInfoBo extends BaseEntity {
*/
@NotNull(message = "计划时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date planDate;
/**
* 编码
*/
private String code;
/**
* 交付内容
*/
private String deliverContent;
}

2
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/MaterialInfoBo.java

@ -69,4 +69,6 @@ public class MaterialInfoBo extends BaseEntity {
private Long status;
@NotNull(message = "价格为空", groups = { AddGroup.class, EditGroup.class })
private Double price;
}

72
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/PerformanceManagementBo.java

@ -0,0 +1,72 @@
package org.dromara.platform.domain.bo;
import org.dromara.platform.domain.PerformanceManagement;
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.*;
/**
* 考核管理业务对象 performance_management
*
* @author gejunhao
* @date 2025-04-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = PerformanceManagement.class, reverseConvertGenerate = false)
public class PerformanceManagementBo extends BaseEntity {
/**
* 唯一标识符
*/
@NotBlank(message = "唯一标识符不能为空", groups = { EditGroup.class })
private String id;
/**
* 类型
*/
@NotBlank(message = "类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String type;
/**
* 评分大类
*/
@NotBlank(message = "评分大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String largeRating;
/**
* 评分小类
*/
@NotBlank(message = "评分小类不能为空", groups = { AddGroup.class, EditGroup.class })
private String smallRating;
/**
* 分值
*/
@NotNull(message = "分值不能为空", groups = { AddGroup.class, EditGroup.class })
private Long rating;
/**
* 扣分标准
*/
@NotBlank(message = "扣分标准不能为空", groups = { AddGroup.class, EditGroup.class })
private String standards;
/**
* 考核类型
*/
@NotBlank(message = "考核类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String checkType;
/**
* 当前状态
*/
@NotNull(message = "当前状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Long status;
}

1
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/dto/RoutineInspectionDto.java

@ -11,6 +11,7 @@ import java.util.List;
@Data
public class RoutineInspectionDto {
private String code;
private String projectName;
private String contractName;
private String description;

9
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractSelectVo.java

@ -0,0 +1,9 @@
package org.dromara.platform.domain.vo;
import lombok.Data;
@Data
public class ContractSelectVo {
private String id;
private String contractName;
}

10
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/InspectionPlanInfoVo.java

@ -106,4 +106,14 @@ public class InspectionPlanInfoVo implements Serializable {
* 交付内容
*/
private String deliverContent;
/**
* 服务内容
*/
private String serviceProject;
/**
* 编码
*/
private String code;
}

5
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/MaterialInfoVo.java

@ -1,5 +1,6 @@
package org.dromara.platform.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.platform.domain.MaterialInfo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
@ -76,5 +77,9 @@ public class MaterialInfoVo implements Serializable {
@ExcelProperty(value = "当前状态")
private Long status;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
private Double price;
}

83
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PerformanceManagementVo.java

@ -0,0 +1,83 @@
package org.dromara.platform.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.platform.domain.PerformanceManagement;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.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;
/**
* 考核管理视图对象 performance_management
*
* @author gejunhao
* @date 2025-04-21
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = PerformanceManagement.class)
public class PerformanceManagementVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 唯一标识符
*/
@ExcelProperty(value = "唯一标识符")
private String id;
/**
* 类型
*/
@ExcelProperty(value = "类型")
private String type;
/**
* 评分大类
*/
@ExcelProperty(value = "评分大类")
private String largeRating;
/**
* 评分小类
*/
@ExcelProperty(value = "评分小类")
private String smallRating;
/**
* 分值
*/
@ExcelProperty(value = "分值")
private Long rating;
/**
* 扣分标准
*/
@ExcelProperty(value = "扣分标准")
private String standards;
/**
* 考核类型
*/
@ExcelProperty(value = "考核类型")
private String checkType;
/**
* 当前状态
*/
@ExcelProperty(value = "当前状态")
private Long status;
@ExcelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
}

15
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/PerformanceManagementMapper.java

@ -0,0 +1,15 @@
package org.dromara.platform.mapper;
import org.dromara.platform.domain.PerformanceManagement;
import org.dromara.platform.domain.vo.PerformanceManagementVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 考核管理Mapper接口
*
* @author gejunhao
* @date 2025-04-21
*/
public interface PerformanceManagementMapper extends BaseMapperPlus<PerformanceManagement, PerformanceManagementVo> {
}

6
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractInfoService.java

@ -5,6 +5,8 @@ import org.dromara.platform.domain.vo.ContractInfoVo;
import org.dromara.platform.domain.bo.ContractInfoBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.platform.domain.vo.ContractSelectVo;
import org.dromara.platform.domain.vo.ProjectSelectVo;
import java.util.Collection;
import java.util.List;
@ -74,4 +76,8 @@ public interface IContractInfoService {
*/
ContractInfo queryContractInfoByProjectId(String projectId);
List<ContractSelectVo> getNames();
List<ContractSelectVo> getContractNamesByProjectName(String projectName);
}

68
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPerformanceManagementService.java

@ -0,0 +1,68 @@
package org.dromara.platform.service;
import org.dromara.platform.domain.vo.PerformanceManagementVo;
import org.dromara.platform.domain.bo.PerformanceManagementBo;
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 gejunhao
* @date 2025-04-21
*/
public interface IPerformanceManagementService {
/**
* 查询考核管理
*
* @param id 主键
* @return 考核管理
*/
PerformanceManagementVo queryById(String id);
/**
* 分页查询考核管理列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 考核管理分页列表
*/
TableDataInfo<PerformanceManagementVo> queryPageList(PerformanceManagementBo bo, PageQuery pageQuery);
/**
* 查询符合条件的考核管理列表
*
* @param bo 查询条件
* @return 考核管理列表
*/
List<PerformanceManagementVo> queryList(PerformanceManagementBo bo);
/**
* 新增考核管理
*
* @param bo 考核管理
* @return 是否新增成功
*/
Boolean insertByBo(PerformanceManagementBo bo);
/**
* 修改考核管理
*
* @param bo 考核管理
* @return 是否修改成功
*/
Boolean updateByBo(PerformanceManagementBo bo);
/**
* 校验并批量删除考核管理信息
*
* @param ids 待删除的主键集合
* @param isValid 是否进行有效性校验
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
}

2
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IRoutineInspectionInfoService.java

@ -76,5 +76,5 @@ public interface IRoutineInspectionInfoService {
void createSpecialInspection(String projectName, String contractName, String description, String serviceProject,
String ioCompany, String pointName,
String deliverContent, Date scheduleStartDate, Date scheduleEndDate);
String deliverContent, Date scheduleStartDate, Date scheduleEndDate,String code);
}

46
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractInfoServiceImpl.java

@ -1,5 +1,6 @@
package org.dromara.platform.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import jakarta.annotation.Resource;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
@ -9,7 +10,10 @@ 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 org.dromara.platform.domain.ProjectInfo;
import org.dromara.platform.domain.vo.ContractSelectVo;
import org.dromara.platform.domain.vo.ProjectInfoVo;
import org.dromara.platform.domain.vo.ProjectSelectVo;
import org.dromara.platform.service.IProjectInfoService;
import org.springframework.stereotype.Service;
import org.dromara.platform.domain.bo.ContractInfoBo;
@ -18,6 +22,7 @@ import org.dromara.platform.domain.ContractInfo;
import org.dromara.platform.mapper.ContractInfoMapper;
import org.dromara.platform.service.IContractInfoService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Collection;
@ -164,4 +169,45 @@ public class ContractInfoServiceImpl implements IContractInfoService {
}
return null;
}
@Override
public List<ContractSelectVo> getNames() {
List<ContractSelectVo> selectVoList = new ArrayList<>();
//查询数据库
LambdaQueryWrapper<ContractInfo> queryWrapper = new LambdaQueryWrapper<>();
List<ContractInfo> contractInfos = baseMapper.selectList(queryWrapper);
//封装VO
if (CollectionUtil.isNotEmpty(contractInfos)){
for (ContractInfo contractInfo : contractInfos) {
ContractSelectVo selectVo = new ContractSelectVo();
selectVo.setId(contractInfo.getId());
selectVo.setContractName(contractInfo.getContractName());
selectVoList.add(selectVo);
}
}
return selectVoList;
}
@Override
public List<ContractSelectVo> getContractNamesByProjectName(String projectName) {
List<ContractSelectVo> selectVoList = new ArrayList<>();
//查询数据库
LambdaQueryWrapper<ContractInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ContractInfo::getProjectName,projectName);
List<ContractInfo> contractInfos = baseMapper.selectList(queryWrapper);
//封装VO
if (CollectionUtil.isNotEmpty(contractInfos)){
for (ContractInfo contractInfo : contractInfos) {
ContractSelectVo selectVo = new ContractSelectVo();
selectVo.setId(contractInfo.getId());
selectVo.setContractName(contractInfo.getContractName());
selectVoList.add(selectVo);
}
}
return selectVoList;
}
}

6
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/InspectionPlanInfoServiceImpl.java

@ -182,6 +182,7 @@ public class InspectionPlanInfoServiceImpl implements IInspectionPlanInfoService
Date endDate = contractInfoVo.getEndDate();
String partyB = contractInfoVo.getPartyB();
// 初始化待新增的协议信息集合
List<AgreementInfo> agreementInfos = new ArrayList<>();
// 根据服务目录最外层id获取到所有服务最里层id
@ -210,6 +211,7 @@ public class InspectionPlanInfoServiceImpl implements IInspectionPlanInfoService
inspectionPlanInfo.setServiceProject(agreementInfo.getServiceProject());
inspectionPlanInfo.setIoCompany(partyB);
inspectionPlanInfo.setDeliverContent(agreementInfo.getDeliverContent());
inspectionPlanInfo.setCode(agreementInfo.getCode());
// 0未开始 1进行中 2已完成
inspectionPlanInfo.setStatus(0L);
@ -289,7 +291,7 @@ public class InspectionPlanInfoServiceImpl implements IInspectionPlanInfoService
routineInspectionInfo.setScheduleStartDate(DateUtil.offsetDay(startDate, (int) i));
routineInspectionInfo.setScheduleEndDate(DateUtil.offsetDay(startDate, (int) i));
routineInspectionInfo.setIoCompany(partyB);
routineInspectionInfo.setStatus(1L);
routineInspectionInfo.setStatus(0L);
addList.add(routineInspectionInfo);
}
}
@ -309,6 +311,7 @@ public class InspectionPlanInfoServiceImpl implements IInspectionPlanInfoService
inspectionPlanInfo.setIoCompany(partyB);
inspectionPlanInfo.setDeliverContent(agreementInfo.getDeliverContent());
inspectionPlanInfo.setStatus(0L);
inspectionPlanInfo.setCode(agreementInfo.getCode());
baseMapper.insert(inspectionPlanInfo);
log.info("开始新增专项工作!");
}
@ -339,6 +342,7 @@ public class InspectionPlanInfoServiceImpl implements IInspectionPlanInfoService
inspectionPlanInfo.setIoCompany(partyB);
inspectionPlanInfo.setDeliverContent(agreementInfoVo.getDeliverContent());
inspectionPlanInfo.setStatus(0L);
inspectionPlanInfo.setCode(agreementInfoVo.getCode());
baseMapper.insert(inspectionPlanInfo);
log.info("已根据服务目录创建全部工作!");
}

135
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PerformanceManagementServiceImpl.java

@ -0,0 +1,135 @@
package org.dromara.platform.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 org.springframework.stereotype.Service;
import org.dromara.platform.domain.bo.PerformanceManagementBo;
import org.dromara.platform.domain.vo.PerformanceManagementVo;
import org.dromara.platform.domain.PerformanceManagement;
import org.dromara.platform.mapper.PerformanceManagementMapper;
import org.dromara.platform.service.IPerformanceManagementService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 考核管理Service业务层处理
*
* @author gejunhao
* @date 2025-04-21
*/
@RequiredArgsConstructor
@Service
public class PerformanceManagementServiceImpl implements IPerformanceManagementService {
private final PerformanceManagementMapper baseMapper;
/**
* 查询考核管理
*
* @param id 主键
* @return 考核管理
*/
@Override
public PerformanceManagementVo queryById(String id){
return baseMapper.selectVoById(id);
}
/**
* 分页查询考核管理列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 考核管理分页列表
*/
@Override
public TableDataInfo<PerformanceManagementVo> queryPageList(PerformanceManagementBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<PerformanceManagement> lqw = buildQueryWrapper(bo);
Page<PerformanceManagementVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的考核管理列表
*
* @param bo 查询条件
* @return 考核管理列表
*/
@Override
public List<PerformanceManagementVo> queryList(PerformanceManagementBo bo) {
LambdaQueryWrapper<PerformanceManagement> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<PerformanceManagement> buildQueryWrapper(PerformanceManagementBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<PerformanceManagement> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getType()), PerformanceManagement::getType, bo.getType());
lqw.eq(StringUtils.isNotBlank(bo.getLargeRating()), PerformanceManagement::getLargeRating, bo.getLargeRating());
lqw.eq(StringUtils.isNotBlank(bo.getSmallRating()), PerformanceManagement::getSmallRating, bo.getSmallRating());
lqw.eq(bo.getRating() != null, PerformanceManagement::getRating, bo.getRating());
lqw.eq(StringUtils.isNotBlank(bo.getStandards()), PerformanceManagement::getStandards, bo.getStandards());
lqw.eq(StringUtils.isNotBlank(bo.getCheckType()), PerformanceManagement::getCheckType, bo.getCheckType());
lqw.eq(bo.getStatus() != null, PerformanceManagement::getStatus, bo.getStatus());
return lqw;
}
/**
* 新增考核管理
*
* @param bo 考核管理
* @return 是否新增成功
*/
@Override
public Boolean insertByBo(PerformanceManagementBo bo) {
PerformanceManagement add = MapstructUtils.convert(bo, PerformanceManagement.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setId(add.getId());
}
return flag;
}
/**
* 修改考核管理
*
* @param bo 考核管理
* @return 是否修改成功
*/
@Override
public Boolean updateByBo(PerformanceManagementBo bo) {
PerformanceManagement update = MapstructUtils.convert(bo, PerformanceManagement.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(PerformanceManagement entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 校验并批量删除考核管理信息
*
* @param ids 待删除的主键集合
* @param isValid 是否进行有效性校验
* @return 是否删除成功
*/
@Override
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

6
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/RoutineInspectionInfoServiceImpl.java

@ -188,11 +188,12 @@ public class RoutineInspectionInfoServiceImpl implements IRoutineInspectionInfoS
.filter(record -> !"例行操作".equals(record.getDeliverContent()))
.collect(Collectors.toList());
result.setRecords(filteredRecords);
result.setTotal(filteredRecords.size());
return TableDataInfo.build(result);
}
@Override
public void createSpecialInspection(String projectName, String contractName, String description, String serviceProject, String ioCompany, String pointName,String deliverContent, Date scheduleStartDate, Date scheduleEndDate) {
public void createSpecialInspection(String projectName, String contractName, String description, String serviceProject, String ioCompany, String pointName,String deliverContent, Date scheduleStartDate, Date scheduleEndDate,String code) {
RoutineInspectionInfo routineInspectionInfo = new RoutineInspectionInfo();
routineInspectionInfo.setProjectName(projectName);
routineInspectionInfo.setContractName(contractName);
@ -203,7 +204,8 @@ public class RoutineInspectionInfoServiceImpl implements IRoutineInspectionInfoS
routineInspectionInfo.setScheduleStartDate(scheduleStartDate);
routineInspectionInfo.setScheduleEndDate(scheduleEndDate);
routineInspectionInfo.setDeliverContent(deliverContent);
routineInspectionInfo.setStatus(1L);
routineInspectionInfo.setCode(code);
routineInspectionInfo.setStatus(0L);
baseMapper.insert(routineInspectionInfo);
}
}

Loading…
Cancel
Save