Browse Source

#定时任务抽离

zhongwei
yang_shj 2 years ago
parent
commit
b904a9fb7c
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/DutyDefectVO.java
  2. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskMapper.java
  3. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/PhenomenonMapper.java
  4. 10
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/CompanyMapper.java
  5. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/InstanceMapper.java
  6. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/MonthMapper.java
  7. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/TrialMapper.java
  8. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  9. 26
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java
  10. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/TaskService.java
  11. 64
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java
  12. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AccessService.java
  13. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java
  14. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MonitorService.java
  15. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java
  16. 9
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ReportService.java
  17. 37
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AccessServiceImpl.java
  18. 38
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/MaintenanceServiceImpl.java
  19. 60
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/PhenomenonServiceImpl.java
  20. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java
  21. 527
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ReportServiceImpl.java
  22. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/CompanyService.java
  23. 12
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/InstanceService.java
  24. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/MonthService.java
  25. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/TrialService.java
  26. 19
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/CompanyServiceImpl.java
  27. 19
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/InstanceServiceImpl.java
  28. 96
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/MonthServiceImpl.java
  29. 50
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/TrialServiceImpl.java
  30. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/TicketService.java
  31. 62
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java
  32. 4
      hzims-service/hzims-scheduled/src/main/resources/mapper/inspect/TaskMapper.xml
  33. 5
      hzims-service/hzims-scheduled/src/main/resources/mapper/operation/PhenomenonMapper.xml
  34. 6
      hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/CompanyMapper.xml
  35. 5
      hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/InstanceMapper.xml
  36. 5
      hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/MonthMapper.xml
  37. 20
      hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/TrialMapper.xml
  38. 20
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckItemInstanceMapper.xml
  39. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckItemServiceImpl.java

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DutyDefectVO.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/DutyDefectVO.java

