| | |
| | | item.setPlaceCheckId(placeCheck.getId()); |
| | | item.setCreateUser(AuthUtil.getUserId()); |
| | | }); |
| | | List<PatrolRecord> collect = patrolRecordVOList.stream().filter(item -> item.getState().equals(0)).collect(Collectors.toList()); |
| | | boolean b = bean.saveBatch(collect); |
| | | updateById(placeCheck); |
| | | if (b) { |
| | | // 隐患问题大于0 则创建任务 |
| | | try { |
| | | Integer integer = number.get(); |
| | | if (integer > 0) { |
| | | // 保存任务表 |
| | | ITaskService bean2 = SpringUtils.getBean(ITaskService.class); |
| | | Long aLong = bean2.saveTask(CommonConstant.NUMBER_FOUR, DictConstant.FIRE_RECTIFICATION_NOTICE, 1, |
| | | "", AuthUtil.getUserId(), placeCheck.getHouseCode(), CommonConstant.NUMBER_EIGHT,4); |
| | | if (aLong > 0) { |
| | | // 保存任务详情表 |
| | | ITaskPlaceRectificationService bean1 = SpringUtil.getBean(ITaskPlaceRectificationService.class); |
| | | TaskPlaceRectificationEntity copy = BeanUtil.copy(placeCheck, TaskPlaceRectificationEntity.class); |
| | | copy.setTaskId(aLong); |
| | | copy.setPlaceCheckId(placeCheck.getId()); |
| | | copy.setId(null); |
| | | copy.setStatus(4); |
| | | bean1.save(copy); |
| | | // List<PatrolRecord> collect = patrolRecordVOList.stream().filter(item -> item.getState().equals(0)).collect(Collectors.toList()); |
| | | if (patrolRecordVOList != null && patrolRecordVOList.size() > 0) { |
| | | boolean b = bean.saveBatch(patrolRecordVOList); |
| | | if (b) { |
| | | // 隐患问题大于0 则创建任务 |
| | | try { |
| | | Integer integer = number.get(); |
| | | if (integer > 0) { |
| | | // 保存任务表 |
| | | ITaskService bean2 = SpringUtils.getBean(ITaskService.class); |
| | | Long aLong = bean2.saveTask(CommonConstant.NUMBER_FOUR, DictConstant.FIRE_RECTIFICATION_NOTICE, 1, |
| | | "", AuthUtil.getUserId(), placeCheck.getHouseCode(), CommonConstant.NUMBER_EIGHT, 4); |
| | | if (aLong > 0) { |
| | | // 保存任务详情表 |
| | | ITaskPlaceRectificationService bean1 = SpringUtil.getBean(ITaskPlaceRectificationService.class); |
| | | TaskPlaceRectificationEntity copy = BeanUtil.copy(placeCheck, TaskPlaceRectificationEntity.class); |
| | | copy.setTaskId(aLong); |
| | | copy.setPlaceCheckId(placeCheck.getId()); |
| | | copy.setId(null); |
| | | copy.setStatus(4); |
| | | bean1.save(copy); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("任务保存失败!", e); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("任务保存失败!", e); |
| | | return b; |
| | | } |
| | | return b; |
| | | } |
| | | throw new Exception("保存失败!"); |
| | | return save; |
| | | } |
| | | return false; |
| | | } |