| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.mapper.ZfEventMapper; |
| | | import com.ruoyi.service.ZAuthorityService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfEventService; |
| | | import com.ruoyi.service.*; |
| | | import com.ruoyi.util.ArraysUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Resource |
| | | ZAuthorityService zAuthorityService; |
| | | |
| | | //加入到es中 |
| | | @Resource |
| | | private esService esSer; |
| | | private LambdaQueryWrapper<ZfEvent> buildCondition(ZfEvent zfEvent,List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfEvent> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.orderByDesc(ZfEvent::getCreateTime); |
| | |
| | | } |
| | | |
| | | if (save(zfEvent)) { |
| | | // 飞 加入 |
| | | EsModel esModel = new EsModel(); |
| | | Integer inte = zfEvent.getId(); |
| | | String uuid = UUID.randomUUID().toString().replace("-",""); |
| | | esModel.setId(uuid); |
| | | esModel.setCtId(Long.valueOf(inte)); |
| | | esModel.setCtName(zfEvent.getTitle()); |
| | | esModel.setCtContent(zfEvent.getAddress()); |
| | | esModel.setBy1(zfEvent.getRemark()); |
| | | |
| | | // esModel.setCtTableName("tb_ajk"); |
| | | // esModel.setCtName("大家"); |
| | | // esModel.setCtContent("大家好,才是真的好");//处事由 |
| | | esSer.insertTable(esModel); |
| | | return AjaxResult.success(); |
| | | } else { |
| | | return AjaxResult.error(); |
| | |
| | | |
| | | } |
| | | |
| | | @Resource |
| | | ZfLogService zfLogService; |
| | | |
| | | @Override |
| | | public AjaxResult updateData(ZfEvent zfEvent) { |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | |
| | | throw new RuntimeException("你没有权限操作此家庭的数据"); |
| | | } |
| | | |
| | | //操作后加入日志 |
| | | ZfLog zfLog = new ZfLog(); |
| | | zfLog.setUpdateTime(LocalDateTime.now()); |
| | | zfLog.setModule("家大事记"); |
| | | zfLog.setUpdater(zInfoUserService.getMyself().getNickName()); |
| | | zfLogService.save(zfLog); |
| | | |
| | | if(updateById(zfEvent)){ |
| | | return AjaxResult.success(); |
| | | }else { |