@ -3,6 +3,9 @@ package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/**
* @author ysj
*/
@Data @Data
public class DutyDefectVO{ public class DutyDefectVO{

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskMapper.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.mapper.inspect;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
@Mapper
public interface TaskMapper extends UserDataScopeBaseMapper<TaskEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/PhenomenonMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.operation;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface PhenomenonMapper extends UserDataScopeBaseMapper<OperPhenomenonEntity> {
}

10
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/CompanyMapper.java

@ -0,0 +1,10 @@
package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface CompanyMapper extends UserDataScopeBaseMapper<CheckCompanyEntity> {
}

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckItemInstanceMapper.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/InstanceMapper.java

@ -1,4 +1,4 @@
package com.hnac.hzims.safeproduct.mapper; package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity; import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
@ -9,7 +9,7 @@ import java.util.List;
/** /**
* Created by Sam Huang 2022/5/6 8:23 * Created by Sam Huang 2022/5/6 8:23
*/ */
public interface CheckItemInstanceMapper extends BaseMapper<CheckItemInstanceEntity> { public interface InstanceMapper extends BaseMapper<CheckItemInstanceEntity> {
List<CheckItemInstanceEntity> getCheckItemInstanceByMonth(@Param("months") List<String> months, @Param("deptId") Long deptId); List<CheckItemInstanceEntity> getCheckItemInstanceByMonth(@Param("months") List<String> months, @Param("deptId") Long deptId);

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/MonthMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
*/
public interface MonthMapper extends UserDataScopeBaseMapper<CheckMonthEntity> {
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/TrialMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* 设备试验mapper接口
*/
public interface TrialMapper extends UserDataScopeBaseMapper<SafeEquipmentTrialEntity> {
}

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -42,7 +42,7 @@ public class MonitorScheduledTask {
*/ */
@XxlJob(REAL_TIME_DATA) @XxlJob(REAL_TIME_DATA)
//@Scheduled(cron = "0/40 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealData(String param) throws Exception { public ReturnT<String> loadRealData(String param) {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
@ -55,7 +55,7 @@ public class MonitorScheduledTask {
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(CENTRALIZED_MONITORING) @XxlJob(CENTRALIZED_MONITORING)
public ReturnT<String> loadMonitoring(String param) throws Exception { public ReturnT<String> loadMonitoring(String param) {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }

26
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ReportScheduledTask.java

@ -1,8 +1,18 @@
package com.hnac.hzims.scheduled.scheduled; package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.operation.ReportService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.AREA_MONTH_REPORT;
/** /**
* @author ysj * @author ysj
@ -11,4 +21,20 @@ import org.springframework.stereotype.Component;
@Component @Component
public class ReportScheduledTask { public class ReportScheduledTask {
@Autowired
private ReportService service;
/**
* 首页-生产月报表
* @return ReturnT<String>
*/
@XxlJob(AREA_MONTH_REPORT)
public ReturnT<String> loadMonthReport(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
}
service.loadMonthReport(param,1);
return new ReturnT<>("SUCCESS");
}
} }

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/TaskService.java

@ -0,0 +1,15 @@
package com.hnac.hzims.scheduled.service.inspect;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface TaskService extends BaseService<TaskEntity> {
DutyInspectTaskVO task(String start, String end, List<Long> areas);
}

64
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java

@ -0,0 +1,64 @@
package com.hnac.hzims.scheduled.service.inspect.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.scheduled.mapper.inspect.TaskMapper;
import com.hnac.hzims.scheduled.service.inspect.TaskService;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author ysj
*/
@Service
@Slf4j
@AllArgsConstructor
public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> implements TaskService {
/**
* 时间区间机构的巡检任务数据查询
* @param start
* @param end
* @param areas
* @return
*/
@Override
public DutyInspectTaskVO task(String start, String end, List<Long> areas) {
DutyInspectTaskVO task = new DutyInspectTaskVO();
task.setInspectTaskSum(0);
task.setInspectTaskFinish(0);
task.setNotExecuteTaskCount(0);
// 查询所有巡检任务
List<TaskEntity> tasks = this.list(new LambdaQueryWrapper<TaskEntity>() {{
ge(TaskEntity::getPlanStartTime, start)
.le(TaskEntity::getPlanStartTime, end)
.in(TaskEntity::getCreateDept, areas);
}});
if(CollectionUtil.isEmpty(tasks)){
return task;
}
task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
task.setInspectTaskSum(tasks.size());
// 所有处理完成巡检任务
List<TaskEntity> finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList());
if(CollectionUtil.isEmpty(finshList)){
return task;
}
task.setInspectTaskFinish(finshList.size());
// 未执行任务数
List<TaskEntity> notExecuteList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(0)).collect(Collectors.toList());
if(CollectionUtil.isEmpty(notExecuteList)){
return task;
}
task.setNotExecuteTaskCount(notExecuteList.size());
return task;
}
}

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/AccessService.java

@ -1,6 +1,7 @@
package com.hnac.hzims.scheduled.service.operation; package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.main.vo.OverhaulVo;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import java.util.List; import java.util.List;
@ -11,4 +12,6 @@ import java.util.List;
public interface AccessService extends BaseService<OperAccessTaskEntity> { public interface AccessService extends BaseService<OperAccessTaskEntity> {
double accessCount(List<Long> areas); double accessCount(List<Long> areas);
OverhaulVo overhaul(String start, String end, List<Long> areas);
} }

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MaintenanceService.java

@ -1,5 +1,6 @@
package com.hnac.hzims.scheduled.service.operation; package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.main.vo.MaintainVo;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
@ -12,4 +13,6 @@ public interface MaintenanceService extends BaseService<OperMaintenanceTaskEntit
// 查询当年日常维护数量 // 查询当年日常维护数量
Integer maintenanceCount(List<Long> departList); Integer maintenanceCount(List<Long> departList);
MaintainVo maintain(String start, String end, List<Long> areas);
} }

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/MonitorService.java

@ -1,5 +1,9 @@
package com.hnac.hzims.scheduled.service.operation; package com.hnac.hzims.scheduled.service.operation;
import org.springblade.core.tool.api.R;
import java.util.Map;
/** /**
* WEB水电站首页接口 * WEB水电站首页接口
* @author ysj * @author ysj

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/PhenomenonService.java

@ -0,0 +1,15 @@
package com.hnac.hzims.scheduled.service.operation;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface PhenomenonService extends BaseService<OperPhenomenonEntity> {
DutyDefectVO defect(String start, String end, List<Long> areas);
}

9
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/ReportService.java

@ -0,0 +1,9 @@
package com.hnac.hzims.scheduled.service.operation;
/**
* @author ysj
*/
public interface ReportService {
void loadMonthReport(String param, int i);
}

37
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/AccessServiceImpl.java

@ -1,20 +1,23 @@
package com.hnac.hzims.scheduled.service.operation.impl; package com.hnac.hzims.scheduled.service.operation.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.access.constants.AccessConstants;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.main.vo.OverhaulVo;
import com.hnac.hzims.scheduled.mapper.operation.AccessMapper; import com.hnac.hzims.scheduled.mapper.operation.AccessMapper;
import com.hnac.hzims.scheduled.service.operation.AccessService; import com.hnac.hzims.scheduled.service.operation.AccessService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author ysj * @author ysj
@ -48,4 +51,36 @@ public class AccessServiceImpl extends BaseServiceImpl<AccessMapper, OperAccessT
} }
return accesss.size(); return accesss.size();
} }
/**
* 时间区间机构的巡检数据查询
* @param start
* @param end
* @param areas
* @return
*/
@Override
public OverhaulVo overhaul(String start, String end, List<Long> areas) {
OverhaulVo overhaulVo = new OverhaulVo();
// 检修总数
List<OperAccessTaskEntity> overhaulList = this.list(new LambdaQueryWrapper<OperAccessTaskEntity>(){{
ge(OperAccessTaskEntity::getPlanStartTime,start);
le(OperAccessTaskEntity::getPlanStartTime,end);
in(OperAccessTaskEntity::getCreateDept,areas);
}});
if(CollectionUtil.isEmpty(overhaulList)){
overhaulVo.setOverhaul(0);
overhaulVo.setOverhaulFinish(0);
return overhaulVo;
}
overhaulVo.setOverhaul(overhaulList.size());
// 检修完成数量
List<Long> overhaulFinishTask = overhaulList.stream().filter(task-> Func.isNotEmpty(task.getStatus()) && AccessConstants.ACCESS_TASK_STATUS_4 == task.getStatus())
.map(OperAccessTaskEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(overhaulFinishTask)){
overhaulVo.setOverhaulFinish(0);
}
overhaulVo.setOverhaulFinish(overhaulFinishTask.size());
return overhaulVo;
}
} }

38
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/MaintenanceServiceImpl.java

@ -1,6 +1,8 @@
package com.hnac.hzims.scheduled.service.operation.impl; package com.hnac.hzims.scheduled.service.operation.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.main.vo.MaintainVo;
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.scheduled.mapper.operation.MaintenanceMapper; import com.hnac.hzims.scheduled.mapper.operation.MaintenanceMapper;
import com.hnac.hzims.scheduled.service.operation.MaintenanceService; import com.hnac.hzims.scheduled.service.operation.MaintenanceService;
@ -8,12 +10,14 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author ysj * @author ysj
@ -47,4 +51,38 @@ public class MaintenanceServiceImpl extends BaseServiceImpl<MaintenanceMapper, O
} }
return mTaskList.size(); return mTaskList.size();
} }
/**
* 时间区间机构的日常维护数据查询
* @param start
* @param end
* @param areas
* @return
*/
@Override
public MaintainVo maintain(String start, String end, List<Long> areas) {
MaintainVo maintainVo = new MaintainVo();
//日常维护
List<OperMaintenanceTaskEntity> maintainList = this.list(new LambdaQueryWrapper<OperMaintenanceTaskEntity>(){{
ge(OperMaintenanceTaskEntity::getDisposeTime,start);
le(OperMaintenanceTaskEntity::getDisposeTime,end);
in(OperMaintenanceTaskEntity::getCreateDept,areas);
}});
if(CollectionUtil.isEmpty(maintainList)){
maintainVo.setMaintain(0);
maintainVo.setMaintainFinish(0);
return maintainVo;
}
// 日常维护完成数
maintainVo.setMaintain(maintainList.size());
List<Long> maintainFinish = maintainList.stream().filter(o-> Func.isNotEmpty(o.getStatus()) && MaintenanceConstant.TASK_STATUS_5 == o.getStatus())
.map(OperMaintenanceTaskEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(maintainFinish)){
maintainVo.setMaintainFinish(0);
}
maintainVo.setMaintainFinish(maintainFinish.size());
return maintainVo;
}
} }

