From 817c9d10f0418f9180799d331f3e477b38a163f4 Mon Sep 17 00:00:00 2001 From: gjh <1421wake> Date: Mon, 21 Apr 2025 10:27:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9F=BA=E7=A1=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ContractInfoController.java | 22 +++ .../PerformanceManagementController.java | 105 ++++++++++++++ .../RoutineInspectionInfoController.java | 3 +- .../platform/domain/InspectionPlanInfo.java | 1 + .../dromara/platform/domain/MaterialInfo.java | 4 + .../domain/PerformanceManagement.java | 72 ++++++++++ .../domain/bo/InspectionPlanInfoBo.java | 9 +- .../platform/domain/bo/MaterialInfoBo.java | 2 + .../domain/bo/PerformanceManagementBo.java | 72 ++++++++++ .../domain/dto/RoutineInspectionDto.java | 1 + .../platform/domain/vo/ContractSelectVo.java | 9 ++ .../domain/vo/InspectionPlanInfoVo.java | 10 ++ .../platform/domain/vo/MaterialInfoVo.java | 5 + .../domain/vo/PerformanceManagementVo.java | 83 +++++++++++ .../mapper/PerformanceManagementMapper.java | 15 ++ .../service/IContractInfoService.java | 6 + .../IPerformanceManagementService.java | 68 +++++++++ .../IRoutineInspectionInfoService.java | 2 +- .../service/impl/ContractInfoServiceImpl.java | 46 ++++++ .../impl/InspectionPlanInfoServiceImpl.java | 6 +- .../PerformanceManagementServiceImpl.java | 135 ++++++++++++++++++ .../RoutineInspectionInfoServiceImpl.java | 6 +- 22 files changed, 676 insertions(+), 6 deletions(-) create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PerformanceManagementController.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/PerformanceManagement.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/PerformanceManagementBo.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractSelectVo.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PerformanceManagementVo.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/PerformanceManagementMapper.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPerformanceManagementService.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PerformanceManagementServiceImpl.java diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractInfoController.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractInfoController.java index 1dc7b8b..74b58c6 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractInfoController.java +++ b/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> getNames() { + List rs = contractInfoService.getNames(); + return R.ok(rs); + } + + + @SaCheckPermission("platform:contractInfo:getContractNamesByProjectName") + @PostMapping("/getContractNamesByProjectName") + public R> getContractNamesByProjectName(@RequestBody Map requestBody) { + String projectName = requestBody.get("projectName"); + List rs = contractInfoService.getContractNamesByProjectName(projectName); + return R.ok(rs); + } } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PerformanceManagementController.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/PerformanceManagementController.java new file mode 100644 index 0000000..7e4e8a8 --- /dev/null +++ b/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 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 list = performanceManagementService.queryList(bo); + ExcelUtil.exportExcel(list, "考核管理", PerformanceManagementVo.class, response); + } + + /** + * 获取考核管理详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("platform:management:query") + @GetMapping("/{id}") + public R 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 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 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 remove(@NotEmpty(message = "主键不能为空") + @PathVariable String[] ids) { + return toAjax(performanceManagementService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/RoutineInspectionInfoController.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/RoutineInspectionInfoController.java index 4649c00..79d440a 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/RoutineInspectionInfoController.java +++ b/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("创建成功!"); } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/InspectionPlanInfo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/InspectionPlanInfo.java index 9aae63f..49cd445 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/InspectionPlanInfo.java +++ b/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; } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/MaterialInfo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/MaterialInfo.java index cbb41ed..afd1f64 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/MaterialInfo.java +++ b/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代表删除) */ diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/PerformanceManagement.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/PerformanceManagement.java new file mode 100644 index 0000000..e5d992d --- /dev/null +++ b/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; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/InspectionPlanInfoBo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/InspectionPlanInfoBo.java index b1aa8e8..198829c 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/InspectionPlanInfoBo.java +++ b/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; } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/MaterialInfoBo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/MaterialInfoBo.java index 348ecea..01f7c48 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/MaterialInfoBo.java +++ b/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; } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/PerformanceManagementBo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/PerformanceManagementBo.java new file mode 100644 index 0000000..368122d --- /dev/null +++ b/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; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/dto/RoutineInspectionDto.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/dto/RoutineInspectionDto.java index 0a34a63..3a50001 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/dto/RoutineInspectionDto.java +++ b/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; diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractSelectVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractSelectVo.java new file mode 100644 index 0000000..db9ae96 --- /dev/null +++ b/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; +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/InspectionPlanInfoVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/InspectionPlanInfoVo.java index bfe5302..b8637b3 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/InspectionPlanInfoVo.java +++ b/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; } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/MaterialInfoVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/MaterialInfoVo.java index cfedc36..10ad7cb 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/MaterialInfoVo.java +++ b/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; } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PerformanceManagementVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/PerformanceManagementVo.java new file mode 100644 index 0000000..c9bf6d7 --- /dev/null +++ b/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; +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/PerformanceManagementMapper.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/PerformanceManagementMapper.java new file mode 100644 index 0000000..38f6802 --- /dev/null +++ b/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 { + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractInfoService.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractInfoService.java index 592c522..34414c4 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractInfoService.java +++ b/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 getNames(); + + List getContractNamesByProjectName(String projectName); + } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPerformanceManagementService.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IPerformanceManagementService.java new file mode 100644 index 0000000..1157717 --- /dev/null +++ b/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 queryPageList(PerformanceManagementBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的考核管理列表 + * + * @param bo 查询条件 + * @return 考核管理列表 + */ + List 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 ids, Boolean isValid); +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IRoutineInspectionInfoService.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IRoutineInspectionInfoService.java index 94566d1..b059c90 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IRoutineInspectionInfoService.java +++ b/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); } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractInfoServiceImpl.java index 718d1fd..7b4afb3 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractInfoServiceImpl.java +++ b/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 getNames() { + List selectVoList = new ArrayList<>(); + + //查询数据库 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + List 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 getContractNamesByProjectName(String projectName) { + List selectVoList = new ArrayList<>(); + + //查询数据库 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ContractInfo::getProjectName,projectName); + List 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; + } } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/InspectionPlanInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/InspectionPlanInfoServiceImpl.java index 7953878..5cb0571 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/InspectionPlanInfoServiceImpl.java +++ b/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 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("已根据服务目录创建全部工作!"); } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PerformanceManagementServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/PerformanceManagementServiceImpl.java new file mode 100644 index 0000000..f88f2ab --- /dev/null +++ b/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 queryPageList(PerformanceManagementBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的考核管理列表 + * + * @param bo 查询条件 + * @return 考核管理列表 + */ + @Override + public List queryList(PerformanceManagementBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(PerformanceManagementBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper 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 ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/RoutineInspectionInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/RoutineInspectionInfoServiceImpl.java index 50ed5c3..5f996a4 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/RoutineInspectionInfoServiceImpl.java +++ b/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); } }