|
|
@ -1,16 +1,15 @@ |
|
|
|
package com.ccsens.health.service; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.lang.Snowflake; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.ccsens.health.bean.dto.AbnormalDto; |
|
|
|
import com.ccsens.health.bean.dto.JourneyDto; |
|
|
|
import com.ccsens.health.bean.po.HealthAbnormal; |
|
|
|
import com.ccsens.health.bean.vo.AbnormalVo; |
|
|
|
import com.ccsens.health.persist.dao.HealthAbnormalDao; |
|
|
|
import com.ccsens.util.CodeEnum; |
|
|
|
import com.ccsens.util.DateUtil; |
|
|
|
import com.ccsens.util.bean.dto.QueryDto; |
|
|
|
import com.ccsens.util.exception.BaseException; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
@ -20,7 +19,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Slf4j |
|
|
@ -40,11 +39,22 @@ public class AbnormalService implements IAbnormalService{ |
|
|
|
@Override |
|
|
|
public List<AbnormalVo.AbnormalOverview> abnormalOverview(QueryDto<AbnormalDto.SelectAbnormal> params) throws Exception { |
|
|
|
AbnormalDto.SelectAbnormal selectAbnormal = params.getParam(); |
|
|
|
// Long startTime = selectAbnormal.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectAbnormal.getStartTime();
|
|
|
|
// Long endTime = selectAbnormal.getEndTime() == null ? System.currentTimeMillis() : selectAbnormal.getEndTime();
|
|
|
|
|
|
|
|
List<AbnormalVo.AbnormalOverview> abnormalOverviewList = |
|
|
|
List<AbnormalVo.AbnormalOverview> abnormalOverviewList = new ArrayList<>(); |
|
|
|
//人员异常
|
|
|
|
abnormalOverviewList = |
|
|
|
healthAbnormalDao.abnormalOverview(selectAbnormal.getDepartment(),selectAbnormal.getStartTime(),selectAbnormal.getEndTime()); |
|
|
|
if(CollectionUtil.isNotEmpty(abnormalOverviewList)){ |
|
|
|
for(AbnormalVo.AbnormalOverview abnormalOverview : abnormalOverviewList){ |
|
|
|
abnormalOverview.setAbnormalType(1); |
|
|
|
} |
|
|
|
} |
|
|
|
//行程异常
|
|
|
|
int journeyNumber = healthAbnormalDao.selectJourneyNumber(selectAbnormal.getDepartment(),selectAbnormal.getStartTime(),selectAbnormal.getEndTime()); |
|
|
|
AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview(); |
|
|
|
abnormalOverview.setAbnormalType(2); |
|
|
|
abnormalOverview.setCode(5); |
|
|
|
abnormalOverview.setNumber(journeyNumber); |
|
|
|
abnormalOverviewList.add(abnormalOverview); |
|
|
|
|
|
|
|
return abnormalOverviewList; |
|
|
|
} |
|
|
|