| | |
| | | import java.util.Arrays;
|
| | | import java.util.List;
|
| | | import java.util.UUID;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | import static com.ruoyi.constant.MenuAuthority.EVENT_LIST_ADD;
|
| | |
|
| | |
|
| | | @Slf4j
|
| | |
| | | public AjaxResult updateData(MeetingStatistic meetingStatistic) {
|
| | | ZfLog zfLog = new ZfLog();
|
| | | zfLog.setUpdateTime(LocalDateTime.now());
|
| | | zfLog.setModule("会议审批");
|
| | | zfLog.setModule("会议统计");
|
| | | zfLog.setUpdater(zInfoUserService.getMyself().getNickName());
|
| | | zfLogService.save(zfLog);
|
| | | System.out.println("===================================="+meetingStatistic);
|
| | |
| | | MeetingStatistic dataById = getById(meetingStatistic.getId());
|
| | |
|
| | | //先到es中查询到对应那条数据在es的id
|
| | | EsModel esResult = esSer.findByCtId(dataById.getId().intValue(), "会议");
|
| | | EsModel esResult = esSer.findByCtId(dataById.getId().intValue(), "会议统计");
|
| | | System.out.println("===================================="+meetingStatistic);
|
| | | if (esResult == null){
|
| | | return AjaxResult.success();
|
| | |
| | | if (meetingStatisticService.removeByIds(Arrays.asList(ids))) {
|
| | | //删除es中的数据
|
| | | meetings.stream().forEach(meeting -> {
|
| | | EsModel esModel = esSer.findByCtId((meeting.getId().intValue()), "会议");
|
| | | EsModel esModel = esSer.findByCtId((meeting.getId().intValue()), "会议统计");
|
| | | if (esModel != null){
|
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
|
| | | try {
|
| | |
| | | ZInfoUser myself = zInfoUserService.getMyself();
|
| | | Long familyId = myself.getFamilyId();
|
| | |
|
| | | if(familyId == null){
|
| | | throw new RuntimeException("您还未加入任何家庭");
|
| | | }
|
| | |
|
| | | List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | List<Long> familyIdList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST_ADD)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | familyIdList.add(familyId);
|
| | |
|
| | | if (meetingStatistic.getFamilyId()!=null && !familyIdList.contains(meetingStatistic.getFamilyId())) {
|
| | | throw new RuntimeException("你没有权限操作此家庭的数据");
|
| | | }
|
| | |
|
| | |
|
| | | if(meetingStatistic.getFamilyId() == null){
|
| | | //默认添加自己家庭的数据
|
| | | meetingStatistic.setFamilyId(familyId);
|
| | | }
|
| | | // if(familyId == null){
|
| | | // throw new RuntimeException("您还未加入任何家庭");
|
| | | // }
|
| | | //
|
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | // List<Long> familyIdList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST_ADD)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | // familyIdList.add(familyId);
|
| | | //
|
| | | // if (meetingStatistic.getFamilyId()!=null && !familyIdList.contains(meetingStatistic.getFamilyId())) {
|
| | | // throw new RuntimeException("你没有权限操作此家庭的数据");
|
| | | // }
|
| | | //
|
| | | //
|
| | | // if(meetingStatistic.getFamilyId() == null){
|
| | | // //默认添加自己家庭的数据
|
| | | // meetingStatistic.setFamilyId(familyId);
|
| | | // }
|
| | |
|
| | | //判断是否有重复数据
|
| | | LambdaQueryWrapper<MeetingStatistic> lqw = uniqueCondition(meetingStatistic);
|