Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
tyty 1 year ago
parent
commit
694c2fc84f
  1. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/DefectService.java
  2. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/PhenomenonService.java
  3. 24
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DefectServiceImpl.java
  4. 30
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java
  5. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java
  6. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java
  7. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java

1
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<OperDefectEntity> { public interface DefectService extends BaseService<OperDefectEntity> {
SolveHomeVO solve_count(List<Long> deptIds, String start, String end);
} }

3
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; package com.hnac.hzims.scheduled.service.operation.business;
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 org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
@ -12,6 +13,8 @@ import java.util.List;
*/ */
public interface PhenomenonService extends BaseService<OperPhenomenonEntity> { public interface PhenomenonService extends BaseService<OperPhenomenonEntity> {
SolveHomeVO solve_count(List<Long> deptIds, String start, String end);
DutyDefectVO defect(String start, String end, List<Long> areas); DutyDefectVO defect(String start, String end, List<Long> areas);
ShortagesVo defectMonth(String start, String end, List<Long> list); ShortagesVo defectMonth(String start, String end, List<Long> list);

24
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 @AllArgsConstructor
public class DefectServiceImpl extends BaseServiceImpl<DefectMapper, OperDefectEntity> implements DefectService { public class DefectServiceImpl extends BaseServiceImpl<DefectMapper, OperDefectEntity> implements DefectService {
/**
* 消缺数量统计
* @param deptIds
* @param start
* @param end
* @return
*/
@Override
public SolveHomeVO solve_count(List<Long> deptIds, String start, String end) {
SolveHomeVO solve = new SolveHomeVO();
List<OperDefectEntity> defects = this.list(Wrappers.<OperDefectEntity>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;
}
} }

30
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; 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

3
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 OtherService otherService;
private final AccessService accessService; private final AccessService accessService;
private final TicketService ticketService; private final TicketService ticketService;
private final DefectService defectService;
private final DutyService dutyService; private final DutyService dutyService;
private final StationService stationService; private final StationService stationService;
private final OverDetailsService detailsService; private final OverDetailsService detailsService;
@ -397,7 +396,7 @@ public class ShowServiceImpl implements ShowService {
}); });
// 消缺率 // 消缺率
exe.execute(() -> { 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){ 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()); target.setTaget_three(BigDecimal.valueOf((double)solve.getSolveCount() / solve.getDefectCount() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}else{ }else{

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java

@ -547,8 +547,7 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl<OperPhenomenonMap
defectVO.setTotalIds(operPhenomenonList.stream().map(o->String.valueOf(o.getId())).collect(Collectors.joining(","))); defectVO.setTotalIds(operPhenomenonList.stream().map(o->String.valueOf(o.getId())).collect(Collectors.joining(",")));
defectVO.setDefectSum(operPhenomenonList.size()); defectVO.setDefectSum(operPhenomenonList.size());
// 消缺数 // 消缺数
List<Long> defectList = operPhenomenonList.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())). List<Long> defectList = operPhenomenonList.stream().filter(defect -> !ObjectUtil.isEmpty(defect.getHandleTaskId())).map(OperPhenomenonEntity::getId).collect(Collectors.toList());
map(OperPhenomenonEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(defectList)){ if(CollectionUtil.isEmpty(defectList)){
defectVO.setDefect(0); defectVO.setDefect(0);
return defectVO; return defectVO;

1
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(); e.printStackTrace();
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
exe.shutdown();
return target; return target;
} }

Loading…
Cancel
Save