|
|
@ -1,7 +1,10 @@ |
|
|
|
package com.hnac.hzims.scheduled.service.operation.business.impl; |
|
|
|
package com.hnac.hzims.scheduled.service.operation.business.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
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.entity.OperPhenomenonEntity; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.defect.vo.SolveHomeVO; |
|
|
|
import com.hnac.hzims.operational.main.vo.ShortagesVo; |
|
|
|
import com.hnac.hzims.operational.main.vo.ShortagesVo; |
|
|
|
import com.hnac.hzims.operational.report.vo.DutyDefectVO; |
|
|
|
import com.hnac.hzims.operational.report.vo.DutyDefectVO; |
|
|
|
import com.hnac.hzims.scheduled.mapper.operation.PhenomenonMapper; |
|
|
|
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.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
@ -28,6 +32,32 @@ import java.util.stream.Collectors; |
|
|
|
public class PhenomenonServiceImpl extends BaseServiceImpl<PhenomenonMapper, OperPhenomenonEntity> implements PhenomenonService { |
|
|
|
public class PhenomenonServiceImpl extends BaseServiceImpl<PhenomenonMapper, OperPhenomenonEntity> implements PhenomenonService { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|
|
|
|
* 消缺数量统计 |
|
|
|
|
|
|
|
* @param deptIds |
|
|
|
|
|
|
|
* @param start |
|
|
|
|
|
|
|
* @param end |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public SolveHomeVO solve_count(List<Long> deptIds, String start, String end) { |
|
|
|
|
|
|
|
SolveHomeVO solve = new SolveHomeVO(); |
|
|
|
|
|
|
|
List<OperPhenomenonEntity> defects = this.list(Wrappers.<OperPhenomenonEntity>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 start |
|
|
|
* @param end |
|
|
|
* @param end |
|
|
|