60
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/PhenomenonServiceImpl.java

@ -0,0 +1,60 @@
package com.hnac.hzims.scheduled.service.operation.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import com.hnac.hzims.scheduled.mapper.operation.PhenomenonMapper;
import com.hnac.hzims.scheduled.service.operation.PhenomenonService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author ysj
*/
@Service
@Slf4j
@AllArgsConstructor
public class PhenomenonServiceImpl extends BaseServiceImpl<PhenomenonMapper, OperPhenomenonEntity> implements PhenomenonService {
/**
* 时间范围内机构缺陷数据查询
* @param start
* @param end
* @param areas
* @return
*/
@Override
public DutyDefectVO defect(String start, String end, List<Long> areas) {
DutyDefectVO defectVO = new DutyDefectVO();
// 查询缺陷现象总数
List<OperPhenomenonEntity> operPhenomenonList = this.list(new LambdaQueryWrapper<OperPhenomenonEntity>(){{
ge(OperPhenomenonEntity::getCreateTime,start);
le(OperPhenomenonEntity::getCreateTime,end);
in(OperPhenomenonEntity::getCreateDept,areas);
}});
if(CollectionUtil.isEmpty(operPhenomenonList)){
defectVO.setDefectSum(0);
defectVO.setDefect(0);
return defectVO;
}
defectVO.setTotalIds(operPhenomenonList.stream().map(o->String.valueOf(o.getId())).collect(Collectors.joining(",")));
defectVO.setDefectSum(operPhenomenonList.size());
// 消缺数
List<Long> defectList = operPhenomenonList.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())).
map(OperPhenomenonEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(defectList)){
defectVO.setDefect(0);
return defectVO;
}
// 缺陷总数
defectVO.setDefect(defectList.size());
return defectVO;
}
}

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java

