Browse Source

根据服务目录自动和手动创建工作内容

ops-management-platform-backend-dev
gjh 3 weeks ago
parent
commit
1718b5b316
  1. 12
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/InspectionPlanInfoController.java
  2. 27
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/RoutineInspectionInfoController.java
  3. 7
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/dto/RoutineInspectionDto.java
  4. 2
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IInspectionPlanInfoService.java
  5. 5
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IRoutineInspectionInfoService.java
  6. 29
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/InspectionPlanInfoServiceImpl.java
  7. 21
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/RoutineInspectionInfoServiceImpl.java
  8. 1
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java

12
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/InspectionPlanInfoController.java

@ -9,6 +9,7 @@ import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.apache.ibatis.annotations.Param;
import org.dromara.platform.domain.AgreementInfo;
import org.dromara.platform.domain.dto.RoutineWorkDto;
import org.dromara.platform.domain.vo.ioCompanySelectVo;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
@ -132,4 +133,15 @@ public class InspectionPlanInfoController extends BaseController {
List<AgreementInfo> rs = inspectionPlanInfoService.findLeafNodeInfos(categoryId);
return R.ok(rs);
}
@SaCheckPermission("platform:inspectPlanInfo:createPlansByHands")
@PostMapping("/createPlansByHands")
public R<Void> createPlansByHand(@RequestBody RoutineWorkDto routineWorkDto) {
String contractId = routineWorkDto.getContractId();
String categoryId = routineWorkDto.getCategoryId();
List<String> serviceProjectList = routineWorkDto.getServiceProjectList();
inspectionPlanInfoService.createPlansByHands(contractId,categoryId,serviceProjectList);
return R.ok("手动创建巡检计划成功!");
}
}

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

@ -1,5 +1,6 @@
package org.dromara.platform.controller;
import java.util.Date;
import java.util.List;
import jakarta.annotation.Resource;
@ -143,7 +144,7 @@ public class RoutineInspectionInfoController extends BaseController {
return routineInspectionInfoService.queryPageSpecialList(bo, pageQuery);
}
@SaCheckPermission("platform:routineInspectionInfo:specialList")
@SaCheckPermission("platform:routineInspectionInfo:autoCreatePlans")
@PostMapping("/autoCreatePlans")
public R<Void> autoCreatePlans(@RequestBody RoutineWorkDto routineWorkDto) {
String contractId = routineWorkDto.getContractId();
@ -152,5 +153,29 @@ public class RoutineInspectionInfoController extends BaseController {
inspectionPlanInfoService.autoCreatePlans( contractId, categoryId, serviceProjectList);
return R.ok("根据服务目录创建工作内容 !");
}
@SaCheckPermission("platform:routineInspectionInfo:createSpecialInspection")
@PostMapping("/createSpecialInspection")
public R<Void> createSpecialInspection(@RequestBody RoutineInspectionDto routineInspectionDto) {
String projectName = routineInspectionDto.getProjectName();
String contractName = routineInspectionDto.getContractName();
String description = routineInspectionDto.getDescription();
String serviceProject = routineInspectionDto.getServiceProject();
String ioCompany = routineInspectionDto.getIoCompany();
String pointName = routineInspectionDto.getPointName();
String deliverContent = routineInspectionDto.getDeliverContent();
Date scheduleStartDate = routineInspectionDto.getScheduleStartDate();
Date scheduleEndDate = routineInspectionDto.getScheduleEndDate();
routineInspectionInfoService.createSpecialInspection( projectName,
contractName,
description,
serviceProject,
ioCompany,
pointName,deliverContent,scheduleStartDate,scheduleEndDate
);
return R.ok("创建成功!");
}
}

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

@ -1,10 +1,12 @@
package org.dromara.platform.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.ibatis.annotations.Param;
import org.dromara.platform.domain.InspectionPlanInfo;
import org.dromara.platform.domain.bo.RoutineInspectionInfoBo;
import java.util.Date;
import java.util.List;
@Data
@ -15,5 +17,10 @@ public class RoutineInspectionDto {
private String serviceProject;
private String ioCompany;
private String pointName;
private String deliverContent;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date scheduleStartDate;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date scheduleEndDate;
private List<RoutineInspectionInfoBo> finishStatus;
}

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

