screen-api/src/main/java/com/moral/api/service/OrganizationService.java
@@ -2,6 +2,7 @@ import com.moral.api.entity.Organization; import com.baomidou.mybatisplus.extension.service.IService; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -34,6 +35,11 @@ Organization getOrganizationById(Integer id); /** * 查询关联组织信息 * @param organizationId * @return */ List<Integer> orgIdList( Integer organizationId); } screen-api/src/main/java/com/moral/api/service/UserService.java
@@ -54,6 +54,7 @@ boolean updateUserId(Integer userId); // 小程序推送 void pushOneUser(Allocation appAllocationPushUserCond); } screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -127,7 +127,7 @@ //单号 String allocationNum = "JBD-" + dateString + String.format("%04d", i); allocation.setAllocationNum(allocationNum); if(Objects.nonNull(allocationCond.getEscalationUnitId())&& escalationType(allocationCond.getEscalationUnitId())) { if(Objects.nonNull(allocationCond.getEscalationUnitId())&& !allocationCond.getEscalationUnitId().equals(allocationCond.getUnitId()) && escalationType(allocationCond.getEscalationUnitId())) { allocation.setEscalationType(AllocationEscalationTypeEnum.CHECK.getValue()); } if(NEW_BUILT.equals(allocationCond.getState())) { @@ -138,7 +138,7 @@ //推送数据 userService.pushOneUser(allocation); redisTemplate.opsForValue().set(RedisConstants.JBD_DATA,i); if(NEW_BUILT.equals(allocationCond.getState())) { if(NEW_BUILT.equals(allocationCond.getState())||AllocationApproveEnum.UNDER_RECTIFICATION.value.equals(allocationCond.getState())) { //添加流程数据 ApproveTable approveTable = new ApproveTable(); approveTable.setRelationId(allocation.getAllocationId()); @@ -795,10 +795,10 @@ //添加流程数据 ApproveTable approveTable = new ApproveTable(); approveTable.setRelationId(allocation.getAllocationId()); approveTable.setState(NEW_BUILT); approveTable.setApproveModule(FileTableEnum.ALLOCATION_FOUNDATION.value); /* approveTable.setState(NEW_BUILT); approveTable.setStateName("新建"); approveTableService.saveResult(approveTable); approveTableService.saveResult(approveTable);*/ approveTable.setState(AllocationApproveEnum.UNDER_RECTIFICATION.value); approveTable.setStateName(AllocationApproveEnum.UNDER_RECTIFICATION.name); approveTableService.saveResult(approveTable); screen-api/src/main/java/com/moral/api/service/impl/HistorySecondUavServiceImpl.java
@@ -27,6 +27,7 @@ import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; import java.util.stream.Collectors; /** * <p> @@ -59,28 +60,27 @@ public List<Date> queryDate(Integer organizationId) { //构造查询条件 QueryWrapper<HistorySecondUav> queryWrapper = new QueryWrapper<>(); //List<Integer> childrenId = new ArrayList<>(); List<Integer> children = organizationService.orgIdList(organizationId); //获取子组织id List<Organization> children = organizationService.getChildrenOrganizationsById(organizationId); /*List<Organization> children = organizationService.getChildrenOrganizationsById(organizationId); List<Integer> childrenId = new ArrayList<>(); for (Organization child : children) { childrenId.add(child.getId()); } childrenId.add(organizationId); queryWrapper.in("organization_id", childrenId); childrenId.add(organizationId);*/ queryWrapper.in("organization_id", children); //设置查询时间范围为180天 Date endDate = new Date(); Date startDate = DateUtils.addDays(endDate, -180); queryWrapper.between("batch", startDate, endDate); //设置查询字段 queryWrapper.select("DISTINCT batch"); queryWrapper.select("DISTINCT DATE_FORMAT(batch,'%Y-%m-%d') batch "); queryWrapper.orderByDesc("batch"); //查询结果 List<HistorySecondUav> historySecondUavs = historySecondUavMapper.selectList(queryWrapper); //结果转为Date集合 List<Date> result = new ArrayList<>(); for (HistorySecondUav historySecondUav : historySecondUavs) { result.add(historySecondUav.getBatch()); } List<Date> result = historySecondUavs.stream().map(HistorySecondUav::getBatch).collect(Collectors.toList()); return result; } @@ -94,12 +94,9 @@ Date endDate = form.getEndDate(); QueryWrapper<HistorySecondUav> wrapper = new QueryWrapper<>(); //获取子组织id List<Organization> children = organizationService.getChildrenOrganizationsById(organizationId); List<Integer> children = organizationService.orgIdList(organizationId); List<Integer> childrenId = new ArrayList<>(); for (Organization child : children) { childrenId.add(child.getId()); } childrenId.add(organizationId); childrenId.addAll(children); childrenId.addAll(integerList); wrapper.in("organization_id", childrenId); //查询根据batch查,因为可能会有跨天飞行的情况。 screen-api/src/main/java/com/moral/api/service/impl/OrganizationServiceImpl.java
@@ -71,4 +71,9 @@ return; } } @Override public List<Integer> orgIdList(Integer organizationId) { return this.baseMapper.orgIdList(organizationId); } } screen-api/src/main/resources/word/???????.docxBinary files differ