| | |
| | | if (Objects.isNull(form.getPointId())) { |
| | | throw new RuntimeException("点位不能为空"); |
| | | } |
| | | Long userId = SecurityUtils.getUserId(); |
| | | YwPeople people = new LambdaQueryChainWrapper<>(peopleMapper).eq(YwPeople::getUserId, userId).one(); |
| | | form.setPeopleId(people.getId()); |
| | | form.setUnitId(people.getBelongUnit()); |
| | | Integer unitId = SecurityUtils.getUnitId(); |
| | | if (Objects.isNull(unitId)) { |
| | | throw new RuntimeException("非运维单位暂时无法报备"); |
| | | } |
| | | form.setUnitId(unitId); |
| | | if ("事前报备".equals(form.getReportType())) { |
| | | // 如果是事前报备需要检验是否已经生成下发工单 |
| | | YwPointVO point = ywpointMapper.countNotFinishedWorkOrderByGb(form.getPointId()); |
| | |
| | | @SneakyThrows |
| | | @Transactional |
| | | public Result importData(ReportForm form) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | YwPeople people = new LambdaQueryChainWrapper<>(peopleMapper).eq(YwPeople::getUserId, userId).one(); |
| | | form.setPeopleId(people.getId()); |
| | | form.setUnitId(people.getBelongUnit()); |
| | | Integer unitId = SecurityUtils.getUnitId(); |
| | | if (Objects.isNull(unitId)) { |
| | | throw new RuntimeException("非运维单位暂时无法报备"); |
| | | } |
| | | form.setUnitId(unitId); |
| | | form.setBeginCreateTime(DateUtils.parseDate(form.getBeginCreateTimeStr())); |
| | | form.setEndCreateTime(DateUtils.parseDate(form.getEndCreateTimeStr())); |
| | | // 读取excel数据 |