@ -92,4 +92,6 @@ public interface IInspectionPlanInfoService {
void autoCreatePlans(String contractId, String categoryId, List<String> serviceProjectList);
void createPlansByHands(String contractId, String categoryId, List<String> serviceProjectList);
}

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

@ -7,6 +7,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
@ -72,4 +73,8 @@ public interface IRoutineInspectionInfoService {
String ioCompany,String pointName);
TableDataInfo<RoutineInspectionInfoVo> queryPageSpecialList(RoutineInspectionInfoBo bo, PageQuery pageQuery);
void createSpecialInspection(String projectName, String contractName, String description, String serviceProject,
String ioCompany, String pointName,
String deliverContent, Date scheduleStartDate, Date scheduleEndDate);
}

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

@ -314,4 +314,33 @@ public class InspectionPlanInfoServiceImpl implements IInspectionPlanInfoService
}
}
@Override
public void createPlansByHands(String contractId, String categoryId, List<String> serviceProjectList) {
ContractInfoVo contractInfoVo = contractInfoService.queryById(contractId);
// 获取到通用数据
String contractName = contractInfoVo.getContractName();
String projectName = contractInfoVo.getProjectName();
Date startDate = contractInfoVo.getStartDate();
Date endDate = contractInfoVo.getEndDate();
String partyB = contractInfoVo.getPartyB();
List<AgreementInfoVo> agreementInfoVos = agreementInfoMapper.selectVoByIds(serviceProjectList);
for (AgreementInfoVo agreementInfoVo : agreementInfoVos) {
InspectionPlanInfo inspectionPlanInfo = new InspectionPlanInfo();
inspectionPlanInfo.setProjectName(projectName);
inspectionPlanInfo.setContractName(contractName);
inspectionPlanInfo.setStartDate(startDate);
inspectionPlanInfo.setEndDate(endDate);
inspectionPlanInfo.setDescription(agreementInfoVo.getServiceContent());
inspectionPlanInfo.setFrequency(agreementInfoVo.getFrequency());
inspectionPlanInfo.setServiceProject(agreementInfoVo.getServiceProject());
inspectionPlanInfo.setIoCompany(partyB);
inspectionPlanInfo.setDeliverContent(agreementInfoVo.getDeliverContent());
inspectionPlanInfo.setStatus(0L);
baseMapper.insert(inspectionPlanInfo);
log.info("已根据服务目录创建全部工作!");
}
}
}

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

@ -17,10 +17,7 @@ import org.dromara.platform.domain.RoutineInspectionInfo;
import org.dromara.platform.mapper.RoutineInspectionInfoMapper;
import org.dromara.platform.service.IRoutineInspectionInfoService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -184,4 +181,20 @@ public class RoutineInspectionInfoServiceImpl implements IRoutineInspectionInfoS
result.setRecords(filteredRecords);
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) {
RoutineInspectionInfo routineInspectionInfo = new RoutineInspectionInfo();
routineInspectionInfo.setProjectName(projectName);
routineInspectionInfo.setContractName(contractName);
routineInspectionInfo.setDescription(description);
routineInspectionInfo.setServiceProject(serviceProject);
routineInspectionInfo.setIoCompany(ioCompany);
routineInspectionInfo.setPointName(pointName);
routineInspectionInfo.setScheduleStartDate(scheduleStartDate);
routineInspectionInfo.setScheduleEndDate(scheduleEndDate);
routineInspectionInfo.setDeliverContent(deliverContent);
routineInspectionInfo.setStatus(1L);
baseMapper.insert(routineInspectionInfo);
}
}

1
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java

@ -106,6 +106,7 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService {
@Override
public Boolean insertByBo(WorkOrderInfoBo bo) {
WorkOrderInfo add = MapstructUtils.convert(bo, WorkOrderInfo.class);
add.setRepairTime(DateUtil.date());
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {

Loading…
Cancel
Save