diff --git a/hzims-service-api/common-api/pom.xml b/hzims-service-api/common-api/pom.xml
index dad68bd..49c639e 100644
--- a/hzims-service-api/common-api/pom.xml
+++ b/hzims-service-api/common-api/pom.xml
@@ -22,6 +22,10 @@
+
+ com.alibaba
+ easyexcel
+
diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java
new file mode 100644
index 0000000..788f4cd
--- /dev/null
+++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java
@@ -0,0 +1,39 @@
+package com.hnac.hzims.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author hx
+ */
+@Data
+@ApiModel("各个票种统计表")
+public class VoteChartVo {
+ @ApiModelProperty(value = "站点名称")
+ @ExcelProperty(value = "站点名称", index = 0)
+ private String name;
+
+ @ApiModelProperty(value = "总数量")
+ @ExcelProperty(value = "总数量", index = 1)
+ private int sumNum;
+ @ApiModelProperty(value = "总数量id")
+ @ExcelIgnore
+ private List sumIds;
+ @ApiModelProperty(value = "未完成数量")
+ @ExcelProperty(value = "未完成数量", index = 2)
+ private int undoneNum;
+ @ApiModelProperty(value = "未完成id")
+ @ExcelIgnore
+ private List undoneIds;
+ @ApiModelProperty(value = "完成数量")
+ @ExcelProperty(value = "完成数量", index = 3)
+ private int finishNum;
+ @ApiModelProperty(value = "完成id")
+ @ExcelIgnore
+ private List finishIds;
+}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/constants/AbnormalAlarmConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/constants/AbnormalAlarmConstant.java
index 9ece78b..72f7643 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/constants/AbnormalAlarmConstant.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/constants/AbnormalAlarmConstant.java
@@ -23,7 +23,7 @@ public interface AbnormalAlarmConstant {
/**故障**/
String FAULT = "3";
-
+
/**预警**/
Long EARLY_WARNING = 20L;
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java
index e420e57..bb1120c 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java
@@ -1,13 +1,14 @@
package com.hnac.hzims.operational.defect.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
+import java.util.List;
/**
* 模型VO
@@ -22,7 +23,8 @@ public class OperDefectStatisticsVO extends OperDefectStatisticsEntity {
@ApiModelProperty(value = "问题发现人名称")
private String finderName;
-
+ @ApiModelProperty(value = "现象Ids")
+ private List defectCodeList;
@ApiModelProperty(value = "甄别人名称")
private String discriminatorName;
@@ -69,4 +71,9 @@ public class OperDefectStatisticsVO extends OperDefectStatisticsEntity {
)
@ApiModelProperty(value = "定论时间范围-最晚")
private Date createEndTime;
+
+ @ApiModelProperty("当前页")
+ private Integer current;
+ @ApiModelProperty("每页的数量")
+ private Integer size;
}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java
index bd32e77..5d82099 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java
@@ -1,6 +1,5 @@
package com.hnac.hzims.operational.maintenance.dto;
-import com.baomidou.mybatisplus.annotation.TableField;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -24,6 +23,8 @@ public class OperMaintenanceTaskDTO extends OperMaintenanceTaskEntity {
@ApiModelProperty("任务Id 多个按逗号分隔")
private String taskIds;
+ @ApiModelProperty("任务Id 多个按逗号分隔")
+ private List taskList;
@ApiModelProperty("任务Id 多个按逗号分隔")
private List deptIds;
@@ -33,4 +34,9 @@ public class OperMaintenanceTaskDTO extends OperMaintenanceTaskEntity {
@ApiModelProperty("结束时间")
private String endTime;
+
+ @ApiModelProperty("当前页")
+ private Integer current;
+ @ApiModelProperty("每页的数量")
+ private Integer size;
}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CheckVoteChartVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CheckVoteChartVo.java
new file mode 100644
index 0000000..9946e8f
--- /dev/null
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/vo/CheckVoteChartVo.java
@@ -0,0 +1,45 @@
+package com.hnac.hzims.operational.report.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author hx
+ */
+@Data
+@ApiModel("缺陷统计表")
+public class CheckVoteChartVo {
+ @ApiModelProperty(value = "站点名称")
+ @ExcelProperty(value = "站点名称", index = 0)
+ private String name;
+
+ @ApiModelProperty(value = "现象数量")
+ @ExcelProperty(value = "现象数量", index = 1)
+ private int phenomenonNum;
+ @ApiModelProperty(value = "现象数量id")
+ @ExcelIgnore
+ private List phenomenonIds;
+ @ApiModelProperty(value = "缺陷数量")
+ @ExcelProperty(value = "缺陷数量", index = 2)
+ private int defectNum;
+ @ApiModelProperty(value = "缺陷code")
+ @ExcelIgnore
+ private List defectIds;
+ @ApiModelProperty(value = "处理数量")
+ @ExcelProperty(value = "处理数量", index = 3)
+ private int handleNum;
+ @ApiModelProperty(value = "处理code")
+ @ExcelIgnore
+ private List handleIds;
+ @ApiModelProperty(value = "定论数量")
+ @ExcelProperty(value = "定论数量", index = 4)
+ private int conclusionNum;
+ @ApiModelProperty(value = "定论code")
+ @ExcelIgnore
+ private List conclusionIds;
+}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
index 1721302..4267005 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
@@ -162,6 +162,7 @@ public class StationEntity extends TenantEntity implements Serializable {
private Integer sort;
@ApiModelProperty("实时画面绑定账号秘钥")
+
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String secretKey;
@@ -173,4 +174,9 @@ public class StationEntity extends TenantEntity implements Serializable {
@QueryField(condition = SqlCondition.EQUAL)
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Boolean isAbroad;
+
+ @ApiModelProperty("所属国家")
+ @QueryField(condition = SqlCondition.EQUAL)
+ @TableField(updateStrategy = FieldStrategy.IGNORED)
+ private String refCountry;
}
diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java
index 2d6a4a2..fd8d81d 100644
--- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java
+++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/dto/TaskDTO.java
@@ -11,6 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
+import java.util.List;
/**
* @ClassName TaskDTO
@@ -34,4 +35,10 @@ public class TaskDTO extends TaskEntity implements Serializable {
@ApiModelProperty(value = "任务计划开始时间-止")
private LocalDateTime planStartTimeEnd;
+ @ApiModelProperty(value = "id集合")
+ private List ids;
+ @ApiModelProperty("当前页")
+ private Integer current;
+ @ApiModelProperty("每页的数量")
+ private Integer size;
}
diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/WxMessageDTO.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/WxMessageDTO.java
index 0c40b50..6846b6d 100644
--- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/WxMessageDTO.java
+++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/WxMessageDTO.java
@@ -45,7 +45,7 @@ public class WxMessageDTO implements Serializable {
@NotNull
@ApiModelProperty(value = "推送消息键值对")
- private Map map;
+ private Map map;
@NotNull
@ApiModelProperty(value = "内容")
diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceivesMapper.xml b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceivesMapper.xml
index 29c592e..5cfb451 100644
--- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceivesMapper.xml
+++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceivesMapper.xml
@@ -45,7 +45,7 @@
wt_sp_receives wr
JOIN wt_sp_warehouse sw ON wr.STORAGE_ROOM = sw.id
- and wr.code = #{params.code}
+ and wr.code like concat('%',#{params.code},'%')
and wr.CREATE_USER = #{params.createUser}
diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java
index f9dbf68..74bf8bb 100644
--- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java
+++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java
@@ -1,6 +1,5 @@
package com.hnac.hzims.spare.mapper;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity;
import com.hnac.hzims.spare.entity.WtSpBasicEntity;
import com.hnac.hzims.spare.vo.WtSpBasicVO;
@@ -15,7 +14,7 @@ import java.util.Map;
*
* @author Chill
*/
-public interface WtSpBasicMapper extends BaseMapper {
+public interface WtSpBasicMapper extends UserDataScopeBaseMapper {
/**
* 备品备件基础信息列表
* @param params
diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java
index fa00a7c..3a3bcb4 100644
--- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java
+++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java
@@ -14,14 +14,13 @@ import com.hnac.hzims.spare.vo.WtSpBasicVO;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springblade.core.launch.constant.FlowConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.support.Kv;
+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.IDictBizClient;
@@ -31,7 +30,6 @@ import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@@ -39,7 +37,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
/**
* 服务实现类
@@ -246,7 +243,11 @@ public class SpAllocationServiceImpl extends BaseServiceImpl data = new ArrayList<>();
List error = new ArrayList<>();
error = JSONArray.parseArray(JSON.toJSONString(entityList), WtSpBasicEntity.class).stream()
- .filter(entity -> Func.isEmpty(entity.getName())).collect(Collectors.toList());
+ .filter(entity -> Func.isEmpty(entity.getCode())).collect(Collectors.toList());
data = JSONArray.parseArray(JSON.toJSONString(entityList), WtSpBasicEntity.class).stream()
- .filter(entity -> Func.isNotEmpty(entity.getName())).collect(Collectors.toList());
+ .filter(entity -> Func.isNotEmpty(entity.getCode())).collect(Collectors.toList());
Assert.isTrue(CollectionUtil.isEmpty(error), () -> {
throw new ServiceException("填入工器具编码不能为空");
});
@@ -567,7 +567,7 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl r = this.validExcel(libraryExcel, codeList, counter);
- if (r.getMsg()!=null|| !r.isSuccess()) {
+ if ( !r.isSuccess()) {
return r;
}
}
diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java
index 5561d68..364ca2d 100644
--- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java
+++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java
@@ -523,6 +523,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl imp
task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
task.setInspectTaskSum(tasks.size());
// 所有处理完成巡检任务
- List finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList());
+ List finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(4)).collect(Collectors.toList());
if(CollectionUtil.isEmpty(finshList)){
return task;
}
task.setInspectTaskFinish(finshList.size());
// 未执行任务数
- List notExecuteList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(0)).collect(Collectors.toList());
+ List notExecuteList = tasks.stream().filter(o-> !finshList.stream().map(TaskEntity::getId).collect(Collectors.toList()).contains(o.getId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(notExecuteList)){
return task;
}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/DefectService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/DefectService.java
index fd9ebce..73fbb5f 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/DefectService.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/DefectService.java
@@ -11,5 +11,4 @@ import java.util.List;
*/
public interface DefectService extends BaseService {
- SolveHomeVO solve_count(List deptIds, String start, String end);
}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/PhenomenonService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/PhenomenonService.java
index 26a354e..4cc1312 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/PhenomenonService.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/PhenomenonService.java
@@ -1,6 +1,7 @@
package com.hnac.hzims.scheduled.service.operation.business;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
+import com.hnac.hzims.operational.defect.vo.SolveHomeVO;
import com.hnac.hzims.operational.main.vo.ShortagesVo;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import org.springblade.core.mp.base.BaseService;
@@ -12,6 +13,8 @@ import java.util.List;
*/
public interface PhenomenonService extends BaseService {
+ SolveHomeVO solve_count(List deptIds, String start, String end);
+
DutyDefectVO defect(String start, String end, List areas);
ShortagesVo defectMonth(String start, String end, List list);
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DefectServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DefectServiceImpl.java
index 1103e13..9efd2c3 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DefectServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DefectServiceImpl.java
@@ -26,28 +26,4 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class DefectServiceImpl extends BaseServiceImpl implements DefectService {
- /**
- * 消缺数量统计
- * @param deptIds
- * @param start
- * @param end
- * @return
- */
- @Override
- public SolveHomeVO solve_count(List deptIds, String start, String end) {
- SolveHomeVO solve = new SolveHomeVO();
- List defects = this.list(Wrappers.lambdaQuery()
- .in(OperDefectEntity::getCreateDept,deptIds)
- .gt(OperDefectEntity::getCreateTime,start)
- .lt(OperDefectEntity::getCreateTime,end)
- );
- if(cn.hutool.core.collection.CollectionUtil.isEmpty(defects)){
- solve.setDefectCount(0);
- solve.setSolveCount(0);
- }else{
- solve.setDefectCount(defects.size());
- solve.setSolveCount((int) defects.stream().filter(defect-> ObjectUtil.isNotEmpty(defect.getHandleTaskId())).count());
- }
- return solve;
- }
}
\ No newline at end of file
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/MaintenanceServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/MaintenanceServiceImpl.java
index ba446b0..b2597db 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/MaintenanceServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/MaintenanceServiceImpl.java
@@ -156,7 +156,7 @@ public class MaintenanceServiceImpl extends BaseServiceImpl maintainFinish = maintainList.stream().filter(o-> Func.isNotEmpty(o.getStatus()) && MaintenanceConstant.TASK_STATUS_5 == o.getStatus())
+ List maintainFinish = maintainList.stream().filter(o-> "结束".equals(o.getFlowTaskName()))
.map(OperMaintenanceTaskEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(maintainFinish)){
maintainVo.setMaintainFinish(0);
@@ -281,7 +281,7 @@ public class MaintenanceServiceImpl extends BaseServiceImpl regularWorkFinishList = regularWorkList.stream().filter(o -> MaintenanceConstant.TASK_STATUS_5 == o.getStatus()).collect(Collectors.toList());
+ List regularWorkFinishList = regularWorkList.stream().filter(o -> "结束".equals(o.getFlowTaskName())).collect(Collectors.toList());
if (CollectionUtil.isEmpty(regularWorkFinishList)) {
regularWorkVO.setRegularWork(0);
return regularWorkVO;
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java
index 1dc8019..9cfa208 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java
@@ -1,7 +1,10 @@
package com.hnac.hzims.scheduled.service.operation.business.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
+import com.hnac.hzims.operational.defect.vo.SolveHomeVO;
import com.hnac.hzims.operational.main.vo.ShortagesVo;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import com.hnac.hzims.scheduled.mapper.operation.PhenomenonMapper;
@@ -11,6 +14,7 @@ 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.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
@@ -28,6 +32,32 @@ import java.util.stream.Collectors;
public class PhenomenonServiceImpl extends BaseServiceImpl implements PhenomenonService {
/**
+ * 消缺数量统计
+ * @param deptIds
+ * @param start
+ * @param end
+ * @return
+ */
+ @Override
+ public SolveHomeVO solve_count(List deptIds, String start, String end) {
+ SolveHomeVO solve = new SolveHomeVO();
+ List defects = this.list(Wrappers.lambdaQuery()
+ .in(OperPhenomenonEntity::getCreateDept,deptIds)
+ .gt(OperPhenomenonEntity::getCreateTime,start)
+ .lt(OperPhenomenonEntity::getCreateTime,end)
+ );
+ if(cn.hutool.core.collection.CollectionUtil.isEmpty(defects)){
+ solve.setDefectCount(0);
+ solve.setSolveCount(0);
+ }else{
+ solve.setDefectCount(defects.size());
+ solve.setSolveCount((int) defects.stream().filter(defect-> !ObjectUtil.isEmpty(defect.getHandleTaskId())).count());
+ }
+ return solve;
+ }
+
+
+ /**
* 时间范围内机构缺陷数据查询
* @param start
* @param end
@@ -51,7 +81,7 @@ public class PhenomenonServiceImpl extends BaseServiceImplString.valueOf(o.getId())).collect(Collectors.joining(",")));
defectVO.setDefectSum(operPhenomenonList.size());
// 消缺数
- List defectList = operPhenomenonList.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())).
+ List defectList = operPhenomenonList.stream().filter(defect-> !ObjectUtil.isEmpty(defect.getHandleTaskId())).
map(OperPhenomenonEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(defectList)){
defectVO.setDefect(0);
@@ -88,8 +118,7 @@ public class PhenomenonServiceImpl extends BaseServiceImpl shortagesList = defects.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())).
- map(OperPhenomenonEntity::getId).collect(Collectors.toList());
+ List shortagesList = defects.stream().filter(defect-> !ObjectUtil.isEmpty(defect.getHandleTaskId())).map(OperPhenomenonEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(shortagesList)){
shortagesVo.setShortages(0);
}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java
index 9d573a6..be7492f 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java
@@ -80,7 +80,6 @@ public class ShowServiceImpl implements ShowService {
private final OtherService otherService;
private final AccessService accessService;
private final TicketService ticketService;
- private final DefectService defectService;
private final DutyService dutyService;
private final StationService stationService;
private final OverDetailsService detailsService;
@@ -397,7 +396,7 @@ public class ShowServiceImpl implements ShowService {
});
// 消缺率
exe.execute(() -> {
- SolveHomeVO solve = defectService.solve_count(areas,DateUtil.format(DateUtil.toDate(firstDateTime.toLocalDate()),DateUtil.PATTERN_DATETIME),DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME));
+ SolveHomeVO solve = phenomenonService.solve_count(areas,DateUtil.format(DateUtil.toDate(firstDateTime.toLocalDate()),DateUtil.PATTERN_DATETIME),DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME));
if(Math.abs(solve.getSolveCount()) > 0 && Math.abs(solve.getDefectCount()) > 0){
target.setTaget_three(BigDecimal.valueOf((double)solve.getSolveCount() / solve.getDefectCount() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}else{
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java
index a108ff0..03ed645 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java
@@ -15,7 +15,6 @@ import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import lombok.RequiredArgsConstructor;
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;
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java
index 7cad00b..c7638d1 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java
@@ -2,26 +2,19 @@ package com.hnac.hzims.scheduled.service.ticket.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.scheduled.mapper.ticket.WorkTicketMapper;
import com.hnac.hzims.scheduled.service.ticket.WorkDelayService;
import com.hnac.hzims.scheduled.service.ticket.WorkPrincipalService;
import com.hnac.hzims.scheduled.service.ticket.WorkTicketService;
-import com.hnac.hzims.ticket.constants.TicketConstants;
-import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
-import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketStatisticVO;
import lombok.AllArgsConstructor;
-import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.FutureTask;
import java.util.stream.Collectors;
@@ -46,32 +39,40 @@ public class WorkTicketServiceImpl extends BaseServiceImpl infoIdList = infoList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList());
+// List infoIdList = infoList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList());
work.setTotal(infoList.size());
//工作票作废
- List invalidList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.INVALID.getStatus().equals(w.getStatus()))
+ List invalidList = infoList.stream().filter(item -> "废票".equals(item.getFlowTaskName()))
.collect(Collectors.toList());
work.setInvalid(CollectionUtil.isNotEmpty(invalidList) ? invalidList.size() : 0);
- // 工作票完成数
- List completeList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.FINISH.getStatus().equals(w.getStatus()))
+ // 工作票结束数
+ List completeList = infoList.stream().filter(item -> "结束".equals(item.getFlowTaskName()))
.collect(Collectors.toList());
work.setComplete(CollectionUtil.isNotEmpty(completeList) ? completeList.size() : 0);
- int transferTask = 0;
- int delayTask = 0;
- List moveList = workPrincipalService.list(new LambdaQueryWrapper() {{
- in(WorkTicketPrincipalChangeEntity::getTicketId, infoIdList);
- }});
- if(CollectionUtil.isNotEmpty(moveList)){
- transferTask = moveList.size();
- }
- List delayEntityList = workDelayService.list(Wrappers.lambdaQuery()
- .in(WorkTicketDelayEntity::getTicketId, infoIdList)
- );
- if(CollectionUtil.isNotEmpty(delayEntityList)){
- delayTask = delayEntityList.size();
- }
- work.setDelay(delayTask);
- work.setTransfer(transferTask);
+ // 工作票延期总数数
+ List delayList = infoList.stream().filter(item -> "延期".equals(item.getInput()))
+ .collect(Collectors.toList());
+ work.setDelay(CollectionUtil.isNotEmpty(delayList) ? delayList.size() : 0);
+ // 工作票移交数
+ List changeList = infoList.stream().filter(item -> "转移".equals(item.getInput()))
+ .collect(Collectors.toList());
+ work.setTransfer(CollectionUtil.isNotEmpty(changeList) ? changeList.size() : 0);
+// int transferTask = 0;
+// int delayTask = 0;
+// List moveList = workPrincipalService.list(new LambdaQueryWrapper() {{
+// in(WorkTicketPrincipalChangeEntity::getTicketId, infoIdList);
+// }});
+// if(CollectionUtil.isNotEmpty(moveList)){
+// transferTask = moveList.size();
+// }
+// List delayEntityList = workDelayService.list(Wrappers.lambdaQuery()
+// .in(WorkTicketDelayEntity::getTicketId, infoIdList)
+// );
+// if(CollectionUtil.isNotEmpty(delayEntityList)){
+// delayTask = delayEntityList.size();
+// }
+// work.setDelay(delayTask);
+// work.setTransfer(transferTask);
}
return work;
}
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java
index 2393be5..38d45d9 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java
@@ -29,7 +29,9 @@ public interface IContentDefinitionService extends BaseService queryWrapper = Condition.getQueryWrapper(entity,ContentDefinitionEntity.class);
queryWrapper.eq(Func.isNotEmpty(entity.getCreateDept()), ContentDefinitionEntity::getCreateDept, entity.getCreateDept())
.eq(Func.isNotEmpty(entity.getCreateUser()), ContentDefinitionEntity::getCreateUser, entity.getCreateUser())
- .eq(Func.isNotEmpty(entity.getStatus()), ContentDefinitionEntity::getStatus, entity.getStatus()).orderByDesc(ContentDefinitionEntity::getCreateTime);
+ .eq(Func.isNotEmpty(entity.getStatus()), ContentDefinitionEntity::getStatus, entity.getStatus()).orderByDesc(ContentDefinitionEntity::getCreateTime)
+ .eq(Func.isNotEmpty(entity.getCheckType()),ContentDefinitionEntity::getCheckType,entity.getCheckType())
+ .like(Func.isNotEmpty(entity.getName()),ContentDefinitionEntity::getName,entity.getName());
return queryWrapper;
}
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
index df2452c..00ca26a 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
@@ -1,17 +1,12 @@
package com.hnac.hzinfo.inspect.plan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
-import com.hnac.hzinfo.inspect.Constants;
-import com.hnac.hzinfo.inspect.invalid.DictInvalid;
import com.hnac.hzinfo.inspect.obj.utils.CodeUtils;
-import com.hnac.hzinfo.inspect.plan.PlanContants;
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity;
import com.hnac.hzinfo.inspect.plan.service.IPlanObjectTemplateService;
import com.hnac.hzinfo.inspect.plan.service.IPlanService;
@@ -24,7 +19,6 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
-import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
@@ -32,11 +26,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.Size;
import java.time.LocalDate;
-import java.time.LocalDateTime;
import java.util.List;
@@ -83,9 +73,9 @@ public class PlanController extends BladeController {
if(plan.getEndTime()!=null){
queryWrapper.le(PlanEntity::getEndTime,plan.getEndTime());
}
- if(plan.getStatus()==null){
- queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus());
- }
+// if(plan.getStatus()==null){
+// queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus());
+// }
if(plan.getCreateDept()!=null){
queryWrapper.eq(PlanEntity::getCreateDept,plan.getCreateDept());
}
@@ -113,7 +103,15 @@ public class PlanController extends BladeController {
public R> addAndChecked(@Valid @RequestBody PlanVO plan) {
return R.data(planService.addAndChecked(plan));
}
-
+ /**
+ * 撤销
+ */
+ @GetMapping("/revoke")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "撤销", notes = "传入plan")
+ public R revoke(@RequestParam Long planId) {
+ return R.data(planService.revoke(planId));
+ }
/**
* 删除
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java
index e3ce4ec..bf491d2 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java
@@ -59,4 +59,6 @@ public interface IPlanService extends BaseService {
Boolean deletePlanAndRelatives(Long id);
List getPlans(List planIds);
+
+ Boolean revoke(Long planId);
}
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java
index 6c1b0b7..b060ace 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java
@@ -109,6 +109,21 @@ public class PlanServiceImpl extends BaseServiceImpl imp
}
/**
+ *巡检计划撤销
+ * @param planId
+ * @return
+ */
+ @Override
+ public Boolean revoke(Long planId) {
+ boolean re;
+ LambdaUpdateWrapper uw = new UpdateWrapper().lambda();
+ uw.set(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_SUBMIT.getStatus());
+ uw.eq(PlanEntity::getId, planId);
+ re = update(uw);
+ return re;
+ }
+
+ /**
* 保存巡检计划
*/
@Transactional(rollbackFor = Exception.class)
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
index 90b5af1..3309ca8 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
@@ -1,16 +1,15 @@
package com.hnac.hzinfo.inspect.task.controller;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fasterxml.jackson.annotation.JsonRawValue;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Lists;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
+import com.hnac.hzims.vo.VoteChartVo;
import com.hnac.hzinfo.core.push.enums.PushAudienceType;
import com.hnac.hzinfo.core.push.model.PushAudience;
import com.hnac.hzinfo.core.push.model.PushInfo;
@@ -31,14 +30,14 @@ import com.hnac.hzinfo.inspect.utils.Condition;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
-import org.springblade.core.cache.utils.CacheUtil;
+import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.resource.feign.IPushClient;
import org.springblade.resource.vo.PushInfoVO;
import org.springblade.system.user.cache.UserCache;
@@ -46,7 +45,13 @@ import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
-import java.util.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
@@ -104,11 +109,11 @@ public class TaskController extends BladeController {
return R.data(detail);
}
- @GetMapping("/listPage")
+ @PostMapping("/listPage")
@ApiOperation(value = "巡检任务分页查询-站长级", notes = "传入task")
@ApiOperationSupport(order = 1)
- public R> listPage(TaskDTO taskDTO, Query query) {
- return R.data(taskService.page(taskDTO,query));
+ public R> listPage(@RequestBody TaskDTO taskDTO) {
+ return R.data(taskService.page(taskDTO));
}
/**
@@ -370,5 +375,43 @@ public class TaskController extends BladeController {
return R.data(pageList);
}
+ /**
+ * 巡检计划统计
+ */
+ @GetMapping("/getTaskListStatistics")
+ @ApiOperation(value = "巡检计划统计", notes = "传入计划id")
+ public R> getTaskListStatistics(String startTime,String endTime,Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ return R.fail("暂无权限查看,请稍后重试");
+ }
+ List list=taskService.getTaskListStatistics(startTime,endTime,deptId);
+ return R.data(list);
+ }
+ /**
+ * 巡检计划统计
+ */
+ @GetMapping("/importTaskListStatistics")
+ @ApiOperation(value = "导出", notes = "传入计划id")
+ public void importTaskListStatistics(HttpServletResponse response, String startTime, String endTime,Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ throw new ServiceException ("暂无权限查看,请稍后重试");
+ }
+ List list=taskService.getTaskListStatistics(startTime,endTime,deptId);
+ // 下载导出
+ String filename = "(" + startTime+"-"+endTime + ")巡检统计表";
+ // 设置头信息
+ response.setCharacterEncoding("UTF-8");
+ response.setContentType("application/vnd.ms-excel");
+ try {
+ //设置xlsx格式
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xlsx", "UTF-8"));
+ //创建一个输出流
+ EasyExcel.write(response.getOutputStream(), VoteChartVo.class).autoCloseStream(Boolean.TRUE).sheet(1,"巡检计划统计表")
+ .doWrite(list);
+ response.getOutputStream().close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskReportClient.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskReportClient.java
index b018474..1fbca6a 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskReportClient.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskReportClient.java
@@ -131,7 +131,7 @@ public class InspectTaskReportClient implements IInspectTaskReportClient {
if(CollectionUtil.isEmpty(taskList)){
return R.data(dutyInspectTaskVO);
}
- dutyInspectTaskVO.setInspectTaskIds(taskList.stream().map(TaskEntity::getId).map(id->id.toString()).collect(Collectors.joining(",")));
+ dutyInspectTaskVO.setInspectTaskIds(taskList.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
dutyInspectTaskVO.setInspectTaskSum(taskList.size());
// 所有处理完成巡检任务
List finshList = taskList.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList());
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java
index e0f7ec3..7f62c5a 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/ITaskService.java
@@ -3,15 +3,14 @@ package com.hnac.hzinfo.inspect.task.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.vo.SafeCheckStatisticVO;
+import com.hnac.hzims.vo.VoteChartVo;
import com.hnac.hzinfo.inspect.task.dto.TaskDTO;
import com.hnac.hzinfo.inspect.task.entity.InspectionTaskSMS;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.vo.*;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.BladePage;
-import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
-import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
@@ -65,7 +64,7 @@ public interface ITaskService extends BaseService {
*/
List getTaskById(Long id);
- IPage page(TaskDTO taskDTO, Query query);
+ IPage page(TaskDTO taskDTO);
/**
* PC端任务列表
@@ -189,4 +188,6 @@ public interface ITaskService extends BaseService {
* @return
*/
BladePage selectPage(Page pageInfo, TaskListQuery task);
+
+ List getTaskListStatistics(String startTime, String endTime,Long deptId);
}
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
index 3f7e0df..61b1c82 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
@@ -14,6 +14,7 @@ import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.entity.ImsMonCameraInfoEntity;
import com.hnac.hzims.safeproduct.feign.IImsMonCameraInfoClient;
import com.hnac.hzims.vo.SafeCheckStatisticVO;
+import com.hnac.hzims.vo.VoteChartVo;
import com.hnac.hzinfo.inspect.ai.service.IRobotService;
import com.hnac.hzinfo.inspect.obj.ObjContants;
import com.hnac.hzinfo.inspect.obj.services.IObjectDangerService;
@@ -44,6 +45,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.*;
import org.springblade.system.cache.DictCache;
+import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
@@ -521,13 +523,17 @@ public class TaskServiceImpl extends BaseServiceImpl imp
}
@Override
- public IPage page(TaskDTO taskDTO, Query query) {
+ public IPage page(TaskDTO taskDTO) {
+ Query query = new Query();
+ query.setSize(taskDTO.getSize());
+ query.setCurrent(taskDTO.getCurrent());
TaskEntity request = BeanUtil.copy(taskDTO,TaskEntity.class);
LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(TaskEntity.class,request);
queryWrapper.ge(Func.isNotEmpty(taskDTO.getPlanStartTime()),TaskEntity::getPlanStartTime,taskDTO.getPlanStartTime());
queryWrapper.le(Func.isNotEmpty(taskDTO.getPlanStartTimeEnd()),TaskEntity::getPlanStartTime,taskDTO.getPlanStartTimeEnd());
queryWrapper.eq(Func.isNotEmpty(taskDTO.getCreateDept()),TaskEntity::getCreateDept,taskDTO.getCreateDept());
queryWrapper.eq(Func.isNotEmpty(taskDTO.getStatus()),TaskEntity::getStatus,taskDTO.getStatus());
+ queryWrapper.in(Func.isNotEmpty(taskDTO.getIds()),TaskEntity::getId,taskDTO.getIds());
queryWrapper.orderByDesc(TaskEntity::getCreateTime);
IPage page = this.page(Condition.getPage(query), queryWrapper);
List records = page.getRecords();
@@ -539,8 +545,13 @@ public class TaskServiceImpl extends BaseServiceImpl imp
.filter(Func::isNotEmpty).map(String::valueOf).collect(Collectors.joining(","));
// 获取巡检任务人员名称
String userNames = taskUserList.stream().filter(Func::isNotEmpty).map(TaskUserEntity::getUserId).filter(Func::isNotEmpty)
- .map(UserCache::getUser).map(user -> Optional.ofNullable(user).map(User::getName).orElse(""))
- .collect(Collectors.joining(","));
+ .map(userId -> {
+ User user = UserCache.getUser(userId);
+ if(ObjectUtil.isEmpty(user)){
+ return "";
+ }
+ return user.getName();
+ }).collect(Collectors.joining(","));
taskVo.setUserIds(userIds);
taskVo.setUserNames(userNames);
// 获取机器人信息
@@ -954,6 +965,49 @@ public class TaskServiceImpl extends BaseServiceImpl imp
}
+ @Override
+ public List getTaskListStatistics(String startTime, String endTime,Long deptId) {
+ List taskEntities=new ArrayList<>();
+ R> deptByCurrentUser = sysClient.getDeptByCurrentUser();
+ List deptIds;
+ if (deptByCurrentUser.isSuccess() && CollectionUtil.isNotEmpty(deptByCurrentUser.getData())) {
+ deptIds = deptByCurrentUser.getData().stream().map(s -> s.getId()).collect(Collectors.toList());
+ } else {
+ throw new ServiceException("暂无机构权限");
+ }
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ if (ObjectUtil.isNotEmpty(deptId)) {
+ if (deptIds.contains(deptId)) {
+ queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptId);
+ } else {
+ throw new ServiceException("暂无该机构权限");
+ }
+ } else {
+ queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptIds);
+ }
+ queryWrapper.ge(ObjectUtils.isNotNull(startTime), "CREATE_TIME",startTime);
+ queryWrapper.le(ObjectUtils.isNotNull(endTime), "CREATE_TIME",endTime);
+ taskEntities= baseMapper.selectList(queryWrapper);
+ List res=new ArrayList<>();
+ if (CollectionUtil.isNotEmpty(taskEntities)) {
+ VoteChartVo all = getVoteChartVo(taskEntities);
+ all.setName("总计");
+ res.add(all);
+ Map> collect = Optional.ofNullable(taskEntities).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(TaskEntity::getCreateDept));
+ for (Map.Entry> longListEntry : collect.entrySet()) {
+ VoteChartVo voteChartVo = getVoteChartVo(longListEntry.getValue());
+ R deptName = sysClient.getDeptName(longListEntry.getKey());
+ voteChartVo.setName(deptName.isSuccess() ? deptName.getData() : "");
+ res.add(voteChartVo);
+ }
+ }else {
+ VoteChartVo all = new VoteChartVo();
+ all.setName("总计");
+ res.add(all);
+ }
+ return res;
+ }
+
/**
* 巡检任务分页
*
@@ -1018,4 +1072,18 @@ public class TaskServiceImpl extends BaseServiceImpl imp
}
return null;
}
+
+ private VoteChartVo getVoteChartVo(List list) {
+ VoteChartVo voteChartVo = new VoteChartVo();
+ List finishIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() == 3).map(s -> s.getId()).collect(Collectors.toList());
+ List undoneIds =Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() != 3).map(s -> s.getId()).collect(Collectors.toList());
+ voteChartVo.setSumNum(list.size());
+ voteChartVo.setSumIds(list.stream().map(s -> s.getId()).collect(Collectors.toList()));
+ voteChartVo.setFinishNum(finishIds.size());
+ voteChartVo.setFinishIds(finishIds);
+ voteChartVo.setUndoneNum(undoneIds.size());
+ voteChartVo.setUndoneIds(undoneIds);
+ return voteChartVo;
+ }
+
}
diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskListQuery.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskListQuery.java
index b36c94d..6343e9c 100644
--- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskListQuery.java
+++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskListQuery.java
@@ -8,7 +8,6 @@ import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
-import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.YearMonth;
@@ -130,4 +129,9 @@ public class TaskListQuery implements Serializable {
* 创建机构
*/
private Long createDept;
+
+ @ApiModelProperty("当前页")
+ private Integer current;
+ @ApiModelProperty("每页的数量")
+ private Integer size;
}
diff --git a/hzims-service/message/pom.xml b/hzims-service/message/pom.xml
index 56dd88f..b3856f8 100644
--- a/hzims-service/message/pom.xml
+++ b/hzims-service/message/pom.xml
@@ -88,6 +88,7 @@
org.springblade
blade-system-api
+ 5.0.2-SNAPSHOT
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
index c718ab3..c7a93ff 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
@@ -90,7 +90,7 @@ public class MessageClient extends BladeController implements IMessageClient{
entity.setDeptName(Func.isNotEmpty(entity.getDeptName()) ? entity.getDeptName() : this.getDeptNameById(entity.getDeptId()));
entity.setMessageId(IdWorker.getId());
entity.setPusher(userId.toString());
- entity.setPusherName(Optional.ofNullable(UserCache.getUser(userId)).map(User::getName).orElse(null));
+ //entity.setPusherName(Optional.ofNullable(UserCache.getUser(userId)).map(User::getName).orElse(null));
entity.setPushType(MessageConstants.IMMEDIATELY);
entity.setAccount(userId.toString());
entity.setPlanTime(LocalDateTime.now());
@@ -98,11 +98,11 @@ public class MessageClient extends BladeController implements IMessageClient{
entity.setCreateDept(entity.getDeptId());
return entity;
}).collect(Collectors.toList());
- boolean isSave = recordService.saveBatch(messages);
+ /*boolean isSave = recordService.saveBatch(messages);
if(isSave){
return R.data(recordService.sendWxMessageByUser(request,messages));
- }
- return R.data(false);
+ }*/
+ return R.data(recordService.sendWxMessageByUser(request,messages));
}
@PostMapping(PLAN_SEND_MESSAGE)
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
index bf9b069..6ab12eb 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
@@ -394,19 +394,15 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl records) {
- Map param = new HashMap();
- param.put("templateId",message.getTemplateId());
- param.put("skip",message.getSkipUrl());
- param.put("map",message.getMap());
- param.put("userIds", Arrays.stream(message.getUserIds().split(",")).collect(Collectors.toList()));
+
WxMessageServiceImpl service = SpringUtil.getBean(WxMessageServiceImpl.class);
- boolean isSend = service.send(param);
- if (isSend) {
+ boolean isSend = service.send(message);
+ /*if (isSend) {
this.update(Wrappers.lambdaUpdate()
.set(MessagePushRecordEntity::getPushTime, LocalDateTime.now())
.set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS)
.in(MessagePushRecordEntity::getId, records.stream().map(MessagePushRecordEntity::getId).collect(Collectors.toList())));
- }
+ }*/
return isSend;
}
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WxMessageServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WxMessageServiceImpl.java
index 337983d..aea5845 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WxMessageServiceImpl.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WxMessageServiceImpl.java
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.AppPushDto;
import com.hnac.hzims.message.dto.PushDto;
+import com.hnac.hzims.message.dto.WxMessageDTO;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.log.aspect.SaveLog;
import com.hnac.hzims.message.service.IMessageService;
@@ -16,6 +17,7 @@ import com.hnac.hzinfo.core.push.model.PushPlatform;
import com.hnac.hzinfo.core.push.model.PushResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.formula.functions.T;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.secure.utils.AuthUtil;
@@ -24,6 +26,9 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.resource.feign.IPushClient;
import org.springblade.resource.vo.PushInfoVO;
+import org.springblade.system.entity.PushTemplate;
+import org.springblade.system.feign.IWxPushClient;
+import org.springblade.system.vo.WxPushFeignVO;
import org.springframework.stereotype.Service;
import java.io.*;
@@ -38,6 +43,7 @@ import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
/**
* @author hx
@@ -48,6 +54,7 @@ import java.util.concurrent.atomic.AtomicReference;
public class WxMessageServiceImpl implements IMessageService {
private final IPushClient pushClient;
+ private final IWxPushClient wxPushClient;
private final BladeLogger logger;
private final ExecutorService appMessagePushExecutor;
@@ -75,50 +82,13 @@ public class WxMessageServiceImpl implements IMessageService {
return false;
}
- public boolean send(Map param) {
- OutputStream out = null;
- try{
- URL serverUrl = new URL("https://3d.hnaccloud.com/api/blade-system/wxPush/sendPush");
- HttpURLConnection conn = (HttpURLConnection) serverUrl.openConnection();
- conn.setRequestMethod("GET");
- conn.setRequestProperty("Content-type", "application/json");
- //必须设置false,否则会自动redirect到重定向后的地址
- conn.setInstanceFollowRedirects(false);
- conn.connect();
- String result = responseFormat(conn);
- //获取输出流
- out = conn.getOutputStream();
- log.error("send_wx_message_param: {}",param.toString());
- //输出流里写入POST参数
- out.write(param.toString().getBytes());
- out.flush();
- out.close();
- }catch (Exception ex){
- log.error("send_wx_message_error: {} ", ex.getMessage());
- }
- return false;
- }
-
- /***
- * 获取返回的内容
- * @param connection
- * @return
- */
- private String responseFormat(HttpURLConnection connection) {
- StringBuilder stringBuilder = new StringBuilder();
- //将返回的输入流转换成字符串
- try (
- InputStream inputStream = connection.getInputStream();
- InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
- BufferedReader bufferedReader = new BufferedReader(inputStreamReader)
- ) {
- String str;
- while ((str = bufferedReader.readLine()) != null) {
- stringBuilder.append(str);
- }
- } catch (IOException e) {
- return null;
- }
- return stringBuilder.toString();
- }
+ public boolean send(WxMessageDTO message) {
+ PushTemplate template = new PushTemplate();
+ template.setTemplateId(message.getTemplateId());
+ template.setSkipUrl(message.getSkipUrl());
+ template.setMap(message.getMap());
+ template.setUserIds(Arrays.stream(message.getUserIds().split(",")).collect(Collectors.toList()));
+ R result = wxPushClient.sendPushTemplateByUserId(template);
+ return result.isSuccess();
+ }
}
diff --git a/hzims-service/operational/pom.xml b/hzims-service/operational/pom.xml
index 03d3536..ea3b0b7 100644
--- a/hzims-service/operational/pom.xml
+++ b/hzims-service/operational/pom.xml
@@ -139,7 +139,6 @@
org.springblade
blade-user-api
- 5.0.1.RELEASE
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java
index 0093523..13b9364 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java
@@ -20,7 +20,6 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
-import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
/**
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java
index 1ac99e2..de3219d 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java
@@ -1,5 +1,6 @@
package com.hnac.hzims.operational.access.controller;
+import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
@@ -10,18 +11,25 @@ import com.hnac.hzims.operational.access.dto.OperAccessTaskFlowDTO;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.access.vo.OperAccessTaskVO;
import com.hnac.hzims.operational.access.vo.RepairBillVO;
+import com.hnac.hzims.vo.VoteChartVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
+import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
+import java.io.IOException;
+import java.net.URLEncoder;
import java.util.List;
/**
@@ -79,6 +87,7 @@ public class OperAccessTaskController extends BladeController {
return service.detail(id);
}
+
/**
* 分页
*/
@@ -92,7 +101,22 @@ public class OperAccessTaskController extends BladeController {
public R> list(OperAccessTaskDTO req, Query query) {
return service.list(req, query);
}
-
+ /**
+ * 分页
+ */
+ @ApiLog
+ @PostMapping("/listByStatus")
+ @ApiOperationSupport(order = 50)
+ @OperationAnnotation(moduleName = "检修管理",title = "检修任务",operatorType = OperatorType.MOBILE,businessType =
+ BusinessType.GENCODE,
+ action = "分页查询我的检修任务列表")
+ @ApiOperation(value = "分页 查询参数:name,code,handler,status,planId,planCode")
+ public R> list(@RequestBody OperAccessTaskDTO req) {
+ Query query=new Query();
+ query.setCurrent(req.getCurrent());
+ query.setSize(req.getSize());
+ return service.listByStatus(req, query);
+ }
/**
* 获取检修台账
@@ -104,4 +128,47 @@ public class OperAccessTaskController extends BladeController {
public R> getAccessTaskByEmCode(String emCode, String startTime, String endTime) {
return R.data(service.getRepairBill(emCode, startTime, endTime));
}
+
+ /**
+ * 检修计划统计
+ */
+ @GetMapping("/getAccessListStatistics")
+ @ApiOperation(value = "检修计划统计", notes = "传入时间")
+ public R> getAccessListStatistics(String startTime, String endTime,Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ return R.fail("暂无权限查看,请稍后重试");
+ }
+ List list=service.getAccessListStatistics(startTime,endTime,deptId);
+ return R.data(list);
+ }
+
+ /**
+ * 检修计划统计
+ */
+ @GetMapping("/importAccessListStatistics")
+ @ApiOperation(value = "导出", notes = "传入时间")
+ public void importAccessListStatistics(HttpServletResponse response, String startTime, String endTime,Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ throw new ServiceException("暂无权限查看,请稍后重试");
+ }
+ List list=service.getAccessListStatistics(startTime,endTime,deptId);
+ // 下载导出
+ String filename = "(" + startTime+"-"+endTime + ")检修计划统计表";
+ // 设置头信息
+ response.setCharacterEncoding("UTF-8");
+ response.setContentType("application/vnd.ms-excel");
+ try {
+ //设置xlsx格式
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xlsx", "UTF-8"));
+ //创建一个输出流
+ EasyExcel.write(response.getOutputStream(), VoteChartVo.class).autoCloseStream(Boolean.TRUE).sheet(1,"检修计划统计表")
+ .doWrite(list);
+ response.getOutputStream().close();
+ // 关闭
+ response.getOutputStream().close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java
index 62db8b3..bb9effb 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java
@@ -25,7 +25,8 @@ public class OperAccessStatisticsDTO extends OperAccessStatisticsEntity {
@ApiModelProperty(value = "创建机构集合")
private List deptIds;
-
+ @ApiModelProperty(value = "id集合")
+ private List ids;
/**
* 月份
*/
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java
index ae0d3b3..a3a3508 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java
@@ -21,7 +21,8 @@ public class OperAccessTaskDTO extends OperAccessTaskEntity {
@ApiModelProperty(value = "创建机构集合")
private List deptIds;
-
+ @ApiModelProperty(value = "ids")
+ private List ids;
@ApiModelProperty(value = "工作流Key")
private String procDefId;
@@ -39,4 +40,8 @@ public class OperAccessTaskDTO extends OperAccessTaskEntity {
@ApiModelProperty("结束时间")
private String endTime;
+ @ApiModelProperty("当前页")
+ private Integer current;
+ @ApiModelProperty("每页的数量")
+ private Integer size;
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java
index b9ca2b3..b45f846 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java
@@ -28,6 +28,9 @@ public interface OperAccessTaskMapper extends UserDataScopeBaseMapper pageCondition(IPage page, @Param("req") OperAccessTaskDTO req);
+
+ List pageConditionByStatus(IPage page, @Param("req") OperAccessTaskDTO req);
+
List selectByEmCode(String emCode,List list);
@SqlParser(filter = true)
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
index 640690d..6efe664 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
@@ -65,6 +65,7 @@
AND t.`CODE` LIKE CONCAT('%',#{req.code},'%')
+
AND t.`HANDLER`=#{req.handler}
@@ -91,7 +92,48 @@
ORDER BY t.create_time DESC
-
+
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java
index a151d74..73129be 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java
@@ -151,9 +151,13 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl handles(List types,Integer alarm) {
+ public List handles(List types,Integer isEarly) {
+ if(AbnormalAlarmConstant.INTELLIGENCE_ALARM.equals(isEarly)){
+ String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
+ return this.baseMapper.handles(types,null,null);
+ }
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
- return this.baseMapper.handles(types,alarm,start,end);
+ return this.baseMapper.handles(types,start,end);
}
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/DeviceDataController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/DeviceDataController.java
index a448691..89e98c5 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/DeviceDataController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/DeviceDataController.java
@@ -42,4 +42,11 @@ public class DeviceDataController {
public R> history(AnalyzeDataCondition analyzeDataCondition) {
return service.history(analyzeDataCondition);
}
+
+ @ApiOperation("微信消息推送测试")
+ @PostMapping("/sendWxMessage")
+ @ApiOperationSupport(order = 1)
+ public R sendWxMessage() {
+ return service.sendWxMessage();
+ }
}
\ No newline at end of file
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/DeviceDataService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/DeviceDataService.java
index 6726c14..c69fe0a 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/DeviceDataService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/DeviceDataService.java
@@ -19,4 +19,6 @@ public interface DeviceDataService {
R> real(RealDataSearchPO search);
R> history(AnalyzeDataCondition analyzeDataCondition);
+
+ R sendWxMessage();
}
\ No newline at end of file
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/DeviceDataServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/DeviceDataServiceImpl.java
index cc96c56..91c2a11 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/DeviceDataServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/DeviceDataServiceImpl.java
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.esotericsoftware.minlog.Log;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
+import com.hnac.hzims.message.dto.WxMessageDTO;
+import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.census.service.DeviceDataService;
import com.hnac.hzims.operational.census.vo.RealVo;
import com.hnac.hzinfo.datasearch.PointData;
@@ -15,10 +17,13 @@ import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.AnalyseDataSearchClient;
import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
+import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.support.QueryField;
+import org.springblade.core.mp.support.SqlCondition;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.StringUtil;
@@ -26,6 +31,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
+import javax.validation.constraints.NotNull;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -42,6 +49,8 @@ public class DeviceDataServiceImpl implements DeviceDataService {
private final AnalyseDataSearchClient analyseDataSearchClient;
+ private final IMessageClient messageClient;
+
/**
* 实时数据
* @param search
@@ -67,4 +76,44 @@ public class DeviceDataServiceImpl implements DeviceDataService {
Result> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCode(analyzeDataCondition);
return R.data(result.getData());
}
+
+ /**
+ * 微信消息推送测试
+ * @return
+ */
+ @Override
+ public R sendWxMessage() {
+ WxMessageDTO message = new WxMessageDTO();
+ // 模板Id
+ message.setTemplateId("hIgINCsjpG-gyCKh8wzwBWjR-hkbjkNLFTXQEsnR_Z8");
+ // 微信消息跳转地址
+ message.setSkipUrl("http://baidu.com");
+ // 机构Id
+ message.setDeptId(200000010709L);
+ // 业务关键字
+ message.setBusinessKey("wx_message_test");
+ // 业务分类关键字
+ message.setBusinessClassify("wx_message_test");
+ // 任务Id
+ message.setTaskId(1686044105416650753L);
+ // 微信参数键值对
+ HashMap map = new HashMap<>();
+ map.put("thing18","云南维西拉波洛水电站");
+ map.put("thing5","1号机组");
+ map.put("thing11","拉波洛电站数据_1号机组PLC.(D182)机组故障_分");
+ map.put("thing14","故障");
+ map.put("time2","2023-08-28 16:08:19");
+ message.setMap(map);
+ // 消息内容
+ message.setContent("杨胜军在测试微信消息推送");
+ // 消息主题
+ message.setSubject("微信公众号推送消息测试");
+ // 推送用户
+ message.setUserIds("1678930425282785281,1696056255481344002,1696073993931157505");
+ // 创建用户
+ message.setCreateUser(1394936547620040706L);
+ // 租户Id
+ message.setTenantId("200000");
+ return messageClient.sendWxMessage(message);
+ }
}
\ No newline at end of file
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
index 1693d5d..022e1eb 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
@@ -730,7 +730,9 @@ public class TargetServiceImpl implements TargetService {
}
// 查询日常维护任务
params.setDeptIds(areas.keySet().stream().map(Dept::getId).collect(Collectors.toList()));
- return maintenanceTaskService.list(params,query);
+ params.setCurrent(query.getCurrent());
+ params.setSize(query.getSize());
+ return maintenanceTaskService.list(params);
}
/**
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java
index c636df2..9865756 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.fdp.feign.IFdpMonitorClient;
@@ -24,6 +25,7 @@ import com.hnac.hzims.operational.config.service.StAlamRecordService;
import com.hnac.hzims.operational.config.service.StFocusPropertiesService;
import com.hnac.hzims.operational.config.vo.*;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
+import com.hnac.hzims.operational.main.vo.RealDeviceVo;
import com.hnac.hzims.operational.main.vo.SoeDataVo;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService;
@@ -739,10 +741,17 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl handles = handleService.handles(Collections.singletonList(AbnormalAlarmConstant.EARLY_WARNING),AbnormalAlarmConstant.INTELLIGENCE_ALARM);
Map map = stations.stream().collect(Collectors.toMap(StationEntity::getCode,StationEntity::getName));
- return list.stream().filter(fault -> map.containsKey(fault.getStation())).peek(o-> o.setStationName(map.get(o.getStation()))).collect(Collectors.toList());
+ return list.stream().filter(fault -> map.containsKey(fault.getStation())).peek(record -> {
+ record.setStationName(map.get(record.getStation()));
+ if(CollectionUtil.isEmpty(handles)){
+ record.setIsHandle(false);
+ }else{
+ record.setIsHandle(handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(String.valueOf(record.getFaultId())));
+ }
+ }).sorted(Comparator.comparing((FaultVo::getIsHandle)).reversed().thenComparing(FaultVo::getCreateTime).reversed()).collect(Collectors.toList());
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/FaultVo.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/FaultVo.java
index 74a0f60..a76ef46 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/FaultVo.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/FaultVo.java
@@ -27,4 +27,6 @@ public class FaultVo {
private String info;
private String name;
+
+ private Boolean isHandle;
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java
index d8e798a..cd4e5b2 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java
@@ -25,10 +25,7 @@ import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
@@ -64,14 +61,17 @@ public class OperDefectStatisticsController extends BladeController {
* 分页 代码自定义代号
*/
@ApiLog
- @GetMapping("/list")
+ @PostMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入statistics")
@ApiImplicitParams({
})
@OperationAnnotation(moduleName = "缺陷管理",title = "缺陷记录",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action
= "分页查询缺陷记录列表")
- public R> list( OperDefectStatisticsVO entity, Query query) {
+ public R> list(@RequestBody OperDefectStatisticsVO entity) {
+ Query query=new Query();
+ query.setCurrent(entity.getCurrent());
+ query.setSize(entity.getSize());
LambdaQueryWrapper queryWrapper = statisticsService.getQueryWrapper(entity);
IPage pages = statisticsService.page(Condition.getPage(query), queryWrapper);
IPage vos = OperDefectStatisticsWrapper.build().pageVO(pages);
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java
index 1abf0d9..11c37b0 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java
@@ -1,5 +1,6 @@
package com.hnac.hzims.operational.defect.controller;
+import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@@ -12,6 +13,7 @@ import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.service.IOperAppearanceService;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO;
+import com.hnac.hzims.operational.report.vo.CheckVoteChartVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@@ -19,14 +21,22 @@ import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
+import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.entity.BladeFlow;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.List;
+
/**
* 控制器
*
@@ -131,4 +141,44 @@ public class OperPhenomenonController extends BladeController {
public R getFdpTaskByDefectCode(@RequestParam("defectCode") String defectCode) {
return R.data(phenomenonService.getFdpTaskByDefectCode(defectCode));
}
+
+ /**
+ * 缺陷记录统计
+ */
+ @GetMapping("/getDefectListStatistics")
+ @ApiOperation(value = "缺陷记录统计", notes = "传入时间")
+ public R> getDefectListStatistics(String startTime, String endTime, Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ return R.fail("暂无权限查看,请稍后重试");
+ }
+ List list=phenomenonService.getDefectListStatistics(startTime,endTime,deptId);
+ return R.data(list);
+ }
+
+ /**
+ * 缺陷记录统计
+ */
+ @GetMapping("/importDefectListStatistics")
+ @ApiOperation(value = "导出", notes = "传入时间")
+ public void importDefectListStatistics(HttpServletResponse response, String startTime, String endTime, Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ throw new ServiceException ("暂无权限查看,请稍后重试");
+ }
+ List list=phenomenonService.getDefectListStatistics(startTime,endTime,deptId);
+ // 下载导出
+ String filename = "(" + startTime+"-"+endTime + ")缺陷统计表";
+ // 设置头信息
+ response.setCharacterEncoding("UTF-8");
+ response.setContentType("application/vnd.ms-excel");
+ try {
+ //设置xlsx格式
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xlsx", "UTF-8"));
+ //创建一个输出流
+ EasyExcel.write(response.getOutputStream(), CheckVoteChartVo.class).autoCloseStream(Boolean.TRUE).sheet(1,"缺陷统计表")
+ .doWrite(list);
+ response.getOutputStream().close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperPhenomenonService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperPhenomenonService.java
index 3b3f6d0..1f3bf57 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperPhenomenonService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperPhenomenonService.java
@@ -4,14 +4,12 @@ import com.hnac.hzims.fdp.entity.FdpTaskEntity;
import com.hnac.hzims.operational.defect.dto.OperMainDefectDTO;
import com.hnac.hzims.operational.defect.dto.OperPhenomenonDTO;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
-import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO;
import com.hnac.hzims.operational.duty.vo.MainOperPhenomenonVo;
+import com.hnac.hzims.operational.report.vo.CheckVoteChartVo;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import org.springblade.core.mp.base.BaseService;
-import org.springblade.core.tool.api.R;
import org.springblade.flow.core.entity.BladeFlow;
-import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@@ -95,4 +93,6 @@ public interface IOperPhenomenonService extends BaseService getDefectListStatistics(String startTime, String endTime, Long deptId);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
index 83097ad..ebca68e 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
@@ -12,8 +12,6 @@ import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
-import com.hnac.hzims.operational.access.service.IOperAccessPlanService;
-import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.defect.constants.TreatMethodConstant;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
@@ -26,7 +24,6 @@ import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.service.IOperDefectStatisticsService;
import com.hnac.hzims.operational.defect.vo.SolveHomeVO;
import com.hnac.hzims.operational.util.TimeUtils;
-import com.hnac.hzims.ticket.repair.fegin.IRepairClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
@@ -42,7 +39,6 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.system.cache.DictCache;
import org.springblade.system.feign.ISysClient;
-import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -72,6 +68,7 @@ public class DefectCheckServiceImpl extends BaseServiceImpl getQueryWrapper(OperDefectStatisticsVO statistics) {
LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new OperDefectStatisticsEntity(),statistics);
if(Func.isNotEmpty(statistics)) {
+ if (Func.isNotEmpty(statistics.getDefectCodeList())) {
+ queryWrapper.in(OperDefectStatisticsEntity::getDefectCode, statistics.getDefectCodeList());
+ }
if (statistics.getActStartTime() != null) {
queryWrapper.ge(OperDefectStatisticsEntity::getActStartTime, statistics.getActStartTime());
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java
index cf8acfa..4032dff 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java
@@ -3,12 +3,12 @@ package com.hnac.hzims.operational.defect.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.fdp.entity.FdpTaskEntity;
import com.hnac.hzims.fdp.feign.IFdpTaskClient;
import com.hnac.hzims.operational.defect.config.DefectConfiguration;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
-import com.hnac.hzims.operational.defect.constants.RepairConstant;
import com.hnac.hzims.operational.defect.dto.OperMainDefectDTO;
import com.hnac.hzims.operational.defect.dto.OperPhenomenonDTO;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
@@ -20,16 +20,13 @@ import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.service.IOperDefectStatisticsService;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO;
-import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper;
import com.hnac.hzims.operational.duty.vo.MainOperPhenomenonVo;
+import com.hnac.hzims.operational.report.vo.CheckVoteChartVo;
import com.hnac.hzims.operational.report.vo.DutyDefectVO;
-import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity;
import com.hnac.hzims.operational.util.GenerateCode;
-import com.hnac.hzims.ticket.repair.entity.RepairEntity;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.core.mp.support.Condition;
import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLock;
import org.springblade.core.secure.utils.AuthUtil;
@@ -43,6 +40,8 @@ import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.flow.core.utils.TaskUtil;
import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache;
+import org.springblade.system.entity.Dept;
+import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
@@ -67,6 +66,8 @@ import java.util.stream.Collectors;
public class OperPhenomenonServiceImpl extends BaseServiceImpl implements IOperPhenomenonService,GenerateCode{
@Autowired
+ private ISysClient sysClient;
+ @Autowired
private IFlowClient flowClient;
@Autowired
@@ -546,8 +547,7 @@ public class OperPhenomenonServiceImpl extends BaseServiceImplString.valueOf(o.getId())).collect(Collectors.joining(",")));
defectVO.setDefectSum(operPhenomenonList.size());
// 消缺数
- List defectList = operPhenomenonList.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())).
- map(OperPhenomenonEntity::getId).collect(Collectors.toList());
+ List defectList = operPhenomenonList.stream().filter(defect -> !ObjectUtil.isEmpty(defect.getHandleTaskId())).map(OperPhenomenonEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(defectList)){
defectVO.setDefect(0);
return defectVO;
@@ -582,4 +582,65 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl getDefectListStatistics(String startTime, String endTime, Long deptId) {
+ List operPhenomenonEntities;
+ R> deptByCurrentUser = sysClient.getDeptByCurrentUser();
+ List deptIds;
+ if (deptByCurrentUser.isSuccess() && CollectionUtil.isNotEmpty(deptByCurrentUser.getData())) {
+ deptIds = deptByCurrentUser.getData().stream().map(s -> s.getId()).collect(Collectors.toList());
+ } else {
+ throw new ServiceException("暂无机构权限");
+ }
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ if (ObjectUtil.isNotEmpty(deptId)) {
+ if (deptIds.contains(deptId)) {
+ queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptId);
+ } else {
+ throw new ServiceException("暂无该机构权限");
+ }
+ } else {
+ queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptIds);
+ }
+ queryWrapper.ge(ObjectUtils.isNotNull(startTime), "CREATE_TIME", startTime);
+ queryWrapper.le(ObjectUtils.isNotNull(endTime), "CREATE_TIME", endTime);
+ operPhenomenonEntities = baseMapper.selectList(queryWrapper);
+
+ List res = new ArrayList<>();
+ if (CollectionUtil.isNotEmpty(operPhenomenonEntities)) {
+ CheckVoteChartVo all = getCheckVoteChartVo(operPhenomenonEntities);
+ all.setName("总计");
+ res.add(all);
+ Map> collect = Optional.ofNullable(operPhenomenonEntities).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getCreateDept));
+ for (Map.Entry> longListEntry : collect.entrySet()) {
+ CheckVoteChartVo chartVo= getCheckVoteChartVo(longListEntry.getValue());
+ R deptName = sysClient.getDeptName(longListEntry.getKey());
+ chartVo.setName(deptName.isSuccess() ? deptName.getData() : "");
+ res.add(chartVo);
+ }
+ } else {
+ CheckVoteChartVo all = new CheckVoteChartVo();
+ all.setName("总计");
+ res.add(all);
+ }
+ return res;
+ }
+
+ private CheckVoteChartVo getCheckVoteChartVo(List list) {
+ CheckVoteChartVo voteChartVo = new CheckVoteChartVo();
+ List checkIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getIsDefect() !=null).filter(s -> s.getIsDefect() == 1).map(s -> s.getDefectCode()).collect(Collectors.toList());
+ List handerIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getIsDefect() !=null).filter(s -> "1".equals(s.getHandleStatus())).map(s -> s.getDefectCode()).collect(Collectors.toList());
+ List conclusionIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getIsDefect() !=null).filter(s -> "1".equals(s.getConclusionStatus())).map(s -> s.getDefectCode()).collect(Collectors.toList());
+ voteChartVo.setPhenomenonNum(list.size());
+ voteChartVo.setPhenomenonIds(list.stream().map(s -> s.getDefectCode()).collect(Collectors.toList()));
+ voteChartVo.setDefectNum(checkIds.size());
+ voteChartVo.setDefectIds(checkIds);
+ voteChartVo.setHandleNum(handerIds.size());
+ voteChartVo.setHandleIds(handerIds);
+ voteChartVo.setConclusionNum(conclusionIds.size());
+ voteChartVo.setConclusionIds(conclusionIds);
+ return voteChartVo;
+ }
+
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java
index 326bb0b..5cac3e6 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java
@@ -1,12 +1,10 @@
package com.hnac.hzims.operational.defect.wrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity;
import com.hnac.hzims.operational.defect.vo.OperDefectStatisticsVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
-import org.springblade.system.entity.Dept;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
@@ -30,19 +28,22 @@ public class OperDefectStatisticsWrapper extends BaseEntityWrapper> analyzeDataByAnalyzeCode = searchClient.getAnalyzeDataByAnalyzeCode(analyzeDataCondition);
+ if(!analyzeDataByAnalyzeCode.isSuccess()) {
+ throw new ServiceException("设备数据查询异常,请检查好配置后重试!");
+ }
return analyzeDataByAnalyzeCode;
}
@@ -131,6 +134,9 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl personWrapper = new LambdaQueryWrapper();
personWrapper.eq(ImsDutyMainPersonEntity::getCreateDept, deptId);
+ personWrapper.like(ImsDutyMainPersonEntity::getDutyDate, yearAndMonth);
List deptPersonList = imsDutyMainPersonMapper.selectList(personWrapper);
// 获取本月天数
@@ -1438,13 +1439,15 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl list = imsDutyGroupPService.list(groupPWrapper);
managerName = deptUserMap.get(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId());
- personIds = list.stream().map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList());
+ personIds = list.stream()
+// 过滤出组长
+ .filter(s->!s.getPersonId().equals(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId()))
+ .map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList());
} else {
// 不存在分组id从排班人员中获取组长和组员
List personList = deptPersonList.stream().filter(var -> var.getDutyMainId().equals(imsDutyMainEntity.getId())).collect(Collectors.toList());
-
managerName = deptUserMap.get(personList.get(0).getDutyChargePerson());
- personIds = personList.stream().map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList());
+ personIds = personList.stream().filter(s->!s.getDutyPerson().equals(personList.get(0).getDutyChargePerson())).map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList());
}
String personNames = "";
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/utils/ExcelTool.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/utils/ExcelTool.java
new file mode 100644
index 0000000..a0d56b3
--- /dev/null
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/utils/ExcelTool.java
@@ -0,0 +1,27 @@
+package com.hnac.hzims.operational.duty.utils;
+
+import org.apache.poi.ss.SpreadsheetVersion;
+
+import java.lang.reflect.Field;
+
+/**
+ * 设置Excel导出的最大字符数
+ * @author tanghaihao
+ * @date 2023年08月18日 16:40
+ */
+public class ExcelTool {
+
+ public static void resetCellMaxTextLength() {
+ SpreadsheetVersion excel2007 = SpreadsheetVersion.EXCEL2007;
+ if (Integer.MAX_VALUE != excel2007.getMaxTextLength()) {
+ Field field;
+ try {
+ field = excel2007.getClass().getDeclaredField("_maxTextLength");
+ field.setAccessible(true);
+ field.set(excel2007, Integer.MAX_VALUE);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainReportController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainReportController.java
index 105b5dd..f8520ed 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainReportController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainReportController.java
@@ -9,14 +9,12 @@ import com.hnac.hzims.operational.access.constants.AccessConstants;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
-import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
+import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IOperDefectService;
+import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.main.bo.OperationalReportBO;
-import com.hnac.hzims.operational.main.service.IMainReportService;
import com.hnac.hzims.operational.main.vo.DefectReportVO;
import com.hnac.hzims.operational.main.vo.OperationalReportVO;
-import com.hnac.hzims.operational.report.vo.PersonalMonthReportVO;
-import com.hnac.hzims.operational.report.vo.StationReportAllVO;
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
@@ -55,7 +53,7 @@ public class MainReportController extends BladeController {
private final IOperMaintenanceTaskService maintenanceTaskService;
private final IOperAccessTaskService accessTaskService;
-
+ private final IOperPhenomenonService operPhenomenonService;
@ApiLog
@ApiOperationSupport(order = 10)
@@ -68,16 +66,16 @@ public class MainReportController extends BladeController {
Date startTime = DateUtil.parse(startDate, DateUtil.PATTERN_DATE);
Date endTime = DateUtil.plusDays(DateUtil.parse(endDate, DateUtil.PATTERN_DATE), 1);
- List list = defectService.list(new LambdaQueryWrapper() {{
- gt(OperDefectEntity::getCreateTime, startTime);
- le(OperDefectEntity::getCreateTime, endTime);
+ List list = operPhenomenonService.list(new LambdaQueryWrapper() {{
+ ge(OperPhenomenonEntity::getCreateTime, startTime);
+ le(OperPhenomenonEntity::getCreateTime, endTime);
}});
if (CollectionUtil.isEmpty(list)) {
return R.data(new HashMap<>());
}
//按照日期将查询结果分类
- Map> map = list.stream().collect(Collectors.groupingBy(o -> DateUtil.formatDate(o.getCreateTime())));
+ Map> map = list.stream().collect(Collectors.groupingBy(o -> DateUtil.formatDate(o.getCreateTime())));
Map data = new TreeMap<>();
Date date = DateUtil.plusDays(startTime, 0);
do {
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainWorkBenchController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainWorkBenchController.java
index baa7595..9f5cf5a 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainWorkBenchController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainWorkBenchController.java
@@ -87,12 +87,19 @@ public class MainWorkBenchController extends BladeController {
* 根据用户权限获取路由
*
* @return
- */
@ApiLog
@ApiOperationSupport(order = 50)
@ApiOperation("获取路由")
@PostMapping("/getHomePageWorkBench")
public R getHomePageWorkBench(@Valid @RequestBody RoutingParamVo vo) {
return R.data(workBenchService.getHomePageWorkBench(vo));
+ }*/
+
+ @ApiLog
+ @ApiOperationSupport(order = 60)
+ @ApiOperation("首页工作台路由")
+ @PostMapping("/getHomePageWorkBench")
+ public R homeStagingRoute(@Valid @RequestBody RoutingParamVo vo) {
+ return R.data(workBenchService.route(vo));
}
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.java
index 173a0cc..76449c6 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.java
@@ -26,4 +26,6 @@ public interface MainWorkBenchMapper extends UserDataScopeBaseMapper stationTypes,List deptList,@Param("excludeDept") Long excludeDept,@Param("ascriptionUser") Long ascriptionUser);
List selectMainWorkBenchByTypes(@Param(value = "type") String type,@Param(value = "refDomains") List refDomains,@Param("refTerminal") String refTerminal,@Param("stationTypes") List stationTypes);
+
+ List stagingRoute(@Param("terminal") String terminal,@Param("types") List types,@Param("category") int category);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.xml
index b5b700f..9d43528 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.xml
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.xml
@@ -94,5 +94,15 @@
order by ord
-
+
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IMainWorkBenchService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IMainWorkBenchService.java
index cc9e0cd..f52a203 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IMainWorkBenchService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IMainWorkBenchService.java
@@ -38,4 +38,5 @@ public interface IMainWorkBenchService extends BaseService
InDustryVo getHomePageWorkBench(RoutingParamVo vo);
+ InDustryVo route(RoutingParamVo vo);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java
index e750044..e9a531c 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java
@@ -539,6 +539,7 @@ public class AppHomeServiceImpl implements IAppHomeService {
e.printStackTrace();
Thread.currentThread().interrupt();
}
+ pool.shutdown();
// 任务完成率
int taskSum = item.getDefectSum() + item.getInspectionTaskCount() + item.getMaintenanceTaskCount() + item.getOverhaulTaskCount();
int finishSum = item.getSolvedCount() + item.getInspectionTaskFinishCount() + item.getMaintenanceTaskFinishCount() + item.getOverhaulTaskFinishCount();
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java
index 592fae1..f09e610 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java
@@ -491,10 +491,12 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
ticketChartCell.setTicketName(value.getFileName());
if (value.getTicketType() == 2) {
List yearTicketCollect = Optional.ofNullable(yearTicket.getData()).orElse(new ArrayList<>()).stream()
+ .filter(s -> s.getSignageCode() != null)
.filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getType().equals(value.getType())).collect(Collectors.toList());
List monthTicketCollect = Optional.ofNullable(monthTicket.getData()).orElse(new ArrayList<>()).stream()
- .filter(s -> s.getSignageCode().equals(stationId))
+ .filter(s -> s.getSignageCode() != null)
+ .filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getType().equals(value.getType())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(yearTicketCollect)) {
//年合格率和数量
@@ -521,10 +523,12 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
}
if (value.getTicketType() == 1) {
List yearOperateCollect = Optional.ofNullable(yearOperateTicket.getData()).orElse(new ArrayList<>()).stream()
+ .filter(s -> s.getSignageCode() != null)
.filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getTicketType().equals(value.getType())).collect(Collectors.toList());
List monthOperateCollect = Optional.ofNullable(monthOperateTicket.getData()).orElse(new ArrayList<>()).stream()
- .filter(s -> s.getSignageCode().equals(stationId))
+ .filter(s -> s.getSignageCode() != null)
+ .filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getTicketType().equals(value.getType())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(yearOperateCollect)) {
//年合格率和数量
@@ -590,8 +594,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
ticketMap2.put("info", "合格率");
ticketMap.put("ticketMon" + ticketType, String.valueOf(chartCell.getTicketMon()));
ticketMap.put("ticketYear" + ticketType, String.valueOf(chartCell.getTicketYear()));
- ticketMap2.put("ticketMon" + ticketType, chartCell.getTicketMonPerc()* 100 + "%");
- ticketMap2.put("ticketYear" + ticketType, chartCell.getTicketYeaPercr()* 100 + "%");
+ ticketMap2.put("ticketMon" + ticketType, new BigDecimal(chartCell.getTicketMonPerc()).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() + "%");
+ ticketMap2.put("ticketYear" + ticketType,new BigDecimal(chartCell.getTicketYeaPercr()).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()+ "%");
}
ticketListRes.add(ticketMap);
ticketListRes.add(ticketMap2);
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
index 717f72e..f047a22 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
@@ -474,6 +474,7 @@ public class HomeServiceImpl implements HomeService {
e.printStackTrace();
Thread.currentThread().interrupt();
}
+ exe.shutdown();
return target;
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java
index 732f6ce..3ff6723 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java
@@ -26,6 +26,7 @@ import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
+import org.springblade.system.user.cache.UserCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -64,6 +65,9 @@ public class MainWorkBenchServiceImpl extends BaseServiceImpl pages = super.page(Condition.getPage(query), lambdaQueryWrapper);
IPage vos = MainWorkBenchWrapper.builder().pageVO(pages);
@@ -173,7 +177,7 @@ public class MainWorkBenchServiceImpl extends BaseServiceImpl list = this.baseMapper.selectMainWorkBenchByType(deptCategory.toString(), null, vo.getRefTerminal(), stations.stream().map(StationEntity::getType).collect(Collectors.toList()), deptList,dept.getId(),user.getUserId());
+ List list = this.baseMapper.selectMainWorkBenchByType(deptCategory.toString(), null, vo.getRefTerminal(), stations.stream().map(StationEntity::getType).distinct().collect(Collectors.toList()), deptList,dept.getId(),user.getUserId());
// 路由列表包含指定用户,过滤非指定用户数据
boolean isDesign = CollectionUtil.isNotEmpty(list.stream().filter(o->StringUtils.isNotEmpty(o.getAscriptionUser())).collect(Collectors.toList()));
if(isDesign){
@@ -184,4 +188,76 @@ public class MainWorkBenchServiceImpl extends BaseServiceImpl stations = stationService.list();
+ if(CollectionUtil.isEmpty(stations)){
+ return new InDustryVo();
+ }
+ List types = stations.stream().map(StationEntity::getType).distinct().collect(Collectors.toList());
+ // 用户权限机构
+ R> result = sysClient.getDeptByCurrentUser();
+ if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
+ return new InDustryVo();
+ }
+ // 首页分类
+ int category = this.userCategory(result.getData());
+ List routes = this.baseMapper.stagingRoute(terminal,types,category);
+ if(CollectionUtil.isEmpty(routes)){
+ return new InDustryVo();
+ }
+ // 所属机构
+ List depts = result.getData().stream().map(o->o.getId().toString()).collect(Collectors.toList());
+ // 所属用户
+ String user = AuthUtil.getUserId().toString();
+ InDustryVo dustry = new InDustryVo();
+ MainWorkBenchExtendVo workBench = new MainWorkBenchExtendVo();
+ if(CollectionUtil.isEmpty(routes.stream().filter(o->StringUtils.isNotEmpty(o.getRefDept())).collect(Collectors.toList())) &&
+ CollectionUtil.isEmpty(routes.stream().filter(o->StringUtils.isNotEmpty(o.getAscriptionUser())).collect(Collectors.toList()))){
+ // 设置结果集
+ workBench.setMainWorkBenchEntityList(routes);
+ }else if(CollectionUtil.isEmpty(routes.stream().filter(o->StringUtils.isNotEmpty(o.getRefDept())).collect(Collectors.toList()))){
+ // 设置结果集
+ workBench.setMainWorkBenchEntityList(routes.stream().filter(o->o.getAscriptionUser().contains(user)).collect(Collectors.toList()));
+ }else{
+ // 设置结果集
+ workBench.setMainWorkBenchEntityList(routes.stream().filter(o->{
+ for(String deptId: depts) {
+ if (o.getRefDept().contains(deptId)) {
+ return true;
+ }
+ }
+ return false;
+ }).collect(Collectors.toList()));
+ }
+ if(CollectionUtil.isEmpty(workBench.getMainWorkBenchEntityList())){
+ workBench.setMainWorkBenchEntityList(routes.stream().filter(o-> StringUtils.isEmpty(o.getAscriptionUser()) && StringUtils.isEmpty(o.getRefDept())).collect(Collectors.toList()));
+ }
+ dustry.setMainWorkBenchExtendVo(workBench);
+ return dustry;
+ }
+
+ /**
+ * 用户所属机构分类
+ * @return
+ */
+ private int userCategory(List depts) {
+ Dept dept = depts.stream().min(Comparator.comparing(Dept::getDeptCategory)).get();
+ if(ObjectUtil.isEmpty(dept)){
+ return HomePageConstant.STATION;
+ }
+ return dept.getDeptCategory();
+ }
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java
index 49ef934..0f53e7e 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java
@@ -1,42 +1,44 @@
package com.hnac.hzims.operational.maintenance.controller;
+import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.invalid.DictInvalid;
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
-import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant;
import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.scheduled.MaintenanceTaskCreateTask;
import com.hnac.hzims.operational.maintenance.scheduled.MaintenanceTaskPushMsg;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO;
-import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
-import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo;
-import io.swagger.annotations.*;
+import com.hnac.hzims.vo.VoteChartVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
-import org.springblade.core.mp.support.Query;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.vo.ComleteTask;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.web.SortDefault;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
+import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
+import java.io.IOException;
+import java.net.URLEncoder;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -105,15 +107,15 @@ public class OperMaintenanceTaskController extends BladeController {
* 分页
*/
@ApiLog
- @GetMapping("/list")
+ @PostMapping("/list")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:refLibraryId,processInstanceId,disposer,content,status")
@ApiImplicitParams({
})
@OperationAnnotation(moduleName = "日常维护", title = "日常维护记录", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE,
action = "分页查询日常维护记录列表")
- public R> list(OperMaintenanceTaskDTO req, Query query) {
- return taskService.list(req, query);
+ public R> list(@RequestBody OperMaintenanceTaskDTO req) {
+ return taskService.list(req);
}
@@ -161,6 +163,47 @@ public class OperMaintenanceTaskController extends BladeController {
return taskService.deleteTaskBatch(taskIdList);
}
+ /**
+ * 日常计划统计
+ */
+ @GetMapping("/getMaintenanceListStatistics")
+ @ApiOperation(value = "日常计划统计", notes = "传入时间")
+ public R> getMaintenanceListStatistics(String startTime, String endTime,Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ return R.fail("暂无权限查看,请稍后重试");
+ }
+ List list=taskService.getMaintenanceListStatistics(startTime,endTime,deptId);
+ return R.data(list);
+ }
+
+ /**
+ * 日常计划统计
+ */
+ @GetMapping("/importMaintenanceListStatistics")
+ @ApiOperation(value = "导出", notes = "传入时间")
+ public void importMaintenanceListStatistics(HttpServletResponse response, String startTime, String endTime,Long deptId) {
+ if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){
+ throw new ServiceException("暂无权限查看,请稍后重试");
+ }
+ List list=taskService.getMaintenanceListStatistics(startTime,endTime,deptId);
+ // 下载导出
+ String filename = "(" + startTime+"-"+endTime + ")日常维护计划统计表";
+ // 设置头信息
+ response.setCharacterEncoding("UTF-8");
+ response.setContentType("application/vnd.ms-excel");
+ try {
+ //设置xlsx格式
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xlsx", "UTF-8"));
+ //创建一个输出流
+ EasyExcel.write(response.getOutputStream(), VoteChartVo.class).autoCloseStream(Boolean.TRUE).sheet(1,"日常计划统计")
+ .doWrite(list);
+ response.getOutputStream().close();
+ // 关闭
+ response.getOutputStream().close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java
index b4d081e..4bf6352 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java
@@ -94,7 +94,7 @@ public class MaintenanceTaskCreateTask {
//生成日常巡检任务并插入数据库
for (int i = startIndex; i < endIndex; i++) {
- this.generateTaskByPlan(planEntities.get(i));
+ this.generateTaskByPlan(planEntities.get(i),true);
}
Thread.sleep(1000);
@@ -110,18 +110,18 @@ public class MaintenanceTaskCreateTask {
* @param planEntity
* @return
*/
- public void generateTaskByPlan(OperMaintenancePlanEntity planEntity) {
+ public void generateTaskByPlan(OperMaintenancePlanEntity planEntity,Boolean flag) {
OperMaintenanceTaskEntity taskEntity = BeanUtil.copy(planEntity,OperMaintenanceTaskEntity.class);
//拆分设备 每个设备生成一条任务
if(StringUtil.isNotBlank(planEntity.getEmCode())){
List emCodeList = Arrays.asList(planEntity.getEmCode().split(","));
for(String emCode : emCodeList){
taskEntity.setEmCode(emCode);
- maintenanceService.fillTask(taskEntity,planEntity);
+ maintenanceService.fillTask(taskEntity,planEntity,flag);
}
}
else {
- maintenanceService.fillTask(taskEntity,planEntity);
+ maintenanceService.fillTask(taskEntity,planEntity,flag);
}
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java
index c821f1c..d4f10e1 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java
@@ -2,16 +2,16 @@ package com.hnac.hzims.operational.maintenance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.hnac.hzims.operational.main.vo.RegularWorkVO;
import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO;
-import com.hnac.hzims.operational.main.vo.RegularWorkVO;
import com.hnac.hzims.operational.report.vo.MaintenanceReportVO;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskWithAreaVo;
import com.hnac.hzims.vo.SafeCheckStatisticVO;
+import com.hnac.hzims.vo.VoteChartVo;
import org.springblade.core.mp.base.BaseService;
-import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.web.bind.annotation.RequestParam;
@@ -31,7 +31,7 @@ public interface IOperMaintenanceTaskService extends BaseService detail(@RequestParam Long id);
- R> list(OperMaintenanceTaskDTO req, Query query);
+ R> list(OperMaintenanceTaskDTO req);
String genTaskCode(Integer num);
@@ -96,4 +96,5 @@ public interface IOperMaintenanceTaskService extends BaseService queryLogMaintenancePageList(Page pageParam, MaintenanceTaskWithAreaVo areaMonthlyVo);
+ List getMaintenanceListStatistics(String startTime, String endTime,Long deptId);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java
index c370508..d58df2a 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java
@@ -38,5 +38,5 @@ public interface MaintenanceService {
* @param taskEntity
* @param finalPlanEntity
*/
- void fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity);
+ void fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity,Boolean flag);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java
index 8983c96..a884ff5 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java
@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.utils.DateUtil;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
-import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import com.hnac.hzims.message.fegin.IMessageClient;
@@ -34,8 +33,6 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.system.feign.ISysClient;
-import org.springblade.system.user.cache.UserCache;
-import org.springblade.system.user.entity.User;
import org.springframework.beans.BeanUtils;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service;
@@ -51,10 +48,8 @@ import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;
-import java.util.stream.Stream;
import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE;
@@ -273,13 +268,13 @@ public class MaintenanceServiceImpl implements MaintenanceService {
//拆分设备 每个设备生成一条任务
if (StringUtil.isNotBlank(finalPlanEntity.getEmCode())) {
log.info("finalPlanEntity.getEmCode() : {}", finalPlanEntity.getEmCode());
- List emCodeList = Arrays.asList(finalPlanEntity.getEmCode().split(","));
+ String[] emCodeList = finalPlanEntity.getEmCode().split(",");
for (String emCode : emCodeList) {
taskEntity.setEmCode(emCode);
- this.fillTask(taskEntity, finalPlanEntity);
+ this.fillTask(taskEntity, finalPlanEntity,false);
}
} else {
- this.fillTask(taskEntity, finalPlanEntity);
+ this.fillTask(taskEntity, finalPlanEntity,false);
}
}
@@ -291,7 +286,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
* @param taskEntity
* @param finalPlanEntity
*/
- public void fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity) {
+ public void fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity,Boolean flag) {
DefaultTransactionDefinition defaultTransactionDefinition = new DefaultTransactionDefinition();
defaultTransactionDefinition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
TransactionStatus transaction = dataSourceTransactionManager.getTransaction(defaultTransactionDefinition);
@@ -327,7 +322,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
taskService.save(taskEntity);
dataSourceTransactionManager.commit(transaction);
//启动流程
- String processInstanceId = this.startProcess(finalPlanEntity.getProcDefId(), taskEntity);
+ String processInstanceId = this.startProcess(finalPlanEntity.getProcDefId(), taskEntity,flag);
//推送消息
CompletableFuture operMaintenanceTaskEntityCompletableFuture =
CompletableFuture.runAsync(() -> {
@@ -354,28 +349,36 @@ public class MaintenanceServiceImpl implements MaintenanceService {
*
* @author xiashandong
**/
- private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity) {
+ private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity,Boolean flag) {
OperMaintenanceTaskEntityVo operMaintenanceTaskEntityVo = new OperMaintenanceTaskEntityVo();
BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo);
Map params = new HashMap<>();
params.put("taskId", taskEntity.getId());
- List userIdList = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList());
- String taskUsers = userIdList.stream().filter(o -> StringUtils.isNotBlank(o)).map(s -> {
- return "taskUser_".concat(s);
- }).collect(Collectors.joining(","));
- params.put("initUserIds", taskUsers);
+ if(flag){
+ params.put("startFlowUserId", taskEntity.getCreateUser().toString());
+ }
+ String[] userArr = taskEntity.getDisposer().split(",");
+ for(int index = 0; index < userArr.length ; index++){
+ if(index > 4){
+ continue;
+ }
+ if(index > 0){
+ params.put("initUserIds" + index , "taskUser_".concat(userArr[index]));
+ }else{
+ params.put("initUserIds", "taskUser_".concat(userArr[index]));
+ }
+ }
params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo);
-
return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId();
}
- /**
- * 推送日常维护任务消息
- *
- * @return void
+ /*
+ 推送日常维护任务消息
+
+ @return void
* @Param taskEntity 日常维护任务
- **/
+ */
private void pushTaskMessage(OperMaintenanceTaskEntity taskEntity) {
log.info("开始保存{}的日常维护消息推送记录", taskEntity.getDisposer());
R templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId());
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java
index 59297a6..2099a87 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java
@@ -108,7 +108,7 @@ public class OperMaintenancePlanServiceImpl extends BaseServiceImpl {
try{
- schedule.generateTaskByPlan(planEntity);
+ schedule.generateTaskByPlan(planEntity,false);
//更新任务派发时间
this.update(new LambdaUpdateWrapper().set(OperMaintenancePlanEntity::getCreateTaskTime,new Date())
.eq(OperMaintenancePlanEntity::getId,planEntity.getId()));
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
index 87178e9..dab8118 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
@@ -25,6 +26,7 @@ import com.hnac.hzims.safeproduct.feign.IDangerSourceClient;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskWithAreaVo;
import com.hnac.hzims.vo.SafeCheckStatisticVO;
+import com.hnac.hzims.vo.VoteChartVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@@ -40,6 +42,8 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.flow.core.vo.EndVo;
import org.springblade.system.cache.DictCache;
+import org.springblade.system.entity.Dept;
+import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
@@ -70,6 +74,8 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl> list(OperMaintenanceTaskDTO req, Query query) {
+ public R> list(OperMaintenanceTaskDTO req) {
+ Query query=new Query();
+ query.setSize(req.getSize());
+ query.setCurrent(req.getCurrent());
Wrapper queryWrapper = new LambdaQueryWrapper() {{
orderByDesc(OperMaintenanceTaskEntity::getDisposeTime);
if (StringUtil.isNotBlank(req.getTaskIds())) {
in(OperMaintenanceTaskEntity::getId, Lists.newArrayList(req.getTaskIds().split(",")));
}
+ if (CollectionUtil.isNotEmpty(req.getTaskList())) {
+ in(OperMaintenanceTaskEntity::getId, req.getTaskList());
+ }
if (req.getRefLibraryId() != null) {
eq(OperMaintenanceTaskEntity::getRefLibraryId, req.getRefLibraryId());
}
@@ -126,7 +138,7 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl getMaintenanceListStatistics(String startTime, String endTime,Long deptId) {
+ List maintenanceTaskEntities = new ArrayList<>();
+ R> deptByCurrentUser = sysClient.getDeptByCurrentUser();
+ List deptIds;
+ if (deptByCurrentUser.isSuccess() && CollectionUtil.isNotEmpty(deptByCurrentUser.getData())) {
+ deptIds = deptByCurrentUser.getData().stream().map(s -> s.getId()).collect(Collectors.toList());
+ } else {
+ throw new ServiceException("暂无机构权限");
+ }
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ if (ObjectUtil.isNotEmpty(deptId)) {
+ if (deptIds.contains(deptId)) {
+ queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptId);
+ } else {
+ throw new ServiceException("暂无该机构权限");
+ }
+ } else {
+ queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptIds);
+ }
+ queryWrapper.ge(ObjectUtils.isNotNull(startTime), "CREATE_TIME", startTime);
+ queryWrapper.le(ObjectUtils.isNotNull(endTime), "CREATE_TIME", endTime);
+ maintenanceTaskEntities = baseMapper.selectList(queryWrapper);
+
+ List res = new ArrayList<>();
+ if (CollectionUtil.isNotEmpty(maintenanceTaskEntities)) {
+ VoteChartVo all = getVoteChartVo(maintenanceTaskEntities);
+ all.setName("总计");
+ res.add(all);
+ Map> collect = Optional.ofNullable(maintenanceTaskEntities).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(OperMaintenanceTaskEntity::getCreateDept));
+ for (Map.Entry> longListEntry : collect.entrySet()) {
+ VoteChartVo voteChartVo = getVoteChartVo(longListEntry.getValue());
+ R deptName = sysClient.getDeptName(longListEntry.getKey());
+ voteChartVo.setName(deptName.isSuccess() ? deptName.getData() : "");
+ res.add(voteChartVo);
+ }
+ } else {
+ VoteChartVo all = new VoteChartVo();
+ all.setName("总计");
+ res.add(all);
+ }
+ return res;
+ }
+
+ private VoteChartVo getVoteChartVo(List list) {
+ VoteChartVo voteChartVo = new VoteChartVo();
+ List finishIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() == 3).map(s -> s.getId()).collect(Collectors.toList());
+ List undoneIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() != 3).map(s -> s.getId()).collect(Collectors.toList());
+ voteChartVo.setSumNum(list.size());
+ voteChartVo.setSumIds(list.stream().map(s -> s.getId()).collect(Collectors.toList()));
+ voteChartVo.setFinishNum(finishIds.size());
+ voteChartVo.setFinishIds(finishIds);
+ voteChartVo.setUndoneNum(undoneIds.size());
+ voteChartVo.setUndoneIds(undoneIds);
+ return voteChartVo;
+ }
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
index df67928..37d83d0 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
@@ -450,7 +450,6 @@ public class StationServiceImpl extends BaseServiceImpl getStationType(Integer serveType, List typeList, List departIdList,boolean make) {
return this.list(new LambdaQueryWrapper() {{
- eq(StationEntity::getIsDeleted, 0);
if (ObjectUtil.isNotEmpty(serveType)) {
eq(StationEntity::getServeType, serveType);
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
index 4da8447..f67d3ea 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
@@ -28,16 +28,14 @@ import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO;
import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO;
import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO;
import com.hnac.hzims.ticket.standardTicket.wrapper.StandardTicketInfoWrapper;
-import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo;
-import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo;
import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo;
import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo;
+import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo;
import com.hnac.hzims.ticket.utils.ExcelUtil;
import com.hnac.hzims.ticket.utils.PdfUtils;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService;
import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
-import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -680,7 +678,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl operateTicketReportStatistic = this.baseMapper.getOperateTicketReportStatistic(startDate, endDate, deptIdList);
if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) {
//已完成数量
- int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(ticket -> TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(ticket.getStatus())).collect(Collectors.toList()).size();
+ int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName())).collect(Collectors.toList()).size();
//合格数量
int ticketInfoQualifiedNum = operateTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size();
//计算合格率
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
index b207705..441dad5 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
@@ -47,7 +47,6 @@ import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -58,7 +57,6 @@ import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
-import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -885,13 +883,12 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl workTicketReportStatistic = this.baseMapper.getWorkTicketReportStatistic(startDate, endDate, deptIdList);
if(CollectionUtil.isNotEmpty(workTicketReportStatistic)) {
// 工作票完成数量
- int ticketInfoCompleteNum = workTicketReportStatistic.stream().filter(
- ticket-> WorkTicketConstants.FirstWorkTicketStatusEnum.FINISH.getStatus().equals(ticket.getStatus())
- ).collect(Collectors.toList()).size();
+ int ticketInfoCompleteNum = workTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName()))
+ .collect(Collectors.toList()).size();
// 工作票未完成数量
int ticketInfoStartNum = workTicketReportStatistic.size() - ticketInfoCompleteNum;
// 延期数量统计
- int ticketInfoDelayNum = workTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getDelayId()))
+ int ticketInfoDelayNum = workTicketReportStatistic.stream().filter(item -> "延期".equals(item.getInput()))
.collect(Collectors.toList()).size();
// 合格数量统计
int ticketInfoQualifiedNum = workTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && ticket.getEvaluation().intValue() == 1)