zqy
2024-04-30 3ea4e6f426596aef381c6753058398d3d4515a6f
zhang-content/src/main/java/com/ruoyi/service/impl/MeetingStatisticServiceImpl.java
@@ -20,9 +20,6 @@
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
@@ -65,7 +62,7 @@
    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);
@@ -74,7 +71,7 @@
            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();
@@ -139,7 +136,7 @@
        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 {
@@ -168,23 +165,23 @@
        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);