@ -82,7 +82,6 @@ public class RealTargetServiceImpl implements RealTargetService {
private final static String loadwaterpump_target_key = "hzims:operation:loadwaterpump:target:key"; private final static String loadwaterpump_target_key = "hzims:operation:loadwaterpump:target:key";
private final static String loadwaterpump_real_key = "hzims:operation:loadwaterpump:real:key"; private final static String loadwaterpump_real_key = "hzims:operation:loadwaterpump:real:key";
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key"; private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
private final static String loadwater_group_key = "hzims:operation:group:key";
private final static String load_photovoltaic_real_key = "hzims:operation:photovoltaic:real:key"; private final static String load_photovoltaic_real_key = "hzims:operation:photovoltaic:real:key";
private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key"; private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key";

527
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ReportServiceImpl.java

@ -0,0 +1,527 @@
package com.hnac.hzims.scheduled.service.operation.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.message.dto.MailPushDto;
import com.hnac.hzims.message.fegin.IPushMsgClient;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.vo.AreaMonthReportVo;
import com.hnac.hzims.operational.main.vo.MaintainVo;
import com.hnac.hzims.operational.main.vo.OverhaulVo;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.scheduled.service.equipment.PlanService;
import com.hnac.hzims.scheduled.service.inspect.TaskService;
import com.hnac.hzims.scheduled.service.operation.*;
import com.hnac.hzims.scheduled.service.safeproduct.MonthService;
import com.hnac.hzims.scheduled.service.safeproduct.TrialService;
import com.hnac.hzims.scheduled.service.ticket.TicketService;
import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
/**
* @author ysj
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class ReportServiceImpl implements ReportService {
private final PlanService planService;
private final TaskService taskService;
private final TrialService trialService;
private final AccessService accessService;
private final TicketService ticketService;
private final StationService stationService;
private final MonthService monthService;
private final PhenomenonService phenomenonService;
private final MaintenanceService maintenanceService;
private final RedisTemplate redisTemplate;
private final ISysClient sysClient;
private final IUserClient userClient;
private final IPushMsgClient pushMsgClient;
private final static String recent_year_cache_final = "hzims:operation:key:power:data";
@Value("${hzims.operation.area.report}")
private String report_month_cache_final;
/**
* 区域-月报
* @param param
* @param year
*/
@Override
public void loadMonthReport(String param, int year) {
// 获取所有机构
R<List<Dept>> R = sysClient.getDeptList();
if (!R.isSuccess() || CollectionUtil.isEmpty(R.getData())) {
return;
}
// 查询所有服务类型——"运维服务"、站点类型——"水电站"
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER)
);
if (CollectionUtil.isEmpty(stations)) {
return;
}
// 站点近年发电数据
Map<Long, Map<String, Float>> powerMap = (Map<Long, Map<String, Float>>) redisTemplate.opsForValue().get(recent_year_cache_final);
// 存储数据节点 key - 月份 value - 区域数据集合
Map<String, List<AreaMonthReportVo>> map = new HashMap<>();
// 月份集合
List<String> monthList = getMonthList(year, Calendar.getInstance().get(Calendar.MONTH));
monthList.forEach(mon -> {
List<AreaMonthReportVo> list = this.getAreaReportByMon(R.getData(), powerMap, stations, mon);
if (CollectionUtil.isEmpty(list)) {
return;
}
map.put(mon, list);
});
// 推送当月报表邮件
this.sendMonthReport(map, R.getData());
redisTemplate.opsForValue().set(report_month_cache_final, map);
}
/**
* 获取近年月份集合
*
* @param year
* @return
*/
public static List<String> getMonthList(int year, int endMoth) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
// 开始日期
Calendar endCal = Calendar.getInstance();
endCal.setTime(new Date());
endCal.add(Calendar.MONTH, -endCal.get(Calendar.MONTH) + endMoth);
endCal.add(Calendar.DATE, -endCal.get(Calendar.DATE) + 1);
// 结束日期
Calendar startCal = Calendar.getInstance();
startCal.setTime(new Date());
startCal.set(Calendar.YEAR, startCal.get(Calendar.YEAR) - year);
startCal.add(Calendar.MONTH, -startCal.get(Calendar.MONTH));
startCal.add(Calendar.DATE, -startCal.get(Calendar.DATE) + 1);
// 获取日期之间的月份
List<String> list = new ArrayList<>();
while (endCal.after(startCal)) {
list.add(format.format(startCal.getTime()));
startCal.add(Calendar.MONTH, 1);
}
list.add(format.format(endCal.getTime()));
return list;
}
/**
* 区域月报数据加载
* @param deptList
* @param powerMap
* @param stationList
* @param mon
* @return
*/
private List<AreaMonthReportVo> getAreaReportByMon(List<Dept> deptList, Map<Long, Map<String, Float>> powerMap, List<StationEntity> stationList, String mon) {
LocalDateTime startTime = LocalDateTime.parse(mon + "-01 00:00:00", DateUtil.DATETIME_FORMATTER);
LocalDateTime endTime = getEndTime(mon);
// 查询所有站点的计划发电量
List<PlanGenerationEntity> planList = this.planPower(stationList, mon);
// 站点实际发电量
Map<Long, Float> actualMap = this.actualPower(powerMap, stationList, mon + "-01");
// 站点去年发电量
Map<Long, Float> oldActualMap = this.actualPower(powerMap, stationList, lastyear(1,mon));
// 站点前发电量
Map<Long, Float> oldOldActualMap = this.actualPower(powerMap, stationList, lastyear(2,mon));
// 取机构中区域部分
List<Dept> areaList = deptList.stream().filter(o -> o.getDeptCategory().equals(3)).collect(Collectors.toList());
if (CollectionUtil.isEmpty(areaList)) {
return null;
}
List<AreaMonthReportVo> areaMonthReportVoList = new ArrayList<>();
areaList.forEach(area -> {
AreaMonthReportVo areaMonthReport = new AreaMonthReportVo();
areaMonthReport.setAreaId(area.getId());
areaMonthReport.setAreaName(area.getDeptName());
// 获取区域下的站点
List<Long> stationIdList = deptList.stream().filter(o -> o.getParentId().equals(area.getId()) && o.getDeptCategory().equals(4)).map(Dept::getId).collect(Collectors.toList());
List<StationEntity> areaStationList = stationList.stream().filter(o -> stationIdList.contains(o.getRefDept())).collect(Collectors.toList());
if (CollectionUtil.isEmpty(areaStationList)) {
return;
}
// 计划发电量、实际发电量、发电完成率
this.powerMonth(planList, actualMap, oldActualMap, areaStationList, areaMonthReport);
// 操作票、操作票合格率/ 工作票、工作票合格率
this.doubleMonth(area, areaMonthReport, mon + "-01 00:00:00", this.strEndTime(mon));
// 日常维护、巡检任务、缺陷数、消缺率、检修任务
this.taskMonth(Collections.singletonList(area.getId()), areaMonthReport, mon + "-01 00:00:00", strEndTime(mon));
// 预测
this.predictPlanPower(oldActualMap,oldOldActualMap,areaStationList,areaMonthReport);
// 安全生产会议次数、月度检查报告、技能培训、安全大检查
this.securityCheck(Collections.singletonList(area.getId()),areaMonthReport,mon + "-01 00:00:00", strEndTime(mon));
// 设备试验
this.getDeviceTry(mon + "-01 00:00:00", strEndTime(mon), Collections.singletonList(area.getId()),areaMonthReport);
areaMonthReportVoList.add(areaMonthReport);
});
return areaMonthReportVoList;
}
/**
* 获取结束时间
*/
private LocalDateTime getEndTime(String mon) {
Date date = DateUtil.parse(mon + "-01 00:00:00",DateUtil.DATETIME_FORMAT);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, 1);
return calendar.getTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
}
/**
* 获取站点计划发电量
*/
private List<PlanGenerationEntity> planPower(List<StationEntity> stationList, String mon) {
List<String> list = stationList.stream().map(StationEntity::getCode).collect(Collectors.toList());
return planService.planGeneration(list, null, mon);
}
/**
* 获取站点月份实际发电量
*/
private Map<Long, Float> actualPower(Map<Long, Map<String, Float>> powerMap, List<StationEntity> stationList, String month) {
if (MapUtils.isEmpty(powerMap)) {
return null;
}
// 站点Id集合
List<Long> stationIdList = stationList.stream().map(StationEntity::getId).collect(Collectors.toList());
// 存储站点实际发电量
Map<Long, Float> actualPowerMap = new HashMap<>();
stationIdList.forEach(key -> {
Map<String, Float> monthMap = powerMap.get(key);
if (MapUtils.isEmpty(monthMap)) {
return;
}
float actualPower = 0f;
if(ObjectUtil.isNotEmpty(monthMap.get(month))){
actualPower = monthMap.get(month);
}
actualPowerMap.put(key, actualPower);
});
return actualPowerMap;
}
/**
* 获取去年时间
*/
private String lastyear(int year,String mon) {
Date date = DateUtil.parse(mon + "-01 00:00:00",DateUtil.DATETIME_FORMAT);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - year);
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
return DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
}
/**
* 获取结束时间
*/
private String strEndTime(String mon) {
Date date = DateUtil.parse(mon + "-01 00:00:00",DateUtil.DATETIME_FORMAT);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, 1);
return DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
}
/**
* 区域-月计划发电量月实际发电量月发电完成率同比
*
* @param planList
* @param actualMap
* @param oldActualMap
* @param areaStationList
* @param areaMonthReport
*/
private void powerMonth(List<PlanGenerationEntity> planList, Map<Long, Float> actualMap, Map<Long, Float> oldActualMap, List<StationEntity> areaStationList, AreaMonthReportVo areaMonthReport) {
// 计划发电量
List<String> codeList = areaStationList.stream().map(StationEntity::getCode).collect(Collectors.toList());
double planPower = planList.stream().filter(o -> codeList.contains(o.getStationId())).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum();
areaMonthReport.setPlanPower(Float.parseFloat(String.valueOf(planPower)));
if (MapUtils.isEmpty(actualMap)) {
areaMonthReport.setActualPower(0f);
areaMonthReport.setPowerFinishRate(0.0);
return;
}
// 实际发电量
List<Long> ids = areaStationList.stream().map(StationEntity::getId).collect(Collectors.toList());
double actualPower = actualMap.entrySet().stream().filter(e -> ids.contains(e.getKey())).mapToDouble(Map.Entry::getValue).sum();
areaMonthReport.setActualPower(Float.parseFloat(String.valueOf(actualPower)));
if (Math.abs(planPower) <= 0) {
areaMonthReport.setPowerFinishRate(0.0);
} else {
// 发电完成率
double powerFinishRate = BigDecimal.valueOf(actualPower / planPower * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
areaMonthReport.setPowerFinishRate(powerFinishRate);
}
// 同比
double oldActualPower = oldActualMap.entrySet().stream().filter(e -> ids.contains(e.getKey())).mapToDouble(Map.Entry::getValue).sum();
if (Math.abs(actualPower) <= 0 || Math.abs(oldActualPower) <= 0) {
areaMonthReport.setComparePowerRate(0.0);
return;
}
double comparePowerRate = BigDecimal.valueOf(actualPower / oldActualPower).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
areaMonthReport.setComparePowerRate(comparePowerRate);
}
/**
* 区域-操作票操作票合格率/ 工作票工作票合格率
*
* @param area
* @param areaMonthReport
*/
private void doubleMonth(Dept area, AreaMonthReportVo areaMonthReport, String startTime, String endTime) {
// 站点归属机构集合
TicketMonthVO ticket = ticketService.operateWork(startTime,endTime,Collections.singletonList(area.getId()));
if (ObjectUtil.isEmpty(ticket)) {
areaMonthReport.setOperate(0);
areaMonthReport.setOperaQualifyRate(0.0);
areaMonthReport.setWork(0);
areaMonthReport.setWorkQualifyRate(0.0);
return;
}
// 操作票
int operate = ticket.getOperate();
int operateQualify = ticket.getOperateQualify();
areaMonthReport.setOperate(operate);
if (operateQualify <= 0) {
areaMonthReport.setOperaQualifyRate(0.0);
} else {
double operateQualifyRate = BigDecimal.valueOf(operateQualify / (double) operate * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
areaMonthReport.setOperaQualifyRate(operateQualifyRate);
}
//工作票
int work = ticket.getWork();
int workQualify = ticket.getWorkQualify();
areaMonthReport.setWork(work);
if (workQualify <= 0) {
areaMonthReport.setWorkQualifyRate(0.0);
} else {
double workQualifyRate = BigDecimal.valueOf(workQualify / (double) work * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
areaMonthReport.setWorkQualifyRate(workQualifyRate);
}
}
/**
* 任务月报-日常维护巡检任务缺陷数消缺率检修任务
*
* @param areas
* @param areaMonthReport
*/
private void taskMonth(List<Long> areas, AreaMonthReportVo areaMonthReport, String startTime, String endTime) {
//通过线程池异步获取月报各模块内容 主要分为五块内容
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("area_month_report-pool-%d").build();
ExecutorService exe = new ThreadPoolExecutor(4, 4, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
//监控线程执行完后返回结果
CountDownLatch countDownLatch = new CountDownLatch(4);
// 日常维护
exe.execute(() -> {
MaintainVo maintainVo = maintenanceService.maintain(startTime, endTime, areas);
int maintainSum = maintainVo.getMaintain();
areaMonthReport.setRoutineMaintenance(maintainSum);
countDownLatch.countDown();
});
// 巡检任务
exe.execute(() -> {
DutyInspectTaskVO task = taskService.task(startTime,endTime,areas);
if (ObjectUtil.isEmpty(task)) {
areaMonthReport.setInspect(0);
} else {
int inspect = task.getInspectTaskSum();
areaMonthReport.setInspect(inspect);
}
countDownLatch.countDown();
});
// 消缺
exe.execute(() -> {
DutyDefectVO defectVO = phenomenonService.defect(startTime, endTime, areas);
int defectSum = defectVO.getDefectSum();
int defect = defectVO.getDefect();
areaMonthReport.setDefect(defectSum);
if (defectSum <= 0) {
areaMonthReport.setDefectRate(0.0);
} else {
double deletionRate = BigDecimal.valueOf(defect / defectSum * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
areaMonthReport.setDefectRate(deletionRate);
}
countDownLatch.countDown();
});
// 检修
exe.execute(() -> {
OverhaulVo overhaulVo = accessService.overhaul(startTime, endTime, areas);
int overhaul = overhaulVo.getOverhaul();
areaMonthReport.setMaintenanceTasks(overhaul);
countDownLatch.countDown();
});
//所有模板数据获取完成后释放锁
try {
countDownLatch.await();
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
exe.shutdown();
}
/**
* 预测发电量
* @param oldActualMap
* @param oldOldActualMap
* @param areaStationList
* @param areaMonthReport
*/
private void predictPlanPower(Map<Long, Float> oldActualMap, Map<Long, Float> oldOldActualMap, List<StationEntity> areaStationList, AreaMonthReportVo areaMonthReport) {
areaMonthReport.setPredictPlanPower(0.0);
// 实际发电量
List<Long> ids = areaStationList.stream().map(StationEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(ids)){
return;
}
double oldActualPower = oldActualMap.entrySet().stream().filter(e -> ids.contains(e.getKey())).mapToDouble(Map.Entry::getValue).sum();
double oldOldActualPower = oldOldActualMap.entrySet().stream().filter(e -> ids.contains(e.getKey())).mapToDouble(Map.Entry::getValue).sum();
if(Math.abs(oldActualPower) <= 0 && Math.abs(oldOldActualPower) <= 0 ){
return;
}
double predictPlanPower = BigDecimal.valueOf((oldActualPower + oldOldActualPower) / 2).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
areaMonthReport.setPredictPlanPower(predictPlanPower);
}
/**
* 安全检查
* @param areas
* @param areaMonthReport
* @param startTime
* @param endTime
*/
private void securityCheck(List<Long> areas, AreaMonthReportVo areaMonthReport,String startTime,String endTime) {
areaMonthReport.setSafetyMeeting(0);
areaMonthReport.setSelfReport(0);
areaMonthReport.setSkillTrainy(0);
areaMonthReport.setSecurityCheck(0);
// 站点归属机构集合
Map<String, Object> map = new HashMap<>();
map.put("startDate", startTime);
map.put("endDate", endTime);
map.put("deptList", areas);
// 调用安全大检查fegin接口
Map<String, Object> count = monthService.check(map);
if(MapUtils.isEmpty(count)){
return;
}
// 安全生产会议
areaMonthReport.setSafetyMeeting((Integer) count.get("safetyMeetingNum"));
// 月度自查报告
areaMonthReport.setSelfReport((Integer) count.get("monthCheckNum"));
// 技能培训
areaMonthReport.setSkillTrainy((Integer) count.get("skillsTrainingNum"));
// 安全大检查
areaMonthReport.setSecurityCheck((Integer) count.get("bigCheckNum"));
}
/**
* 获取设备试验数据
* @param startTime
* @param endTime
* @param areas
* @param areaMonthReport
*/
private void getDeviceTry(String startTime,String endTime,List<Long> areas,AreaMonthReportVo areaMonthReport) {
areaMonthReport.setDeviceTry(0);
SafeEquipmentTrialDTO request = new SafeEquipmentTrialDTO();
request.setDeptList(areas);
request.setStartTime(startTime);
request.setEndTime(endTime);
areaMonthReport.setDeviceTry(trialService.count(request));
}
/**
* 推送当月月报
*
* @param map
* @param list
*/
private void sendMonthReport(Map<String, List<AreaMonthReportVo>> map, List<Dept> list) {
if (MapUtils.isEmpty(map) || CollectionUtil.isEmpty(list)) {
return;
}
// 获取邮件接收人
Dept dept = list.stream().min(Comparator.comparing(Dept::getDeptCategory)).get();
if(ObjectUtil.isEmpty(dept)){
return;
}
R<List<User>> userR = userClient.userListByDeptId(dept.getId());
if(!userR.isSuccess() && CollectionUtil.isEmpty(userR.getData())){
return;
}
List<User> userList = userR.getData().stream().filter(o->dept.getId().equals(o.getCreateDept())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(userList)){
return;
}
List<String> mailList = userList.stream().map(User::getEmail).filter(StringUtil::isNotBlank).collect(Collectors.toList());
if(CollectionUtil.isEmpty(mailList)){
return;
}
// 获取月报数据
List<AreaMonthReportVo> entityList = map.get(DateUtil.format(new Date(),"yyyy-MM"));
if (CollectionUtil.isEmpty(entityList)) {
return;
}
// 发送邮件
MailPushDto pushDto = new MailPushDto();
pushDto.setBusinessClassify("system");
pushDto.setBusinessKey("Month_Report");
pushDto.setSubject("水电站生产运行");
Map<String, Object> param = new HashMap<>();
param.put("templatePath", "/data/hzims/message/mail/template/stationRunMonthReport.html");
Map<String, Object> parameters = new HashMap<>();
parameters.put("data",entityList);
param.put("parameters", parameters);
pushDto.setExtras(param);
pushDto.setText("水电站生产运行月报内容");
pushDto.setToAccount(mailList.toArray(new String[0]));
pushDto.setHtml(true);
pushDto.setCreateUser(userR.getData().get(0).getCreateUser());
pushDto.setTenantId(dept.getTenantId());
pushDto.setCreateDept(dept.getId());
pushMsgClient.sendMail(pushDto);
}
}

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/CompanyService.java

@ -0,0 +1,11 @@
package com.hnac.hzims.scheduled.service.safeproduct;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface CompanyService extends BaseService<CheckCompanyEntity> {
}

12
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/InstanceService.java

@ -0,0 +1,12 @@
package com.hnac.hzims.scheduled.service.safeproduct;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
import org.springblade.core.mp.base.BaseService;
/**
* Created by Sam Huang 2022/5/6 8:28
*/
public interface InstanceService extends BaseService<CheckItemInstanceEntity> {
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/MonthService.java

@ -0,0 +1,14 @@
package com.hnac.hzims.scheduled.service.safeproduct;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.Map;
/**
* @author ysj
*/
public interface MonthService extends BaseService<CheckMonthEntity> {
Map<String, Object> check(Map<String, Object> map);
}

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/TrialService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.service.safeproduct;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface TrialService extends BaseService<SafeEquipmentTrialEntity> {
int count(SafeEquipmentTrialDTO trial);
}

19
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/CompanyServiceImpl.java

@ -0,0 +1,19 @@
package com.hnac.hzims.scheduled.service.safeproduct.impl;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import com.hnac.hzims.scheduled.mapper.safeproduct.CompanyMapper;
import com.hnac.hzims.scheduled.service.safeproduct.CompanyService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @author ysj
*/
@Service
@AllArgsConstructor
@Slf4j
public class CompanyServiceImpl extends BaseServiceImpl<CompanyMapper, CheckCompanyEntity> implements CompanyService {
}

19
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/InstanceServiceImpl.java

@ -0,0 +1,19 @@
package com.hnac.hzims.scheduled.service.safeproduct.impl;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
import com.hnac.hzims.scheduled.mapper.safeproduct.InstanceMapper;
import com.hnac.hzims.scheduled.service.safeproduct.InstanceService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @author ysj
*/
@Service
@AllArgsConstructor
@Slf4j
public class InstanceServiceImpl extends BaseServiceImpl<InstanceMapper, CheckItemInstanceEntity> implements InstanceService {
}

96
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/MonthServiceImpl.java

@ -0,0 +1,96 @@
package com.hnac.hzims.scheduled.service.safeproduct.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.safeproduct.entity.CheckCompanyEntity;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
import com.hnac.hzims.safeproduct.entity.CheckMonthEntity;
import com.hnac.hzims.scheduled.mapper.safeproduct.MonthMapper;
import com.hnac.hzims.scheduled.service.safeproduct.CompanyService;
import com.hnac.hzims.scheduled.service.safeproduct.InstanceService;
import com.hnac.hzims.scheduled.service.safeproduct.MonthService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author ysj
*/
@Service
@AllArgsConstructor
@Slf4j
public class MonthServiceImpl extends BaseServiceImpl<MonthMapper, CheckMonthEntity> implements MonthService {
private final CompanyService companyService;
private final InstanceService instanceService;
@Override
public Map<String, Object> check(Map<String, Object> map) {
if (ObjectUtil.isEmpty(map)) {
return null;
}
Map<String, Object> result = new HashMap<>();
String startDate = (String) map.get("startDate");
String endDate = (String) map.get("endDate");
List<Long> deptList = (List<Long>) map.get("deptList");
String startMonth = startDate.substring(0, 7);
String endMonth = endDate.substring(0, 7);
//月度自查次数
Wrapper<CheckMonthEntity> wrapper = new LambdaQueryWrapper<CheckMonthEntity>() {{
in(CheckMonthEntity::getCreateDept, deptList);
between(CheckMonthEntity::getMonth, startMonth, endMonth);
}};
List<CheckMonthEntity> monthList = this.list(wrapper);
result.put("monthCheckNum", monthList != null ? monthList.size() : 0);
//公司大检查次数
Wrapper<CheckCompanyEntity> wrapper1 = new LambdaQueryWrapper<CheckCompanyEntity>() {{
in(CheckCompanyEntity::getCreateDept, deptList);
ge(CheckCompanyEntity::getStartTime, startDate);
le(CheckCompanyEntity::getEndTime, endDate);
}};
List<CheckCompanyEntity> companyList = companyService.list(wrapper1);
result.put("bigCheckNum", companyList != null ? companyList.size() : 0);
AtomicInteger safetyMeetingNum = new AtomicInteger(0);
AtomicInteger skillsTrainingNum = new AtomicInteger(0);
if (CollectionUtil.isNotEmpty(monthList)) {
monthList.forEach(checkMonthEntity -> {
Long checkId = checkMonthEntity.getId();
Wrapper<CheckItemInstanceEntity> wrapper2 = new LambdaQueryWrapper<CheckItemInstanceEntity>() {{
eq(CheckItemInstanceEntity::getCheckId, checkId);
}};
List<CheckItemInstanceEntity> list = instanceService.list(wrapper2);
if (CollectionUtil.isNotEmpty(list)) {
list.forEach(instanceEntity -> {
//安全生产会议检查项,系统统计情况不为空纳入统计次数
if ("现场每月1次安全生产会议".equals(instanceEntity.getItem())) {
if (StringUtils.isNotEmpty(instanceEntity.getSystemSituation())) {
safetyMeetingNum.addAndGet(1);
}
}
//技能培训检查项,系统统计情况不为空纳入统计次数
if ("每月开展1次技能培训".equals(instanceEntity.getItem())) {
if (StringUtils.isNotEmpty(instanceEntity.getSystemSituation())) {
skillsTrainingNum.addAndGet(1);
}
}
});
}
});
}
result.put("safetyMeetingNum", safetyMeetingNum.get());
result.put("skillsTrainingNum", skillsTrainingNum.get());
return result;
}
}

50
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/safeproduct/impl/TrialServiceImpl.java

@ -0,0 +1,50 @@
package com.hnac.hzims.scheduled.service.safeproduct.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hnac.hzims.safeproduct.dto.SafeEquipmentTrialDTO;
import com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity;
import com.hnac.hzims.scheduled.mapper.safeproduct.TrialMapper;
import com.hnac.hzims.scheduled.service.safeproduct.TrialService;
import lombok.RequiredArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* @author ysj
*/
@Service
@RequiredArgsConstructor
public class TrialServiceImpl extends BaseServiceImpl<TrialMapper, SafeEquipmentTrialEntity> implements TrialService {
/**
* 时间区间机构的设备实验数据查询
* @param trial
* @return
*/
@Override
public int count(SafeEquipmentTrialDTO trial) {
if (ObjectUtil.isEmpty(trial)) {
return 0;
}
QueryWrapper<SafeEquipmentTrialEntity> queryWrapper = new QueryWrapper<SafeEquipmentTrialEntity>() {{
if (CollectionUtil.isEmpty(trial.getDeptList())) {
if (Optional.ofNullable(trial.getCreateDept()).isPresent()) {
eq("create_dept", trial.getCreateDept());
}
} else {
in("create_dept", trial.getDeptList());
}
if (Optional.ofNullable(trial.getStartTime()).isPresent()) {
gt("create_time", trial.getStartTime());
}
if (Optional.ofNullable(trial.getEndTime()).isPresent()) {
lt("create_time", trial.getEndTime());
}
}};
return this.baseMapper.selectCount(queryWrapper);
}
}

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/TicketService.java

@ -2,7 +2,9 @@ package com.hnac.hzims.scheduled.service.ticket;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -13,4 +15,6 @@ import java.util.List;
public interface TicketService extends BaseService<StandardTicketInfoEntity> { public interface TicketService extends BaseService<StandardTicketInfoEntity> {
DoublePassRateVO doublePassRate(List<Long> areas, LocalDateTime firstDateTime, LocalDateTime now); DoublePassRateVO doublePassRate(List<Long> areas, LocalDateTime firstDateTime, LocalDateTime now);
TicketMonthVO operateWork(String start, String end, List<Long> list);
} }

62
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java

@ -11,9 +11,11 @@ import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -85,4 +87,64 @@ public class TicketServiceImpl extends BaseServiceImpl<TicketMapper, StandardTic
doublePassRateVO.setDoublePassRate(String.valueOf(doublePassRate)); doublePassRateVO.setDoublePassRate(String.valueOf(doublePassRate));
return doublePassRateVO; return doublePassRateVO;
} }
/**
* 获取首页区域当月操作票
* @param start
* @param end
* @param list
* @return
*/
@Override
public TicketMonthVO operateWork(String start, String end, List<Long> list) {
TicketMonthVO ticket = new TicketMonthVO();
// 操作票
List<StandardTicketInfoEntity> operateList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>() {{
ge(StandardTicketInfoEntity::getCreateTime, start);
le(StandardTicketInfoEntity::getCreateTime, end);
in(StandardTicketInfoEntity::getCreateDept, list);
}});
if (CollectionUtil.isEmpty(operateList)) {
ticket.setOperate(0);
ticket.setOperateQualify(0);
}else{
ticket.setOperate(operateList.size());
List<Long> operateIdList = operateList.stream().map(StandardTicketInfoEntity::getId).collect(Collectors.toList());
// 查询合格评价
List<TicketInfoEvaluateEntity> operateQualifyList = ticketEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{
in(TicketInfoEvaluateEntity::getTicketId, operateIdList);
eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode());
}});
if (CollectionUtil.isEmpty(operateQualifyList)) {
ticket.setOperateQualify(0);
}else{
ticket.setOperateQualify(operateQualifyList.size());
}
}
// 工作票
List<WorkTicketInfoEntity> works = workTicketService.list(new LambdaQueryWrapper<WorkTicketInfoEntity>() {{
ge(WorkTicketInfoEntity::getCreateTime, start);
le(WorkTicketInfoEntity::getCreateTime, end);
in(WorkTicketInfoEntity::getCreateDept, list);
}});
if (CollectionUtil.isEmpty(works)) {
ticket.setWork(0);
ticket.setWorkQualify(0);
}else{
ticket.setWork(works.size());
List<Long> workIds = works.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList());
// 查询合格评价
List<TicketInfoEvaluateEntity> operateQualifyList = ticketEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{
in(TicketInfoEvaluateEntity::getTicketId, workIds);
eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode());
}});
if (CollectionUtil.isEmpty(operateQualifyList)) {
ticket.setOperateQualify(0);
}else{
ticket.setWorkQualify(operateQualifyList.size());
}
}
return ticket;
}
} }

