| | |
| | | package com.fzzy.group.manager; |
| | | |
| | | import com.fzzy.common.manager.CommonManager; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.FoodVariety; |
| | | import com.fzzy.igds.constant.RespCodeEnum; |
| | | import com.fzzy.igds.data.*; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.domain.DicArea; |
| | | import com.fzzy.igds.domain.InoutRecord; |
| | | import com.fzzy.igds.domain.*; |
| | | import com.fzzy.igds.service.*; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.fzzy.igds.utils.NumberUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public class GroupManager { |
| | | |
| | | @Resource |
| | | private CommonManager commonManager; |
| | | @Resource |
| | | private DicAreaService dicAreaService; |
| | | @Resource |
| | | private CoreDeptService deptService; |
| | |
| | | private CoreCompanyService coreCompanyService; |
| | | @Resource |
| | | private InoutRecordService inoutRecordService; |
| | | @Resource |
| | | private EventInfoService eventInfoService; |
| | | @Resource |
| | | private SnapRecordService snapRecordService; |
| | | |
| | | /** |
| | | * 获取省及下属市州集合 |
| | |
| | | List<Depot> depotList; |
| | | for (Dept dept : deptList) { |
| | | deptData = new GroupDeptData(); |
| | | deptData.setDeptId(dept.getId()); |
| | | deptData.setDeptName(dept.getKqmc()); |
| | | deptData.setCode(dept.getXzqhdm()); |
| | | deptData.setCounty(dept.getXzqhmc()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //统计AI事件数量 |
| | | IgdsBaseParam igdsParam = new IgdsBaseParam(); |
| | | igdsParam.setDeptId(dept.getId()); |
| | | igdsParam.setCompanyId(param.getCompanyId()); |
| | | igdsParam.setStart(DateUtil.getNewByDay(new Date(), -6)); |
| | | igdsParam.setEnd(DateUtil.getNextZero(new Date())); |
| | | List<EventInfo> enevtList = eventInfoService.getListByParam(igdsParam); |
| | | if (null != enevtList && !enevtList.isEmpty()) { |
| | | deptData.setWarnNum7(enevtList.size()); |
| | | for (EventInfo eventInfo : enevtList) { |
| | | if(DateFormatUtils.format(new Date(), "yyyyMMdd").equals(DateFormatUtils.format(eventInfo.getTime(), "yyyyMMdd"))){ |
| | | deptData.setDailyTotal(deptData.getDailyTotal() + 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | list.add(deptData); |
| | | } |
| | | } |
| | |
| | | |
| | | return groupGisData; |
| | | } |
| | | |
| | | /** |
| | | * 大屏首页-抓拍跟踪信息 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<List<SnapRecord>> indexSnapList(IgdsBaseParam param) { |
| | | |
| | | param.setStart(DateUtil.getNewByDay(new Date(), -10)); |
| | | param.setEnd(new Date()); |
| | | List<SnapRecord> listSnap = snapRecordService.getListByParam(param); |
| | | |
| | | if (null != listSnap && !listSnap.isEmpty()) { |
| | | //判断文件是否存在 |
| | | for (SnapRecord record : listSnap) { |
| | | record.setImgName(commonManager.isImgExit( record.getImgName(), null)); |
| | | } |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, listSnap); |
| | | } |
| | | } |