4
hzims-service/hzims-scheduled/src/main/resources/mapper/inspect/TaskMapper.xml

@ -0,0 +1,4 @@
<?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="com.hnac.hzims.scheduled.mapper.inspect.TaskMapper">
</mapper>

5
hzims-service/hzims-scheduled/src/main/resources/mapper/operation/PhenomenonMapper.xml

@ -0,0 +1,5 @@
<?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="com.hnac.hzims.scheduled.mapper.operation.PhenomenonMapper">
</mapper>

6
hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/CompanyMapper.xml

@ -0,0 +1,6 @@
<?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="com.hnac.hzims.scheduled.mapper.safeproduct.CompanyMapper">
</mapper>

5
hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/InstanceMapper.xml

@ -0,0 +1,5 @@
<?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="com.hnac.hzims.scheduled.mapper.safeproduct.InstanceMapper">
</mapper>

5
hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/MonthMapper.xml

@ -0,0 +1,5 @@
<?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="com.hnac.hzims.scheduled.mapper.safeproduct.MonthMapper">
</mapper>

20
hzims-service/hzims-scheduled/src/main/resources/mapper/safeproduct/TrialMapper.xml

@ -0,0 +1,20 @@
<?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="com.hnac.hzims.scheduled.mapper.safeproduct.TrialMapper">
<!-- 通用查询映射结果 -->
<resultMap id="safeEquipmentTrialResultMap" type="com.hnac.hzims.safeproduct.entity.SafeEquipmentTrialEntity">
<result column="ID" property="id"/>
<result column="FILE_PATH" property="filePath"/>
<result column="FILE_NAME" property="fileName"/>
<result column="TENANT_ID" property="tenantId"/>
<result column="CREATE_DEPT" property="createDept"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="CREATE_USER" property="createUser"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="STATUS" property="status"/>
<result column="IS_DELETED" property="isDeleted"/>
</resultMap>
</mapper>

20
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckItemInstanceMapper.xml

@ -1,20 +0,0 @@
<?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="com.hnac.hzims.safeproduct.mapper.CheckItemInstanceMapper">
<select id="getCheckItemInstanceByMonth" resultType="com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity">
SELECT *
FROM hzims_safe_check_item_instance t
WHERE t.IS_DELETED = 0
AND t.CHECK_ID IN (SELECT id
FROM hzims_safe_check_month
WHERE IS_DELETED = 0 AND CREATE_DEPT = #{deptId} AND MONTH IN
<foreach item="item" index="index" collection="months" open="(" separator="," close=" )">
#{item}
</foreach>
)
</select>
</mapper>

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckItemServiceImpl.java

@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.duty.dto.ChangeShiftsReqDTO; import com.hnac.hzims.operational.duty.dto.ChangeShiftsReqDTO;
import com.hnac.hzims.operational.duty.dto.ChangeShiftsRspDTO; import com.hnac.hzims.operational.duty.dto.ChangeShiftsRspDTO;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity;
import com.hnac.hzims.operational.duty.feign.IDutyRecClient; import com.hnac.hzims.operational.duty.feign.IDutyRecClient;
import com.hnac.hzims.operational.feign.IOperTaskClient; import com.hnac.hzims.operational.feign.IOperTaskClient;
import com.hnac.hzims.safeproduct.dto.CheckItemDTO; import com.hnac.hzims.safeproduct.dto.CheckItemDTO;
@ -27,7 +26,6 @@ import com.hnac.hzims.ticket.workTicket.feign.IOperateTicketClient;
import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient; import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
import com.hnac.hzinfo.inspect.task.feign.IInspectTaskClient; import com.hnac.hzinfo.inspect.task.feign.IInspectTaskClient;
import jodd.util.ArraysUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@ -43,7 +41,6 @@ import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.time.LocalDateTime; import java.time.LocalDateTime;

Loading…
Cancel
Save