Merge remote-tracking branch 'origin/master'
| | |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 通用上传请求(多个) |
| | | // */ |
| | | // @PostMapping("/uploads") |
| | | // public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception |
| | | // { |
| | | // try |
| | | // { |
| | | // // 上传文件路径 |
| | | // String filePath = RuoYiConfig.getUploadPath(); |
| | | // List<String> urls = new ArrayList<String>(); |
| | | // List<String> fileNames = new ArrayList<String>(); |
| | | // List<String> newFileNames = new ArrayList<String>(); |
| | | // List<String> originalFilenames = new ArrayList<String>(); |
| | | // for (MultipartFile file : files) |
| | | // { |
| | | // // 上传并返回新文件名称 |
| | | // String fileName = FileUploadUtils.upload(filePath, file); |
| | | // String url = serverConfig.getUrl() + fileName; |
| | | // urls.add(url); |
| | | // fileNames.add(fileName); |
| | | // newFileNames.add(FileUtils.getName(fileName)); |
| | | // originalFilenames.add(file.getOriginalFilename()); |
| | | // } |
| | | // AjaxResult ajax = AjaxResult.success(); |
| | | // ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | // ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | // ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | // ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | // return ajax; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // return AjaxResult.error(e.getMessage()); |
| | | // } |
| | | // } |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @PostMapping("/uploads") |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files) throws Exception |
| | | { |
| | | //System.out.println("99999999999999999999999990000000000000000"); |
| | | try |
| | | { |
| | | // 上传文件路径 |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> newFileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | // System.out.println("99999999999999999999999990000000000000000"); |
| | | // System.out.println(files); |
| | | // System.out.println(files.size()); |
| | | |
| | | for (MultipartFile file : files) |
| | | { |
| | | // 上传并返回新文件名称 |
| | | String filename = ""; |
| | | // System.out.println("1122123330+++++++++++++++++++++++++++++"); |
| | | |
| | | String fileName = FileUploadUtils.upload(filePath, file, filename); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // System.out.println("99999999999999999999999990000000000000000"); |
| | | |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | // System.out.println("1122123330+++++++++++++++++++++++++++++"); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 本地资源通用下载 |
| | |
| | | import java.util.Set; |
| | | |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import com.ruoyi.framework.web.domain.server.Sys; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | System.out.println(permissions); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | |
| | | public AjaxResult getRouters() |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | System.out.println("9222222222kkkkkkkkkkksssssssssssssssssss"); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);//这里之后已经生成了树形结构 |
| | | System.out.println(menus); |
| | | return AjaxResult.success(menuService.buildMenus(menus));//这里之后就封装好了发给前端的vo |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import com.ruoyi.common.core.domain.entity.sysUserInfo; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfFamily; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfFamilyService; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | @Resource |
| | | private ZfFamilyService zfFamilyService; |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | |
| | | @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | public AjaxResult add(@Validated @RequestBody sysUserInfo userAll) |
| | | { |
| | | SysUser user = new SysUser(); |
| | | user.setUserId(userAll.getUserId()); |
| | | user.setAvatar(userAll.getAvatar()); |
| | | user.setPassword(userAll.getPassword()); |
| | | user.setNickName(userAll.getNickName()); |
| | | user.setUserName(userAll.getUserName()); |
| | | user.setPhonenumber(userAll.getPhonenumber()); |
| | | user.setRoleId(userAll.getRoleId()); |
| | | user.setRoleIds(userAll.getRoleIds()); |
| | | user.setStatus(userAll.getStatus()); |
| | | user.setSex(userAll.getSex()); |
| | | user.setRemark(userAll.getRemark()); |
| | | user.setUpdateBy(userAll.getUpdateBy()); |
| | | user.setPostIds(userAll.getPostIds()); |
| | | // user.set |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | //写入到 新建立的信息表里面 |
| | | |
| | | ZfFamily zfFamily = zfFamilyService.getByFamId(userAll.getFamilyId()); |
| | | ZInfoUser infoUser = new ZInfoUser(); |
| | | infoUser.setUserId(user.getUserId()); |
| | | infoUser.setNickName(user.getNickName()); |
| | | infoUser.setPhoneNumber(user.getPhonenumber()); |
| | | infoUser.setSex(user.getSex()=="男"?1:0); |
| | | infoUser.setFamilyId(userAll.getFamilyId()); |
| | | if(zfFamily!=null) { |
| | | infoUser.setFatherId(zfFamily.getFid()); |
| | | // infoUser.setMomId(zfFamily.getMid()); |
| | | } |
| | | System.out.println("-----"); |
| | | System.out.println(userAll.getIsMyFamily()); |
| | | infoUser.setIsMyFamily(userAll.getIsMyFamily()); |
| | | if(userAll.getSpouseId()==0) |
| | | infoUser.setSpouseId(null); |
| | | else { |
| | | infoUser.setSpouseId(userAll.getSpouseId()); |
| | | |
| | | } |
| | | //前端保证了角色不为空 |
| | | if(user.getRoleIds()[0]==102) |
| | | infoUser.setRoleId(3L); |
| | | // infoUser.setRoleName(user.g); |
| | | if(userAll.getFamilyId()!=-1) { |
| | | zInfoUserService.saveOrUpdate(infoUser); |
| | | LambdaQueryWrapper<ZInfoUser> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZInfoUser::getSpouseId, userAll.getSpouseId()); |
| | | List<ZInfoUser> lis = zInfoUserService.list(lqw); |
| | | if(lis.size()>0) { |
| | | // ZInfoUser zi = new ZInfoUser(); |
| | | // zi.setUserId(userAll.getSpouseId()); |
| | | // // UpdateWrapper wrapper = new UpdateWrapper(); |
| | | // zi.setSpouseId(lis.get(0).getUserId()); |
| | | // System.out.println(userAll.getSpouseId()); |
| | | // System.out.println(lis.get(0).getUserId()); |
| | | zInfoUserService.lambdaUpdate().eq(ZInfoUser::getUserId, userAll.getSpouseId()) |
| | | .set(ZInfoUser::getSpouseId, lis.get(0).getUserId()) |
| | | .update(); |
| | | } |
| | | } |
| | | return toAjax(userService.insertUser(user)); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | public AjaxResult remove(@PathVariable Long[] userIds) |
| | | public AjaxResult remove(@PathVariable("userIds") Long[] userIds) |
| | | { |
| | | if (ArrayUtils.contains(userIds, getUserId())) |
| | | { |
New file |
| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.domain.LiveStreaming; |
| | | import com.ruoyi.service.LiveStreamingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/zLiveStreamingBack") |
| | | public class LiveStreamingBackController extends BaseController { |
| | | @Autowired |
| | | private LiveStreamingService liveStreamingService; |
| | | |
| | | @GetMapping("/all") |
| | | public AjaxResult listAll(LiveStreaming liveStreaming){ |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return liveStreamingService.selectDataList(liveStreaming, pageNum, pageSize); |
| | | } |
| | | /** |
| | | * 通过id获取直播回放详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(liveStreamingService.getById(id)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.domain.LiveStreaming; |
| | | |
| | | import com.ruoyi.service.LiveStreamingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/zLiveStreaming") |
| | | public class LiveStreamingController extends BaseController { |
| | | @Autowired |
| | | private LiveStreamingService liveStreamingService; |
| | | |
| | | @GetMapping("/all") |
| | | public AjaxResult listAll(LiveStreaming liveStreaming){ |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return liveStreamingService.selectDataList(liveStreaming, pageNum, pageSize); |
| | | } |
| | | /** |
| | | * 通过id获取直播详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(liveStreamingService.getById(id)); |
| | | } |
| | | /** |
| | | * 新增直播 |
| | | */ |
| | | @Log(title = "直播", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody LiveStreaming liveStreaming) |
| | | { |
| | | return liveStreamingService.addData(liveStreaming); |
| | | } |
| | | } |
| | |
| | | //新增或修改基本信息 |
| | | @PostMapping() |
| | | public AjaxResult updateData(@RequestBody MarryInfoDto marryInfoDto){ |
| | | |
| | | System.out.println("==========="); |
| | | return marrySelfService.updateData(marryInfoDto); |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.web.controller.zhang;
|
| | |
|
| | | import com.ruoyi.common.annotation.Log;
|
| | | import com.ruoyi.common.core.controller.BaseController;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.common.enums.BusinessType;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.domain.Meeting;
|
| | | import com.ruoyi.domain.ZfEvent;
|
| | | import com.ruoyi.domain.excel.ZfEventExcelBean;
|
| | | import com.ruoyi.service.MeetingService;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | |
|
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
|
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
|
| | |
|
| | | /**
|
| | | * <p>
|
| | | * 前端控制器
|
| | | * </p>
|
| | | *
|
| | | * @author ojq
|
| | | * @since 2023-03-12
|
| | | */
|
| | | @Slf4j
|
| | | @RestController
|
| | | @RequestMapping("/zMeeting")
|
| | | public class MeetingController extends BaseController {
|
| | | @Autowired
|
| | | private MeetingService meetingService;
|
| | |
|
| | | @GetMapping("/all")
|
| | | public AjaxResult listAll(Meeting meeting){
|
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
|
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
| | | return meetingService.selectDataList(meeting, pageNum, pageSize);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取会议记录详细信息
|
| | | */
|
| | | @GetMapping(value = "/{id}")
|
| | | public AjaxResult getInfo(@PathVariable("id") Long id) {
|
| | | return success(meetingService.getById(id));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增会议记录
|
| | | */
|
| | | @Log(title = "会议记录", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody Meeting meeting)
|
| | | {
|
| | | return meetingService.addData(meeting);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取导入模板
|
| | | */
|
| | | @PostMapping("/model")
|
| | | public void getExportModel(HttpServletResponse response){
|
| | | List<Meeting> list = Collections.singletonList(new Meeting());
|
| | | ExcelUtil<Meeting> util = new ExcelUtil<>(Meeting.class);
|
| | | util.exportExcel(response,list,"会议导入模板");
|
| | | }
|
| | |
|
| | | /**
|
| | | * 导出会议记录列表
|
| | | */
|
| | | @Log(title = "会议记录", businessType = BusinessType.EXPORT)
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, Meeting meeting) {
|
| | | List<Meeting> list = new ArrayList<>();
|
| | |
|
| | | list = meetingService.selectByCondition(meeting);
|
| | | log.info("导出记录为:{}", list);
|
| | | ExcelUtil<Meeting> util = new ExcelUtil<>(Meeting.class);
|
| | | util.exportExcel(response, list, "会议记录数据");
|
| | |
|
| | | }
|
| | | /**
|
| | | * 导出会议记录列表
|
| | | */
|
| | | // @PreAuthorize("@ss.hasPermi('system:property:export')")
|
| | | @Log(title = "家庭大事件记录", businessType = BusinessType.EXPORT)
|
| | | @PostMapping("/export1/{ids}")
|
| | | public void export(HttpServletResponse response, @PathVariable Long[] ids) {
|
| | | List<Meeting> list = meetingService.selectByIds(ids);
|
| | | log.info("导出记录为:{}", list);
|
| | | ExcelUtil<Meeting> util = new ExcelUtil<>(Meeting.class);
|
| | | util.exportExcel(response, list, "会议记录数据");
|
| | |
|
| | | }
|
| | | /**
|
| | | * 修改会议记录
|
| | | */
|
| | | @Log(title = "会议记录", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody Meeting meeting) {
|
| | | return meetingService.updateData(meeting);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 批量删除会议记录
|
| | | */
|
| | | @Log(title = "会议记录", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{ids}")
|
| | | public AjaxResult remove(@PathVariable Long[] ids) {
|
| | | return meetingService.deleteData(ids);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 导入会议记录列表
|
| | | */
|
| | | @Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
| | | @PostMapping("/importData")
|
| | | public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception {
|
| | | return meetingService.importExcel(file);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.web.controller.zhang;
|
| | |
|
| | | import com.ruoyi.common.annotation.Log;
|
| | | import com.ruoyi.common.core.controller.BaseController;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.common.enums.BusinessType;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.domain.Meeting;
|
| | | import com.ruoyi.service.MeetingRatifyService;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
|
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
|
| | |
|
| | | @Slf4j
|
| | | @RestController
|
| | | @RequestMapping("/zMeetingRatify")
|
| | | public class MeetingRatifyController extends BaseController {
|
| | | @Autowired
|
| | | private MeetingRatifyService meetingRatifyService;
|
| | |
|
| | | @Log(title = "会议审批", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody Meeting meeting) {
|
| | | return meetingRatifyService.updateData(meeting);
|
| | | }
|
| | |
|
| | | @GetMapping("/all")
|
| | | public AjaxResult listAll(Meeting meeting){
|
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
|
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
| | | return meetingRatifyService.selectDataList(meeting, pageNum, pageSize);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.web.controller.zhang;
|
| | |
|
| | | import com.ruoyi.common.annotation.Log;
|
| | | import com.ruoyi.common.core.controller.BaseController;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.common.enums.BusinessType;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.domain.MeetingStatistic;
|
| | | import com.ruoyi.service.MeetingStatisticService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
|
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
|
| | |
|
| | | @RestController
|
| | | @RequestMapping("/zMeetingStatistic")
|
| | | public class MeetingStatisticController extends BaseController {
|
| | | @Autowired
|
| | | private MeetingStatisticService meetingStatisticService;
|
| | |
|
| | | /**
|
| | | * 全部数据
|
| | | */
|
| | | @GetMapping("/all")
|
| | | public AjaxResult listAll(MeetingStatistic meetingStatistic){
|
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
|
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
| | | return meetingStatisticService.selectDataList(meetingStatistic, pageNum, pageSize);
|
| | | }
|
| | | /**
|
| | | * 根据id,获取会议记录详细信息
|
| | | */
|
| | | @GetMapping(value = "/{id}")
|
| | | public AjaxResult getInfo(@PathVariable("id") Long id) {
|
| | | return success(meetingStatisticService.getById(id));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 只输出家庭号和创建时间
|
| | | */
|
| | | @GetMapping("/one")
|
| | | public AjaxResult listOne(MeetingStatistic meetingStatistic){
|
| | | return meetingStatisticService.DataList(meetingStatistic);
|
| | | }
|
| | | /**
|
| | | * 修改会议统计
|
| | | */
|
| | | @Log(title = "会议统计", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody MeetingStatistic meetingStatistic) {
|
| | | return meetingStatisticService.updateData(meetingStatistic);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 批量删除会议统计记录
|
| | | */
|
| | | @Log(title = "会议统计记录", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{ids}")
|
| | | public AjaxResult remove(@PathVariable Long[] ids) {
|
| | | return meetingStatisticService.deleteData(ids);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增会议统计记录
|
| | | */
|
| | | @Log(title = "会议统计记录", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody MeetingStatistic meetingStatistic) { return meetingStatisticService.addData(meetingStatistic); }
|
| | | }
|
| | |
| | | public AjaxResult updateData(@RequestBody MemoBook memoBook){ |
| | | boolean b = memoBookService.updateById(memoBook); |
| | | if (b){ |
| | | System.out.println("sssddddddddddddddddddddddd"); |
| | | return AjaxResult.success(); |
| | | }else { |
| | | return AjaxResult.error(); |
| | |
| | | |
| | | |
| | | |
| | | return travelCountService.selectDataList(userId,pageNum,pageSize,travelCount,happenStartTime,happenEndTime); |
| | | AjaxResult res = travelCountService.selectDataList(userId,pageNum,pageSize,travelCount,happenStartTime,happenEndTime); |
| | | System.out.println(res); |
| | | return res; |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | |
| | | import com.ruoyi.domain.ZAuthority; |
| | | import com.ruoyi.domain.dto.AuthorityDto; |
| | | import com.ruoyi.domain.dto.AuthorityDto2; |
| | | import com.ruoyi.domain.dto.EmpowerDto; |
| | | import com.ruoyi.service.ZAuthorityService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | return zAuthorityService.getOtherAuthority(authorityDto); |
| | | } |
| | | |
| | | // /** |
| | | // * 授权(只有家庭管理员才能调用这个接口) |
| | | // */ |
| | | // @PostMapping("/empower") |
| | | // public AjaxResult empower(){ |
| | | // |
| | | // } |
| | | /** |
| | | * 授权(只有家庭管理员才能调用这个接口) |
| | | */ |
| | | @PostMapping("/empower") |
| | | public AjaxResult empower(@RequestBody EmpowerDto zAuthority){ |
| | | return zAuthorityService.saveZa(zAuthority); |
| | | } |
| | | /** |
| | | * 根据authorityId和家庭id查看已经授权给那些人 |
| | | */ |
| | | @PostMapping("/getInfoByAidFid") |
| | | public AjaxResult empowerGetInfo(@RequestBody ZAuthority zAuthority){ |
| | | return zAuthorityService.listByFidAid(zAuthority); |
| | | } |
| | | /** |
| | | * 根据authorityId和家庭id收回已经授权给那些人 |
| | | */ |
| | | @PostMapping("/deleteInfoByAidFid") |
| | | public AjaxResult deleteEmpower(@RequestBody EmpowerDto zAuthority){ |
| | | return zAuthorityService.deleteZa(zAuthority); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | Long userId = user.getUserId(); |
| | | return AjaxResult.success(zInfoUserService.getInfoById(userId)); |
| | | } |
| | | @GetMapping("/{id}") |
| | | public AjaxResult getInfoById(@PathVariable("id") Long id) { |
| | | // SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = id; |
| | | return AjaxResult.success(zInfoUserService.getInfoById(userId)); |
| | | } |
| | | // |
| | | |
| | | /** |
| | |
| | | public AjaxResult listAllPeopleWithTree(@PathParam("depth") Integer depth){ |
| | | return zInfoUserService.listWithTree(depth); |
| | | } |
| | | |
| | | /** |
| | | * 根据家庭成员找到所有人 |
| | | */ |
| | | @GetMapping("/allFamInfo") |
| | | public AjaxResult listAllFamilyPeople() |
| | | { |
| | | return zInfoUserService.listAllFamilyPeople(); |
| | | } |
| | | |
| | | /** |
| | | * 找到所有的成员 |
| | |
| | | return zInfoUserService.listGenealogy2(genealogy,pageNum,pageSize); |
| | | } |
| | | |
| | | @GetMapping("/list/getInfoByfid/{fid}") |
| | | public AjaxResult getInfoByfid(@PathVariable("fid") Long fid) |
| | | { |
| | | return zInfoUserService.getInfoByfid(fid); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.ShareMore; |
| | | import com.ruoyi.service.ZfDoctorShareService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("/ZfDoctorShare") |
| | | public class ZfDoctorShareController extends BaseController { |
| | | @Resource |
| | | ZfDoctorShareService zfDoctorShareService; |
| | | |
| | | /** |
| | | * 分享数据 |
| | | */ |
| | | @PostMapping("/share") |
| | | public AjaxResult share(@RequestBody ShareMore zfDoctor){ |
| | | return zfDoctorShareService.saveZa(zfDoctor); |
| | | } |
| | | |
| | | /** |
| | | * 根据UserId和分享人shareId查看已经授权给那些人那些数据 |
| | | */ |
| | | @PostMapping("/getInfoByUserId") |
| | | public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){ |
| | | |
| | | return zfDoctorShareService.listByFidAid(zfDoctor); |
| | | } |
| | | |
| | | /** |
| | | * 用户自己查看别人分享的数据和分享人 |
| | | */ |
| | | @GetMapping("/getInfoByShareId") |
| | | public AjaxResult empowerGetInfo2(){ |
| | | return zfDoctorShareService.listByUserId(); |
| | | } |
| | | /** |
| | | * 根据userId和shareId收回已经授权给那些人 |
| | | */ |
| | | @PostMapping("/deleteInfoByUserId") |
| | | public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){ |
| | | return zfDoctorShareService.deleteZa(zfDoctor); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.domain.ZfFamily; |
| | | import com.ruoyi.domain.dto.UserInfoDto; |
| | | import com.ruoyi.service.ZfFamilyService; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author Jinquan_Ou |
| | |
| | | public AjaxResult getByFamilyId(@PathVariable Long fid){ |
| | | return AjaxResult.success(zfFamilyService.getByFamilyId(fid)); |
| | | } |
| | | @GetMapping("/findByfid/{fid}") |
| | | public AjaxResult getByFId(@PathVariable("fid") Long fid){ |
| | | return AjaxResult.success(zfFamilyService.getByFid(fid)); |
| | | } |
| | | @GetMapping("/findByFname/{name}") |
| | | public AjaxResult getByFName(@PathVariable("name") String name){ |
| | | return AjaxResult.success(zfFamilyService.getByName(name)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查看当前用户当前家庭的家庭成员 |
| | |
| | | */ |
| | | @PostMapping() |
| | | public AjaxResult addFamilyMember(@RequestBody UserInfoDto userInfoDto){ |
| | | |
| | | return zfFamilyService.addMember(userInfoDto); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 导出家庭大事件记录列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:property:export')") |
| | | @Log(title = "家庭大事件记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | List<ZfFamily> list = zfFamilyService.list(); |
| | | System.out.println("------------------"); |
| | | ExcelUtil<ZfFamily> util = new ExcelUtil<>(ZfFamily.class); |
| | | util.exportExcel(response, list, "家庭大事件记录数据"); |
| | | |
| | | } |
| | | |
| | | @Log(title = "家庭大事件记录", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteFam/{ids}") |
| | | public AjaxResult deleteFamily(@PathVariable Long[] ids) { |
| | | return zfFamilyService.deleteFam(ids); |
| | | } |
| | | /** |
| | | * |
| | | * @param zfFamily |
| | | * @return |
| | | */ |
| | | @PostMapping("/addFam") |
| | | public AjaxResult addFamilyMember(@RequestBody ZfFamily zfFamily){ |
| | | |
| | | return zfFamilyService.addFamily(zfFamily); |
| | | |
| | | } |
| | | /** |
| | | * |
| | | * @param zfFamily |
| | | * @return |
| | | */ |
| | | @PostMapping("/findInfo") |
| | | public AjaxResult findFamilyMember(@RequestBody ZfFamily zfFamily){ |
| | | |
| | | return AjaxResult.success(zfFamilyService.getByNameAndUser(zfFamily)); |
| | | |
| | | } |
| | | /** |
| | | * |
| | | * @param zfFamily |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateFam") |
| | | public AjaxResult updateFamily(@RequestBody ZfFamily zfFamily){ |
| | | |
| | | return zfFamilyService.updateFam(zfFamily); |
| | | |
| | | } |
| | | /** |
| | | * 删除家庭成员 |
| | | */ |
| | | |
| | |
| | | |
| | | @GetMapping("/type") |
| | | public AjaxResult listType(){ |
| | | return zfPropertyService.listType(); |
| | | return zfPropertyService.selectType(); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Test |
| | | public void testExcelImport() throws Exception { |
| | | InputStream is = new FileInputStream(new File("D:\\test.xlsx")); |
| | | ExcelUtil<ZfProperty> util = new ExcelUtil<ZfProperty>(ZfProperty.class); |
| | | List<ZfProperty> userList = util.importExcel(is); |
| | | // InputStream is = new FileInputStream(new File("D:\\test.xlsx")); |
| | | // ExcelUtil<ZfProperty> util = new ExcelUtil<ZfProperty>(ZfProperty.class); |
| | | // List<ZfProperty> userList = util.importExcel(is); |
| | | } |
| | | } |
| | |
| | | @Test |
| | | public void esUser() |
| | | { |
| | | System.out.println("__________________________"); |
| | | System.out.println(ess.findByCondition("我真的很开心")); |
| | | // System.out.println("__________________________"); |
| | | // System.out.println(ess.findByCondition("我真的很开心")); |
| | | // request.settings(Settings.builder().put("number_of_shards", "1").put("number_of_replicas", "0")); |
| | | // request.settings(Settings.builder().put("number_of_shards", "1").put("number_of_replicas", "0")); |
| | | } |
| | |
| | | public void esUs() |
| | | { |
| | | // // 操作索引的对象 |
| | | System.out.println(ess); |
| | | ZfEvent zfe = new ZfEvent(); |
| | | zfe.setId(1489); |
| | | zfe.setRemark("大家好90"); |
| | | zfe.setAddress("你好2"); |
| | | zfe.setTitle("很好很好"); |
| | | zfe.setPeople("你好"); |
| | | zfEs.addData(zfe); |
| | | |
| | | System.out.println(ess); |
| | | System.out.println("sdsdsdsds"); |
| | | System.out.println("sdsdsdsds"); |
| | | |
| | | System.out.println("sdsdsdsds"); |
| | | System.out.println(ess); |
| | | // System.out.println(ess); |
| | | // ZfEvent zfe = new ZfEvent(); |
| | | // zfe.setId(1489); |
| | | // zfe.setRemark("大家好90"); |
| | | // zfe.setAddress("你好2"); |
| | | // zfe.setTitle("很好很好"); |
| | | // zfe.setPeople("你好"); |
| | | // zfEs.addData(zfe); |
| | | // |
| | | // System.out.println(ess); |
| | | // System.out.println("sdsdsdsds"); |
| | | // System.out.println("sdsdsdsds"); |
| | | // |
| | | // System.out.println("sdsdsdsds"); |
| | | // System.out.println(ess); |
| | | |
| | | // |
| | | // EsModel esModel = new EsModel(); |
| | |
| | | public class generatorTest { |
| | | @Test |
| | | public void test01() { |
| | | //创建一个代码生成器 |
| | | FastAutoGenerator.create("jdbc:mysql://192.168.88.68:3306/mall_pms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8", |
| | | "root", "root") |
| | | //全局配置(GlobalConfig) |
| | | .globalConfig(builder -> { |
| | | builder.author("ojq") // 设置作者,可以写自己名字 |
| | | //.enableSwagger() // 开启 swagger 模式,这个是接口文档生成器,如果开启的话,就还需要导入swagger依赖 |
| | | .fileOverride() // 覆盖已生成文件 |
| | | .dateType(DateType.TIME_PACK) //时间策略 |
| | | .commentDate("yyyy-MM-dd") //注释日期 |
| | | .outputDir("F:\\JavaProject\\mail-service\\mall-generator\\src\\main\\java"); // 指定输出目录,一般指定到java目录 |
| | | }) |
| | | //包配置(PackageConfig) |
| | | .packageConfig(builder -> { |
| | | builder.parent("com.ojq") // 设置父包名 |
| | | .moduleName("") // 设置父包模块名,这里一般不设置 |
| | | .pathInfo(Collections.singletonMap(OutputFile.mapperXml, "F:\\JavaProject\\mail-service\\mall-generator\\src\\main\\resources\\com\\ojq\\mapper")); // 设置mapperXml生成路径,这里是Mapper配置文件的路径,建议使用绝对路径 |
| | | }) |
| | | //策略配置(StrategyConfig) |
| | | .strategyConfig(builder -> { |
| | | // builder.addInclude("zf_clean") // 设置需要生成的表名 |
| | | // .addInclude("zf_collection") // 设置需要生成的表名 |
| | | builder.addInclude("pms_attr") // 设置需要生成的表名 |
| | | .addInclude("pms_attr_attrgroup_relation") // 设置需要生成的表名 |
| | | .addInclude("pms_attr_group") // 设置需要生成的表名 |
| | | .addInclude("pms_brand") // 设置需要生成的表名 |
| | | .addInclude("pms_category") // 设置需要生成的表名 |
| | | .addInclude("pms_category_brand") // 设置需要生成的表名 |
| | | .addInclude("pms_comment_replay") // 设置需要生成的表名 |
| | | .addInclude("pms_product_attr_value") // 设置需要生成的表名 |
| | | .addInclude("pms_sku_images") // 设置需要生成的表名 |
| | | .addInclude("pms_sku_info") // 设置需要生成的表名 |
| | | .addInclude("pms_sku_sale_attr_value") // 设置需要生成的表名 |
| | | .addInclude("pms_spu_comment") // 设置需要生成的表名 |
| | | .addInclude("pms_spu_images") // 设置需要生成的表名 |
| | | .addInclude("pms_spu_info") // 设置需要生成的表名 |
| | | .addInclude("pms_spu_info_desc"); // 设置需要生成的表名 |
| | | |
| | | builder.serviceBuilder() |
| | | .formatServiceFileName("%sService") //设置service的命名策略,没有这个配置的话,生成的service和serviceImpl类前面会有一个I,比如IUserService和IUserServiceImpl |
| | | .formatServiceImplFileName("%sServiceImpl"); //设置serviceImpl的命名策略 |
| | | builder.controllerBuilder() |
| | | .enableRestStyle(); // 开启生成@RestController 控制器,不配置这个默认是Controller注解,RestController是返回Json字符串的,多用于前后端分离项目。 |
| | | builder.mapperBuilder() |
| | | .enableMapperAnnotation() ;//开启 @Mapper 注解,也就是在dao接口上添加一个@Mapper注解,这个注解的作用是开启注解模式,就可以在接口的抽象方法上面直接使用@Select和@Insert和@Update和@Delete注解。 |
| | | }) |
| | | // .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板 |
| | | .templateEngine(new VelocityTemplateEngine()) |
| | | .execute(); //执行以上配置 |
| | | // //创建一个代码生成器 |
| | | // FastAutoGenerator.create("jdbc:mysql://192.168.88.68:3306/mall_pms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8", |
| | | // "root", "root") |
| | | // //全局配置(GlobalConfig) |
| | | // .globalConfig(builder -> { |
| | | // builder.author("ojq") // 设置作者,可以写自己名字 |
| | | // //.enableSwagger() // 开启 swagger 模式,这个是接口文档生成器,如果开启的话,就还需要导入swagger依赖 |
| | | // .fileOverride() // 覆盖已生成文件 |
| | | // .dateType(DateType.TIME_PACK) //时间策略 |
| | | // .commentDate("yyyy-MM-dd") //注释日期 |
| | | // .outputDir("F:\\JavaProject\\mail-service\\mall-generator\\src\\main\\java"); // 指定输出目录,一般指定到java目录 |
| | | // }) |
| | | // //包配置(PackageConfig) |
| | | // .packageConfig(builder -> { |
| | | // builder.parent("com.ojq") // 设置父包名 |
| | | // .moduleName("") // 设置父包模块名,这里一般不设置 |
| | | // .pathInfo(Collections.singletonMap(OutputFile.mapperXml, "F:\\JavaProject\\mail-service\\mall-generator\\src\\main\\resources\\com\\ojq\\mapper")); // 设置mapperXml生成路径,这里是Mapper配置文件的路径,建议使用绝对路径 |
| | | // }) |
| | | // //策略配置(StrategyConfig) |
| | | // .strategyConfig(builder -> { |
| | | //// builder.addInclude("zf_clean") // 设置需要生成的表名 |
| | | //// .addInclude("zf_collection") // 设置需要生成的表名 |
| | | // builder.addInclude("pms_attr") // 设置需要生成的表名 |
| | | // .addInclude("pms_attr_attrgroup_relation") // 设置需要生成的表名 |
| | | // .addInclude("pms_attr_group") // 设置需要生成的表名 |
| | | // .addInclude("pms_brand") // 设置需要生成的表名 |
| | | // .addInclude("pms_category") // 设置需要生成的表名 |
| | | // .addInclude("pms_category_brand") // 设置需要生成的表名 |
| | | // .addInclude("pms_comment_replay") // 设置需要生成的表名 |
| | | // .addInclude("pms_product_attr_value") // 设置需要生成的表名 |
| | | // .addInclude("pms_sku_images") // 设置需要生成的表名 |
| | | // .addInclude("pms_sku_info") // 设置需要生成的表名 |
| | | // .addInclude("pms_sku_sale_attr_value") // 设置需要生成的表名 |
| | | // .addInclude("pms_spu_comment") // 设置需要生成的表名 |
| | | // .addInclude("pms_spu_images") // 设置需要生成的表名 |
| | | // .addInclude("pms_spu_info") // 设置需要生成的表名 |
| | | // .addInclude("pms_spu_info_desc"); // 设置需要生成的表名 |
| | | // |
| | | // builder.serviceBuilder() |
| | | // .formatServiceFileName("%sService") //设置service的命名策略,没有这个配置的话,生成的service和serviceImpl类前面会有一个I,比如IUserService和IUserServiceImpl |
| | | // .formatServiceImplFileName("%sServiceImpl"); //设置serviceImpl的命名策略 |
| | | // builder.controllerBuilder() |
| | | // .enableRestStyle(); // 开启生成@RestController 控制器,不配置这个默认是Controller注解,RestController是返回Json字符串的,多用于前后端分离项目。 |
| | | // builder.mapperBuilder() |
| | | // .enableMapperAnnotation() ;//开启 @Mapper 注解,也就是在dao接口上添加一个@Mapper注解,这个注解的作用是开启注解模式,就可以在接口的抽象方法上面直接使用@Select和@Insert和@Update和@Delete注解。 |
| | | // }) |
| | | //// .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板 |
| | | // .templateEngine(new VelocityTemplateEngine()) |
| | | // .execute(); //执行以上配置 |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import lombok.Data; |
| | | import org.joda.time.DateTime; |
| | | import org.springframework.data.elasticsearch.annotations.Document; |
| | | import org.springframework.data.elasticsearch.annotations.Field; |
| | | import org.springframework.data.elasticsearch.annotations.FieldType; |
| | | |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private String by6; |
| | | |
| | | /** 备用6 */ |
| | | /** 备用7 */ |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private String by7; |
| | | |
| | | |
| | | /** 备用8*/ |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private int by8; |
| | | |
| | | /** 备用9 */ |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private int by9; |
| | | |
| | | /** 备用10 */ |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private int by10; |
| | | |
| | | /** 备用11 */ |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private int by11; |
| | | |
| | | /** 备用12 */ |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private int by12; |
| | | |
| | | /** 备用13 */ |
| | | @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word") |
| | | private int by13; |
| | | |
| | | /** 备用14 */ |
| | | @Field(index = true,type = FieldType.Date,analyzer = "ik_max_wor") |
| | | private Date by14; |
| | | |
| | | /** 备用15 */ |
| | | @Field(index = true,type = FieldType.Date,analyzer = "ik_max_wor") |
| | | private Date by15; |
| | | |
| | | /** 备用16 */ |
| | | @Field(index = true,type = FieldType.Date,analyzer = "ik_max_wor ") |
| | | private Timestamp by16; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excels; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.xss.Xss; |
| | | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class sysUserInfo extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 用户ID */ |
| | | @Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号") |
| | | private Long userId; |
| | | |
| | | /** 部门ID */ |
| | | @Excel(name = "部门编号", type = Excel.Type.IMPORT) |
| | | private Long deptId; |
| | | |
| | | /** 用户账号 */ |
| | | @Excel(name = "登录名称") |
| | | private String userName; |
| | | |
| | | /** 用户昵称 */ |
| | | @Excel(name = "用户名称") |
| | | private String nickName; |
| | | |
| | | /** 用户邮箱 */ |
| | | @Excel(name = "用户邮箱") |
| | | private String email; |
| | | |
| | | /** 手机号码 */ |
| | | @Excel(name = "手机号码") |
| | | private String phonenumber; |
| | | |
| | | /** 用户性别 */ |
| | | @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") |
| | | private String sex; |
| | | |
| | | /** 用户头像 */ |
| | | private String avatar; |
| | | |
| | | /** 密码 */ |
| | | private String password; |
| | | |
| | | public static long getSerialVersionUID() { |
| | | return serialVersionUID; |
| | | } |
| | | |
| | | public long getFamilyId() { |
| | | return familyId; |
| | | } |
| | | |
| | | public void setFamilyId(long familyId) { |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public long getSpouseId() { |
| | | return spouseId; |
| | | } |
| | | |
| | | public void setSpouseId(long spouseId) { |
| | | this.spouseId = spouseId; |
| | | } |
| | | |
| | | public int getIsMyFamily() { |
| | | return isMyFamily; |
| | | } |
| | | |
| | | public void setIsMyFamily(int isMyFamily) { |
| | | this.isMyFamily = isMyFamily; |
| | | } |
| | | |
| | | public long getFatherId() { |
| | | return fatherId; |
| | | } |
| | | |
| | | public void setFatherId(long fatherId) { |
| | | this.fatherId = fatherId; |
| | | } |
| | | |
| | | public long getMomId() { |
| | | return momId; |
| | | } |
| | | |
| | | public void setMomId(long momId) { |
| | | this.momId = momId; |
| | | } |
| | | |
| | | private long familyId; |
| | | |
| | | private long spouseId; |
| | | |
| | | private int isMyFamily; |
| | | |
| | | public long getFid() { |
| | | return fid; |
| | | } |
| | | |
| | | public void setFid(long fid) { |
| | | this.fid = fid; |
| | | } |
| | | |
| | | private long fatherId; |
| | | |
| | | private long momId; |
| | | |
| | | private long fid; |
| | | /** 帐号状态(0正常 1停用) */ |
| | | @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | private String delFlag; |
| | | |
| | | /** 最后登录IP */ |
| | | @Excel(name = "最后登录IP", type = Excel.Type.EXPORT) |
| | | private String loginIp; |
| | | |
| | | /** 最后登录时间 */ |
| | | @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT) |
| | | private Date loginDate; |
| | | |
| | | /** 部门对象 */ |
| | | @Excels({ |
| | | @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT), |
| | | @Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT) |
| | | }) |
| | | private SysDept dept; |
| | | |
| | | /** 角色对象 */ |
| | | private List<SysRole> roles; |
| | | |
| | | /** 角色组 */ |
| | | private Long[] roleIds; |
| | | |
| | | /** 岗位组 */ |
| | | private Long[] postIds; |
| | | |
| | | /** 角色ID */ |
| | | private Long roleId; |
| | | |
| | | public sysUserInfo() |
| | | { |
| | | |
| | | } |
| | | |
| | | public sysUserInfo(Long userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public boolean isAdmin() |
| | | { |
| | | return isAdmin(this.userId); |
| | | } |
| | | |
| | | public static boolean isAdmin(Long userId) |
| | | { |
| | | //1号用户就是管理员 |
| | | return userId != null && 1L == userId; |
| | | } |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Xss(message = "用户昵称不能包含脚本字符") |
| | | @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") |
| | | public String getNickName() |
| | | { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) |
| | | { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | @Xss(message = "用户账号不能包含脚本字符") |
| | | @NotBlank(message = "用户账号不能为空") |
| | | @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") |
| | | public String getUserName() |
| | | { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) |
| | | { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | public String getEmail() |
| | | { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) |
| | | { |
| | | this.email = email; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") |
| | | public String getPhonenumber() |
| | | { |
| | | return phonenumber; |
| | | } |
| | | |
| | | public void setPhonenumber(String phonenumber) |
| | | { |
| | | this.phonenumber = phonenumber; |
| | | } |
| | | |
| | | public String getSex() |
| | | { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) |
| | | { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getAvatar() |
| | | { |
| | | return avatar; |
| | | } |
| | | |
| | | public void setAvatar(String avatar) |
| | | { |
| | | this.avatar = avatar; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getLoginIp() |
| | | { |
| | | return loginIp; |
| | | } |
| | | |
| | | public void setLoginIp(String loginIp) |
| | | { |
| | | this.loginIp = loginIp; |
| | | } |
| | | |
| | | public Date getLoginDate() |
| | | { |
| | | return loginDate; |
| | | } |
| | | |
| | | public void setLoginDate(Date loginDate) |
| | | { |
| | | this.loginDate = loginDate; |
| | | } |
| | | |
| | | public SysDept getDept() |
| | | { |
| | | return dept; |
| | | } |
| | | |
| | | public void setDept(SysDept dept) |
| | | { |
| | | this.dept = dept; |
| | | } |
| | | |
| | | public List<SysRole> getRoles() |
| | | { |
| | | return roles; |
| | | } |
| | | |
| | | public void setRoles(List<SysRole> roles) |
| | | { |
| | | this.roles = roles; |
| | | } |
| | | |
| | | public Long[] getRoleIds() |
| | | { |
| | | return roleIds; |
| | | } |
| | | |
| | | public void setRoleIds(Long[] roleIds) |
| | | { |
| | | this.roleIds = roleIds; |
| | | } |
| | | |
| | | public Long[] getPostIds() |
| | | { |
| | | return postIds; |
| | | } |
| | | |
| | | public void setPostIds(Long[] postIds) |
| | | { |
| | | this.postIds = postIds; |
| | | } |
| | | |
| | | public Long getRoleId() |
| | | { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) |
| | | { |
| | | this.roleId = roleId; |
| | | } |
| | | } |
| | |
| | | LoginUser loginUser = tokenService.getLoginUser(request); |
| | | if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) |
| | | { |
| | | System.out.println("123"); |
| | | tokenService.verifyToken(loginUser); |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); |
| | | authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); |
| | |
| | | * @param permission 权限字符串 |
| | | * @return 用户是否具备某权限 |
| | | */ |
| | | |
| | | |
| | | private boolean hasPermissions(Set<String> permissions, String permission) |
| | | { |
| | | return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission)); |
| | |
| | | // 管理员拥有所有权限 |
| | | if (user.isAdmin()) |
| | | { |
| | | perms.add("*:*:*"); |
| | | // perms.add("system:*:*"); |
| | | perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>zhang-content</artifactId> |
| | | <version>1.0</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-extension</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | */ |
| | | public interface SysUserMapper |
| | | { |
| | | public List<SysUser> findUserNames(Long[] ids); |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | | * |
| | |
| | | */ |
| | | public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); |
| | | |
| | | public int deleteUserByUserName(String userName); |
| | | public int deleteUserByName(String userName); |
| | | |
| | | public int deleteById(Long[] userId); |
| | | /** |
| | | * 通过用户ID删除用户 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysUserService |
| | | public interface ISysUserService extends IService<SysUser> |
| | | { |
| | | |
| | | |
| | | public List<String> findUserNames(Long [] ids); |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | | * |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Validator; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysUserServiceImpl implements ISysUserService |
| | | { |
| | | public class SysUserServiceImpl implements ISysUserService { |
| | | private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | protected Validator validator; |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Override |
| | | public List<String> findUserNames(Long[] ids) { |
| | | List<String> usNames = userMapper.findUserNames(ids).stream().map(SysUser::getUserName).collect(Collectors.toList()); |
| | | //.stream().map(SysUser::getUserName).collect(Collectors.toList());; |
| | | System.out.println("99999999999900000000000"); |
| | | System.out.println(usNames); |
| | | //.stream().map(SysUser::getUserName).collect(Collectors.toList()); |
| | | return usNames; |
| | | } |
| | | |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | |
| | | insertUserPost(user); |
| | | // 新增用户与角色管理 |
| | | insertUserRole(user); |
| | | |
| | | |
| | | return rows; |
| | | } |
| | | |
| | |
| | | userPostMapper.deleteUserPostByUserId(userId); |
| | | // 新增用户与岗位管理 |
| | | insertUserPost(user); |
| | | |
| | | //更新用户信息表 |
| | | |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void insertUserRole(SysUser user) |
| | | { |
| | | |
| | | this.insertUserRole(user.getUserId(), user.getRoleIds()); |
| | | } |
| | | |
| | |
| | | userRoleMapper.deleteUserRole(userIds); |
| | | // 删除用户与岗位关联 |
| | | userPostMapper.deleteUserPost(userIds); |
| | | return userMapper.deleteUserByIds(userIds); |
| | | //找到用户名 |
| | | List<String> unames = findUserNames(userIds); |
| | | for(String name :unames) { |
| | | // System.out.println(name.equals("")); |
| | | // System.out.println(name==null); |
| | | |
| | | // if(name!="" || name != null) { |
| | | ZInfoUser fs = new ZInfoUser(); |
| | | fs.setNickName(name); |
| | | List<ZInfoUser> lis = zInfoUserService.selectByCondition(fs); |
| | | System.out.println("902"); |
| | | |
| | | System.out.println(lis.size()); |
| | | if (!name.equals("") && lis.size() > 0) |
| | | userMapper.deleteUserByUserName(name); |
| | | else |
| | | userMapper.deleteUserByName(name); |
| | | // } |
| | | } |
| | | |
| | | return 1; |
| | | // zInfoUserService.removeByUserName( findUserNames(userIds)); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return successMsg.toString(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean saveBatch(Collection<SysUser> entityList, int batchSize) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean saveOrUpdateBatch(Collection<SysUser> entityList, int batchSize) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateBatchById(Collection<SysUser> entityList, int batchSize) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean saveOrUpdate(SysUser entity) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public SysUser getOne(Wrapper<SysUser> queryWrapper, boolean throwEx) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getMap(Wrapper<SysUser> queryWrapper) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public <V> V getObj(Wrapper<SysUser> queryWrapper, Function<? super Object, V> mapper) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public BaseMapper<SysUser> getBaseMapper() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Class<SysUser> getEntityClass() { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="selectMenuTreeAll" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 and m.menu_id in (1, 100, 118) |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | |
| | | <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="deptResult" type="SysDept"> |
| | | <id property="deptId" column="dept_id" /> |
| | | <result property="parentId" column="parent_id" /> |
| | |
| | | <result property="dataScope" column="data_scope" /> |
| | | <result property="status" column="role_status" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="findUserNames" parameterType="Long" resultMap="SysUserResult"> |
| | | SELECT |
| | | user_name |
| | | from sys_user |
| | | WHERE user_id IN |
| | | <foreach collection="array" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | | where u.del_flag = '0' or u.del_flag = '2' |
| | | <if test="userId != null and userId != 0"> |
| | | AND u.user_id = #{userId} |
| | | </if> |
| | |
| | | <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |
| | | <if test="userId != null and userId != 0">user_id,</if> |
| | |
| | | update sys_user set password = #{password} where user_name = #{userName} |
| | | </update> |
| | | |
| | | <delete id="deleteUserById" parameterType="Long"> |
| | | update sys_user set del_flag = '2' where user_id = #{userId} |
| | | <delete id="deleteUserByUserName" parameterType="String"> |
| | | update sys_user set status = '1' where user_name= #{userName} |
| | | </delete> |
| | | |
| | | <delete id="deleteUserByIds" parameterType="Long"> |
| | | update sys_user set del_flag = '2' where user_id in |
| | | <delete id="deleteUserByName" parameterType="String"> |
| | | delete from sys_user where user_name= #{userName} |
| | | </delete> |
| | | |
| | | <delete id="deleteUserById" parameterType="Long"> |
| | | update sys_user set status = '1' where user_id = #{userId} |
| | | </delete> |
| | | |
| | | |
| | | |
| | | <delete id="deleteById" parameterType="Long"> |
| | | delete from sys_user where user_id in |
| | | <foreach collection="array" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteUserByIds" parameterType="Long"> |
| | | update sys_user set status = '1' where user_id in |
| | | <foreach collection="array" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
New file |
| | |
| | | package com.ruoyi.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("live_streaming") |
| | | public class LiveStreaming { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 开始开会时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | | /** |
| | | * 结束开会时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | /** |
| | | * 标题 |
| | | */ |
| | | private String title; |
| | | /** |
| | | * 申请人 |
| | | */ |
| | | private String applyPerson; |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | private String contactPerson; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String contactPhone; |
| | | /** |
| | | * 生成时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @TableField(exist = false, jdbcType = JdbcType.TIMESTAMP) |
| | | private Timestamp happenStartTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField(exist = false, jdbcType = JdbcType.TIMESTAMP) |
| | | private Timestamp happenEndTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.domain;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import com.ruoyi.common.annotation.Excel;
|
| | | import lombok.Data;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | | import org.joda.time.DateTime;
|
| | |
|
| | | import java.sql.Timestamp;
|
| | | import java.util.Date;
|
| | |
|
| | | @Data
|
| | | @TableName("meeting")
|
| | | public class Meeting {
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Long id;
|
| | | /**
|
| | | * 标题
|
| | | */
|
| | | @Excel(name = "标题")
|
| | | private String title;
|
| | | /**
|
| | | * 地点
|
| | | */
|
| | | @Excel(name = "地点")
|
| | | private String place;
|
| | | /**
|
| | | * 可容纳人数
|
| | | */
|
| | | @Excel(name = "可容纳人数")
|
| | | private int conPeople;
|
| | | /**
|
| | | * 参与人数
|
| | | */
|
| | | @Excel(name = "参与人数")
|
| | | private int partPeople;
|
| | | /**
|
| | | * 申请人
|
| | | */
|
| | | @Excel(name = "申请人")
|
| | | private String applyPerson;
|
| | | /**
|
| | | * 申请部门或家庭
|
| | | */
|
| | | @Excel(name = "申请部门或家庭")
|
| | | private String applyApart;
|
| | | /**
|
| | | * 开始时间
|
| | | */
|
| | | @Excel(name = "开始时间")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | private Date startTime;
|
| | | /**
|
| | | * 结束时间
|
| | | */
|
| | | @Excel(name = "结束时间")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | private Date endTime;
|
| | |
|
| | |
|
| | | /**
|
| | | * 开始开会时间
|
| | | */
|
| | | @TableField(exist = false, jdbcType = JdbcType.TIMESTAMP)
|
| | | private Timestamp happenStartTime;
|
| | |
|
| | | /**
|
| | | * 结束时间
|
| | | */
|
| | | @TableField(exist = false, jdbcType = JdbcType.TIMESTAMP)
|
| | | private Timestamp happenEndTime;
|
| | | /**
|
| | | * 是否摆放水牌
|
| | | */
|
| | | @Excel(name = "是否摆放水牌")
|
| | | private int isPlacebrand;
|
| | | /**
|
| | | * 联系人
|
| | | */
|
| | | @Excel(name = "联系人")
|
| | | private String connPerson;
|
| | | /**
|
| | | * 联系电话
|
| | | */
|
| | | @Excel(name = "联系电话")
|
| | | private String connPhone;
|
| | | /**
|
| | | * 状态
|
| | | */
|
| | | @Excel(name = "状态")
|
| | | private int statu;
|
| | | /**
|
| | | * 生成时间
|
| | | */
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | private Date createTime;
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("meeting_ratify") |
| | | public class MeetingRatify { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private int familyId; |
| | | |
| | | private String useTime; |
| | | |
| | | private String conferenceRoom; |
| | | |
| | | private String title; |
| | | |
| | | private int applyPerson; |
| | | |
| | | private int ratifyPerson; |
| | | |
| | | private String status; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.domain;
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import lombok.Data;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | @Data
|
| | | @TableName("meeting_statistic")
|
| | | public class MeetingStatistic {
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Long id;
|
| | |
|
| | | /**
|
| | | * 家庭号
|
| | | */
|
| | | private Long familyId;
|
| | | /**
|
| | | * 使用时间
|
| | | */
|
| | | private String useTime;
|
| | | /**
|
| | | * 会议室名称
|
| | | */
|
| | | private String conferenceRoom;
|
| | | /**
|
| | | * 标题
|
| | | */
|
| | | private String title;
|
| | | /**
|
| | | * 申请人
|
| | | */
|
| | | private String applyPerson;
|
| | | /**
|
| | | * 审批人
|
| | | */
|
| | | private int ratifyPerson;
|
| | | /**
|
| | | * 状态
|
| | | */
|
| | | private int status;
|
| | | /**
|
| | | * 开始开会时间
|
| | | */
|
| | | @JsonFormat(timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
|
| | | private Date happenStartTime;
|
| | |
|
| | | /**
|
| | | * 结束时间
|
| | | */
|
| | | @JsonFormat(timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
|
| | | private Date happenEndTime;
|
| | | /**
|
| | | * 创建时间
|
| | | */
|
| | | @JsonFormat(pattern = "yyyy-MM-dd")
|
| | | private Date createTime;
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
| | | private Date createTime; |
| | | |
| | | private String content; |
| | | |
| | | private String url; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class ShareMore implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 分享的用户id |
| | | */ |
| | | private Long[] shareIds; |
| | | |
| | | /** |
| | | * 分享的内容 |
| | | */ |
| | | private Long[] shareContents; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 共计团费 |
| | | * |
| | | * |
| | | * |
| | | */ |
| | | private Double groupTotal; |
| | | |
| | |
| | | */ |
| | | private Double totalPrice; |
| | | |
| | | private String spee; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | |
| | | */ |
| | | private String document; |
| | | |
| | | private Double otherCost; |
| | | |
| | | private String backInfo; |
| | | } |
| | |
| | | */ |
| | | private Long myId; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 起始时间搜索传入 |
| | | */ |
| | |
| | | private Double totalCost; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 消费日期 |
| | | */ |
| | |
| | | @TableField(exist = false) |
| | | private Integer ownData; |
| | | |
| | | private Long shareId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("zf_doctor_share") |
| | | public class ZfDoctorShare implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 分享的用户id |
| | | */ |
| | | private Long shareId; |
| | | |
| | | /** |
| | | * 分享的内容 |
| | | */ |
| | | private Long shareContent; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 家庭名称 |
| | | */ |
| | | @Excel(name="家庭号") |
| | | |
| | | private String name; |
| | | |
| | | |
| | | /** |
| | | * 家庭名称 |
| | | */ |
| | | @Excel(name="父亲id") |
| | | |
| | | private Long fid; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public class EmpowerDto implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long [] uids; |
| | | |
| | | /** |
| | | * 家庭id |
| | | */ |
| | | private Long fid; |
| | | |
| | | /** |
| | | * 权限码 |
| | | */ |
| | | private Long[] authoritys; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.domain.LiveStreaming; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface LiveStreamingBackMapper extends BaseMapper<LiveStreaming> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.domain.LiveStreaming; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface LiveStreamingMapper extends BaseMapper<LiveStreaming> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.ruoyi.domain.Meeting;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Collection;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | @Mapper
|
| | | public interface MeetingMapper extends BaseMapper<Meeting> {
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.ruoyi.domain.Meeting;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | |
|
| | | @Mapper
|
| | | public interface MeetingRatifyMapper extends BaseMapper<Meeting> {
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.ruoyi.domain.MeetingStatistic;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | |
|
| | | @Mapper
|
| | | public interface MeetingStatisticMapper extends BaseMapper<MeetingStatistic> {
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.domain.ZfDoctorShare; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface ZfDoctorShareMapper extends BaseMapper<ZfDoctorShare> { |
| | | } |
| | |
| | | AjaxResult selectDataList(ZfProperty zfProperty,Integer pageNum,Integer pageSize); |
| | | List<ZfProperty> selectByIds(Long[] ids); |
| | | |
| | | AjaxResult selectType(); |
| | | |
| | | List<ZfProperty> selectByFamilyIds(Long[] familyIds); |
| | | AjaxResult addData(ZfProperty zfProperty); |
| | | |
New file |
| | |
| | | package com.ruoyi.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.LiveStreaming; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LiveStreamingBackService extends IService<LiveStreaming> { |
| | | AjaxResult selectDataList(LiveStreaming liveStreaming, Integer pageNum, Integer pageSize); |
| | | |
| | | List<LiveStreaming> selectByIds(Long[] ids); |
| | | } |
New file |
| | |
| | | package com.ruoyi.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.LiveStreaming; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LiveStreamingService extends IService<LiveStreaming> { |
| | | AjaxResult selectDataList(LiveStreaming liveStreaming, Integer pageNum, Integer pageSize); |
| | | |
| | | List<LiveStreaming> selectByIds(Long[] ids); |
| | | |
| | | AjaxResult addData(LiveStreaming liveStreaming); |
| | | } |
New file |
| | |
| | | package com.ruoyi.service;
|
| | |
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.domain.Meeting;
|
| | |
|
| | | public interface MeetingRatifyService extends IService<Meeting> {
|
| | |
|
| | | AjaxResult selectDataList(Meeting meeting, Integer pageNum, Integer pageSize);
|
| | |
|
| | | AjaxResult updateData(Meeting meeting);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.service;
|
| | |
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.domain.Meeting;
|
| | | import com.ruoyi.domain.ZfClean;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | |
|
| | | public interface MeetingService extends IService<Meeting> {
|
| | |
|
| | | AjaxResult selectDataList(Meeting meeting, Integer pageNum, Integer pageSize);
|
| | |
|
| | | List<Meeting> selectByCondition(Meeting meeting);
|
| | |
|
| | | List<Meeting> selectByIds(Long[] ids);
|
| | | // AjaxResult addData(ZfClean zfClean);
|
| | |
|
| | | // AjaxResult addData2(ZfClean zfClean);
|
| | |
|
| | | AjaxResult importExcel(MultipartFile file);
|
| | |
|
| | | AjaxResult updateData(Meeting meeting);
|
| | |
|
| | | AjaxResult deleteData(Long[] ids);
|
| | |
|
| | | AjaxResult addData(Meeting meeting);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.service;
|
| | |
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.ruoyi.common.core.domain.AjaxResult;
|
| | | import com.ruoyi.domain.MeetingStatistic;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | public interface MeetingStatisticService extends IService<MeetingStatistic> {
|
| | |
|
| | | AjaxResult updateData(MeetingStatistic meetingStatistic);
|
| | |
|
| | | AjaxResult deleteData(Long[] ids);
|
| | |
|
| | | AjaxResult DataList(MeetingStatistic meetingStatistic);
|
| | |
|
| | | AjaxResult addData(MeetingStatistic meetingStatistic);
|
| | |
|
| | | List<MeetingStatistic> selectByIds(Long[] ids);
|
| | |
|
| | | AjaxResult selectDataList(MeetingStatistic meetingStatistic, Integer pageNum, Integer pageSize);
|
| | | }
|
| | |
| | | import com.ruoyi.domain.ZAuthority; |
| | | import com.ruoyi.domain.dto.AuthorityDto; |
| | | import com.ruoyi.domain.dto.AuthorityDto2; |
| | | import com.ruoyi.domain.dto.EmpowerDto; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | AjaxResult managerAuthority(AuthorityDto2 authorityDto); |
| | | |
| | | AjaxResult getOtherAuthority(AuthorityDto authorityDto); |
| | | |
| | | AjaxResult saveZa(EmpowerDto zAuthority); |
| | | |
| | | AjaxResult deleteZa(EmpowerDto empowerDto); |
| | | AjaxResult listByFidAid(ZAuthority zAuthority); |
| | | } |
| | |
| | | |
| | | AjaxResult selectInfoList(ZInfoUser zInfoUser, Integer pageNum, Integer pageSize); |
| | | |
| | | AjaxResult getInfoByfid(Long fid); |
| | | List<ZInfoUser> selectByCondition(ZInfoUser zInfoUser); |
| | | |
| | | AjaxResult removeByUserName(List<String> userName); |
| | | List<ZInfoUser> selectByFamId(long fid); |
| | | AjaxResult searchMyRelation(); |
| | | |
| | | AjaxResult addRelation(ZfRelation zfRelation); |
| | |
| | | AjaxResult addParent(Long fatherId, Long motherId); |
| | | |
| | | AjaxResult listAllExceptAdmin(); |
| | | |
| | | AjaxResult listAllFamilyPeople(); |
| | | AjaxResult listMySelfAndSpouse(Long id); |
| | | |
| | | AjaxResult listGenealogy(Genealogy genealogy,Integer pageNum,Integer pageSize); |
New file |
| | |
| | | package com.ruoyi.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.ShareMore; |
| | | import com.ruoyi.domain.ZfDoctor; |
| | | import com.ruoyi.domain.ZfDoctorShare; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ZfDoctorShareService extends IService<ZfDoctorShare> { |
| | | |
| | | List<ZfDoctorShare> getAuthority(); |
| | | |
| | | AjaxResult saveZa(ShareMore zfDoctor); |
| | | |
| | | AjaxResult listByFidAid(ShareMore zfDoctor); |
| | | |
| | | AjaxResult deleteZa(ShareMore zfDoctor); |
| | | |
| | | AjaxResult listByUserId(); |
| | | |
| | | List<ZfDoctor> listUserId(Long shareId); |
| | | |
| | | } |
| | |
| | | @Service |
| | | public interface ZfFamilyService extends IService<ZfFamily> { |
| | | |
| | | ZfFamily getByNameAndUser(ZfFamily zfFamily); |
| | | /** |
| | | * 根据家庭名字查询家庭 |
| | | */ |
| | | ZfFamily getByName(String familyName); |
| | | |
| | | |
| | | ZfFamily getByFid(Long fid); |
| | | ZfFamily getByFamId(Long fid); |
| | | List<UserInfoDto> getByFamilyId(Long fid); |
| | | |
| | | List<UserInfoDto> getNowMember(); |
| | |
| | | AjaxResult addMember(UserInfoDto userInfoDto); |
| | | |
| | | AjaxResult removeMember(UserInfoDto userInfoDto); |
| | | |
| | | |
| | | AjaxResult addFamily(ZfFamily zfFamily); |
| | | |
| | | AjaxResult updateFam(ZfFamily zfFamily); |
| | | |
| | | AjaxResult deleteFam(Long []ids); |
| | | } |
| | |
| | | package com.ruoyi.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | else |
| | | list = list(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult selectType() { |
| | | List<String> lis = list(new QueryWrapper<ZfProperty>().select("distinct (type)").lambda()).stream().map(ZfProperty::getType).collect(Collectors.toList()); |
| | | return AjaxResult.success(lis); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public AjaxResult updateData(ZfProperty zfProperty) { |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | Long familyId = myself.getFamilyId(); |
| | | |
| | | Long familyId = myself.getFamilyId(); |
| | | // System.out.println("sssssssssssss"); |
| | | //先根据id查询出数据的familyId,看看有没有权限操作 |
| | | Long dataFamilyId = getById(zfProperty.getId()).getFamilyId(); |
| | | |
| | |
| | | if(updateById(zfProperty)){ |
| | | //到数据库中查询对应的数据 |
| | | ZfProperty dataById = getById(zfProperty.getId()); |
| | | |
| | | //先到es中查询到对应那条数据在es的id |
| | | EsModel esResult = esService.findByCtId(dataById.getId().intValue(), "家庭资产"); |
| | | if (esResult == null){ |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | //操作es修改数据 |
| | | EsModel newModel = new EsModel(); |
| | |
| | | "by6",newModel.getBy6(), |
| | | "remark",newModel.getRemark() |
| | | ); |
| | | |
| | | try { |
| | | restHighLevelClient.update(updateRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | |
| | | //删除es中的数据 |
| | | zfPropertys.stream().forEach(zfProperty -> { |
| | | EsModel esModel = esService.findByCtId(zfProperty.getId().intValue(), "家庭资产"); |
| | | if(esModel!=null) |
| | | { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest,RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }} |
| | | }); |
| | | return AjaxResult.success(); |
| | | }else { |
New file |
| | |
| | | package com.ruoyi.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.utils.MapUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.LiveStreaming; |
| | | import com.ruoyi.mapper.LiveStreamingBackMapper; |
| | | import com.ruoyi.service.LiveStreamingBackService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class LiveStreamingBackServiceImpl extends ServiceImpl<LiveStreamingBackMapper, LiveStreaming> implements LiveStreamingBackService { |
| | | |
| | | private LambdaQueryWrapper<LiveStreaming> buildCondition(LiveStreaming liveStreaming) { |
| | | LambdaQueryWrapper<LiveStreaming> lqw = new LambdaQueryWrapper<>(); |
| | | // lqw.in(LiveStreaming::getFamilyId,familyIdList); |
| | | lqw.orderByDesc(LiveStreaming::getCreateTime); |
| | | lqw.like(StringUtils.isNotEmpty(liveStreaming.getTitle()), LiveStreaming::getTitle, liveStreaming.getTitle()) |
| | | .like(StringUtils.isNotEmpty(liveStreaming.getApplyPerson()),LiveStreaming::getApplyPerson,liveStreaming.getApplyPerson()) |
| | | .like(StringUtils.isNotEmpty(liveStreaming.getContactPerson()),LiveStreaming::getContactPerson,liveStreaming.getContactPerson()); |
| | | lqw.between(liveStreaming.getHappenStartTime() != null && liveStreaming.getHappenEndTime() != null,LiveStreaming::getCreateTime,liveStreaming.getHappenStartTime(),liveStreaming.getHappenEndTime()); |
| | | |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult selectDataList(LiveStreaming liveStreaming, Integer pageNum, Integer pageSize) { |
| | | //要查自己家庭的 |
| | | // ZInfoUser myself = zInfoUserService.getMyself(); |
| | | // if(myself==null) |
| | | // { |
| | | // // System.out.println("ssssss"); |
| | | // return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | // } |
| | | // Long familyId = myself.getFamilyId(); |
| | | // //也要查别人授权的 |
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | // List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | | // //加上自己家庭的id |
| | | // idList.add(familyId); |
| | | // String familyIds = listFamilyIds(); |
| | | // String secondFamilyAuthority = listSecondFamilyIds(); |
| | | LambdaQueryWrapper<LiveStreaming> lqw = buildCondition(liveStreaming); |
| | | |
| | | |
| | | Page<LiveStreaming> liveStreamingPage = new Page<>(pageNum, pageSize); |
| | | Page<LiveStreaming> pageResult = page(liveStreamingPage, lqw); |
| | | |
| | | List<LiveStreaming> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | |
| | | // List<LiveStreaming> dtoResult = markOwnData(familyId, beanRecords); |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | return AjaxResult.success(data); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<LiveStreaming> selectByIds(Long[] ids) { |
| | | List<LiveStreaming> list = new ArrayList<>(); |
| | | if (ids.length != 0) |
| | | list = listByIds(Arrays.asList(ids)); |
| | | else |
| | | list = list(); |
| | | return list; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.utils.MapUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.LiveStreamingMapper; |
| | | import com.ruoyi.service.EsService; |
| | | import com.ruoyi.service.LiveStreamingService; |
| | | import com.ruoyi.service.ZAuthorityService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ruoyi.constant.MenuAuthority.DOCTOR_LIST; |
| | | @Slf4j |
| | | @Service |
| | | public class LiveStreamingServiceImpl extends ServiceImpl<LiveStreamingMapper, LiveStreaming> implements LiveStreamingService { |
| | | |
| | | @Resource |
| | | ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | ZAuthorityService zAuthorityService; |
| | | |
| | | @Resource |
| | | private EsService esSer; |
| | | |
| | | private LambdaQueryWrapper<LiveStreaming> buildCondition(LiveStreaming liveStreaming) { |
| | | LambdaQueryWrapper<LiveStreaming> lqw = new LambdaQueryWrapper<>(); |
| | | // lqw.in(LiveStreaming::getFamilyId,familyIdList); |
| | | lqw.orderByDesc(LiveStreaming::getCreateTime); |
| | | lqw.like(StringUtils.isNotEmpty(liveStreaming.getTitle()), LiveStreaming::getTitle, liveStreaming.getTitle()) |
| | | .like(StringUtils.isNotEmpty(liveStreaming.getApplyPerson()),LiveStreaming::getApplyPerson,liveStreaming.getApplyPerson()) |
| | | .like(StringUtils.isNotEmpty(liveStreaming.getContactPerson()),LiveStreaming::getContactPerson,liveStreaming.getContactPerson()); |
| | | lqw.between(liveStreaming.getHappenStartTime() != null && liveStreaming.getHappenEndTime() != null,LiveStreaming::getCreateTime,liveStreaming.getHappenStartTime(),liveStreaming.getHappenEndTime()); |
| | | |
| | | return lqw; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<LiveStreaming> uniqueCondition(LiveStreaming liveStreaming){ |
| | | LambdaQueryWrapper<LiveStreaming> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(!StringUtils.isEmpty(liveStreaming.getTitle()), LiveStreaming::getTitle, liveStreaming.getTitle()); |
| | | lqw.eq(!StringUtils.isEmpty(liveStreaming.getContactPhone()), LiveStreaming::getContactPhone, liveStreaming.getContactPhone()); |
| | | lqw.eq(!StringUtils.isEmpty(liveStreaming.getApplyPerson()), LiveStreaming::getApplyPerson, liveStreaming.getApplyPerson()); |
| | | lqw.eq(!StringUtils.isEmpty(liveStreaming.getContactPerson()), LiveStreaming::getContactPerson, liveStreaming.getContactPerson()); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult selectDataList(LiveStreaming liveStreaming, Integer pageNum, Integer pageSize) { |
| | | //要查自己家庭的 |
| | | // ZInfoUser myself = zInfoUserService.getMyself(); |
| | | // if(myself==null) |
| | | // { |
| | | // // System.out.println("ssssss"); |
| | | // return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | // } |
| | | // Long familyId = myself.getFamilyId(); |
| | | // //也要查别人授权的 |
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | // List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | | // //加上自己家庭的id |
| | | // idList.add(familyId); |
| | | // String familyIds = listFamilyIds(); |
| | | // String secondFamilyAuthority = listSecondFamilyIds(); |
| | | LambdaQueryWrapper<LiveStreaming> lqw = buildCondition(liveStreaming); |
| | | |
| | | |
| | | Page<LiveStreaming> liveStreamingPage = new Page<>(pageNum, pageSize); |
| | | Page<LiveStreaming> pageResult = page(liveStreamingPage, lqw); |
| | | |
| | | List<LiveStreaming> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | |
| | | // List<LiveStreaming> dtoResult = markOwnData(familyId, beanRecords); |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | return AjaxResult.success(data); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<LiveStreaming> selectByIds(Long[] ids) { |
| | | List<LiveStreaming> list = new ArrayList<>(); |
| | | if (ids.length != 0) |
| | | list = listByIds(Arrays.asList(ids)); |
| | | else |
| | | list = list(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult addData(LiveStreaming liveStreaming) { |
| | | LambdaQueryWrapper<LiveStreaming> lqw = uniqueCondition(liveStreaming); |
| | | List<LiveStreaming> list = list(lqw); |
| | | |
| | | if(list.size()>0){ |
| | | throw new RuntimeException("请勿新增重复数据"); |
| | | } |
| | | |
| | | if (save(liveStreaming)) { |
| | | EsModel esModel = new EsModel(); |
| | | Long inte =liveStreaming.getId(); |
| | | String uuid = UUID.randomUUID().toString().replace("-",""); |
| | | esModel.setId(uuid); |
| | | esModel.setCtId(Long.valueOf(inte)); |
| | | esModel.setCtTableName("直播"); |
| | | esModel.setBy1(liveStreaming.getTitle()); |
| | | esModel.setBy2(liveStreaming.getApplyPerson()); |
| | | |
| | | //这里存储查询详情的路径 |
| | | esModel.setBy5("/zLIveStreaming"); |
| | | // esModel.setFid(familyId); |
| | | esSer.insertTable(esModel); |
| | | // System.out.println(esModel); |
| | | |
| | | return AjaxResult.success(); |
| | | } else { |
| | | return AjaxResult.error(); |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | 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.utils.MapUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.domain.Meeting;
|
| | | import com.ruoyi.domain.ZInfoUser;
|
| | | import com.ruoyi.domain.ZfLog;
|
| | | import com.ruoyi.mapper.MeetingRatifyMapper;
|
| | | import com.ruoyi.service.*;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.elasticsearch.action.update.UpdateRequest;
|
| | | import org.elasticsearch.client.RequestOptions;
|
| | | import org.elasticsearch.client.RestHighLevelClient;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import java.io.IOException;
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | |
|
| | | @Slf4j
|
| | | @Service
|
| | | public class MeetingRatifyServiceImpl extends ServiceImpl<MeetingRatifyMapper, Meeting> implements MeetingRatifyService {
|
| | |
|
| | | @Resource
|
| | | ZInfoUserService zInfoUserService;
|
| | |
|
| | | @Resource
|
| | | ZfLogService zfLogService;
|
| | |
|
| | | @Resource
|
| | | private EsService esSer;
|
| | |
|
| | | @Resource
|
| | | private RestHighLevelClient restHighLevelClient;
|
| | |
|
| | | private LambdaQueryWrapper<Meeting> buildCondition(Meeting meeting) {
|
| | | LambdaQueryWrapper<Meeting> lqw = new LambdaQueryWrapper<>();
|
| | | // lqw.in(ZfDoctor::getFamilyId,familyIdList);
|
| | | lqw.orderByDesc(Meeting::getCreateTime);
|
| | | lqw.like(StringUtils.isNotEmpty(meeting.getPlace()), Meeting::getPlace, meeting.getPlace())
|
| | | .like(StringUtils.isNotEmpty(meeting.getApplyApart()), Meeting::getApplyApart, meeting.getApplyApart());
|
| | | // .like(Integer.valueOf(meeting.getApplyPerson())!=null, Meeting::getApplyPerson, meeting.getApplyPerson());
|
| | | lqw.between(meeting.getHappenStartTime() != null && meeting.getHappenEndTime() != null, Meeting::getStartTime, meeting.getHappenStartTime(), meeting.getHappenEndTime());
|
| | |
|
| | | return lqw;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public AjaxResult selectDataList(Meeting meeting, Integer pageNum, Integer pageSize) {
|
| | | //要查自己家庭的
|
| | | ZInfoUser myself = zInfoUserService.getMyself();
|
| | | if(myself==null)
|
| | | {
|
| | | // System.out.println("ssssss");
|
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员");
|
| | | }
|
| | | Long familyId = myself.getFamilyId();
|
| | | // //也要查别人授权的
|
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | // List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | // //加上自己家庭的id
|
| | | // idList.add(familyId);
|
| | | // String familyIds = listFamilyIds();
|
| | | // String secondFamilyAuthority = listSecondFamilyIds();
|
| | | LambdaQueryWrapper<Meeting> lqw = buildCondition(meeting);
|
| | |
|
| | |
|
| | | Page<Meeting> meetingPage = new Page<>(pageNum, pageSize);
|
| | | Page<Meeting> pageResult = page(meetingPage, lqw);
|
| | |
|
| | | List<Meeting> beanRecords = pageResult.getRecords();//得到查询出来的数据
|
| | | // System.out.println(beanRecords);
|
| | |
|
| | |
|
| | |
|
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords);
|
| | | return AjaxResult.success(data); }
|
| | |
|
| | |
|
| | | @Override
|
| | | public AjaxResult updateData(Meeting meeting) {
|
| | |
|
| | | ZfLog zfLog = new ZfLog();
|
| | | zfLog.setUpdateTime(LocalDateTime.now());
|
| | | zfLog.setModule("会议审批");
|
| | | zfLog.setUpdater(zInfoUserService.getMyself().getNickName());
|
| | | zfLogService.save(zfLog);
|
| | |
|
| | | if (updateById(meeting)) {
|
| | | //到数据库中查询对应的数据
|
| | | Meeting dataById = getById(meeting.getId());
|
| | |
|
| | | //先到es中查询到对应那条数据在es的id
|
| | | EsModel esResult = esSer.findByCtId(dataById.getId().intValue(), "会议审批");
|
| | | // System.out.println("====================================" + meeting);
|
| | | if (esResult == null) {
|
| | | return AjaxResult.success();
|
| | | }
|
| | |
|
| | | //操作es修改数据
|
| | | EsModel newModel = new EsModel();
|
| | | if (meeting.getStatu() != 0) {
|
| | | newModel.setBy13(meeting.getStatu());
|
| | | } else {
|
| | | newModel.setBy13(dataById.getStatu());
|
| | | }
|
| | |
|
| | | UpdateRequest updateRequest = new UpdateRequest("allsearchdata", esResult.getId());
|
| | | updateRequest.doc(
|
| | | "by12", newModel.getBy13()
|
| | | );
|
| | | try {
|
| | | restHighLevelClient.update(updateRequest, RequestOptions.DEFAULT);
|
| | | } catch (IOException e) {
|
| | | throw new RuntimeException(e);
|
| | | }
|
| | |
|
| | | return AjaxResult.success();
|
| | | } else {
|
| | | return AjaxResult.error();
|
| | | }
|
| | | }}
|
New file |
| | |
| | | package com.ruoyi.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | 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.utils.MapUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.domain.*;
|
| | | import com.ruoyi.mapper.MeetingMapper;
|
| | | import com.ruoyi.service.*;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.elasticsearch.action.delete.DeleteRequest;
|
| | | import org.elasticsearch.action.update.UpdateRequest;
|
| | | import org.elasticsearch.client.RequestOptions;
|
| | | import org.elasticsearch.client.RestHighLevelClient;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import java.io.IOException;
|
| | | import java.sql.Timestamp;
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.*;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | import static com.ruoyi.constant.MenuAuthority.*;
|
| | |
|
| | | @Slf4j
|
| | | @Service
|
| | | public class MeetingServiceImpl extends ServiceImpl<MeetingMapper, Meeting> implements MeetingService {
|
| | |
|
| | | @Resource
|
| | | ZInfoUserService zInfoUserService;
|
| | |
|
| | | @Resource
|
| | | ZAuthorityService zAuthorityService;
|
| | |
|
| | | @Resource
|
| | | private EsService esSer;
|
| | |
|
| | | @Resource
|
| | | ZfLogService zfLogService;
|
| | |
|
| | | @Resource
|
| | | private RestHighLevelClient restHighLevelClient;
|
| | |
|
| | | @Resource
|
| | | private MeetingService meetingService;
|
| | |
|
| | | private LambdaQueryWrapper<Meeting> buildCondition(Meeting meeting) {
|
| | | LambdaQueryWrapper<Meeting> lqw = new LambdaQueryWrapper<>();
|
| | | // lqw.in(ZfDoctor::getFamilyId,familyIdList);
|
| | | lqw.orderByDesc(Meeting::getCreateTime);
|
| | | lqw.like(StringUtils.isNotEmpty(meeting.getPlace()), Meeting::getPlace, meeting.getPlace())
|
| | | .like(StringUtils.isNotEmpty(meeting.getApplyApart()), Meeting::getApplyApart, meeting.getApplyApart());
|
| | | // .like(Integer.valueOf(meeting.getApplyPerson())!=null, Meeting::getApplyPerson, meeting.getApplyPerson());
|
| | |
|
| | | lqw.between(meeting.getHappenStartTime() != null && meeting.getHappenEndTime() != null, Meeting::getStartTime, meeting.getHappenStartTime(), meeting.getHappenEndTime());
|
| | |
|
| | | return lqw;
|
| | | }
|
| | | private LambdaQueryWrapper<Meeting> uniqueCondition(Meeting meeting){
|
| | | LambdaQueryWrapper<Meeting> lqw = new LambdaQueryWrapper<>();
|
| | | lqw.eq(!StringUtils.isEmpty(meeting.getPlace()), Meeting::getPlace, meeting.getPlace());
|
| | | lqw.eq(!StringUtils.isEmpty(meeting.getApplyApart()), Meeting::getApplyApart, meeting.getApplyApart());
|
| | | lqw.eq(!StringUtils.isEmpty(meeting.getTitle()), Meeting::getTitle, meeting.getTitle());
|
| | | lqw.eq(!StringUtils.isEmpty(meeting.getConnPhone()), Meeting::getConnPhone, meeting.getConnPhone());
|
| | | // lqw.eq(meeting.getFamilyId()!=null,Meeting::getFamilyId,meeting.getFamilyId());
|
| | | lqw.eq(!StringUtils.isEmpty(String.valueOf(meeting.getApplyPerson())), Meeting::getApplyPerson, meeting.getApplyPerson());
|
| | | lqw.eq(!StringUtils.isEmpty(String.valueOf(meeting.getPartPeople())), Meeting::getPartPeople, meeting.getPartPeople());
|
| | | lqw.eq(!StringUtils.isEmpty(meeting.getConnPerson()), Meeting::getConnPerson, meeting.getConnPerson());
|
| | | return lqw;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public AjaxResult selectDataList(Meeting meeting, Integer pageNum, Integer pageSize) {
|
| | | //要查自己家庭的
|
| | | ZInfoUser myself = zInfoUserService.getMyself();
|
| | | if(myself==null)
|
| | | {
|
| | | // System.out.println("ssssss");
|
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员");
|
| | | }
|
| | | Long familyId = myself.getFamilyId();
|
| | | // //也要查别人授权的
|
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | // List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | // //加上自己家庭的id
|
| | | // idList.add(familyId);
|
| | | // String familyIds = listFamilyIds();
|
| | | // String secondFamilyAuthority = listSecondFamilyIds();
|
| | | LambdaQueryWrapper<Meeting> lqw = buildCondition(meeting);
|
| | |
|
| | |
|
| | | Page<Meeting> meetingPage = new Page<>(pageNum, pageSize);
|
| | | Page<Meeting> pageResult = page(meetingPage, lqw);
|
| | |
|
| | | List<Meeting> beanRecords = pageResult.getRecords();//得到查询出来的数据
|
| | | // System.out.println(beanRecords);
|
| | |
|
| | |
|
| | |
|
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords);
|
| | | return AjaxResult.success(data); }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<Meeting> selectByCondition(Meeting meeting) {
|
| | | //要查自己家庭的
|
| | | ZInfoUser myself = zInfoUserService.getMyself();
|
| | | // System.out.println("================");
|
| | |
|
| | | // Long familyId = myself.getFamilyId();
|
| | | //
|
| | | // //也要查别人授权的
|
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | // List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | // //加上自己家庭的id
|
| | | // idList.add(familyId);
|
| | |
|
| | | LambdaQueryWrapper<Meeting> lambdaQueryWrapper = buildCondition(meeting);
|
| | | List<Meeting> beanRecords = list(lambdaQueryWrapper);
|
| | | log.info("从数据库中查到的为:{}", beanRecords);
|
| | | return beanRecords;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Meeting> selectByIds(Long[] ids) {
|
| | | List<Meeting> list = new ArrayList<>();
|
| | | if (ids.length != 0)
|
| | | list = listByIds(Arrays.asList(ids));
|
| | | else
|
| | | list = list();
|
| | | return list;
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public AjaxResult importExcel(MultipartFile file) {
|
| | | ExcelUtil<Meeting> util = new ExcelUtil<>(Meeting.class);
|
| | | List<Meeting> dataList = null;
|
| | | try {
|
| | | dataList = util.importExcel(file.getInputStream());
|
| | | } catch (Exception e) {
|
| | | throw new RuntimeException(e);
|
| | | }
|
| | | log.info("数据列表为:{}", dataList);
|
| | |
|
| | |
|
| | | for (Meeting meeting : dataList) {
|
| | | meetingService.addData(meeting);
|
| | | }
|
| | |
|
| | | return AjaxResult.success("导入数据成功");
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public AjaxResult updateData(Meeting meeting) {
|
| | | // ZInfoUser myself = zInfoUserService.getMyself();
|
| | | // Long familyId = myself.getFamilyId();
|
| | | //
|
| | | // //先根据id查询出数据的familyId,看看有没有权限操作
|
| | | // Long dataFamilyId = getById(zfDoctor.getId()).getFamilyId();
|
| | | //
|
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | // List<Long> familyIdList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST_UPDATE)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | // familyIdList.add(familyId);
|
| | |
|
| | | // if (dataFamilyId!=null && !familyIdList.contains(dataFamilyId)) {
|
| | | // throw new RuntimeException("你没有权限操作此家庭的数据");
|
| | | // }
|
| | |
|
| | | //操作后加入日志
|
| | | ZfLog zfLog = new ZfLog();
|
| | | zfLog.setUpdateTime(LocalDateTime.now());
|
| | | zfLog.setModule("会议");
|
| | | zfLog.setUpdater(zInfoUserService.getMyself().getNickName());
|
| | | zfLogService.save(zfLog);
|
| | | // System.out.println("===================================="+meeting);
|
| | | if(updateById(meeting)){
|
| | | //到数据库中查询对应的数据
|
| | | Meeting dataById = getById(meeting.getId());
|
| | |
|
| | | //先到es中查询到对应那条数据在es的id
|
| | | EsModel esResult = esSer.findByCtId(dataById.getId().intValue(), "会议");
|
| | | // System.out.println("===================================="+meeting);
|
| | | if (esResult == null){
|
| | | return AjaxResult.success();
|
| | | }
|
| | |
|
| | | //操作es修改数据
|
| | | EsModel newModel = new EsModel();
|
| | | // System.out.println(meeting);
|
| | | // System.out.println("=============="+meeting.getConnPhone());
|
| | | if(meeting.getTitle()!=null){
|
| | | newModel.setBy1(meeting.getTitle());
|
| | | }else {
|
| | | newModel.setBy1(dataById.getTitle());
|
| | | }
|
| | |
|
| | | if(meeting.getPlace()!=null){
|
| | | newModel.setBy2(meeting.getPlace());
|
| | | }else {
|
| | | newModel.setBy2(dataById.getPlace());
|
| | | }
|
| | | //
|
| | | // if(StringUtils.isNotEmpty(String.valueOf(meeting.getConPeople()))){
|
| | | // newModel.setBy8(meeting.getConPeople());
|
| | | // }else {
|
| | | // newModel.setBy8(dataById.getConPeople());
|
| | | // }
|
| | | //
|
| | | // if(meeting.getPartPeople() == 0){
|
| | | // newModel.setBy9(meeting.getPartPeople());
|
| | | // }else {
|
| | | // newModel.setBy9(dataById.getPartPeople());
|
| | | // }
|
| | |
|
| | |
|
| | | // if(meeting.getApplyPerson() != 0){
|
| | | // newModel.setBy10(meeting.getApplyPerson());
|
| | | // }else {
|
| | | // newModel.setBy10(dataById.getApplyPerson());
|
| | | // }
|
| | | //
|
| | | // if(meeting.getApplyApart()!=null){
|
| | | // newModel.setBy3(meeting.getApplyApart());
|
| | | // }else {
|
| | | // newModel.setBy3(dataById.getApplyApart());
|
| | | // }
|
| | | //
|
| | | // if(String.valueOf(meeting.getStartTime()) != null){
|
| | | // newModel.setBy14(meeting.getStartTime());
|
| | | // }else {
|
| | | // newModel.setBy14(dataById.getStartTime());
|
| | | // }
|
| | | //
|
| | | // if(String.valueOf(meeting.getEndTime()) != null){
|
| | | // newModel.setBy15(meeting.getEndTime());
|
| | | // }else {
|
| | | // newModel.setBy15(dataById.getEndTime());
|
| | | // }
|
| | |
|
| | | //
|
| | | // if(meeting.getIsPlacebrand() != 0 ){
|
| | | // newModel.setBy11(meeting.getIsPlacebrand());
|
| | | // }else {
|
| | | // newModel.setBy11(dataById.getIsPlacebrand());
|
| | | // }
|
| | | //
|
| | | // if(meeting.getConnPhone()!=null){
|
| | | // newModel.setBy12(meeting.getConnPerson());
|
| | | // }else {
|
| | | // newModel.setBy12(dataById.getConnPerson());
|
| | | // }
|
| | |
|
| | | // if(meeting.getConnPhone()!=null){
|
| | | // newModel.setBy4(meeting.getConnPhone());
|
| | | // }else {
|
| | | // newModel.setBy4(dataById.getConnPhone());
|
| | | // }
|
| | | //
|
| | | // if(meeting.getStatu() != 0){
|
| | | // newModel.setBy13(meeting.getStatu());
|
| | | // }else {
|
| | | // newModel.setBy13(dataById.getStatu());
|
| | | // }
|
| | |
|
| | | // if(String.valueOf(meeting.getCreateTime()) !=null){
|
| | | // newModel.setBy16(meeting.getCreateTime());
|
| | | // }else {
|
| | | // newModel.setBy16(dataById.getCreateTime());
|
| | | // }
|
| | |
|
| | | UpdateRequest updateRequest = new UpdateRequest("allsearchdata", esResult.getId());
|
| | | updateRequest.doc(
|
| | | "by1",newModel.getBy1(),
|
| | | "by2",newModel.getBy2(),
|
| | | //"by3",newModel.getBy8(),
|
| | | // "by4",newModel.getBy9(),
|
| | | "by5",newModel.getBy10()
|
| | | // "by6",newModel.getBy11(),
|
| | | // "by7",newModel.getBy3(),
|
| | | // "by8",newModel.getBy14(),
|
| | | // "by9",newModel.getBy15(),
|
| | | // "by10",newModel.getBy12(),
|
| | | // "by11",newModel.getBy4(),
|
| | | // "by12",newModel.getBy13(),
|
| | | // "by13",newModel.getBy15()
|
| | |
|
| | | );
|
| | |
|
| | | try {
|
| | | restHighLevelClient.update(updateRequest, RequestOptions.DEFAULT);
|
| | | } catch (IOException e) {
|
| | | throw new RuntimeException(e);
|
| | | }
|
| | |
|
| | | return AjaxResult.success();
|
| | | }else {
|
| | | return AjaxResult.error();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public AjaxResult deleteData(Long[] ids) {
|
| | |
|
| | | // List<Meeting> dataList = meetingService.listByIds(Arrays.asList(ids));
|
| | | //
|
| | | // ZInfoUser myself = zInfoUserService.getMyself();
|
| | | // Long familyId = myself.getFamilyId();
|
| | | //
|
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | // List<Long> familyIdList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST_REMOVE)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | // familyIdList.add(familyId);
|
| | | //
|
| | | // for (Meeting data : dataList) {
|
| | | // if (!familyIdList.contains(data.getFamilyId())){
|
| | | // throw new RuntimeException("你没有权限操作此家庭的数据");
|
| | | // }
|
| | | // }
|
| | |
|
| | | List<Meeting> meetings = listByIds(Arrays.asList(ids));
|
| | |
|
| | | if (meetingService.removeByIds(Arrays.asList(ids))) {
|
| | |
|
| | | //删除es中的数据
|
| | | meetings.stream().forEach(meeting -> {
|
| | | EsModel esModel = esSer.findByCtId((meeting.getId().intValue()), "会议");
|
| | | if (esModel != null){
|
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
|
| | | try {
|
| | | restHighLevelClient.delete(deleteRequest,RequestOptions.DEFAULT);
|
| | | } catch (IOException e) {
|
| | | throw new RuntimeException(e);
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | return AjaxResult.success();
|
| | | }else {
|
| | | return AjaxResult.error();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public AjaxResult addData(Meeting meeting) {
|
| | |
|
| | | // System.out.println("-----------------000000000000");
|
| | | //
|
| | | // System.out.println(meeting.getStartTime());
|
| | | // 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 (meeting.getFamilyId()!=null && !familyIdList.contains(zfEvent.getFamilyId())) {
|
| | | // throw new RuntimeException("你没有权限操作此家庭的数据");
|
| | | // }
|
| | | //
|
| | | ////
|
| | | // if(meeting.getFamilyId() == null){
|
| | | // //默认添加自己家庭的数据
|
| | | // zfEvent.setFamilyId(familyId);
|
| | | // }
|
| | | //
|
| | | // 判断是否有重复数据
|
| | | LambdaQueryWrapper<Meeting> lqw = uniqueCondition(meeting);
|
| | | List<Meeting> list = list(lqw);
|
| | |
|
| | | if(list.size()>0){
|
| | | throw new RuntimeException("请勿新增重复数据");
|
| | | }
|
| | |
|
| | | if (save(meeting)) {
|
| | | EsModel esModel = new EsModel();
|
| | | Long inte =meeting.getId();
|
| | | String uuid = UUID.randomUUID().toString().replace("-","");
|
| | | esModel.setId(uuid);
|
| | | esModel.setCtId(Long.valueOf(inte));
|
| | | esModel.setCtTableName("会议记录");
|
| | | esModel.setBy1(meeting.getTitle());
|
| | | esModel.setBy2(meeting.getPlace());
|
| | | // esModel.setBy8(meeting.getConPeople());
|
| | | // esModel.setBy9(meeting.getPartPeople());
|
| | | // esModel.setBy10(meeting.getApplyPerson());
|
| | | // esModel.setBy3(meeting.getApplyApart());
|
| | | // esModel.setBy14(meeting.getStartTime());
|
| | | // esModel.setBy15(meeting.getEndTime());
|
| | | // esModel.setBy11(meeting.getIsPlacebrand());
|
| | | // esModel.setBy12(meeting.getConnPerson());
|
| | | // esModel.setBy4(meeting.getConnPhone());
|
| | | // esModel.setBy13(meeting.getStatu());
|
| | | // esModel.setBy16( meeting.getCreateTime());
|
| | | //这里存储查询详情的路径
|
| | | esModel.setBy5("/zMeeting");
|
| | | // esModel.setFid(familyId);
|
| | | esSer.insertTable(esModel);
|
| | | // System.out.println(esModel);
|
| | |
|
| | | return AjaxResult.success();
|
| | | } else {
|
| | | return AjaxResult.error();
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.ruoyi.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | 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.utils.MapUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.domain.*;
|
| | | import com.ruoyi.mapper.MeetingStatisticMapper;
|
| | | import com.ruoyi.service.*;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.elasticsearch.action.delete.DeleteRequest;
|
| | | import org.elasticsearch.action.update.UpdateRequest;
|
| | | import org.elasticsearch.client.RequestOptions;
|
| | | import org.elasticsearch.client.RestHighLevelClient;
|
| | | import org.springframework.stereotype.Service;
|
| | | import javax.annotation.Resource;
|
| | | import java.io.IOException;
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.*;
|
| | |
|
| | |
|
| | | @Slf4j
|
| | | @Service
|
| | | public class MeetingStatisticServiceImpl extends ServiceImpl<MeetingStatisticMapper, MeetingStatistic> implements MeetingStatisticService {
|
| | |
|
| | | @Resource
|
| | | ZInfoUserService zInfoUserService;
|
| | |
|
| | | @Resource
|
| | | ZfLogService zfLogService;
|
| | |
|
| | | @Resource
|
| | | private RestHighLevelClient restHighLevelClient;
|
| | |
|
| | | @Resource
|
| | | private EsService esSer;
|
| | |
|
| | | @Resource
|
| | | ZAuthorityService zAuthorityService;
|
| | |
|
| | | @Resource
|
| | | private MeetingStatisticService meetingStatisticService;
|
| | |
|
| | | private LambdaQueryWrapper<MeetingStatistic> uniqueCondition(MeetingStatistic meetingStatistic){
|
| | | LambdaQueryWrapper<MeetingStatistic> lqw = new LambdaQueryWrapper<>();
|
| | | lqw.eq(!StringUtils.isEmpty(meetingStatistic.getUseTime()), MeetingStatistic::getUseTime, meetingStatistic.getUseTime());
|
| | | lqw.eq(!StringUtils.isEmpty(meetingStatistic.getConferenceRoom()), MeetingStatistic::getConferenceRoom, meetingStatistic.getConferenceRoom());
|
| | | lqw.eq(!StringUtils.isEmpty(meetingStatistic.getTitle()), MeetingStatistic::getTitle, meetingStatistic.getTitle());
|
| | | // lqw.eq(meetingStatistic.getFamilyId()!=null,MeetingStatistic::getFamilyId,meeting.getFamilyId());
|
| | | lqw.eq(!StringUtils.isEmpty(meetingStatistic.getApplyPerson()), MeetingStatistic::getApplyPerson, meetingStatistic.getApplyPerson());
|
| | | lqw.eq(!StringUtils.isEmpty(String.valueOf(meetingStatistic.getRatifyPerson())), MeetingStatistic::getRatifyPerson, meetingStatistic.getRatifyPerson());
|
| | | lqw.eq(!StringUtils.isEmpty(String.valueOf(meetingStatistic.getStatus())), MeetingStatistic::getStatus, meetingStatistic.getStatus());
|
| | | lqw.eq(!StringUtils.isEmpty(String.valueOf(meetingStatistic.getFamilyId())), MeetingStatistic::getFamilyId, meetingStatistic.getFamilyId());
|
| | | return lqw;
|
| | | }
|
| | | public static void getDatePoor(Date endDate, Date nowDate, MeetingStatistic meetingStatistic) {
|
| | |
|
| | | long nd = 1000 * 24 * 60 * 60;
|
| | | long nh = 1000 * 60 * 60;
|
| | | long nm = 1000 * 60;
|
| | | long ns = 1000;
|
| | | // 获得两个时间的毫秒时间差异
|
| | | long diff = endDate.getTime() - nowDate.getTime();
|
| | | // 计算差多少天
|
| | | // long day = diff / nd;
|
| | | // 计算差多少小时
|
| | | long hour = diff % nd / nh;
|
| | | // 计算差多少分钟
|
| | | long min = diff % nd % nh / nm;
|
| | | // 计算差多少秒//输出结果
|
| | | long sec = diff % nd % nh % nm / ns;
|
| | | System.out.println(hour + "小时" + min + "分钟"+ sec + "秒");
|
| | | meetingStatistic.setUseTime(hour + "小时" + min + "分钟" + sec + "秒");
|
| | | }
|
| | | private LambdaQueryWrapper<MeetingStatistic> buildCondition(MeetingStatistic meetingStatistic) {
|
| | | LambdaQueryWrapper<MeetingStatistic> lqw = new LambdaQueryWrapper<>();
|
| | | lqw.select(MeetingStatistic::getFamilyId,MeetingStatistic::getCreateTime);
|
| | | return lqw;
|
| | | }
|
| | | @Override
|
| | | public AjaxResult selectDataList(MeetingStatistic meetingStatistic, Integer pageNum, Integer pageSize) {
|
| | | //要查自己家庭的
|
| | | ZInfoUser myself = zInfoUserService.getMyself();
|
| | | if(myself==null)
|
| | | {
|
| | | // System.out.println("ssssss");
|
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员");
|
| | | }
|
| | | Long familyId = myself.getFamilyId();
|
| | | // //也要查别人授权的
|
| | | // List<ZAuthority> authority = zAuthorityService.getAuthority();
|
| | | // List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST)).map(ZAuthority::getFid).collect(Collectors.toList());
|
| | | // //加上自己家庭的id
|
| | | // idList.add(familyId);
|
| | | // String familyIds = listFamilyIds();
|
| | | // String secondFamilyAuthority = listSecondFamilyIds();
|
| | | LambdaQueryWrapper<MeetingStatistic> lqw = new LambdaQueryWrapper<>();
|
| | | // LambdaQueryWrapper<MeetingStatistic> lqw = buildCondition(meetingStatistic);
|
| | |
|
| | |
|
| | | Page<MeetingStatistic> meetingStatisticPage = new Page<>(pageNum, pageSize);
|
| | | Page<MeetingStatistic> pageResult = page(meetingStatisticPage, lqw);
|
| | |
|
| | | List<MeetingStatistic> beanRecords = pageResult.getRecords();//得到查询出来的数据
|
| | | System.out.println("-----------数据库-----------"+beanRecords);
|
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords);
|
| | | return AjaxResult.success(data);
|
| | | }
|
| | | @Override
|
| | | public AjaxResult DataList(MeetingStatistic meetingStatistic) {
|
| | | LambdaQueryWrapper<MeetingStatistic> lambdaQueryWrapper = buildCondition(meetingStatistic);
|
| | | List<MeetingStatistic> beanRecords = list(lambdaQueryWrapper);
|
| | | log.info("从数据库中查到的为:{}", beanRecords);
|
| | | return AjaxResult.success(beanRecords);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public AjaxResult updateData(MeetingStatistic meetingStatistic) {
|
| | | ZfLog zfLog = new ZfLog();
|
| | | zfLog.setUpdateTime(LocalDateTime.now());
|
| | | zfLog.setModule("会议统计");
|
| | | zfLog.setUpdater(zInfoUserService.getMyself().getNickName());
|
| | | zfLogService.save(zfLog);
|
| | | System.out.println("===================================="+meetingStatistic);
|
| | | if(updateById(meetingStatistic)){
|
| | | //到数据库中查询对应的数据
|
| | | MeetingStatistic dataById = getById(meetingStatistic.getId());
|
| | |
|
| | | //先到es中查询到对应那条数据在es的id
|
| | | EsModel esResult = esSer.findByCtId(dataById.getId().intValue(), "会议统计");
|
| | | System.out.println("===================================="+meetingStatistic);
|
| | | if (esResult == null){
|
| | | return AjaxResult.success();
|
| | | }
|
| | |
|
| | | //操作es修改数据
|
| | | EsModel newModel = new EsModel();
|
| | | // System.out.println(meeting);
|
| | | // System.out.println("=============="+meetingStatistic.getConnPhone());
|
| | |
|
| | | // if (meetingStatistic.getUseTime()==null){
|
| | | // if(meetingStatistic.getHappenEndTime()!=null && meetingStatistic.getHappenStartTime() !=null){
|
| | | // getDatePoor(meetingStatistic.getHappenEndTime(),meetingStatistic.getHappenStartTime(),meetingStatistic);
|
| | | // System.out.println("===============使用时间====================="+meetingStatistic.getUseTime());
|
| | | // newModel.setBy2(meetingStatistic.getUseTime());
|
| | | // }else {
|
| | | // newModel.setBy2(dataById.getUseTime());
|
| | | // }
|
| | | // }
|
| | | if (meetingStatistic.getUseTime()==null){
|
| | | if(meetingStatistic.getHappenEndTime()!=null && meetingStatistic.getHappenStartTime() !=null){
|
| | | getDatePoor(meetingStatistic.getHappenEndTime(),meetingStatistic.getHappenStartTime(),meetingStatistic);
|
| | | newModel.setBy1(meetingStatistic.getUseTime());
|
| | | }
|
| | | else {
|
| | | newModel.setBy1(dataById.getUseTime());
|
| | | }
|
| | | }else {
|
| | | newModel.setBy1(dataById.getUseTime());
|
| | | }
|
| | | // if(meetingStatistic.getConferenceRoom()!=null){
|
| | | // newModel.setBy3(meetingStatistic.getConferenceRoom());
|
| | | // }else {
|
| | | // newModel.setBy3(dataById.getConferenceRoom());
|
| | | // }
|
| | | if(meetingStatistic.getTitle()!=null){
|
| | | newModel.setBy2(meetingStatistic.getTitle());
|
| | | }else {
|
| | | newModel.setBy2(dataById.getTitle());
|
| | | }
|
| | | // if(meetingStatistic.getApplyPerson()!=null){
|
| | | // newModel.setBy5(meetingStatistic.getApplyPerson());
|
| | | // }else {
|
| | | // newModel.setBy5(dataById.getApplyPerson());
|
| | | // }
|
| | | // if(meetingStatistic.getRatifyPerson() == 0){
|
| | | // newModel.setBy10(meetingStatistic.getRatifyPerson());
|
| | | // }else {
|
| | | // newModel.setBy10(dataById.getRatifyPerson());
|
| | | // }
|
| | | // if(meetingStatistic.getStatus() == 0){
|
| | | // newModel.setBy11(meetingStatistic.getStatus());
|
| | | // }else {
|
| | | // newModel.setBy11(dataById.getStatus());
|
| | | // }
|
| | | UpdateRequest updateRequest = new UpdateRequest("allsearchdata", esResult.getId());
|
| | | updateRequest.doc(
|
| | | "by1",newModel.getBy1(),
|
| | | "by2",newModel.getBy2()
|
| | |
|
| | | );
|
| | |
|
| | | LambdaQueryWrapper<MeetingStatistic> lqw = new LambdaQueryWrapper<>();
|
| | | List<MeetingStatistic> beanRecords = list(lqw);
|
| | | log.info("sss从数据库中查到的为:{}", beanRecords);
|
| | |
|
| | | try {
|
| | | restHighLevelClient.update(updateRequest, RequestOptions.DEFAULT);
|
| | | } catch (IOException e) {
|
| | | throw new RuntimeException(e);
|
| | | }
|
| | |
|
| | |
|
| | | return AjaxResult.success();
|
| | | }else {
|
| | | return AjaxResult.error();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public AjaxResult deleteData(Long[] ids) {
|
| | | List<MeetingStatistic> meetings = listByIds(Arrays.asList(ids));
|
| | | if (meetingStatisticService.removeByIds(Arrays.asList(ids))) {
|
| | | //删除es中的数据
|
| | | meetings.stream().forEach(meeting -> {
|
| | | EsModel esModel = esSer.findByCtId((meeting.getId().intValue()), "会议统计");
|
| | | if (esModel != null){
|
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
|
| | | try {
|
| | | restHighLevelClient.delete(deleteRequest,RequestOptions.DEFAULT);
|
| | | } catch (IOException e) {
|
| | | throw new RuntimeException(e);
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | return AjaxResult.success();
|
| | | }else {
|
| | | return AjaxResult.error();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<MeetingStatistic> selectByIds(Long[] ids) {
|
| | | List<MeetingStatistic> list = new ArrayList<>();
|
| | | if (ids.length != 0)
|
| | | list = listByIds(Arrays.asList(ids));
|
| | | else
|
| | | list = list();
|
| | | return list;
|
| | |
|
| | | }
|
| | | @Override
|
| | | public AjaxResult addData(MeetingStatistic meetingStatistic) {
|
| | |
|
| | | 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);
|
| | | // }
|
| | |
|
| | | //判断是否有重复数据
|
| | | LambdaQueryWrapper<MeetingStatistic> lqw = uniqueCondition(meetingStatistic);
|
| | | List<MeetingStatistic> list = list(lqw);
|
| | |
|
| | | if(list.size()>0){
|
| | | throw new RuntimeException("请勿新增重复数据");
|
| | | }
|
| | |
|
| | | if (save(meetingStatistic)) {
|
| | | EsModel esModel = new EsModel();
|
| | | Long inte = meetingStatistic.getId();
|
| | | String uuid = UUID.randomUUID().toString().replace("-","");
|
| | | esModel.setId(uuid);
|
| | | esModel.setCtId(inte);
|
| | | esModel.setCtTableName("会议统计");
|
| | | getDatePoor(meetingStatistic.getHappenEndTime(),meetingStatistic.getHappenStartTime(),meetingStatistic);
|
| | | System.out.println("===============使用时间2====================="+meetingStatistic.getUseTime());
|
| | | esModel.setBy1(meetingStatistic.getUseTime());
|
| | | esModel.setBy2(meetingStatistic.getTitle());
|
| | | // esModel.setBy5(meetingStatistic.getApplyPerson());
|
| | | //这里存储查询详情的路径
|
| | | esModel.setBy5("/zMeetingStatistic");
|
| | | esModel.setFid(familyId);
|
| | | esSer.insertTable(esModel);
|
| | |
|
| | | return AjaxResult.success();
|
| | | } else {
|
| | | return AjaxResult.error();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | @Override |
| | | public AjaxResult mySave(MemoBook memoBook) { |
| | | if(unionCondition(memoBook)){ |
| | | // System.out.println("--------------------=+++++++++++++"); |
| | | |
| | | // System.out.println(memoBook); |
| | | save(memoBook); |
| | | return AjaxResult.success(); |
| | | }else { |
| | |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.domain.TravelCount; |
| | | import com.ruoyi.domain.TravelDetail; |
| | | import com.ruoyi.domain.ZfProperty; |
| | | import com.ruoyi.mapper.TravelCountMapper; |
| | | import com.ruoyi.service.TravelCountService; |
| | | import com.ruoyi.service.TravelDetailService; |
| | |
| | | if(happenEndTime!=null){ |
| | | lqw.lt(TravelCount::getEndTime,happenEndTime); |
| | | } |
| | | lqw.orderByDesc(TravelCount::getCreateTime); |
| | | |
| | | Page<TravelCount> resultPage = page(new Page<>(pageNum, pageSize), lqw); |
| | | resultPage.getRecords().forEach(this::inputTotalData); |
| | |
| | | import com.ruoyi.domain.dto.AuthorityDto; |
| | | import com.ruoyi.domain.dto.AuthorityDto2; |
| | | import com.ruoyi.domain.dto.AuthorityDtoWithName; |
| | | import com.ruoyi.domain.dto.EmpowerDto; |
| | | import com.ruoyi.mapper.ZAuthorityMapper; |
| | | import com.ruoyi.service.ZAuthorityService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | |
| | | |
| | | } |
| | | |
| | | public void addData(ZAuthority za) |
| | | { |
| | | //判断是否重复授权 |
| | | |
| | | // |
| | | zAuthorityService.save(za); |
| | | |
| | | } |
| | | public AjaxResult saveZa(EmpowerDto zAuthority) |
| | | { |
| | | // boolean bl = zAuthorityService.saveOrUpdate(zAuthority); |
| | | Long [] uids = zAuthority.getUids(); |
| | | Long [] authoritys = zAuthority.getAuthoritys(); |
| | | for(Long uid : uids) |
| | | for(Long auri: authoritys) |
| | | { |
| | | ZAuthority za = new ZAuthority(); |
| | | za.setAuthority(auri); |
| | | za.setFid(zAuthority.getFid()); |
| | | za.setUid(uid); |
| | | addData(za); |
| | | } |
| | | // Long [] |
| | | // if(bl) |
| | | return AjaxResult.success("权限新增成功!"); |
| | | // else |
| | | // return AjaxResult.error("权限新增失败!"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteZa(EmpowerDto empowerDto) { |
| | | Long [] uids = empowerDto.getUids(); |
| | | Long [] authoritys = empowerDto.getAuthoritys(); |
| | | for(Long uid : uids) |
| | | for(Long auri: authoritys) |
| | | { |
| | | |
| | | LambdaQueryWrapper<ZAuthority> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZAuthority::getFid,empowerDto.getFid()) |
| | | .eq(ZAuthority::getAuthority, auri) |
| | | .eq(ZAuthority::getUid, uid); |
| | | |
| | | zAuthorityService.remove(lqw); |
| | | // addData(za); |
| | | } |
| | | return AjaxResult.success("权限收回成功!"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult listByFidAid(ZAuthority zAuthority) { |
| | | //找到对应家庭以及权限模块对应的用户 |
| | | LambdaQueryWrapper<ZAuthority> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZAuthority::getFid,zAuthority.getFid()) |
| | | .eq(ZAuthority::getAuthority, zAuthority.getAuthority()); |
| | | |
| | | List<ZAuthority> authorityList = list(lqw); |
| | | |
| | | List<Long> allUserListId = authorityList.stream().map(ZAuthority::getUid).collect(Collectors.toList());//授权用户数组数组 |
| | | |
| | | |
| | | LambdaQueryWrapper<ZInfoUser> lq = new LambdaQueryWrapper<>(); |
| | | lq.in(ZInfoUser::getUserId, allUserListId); |
| | | |
| | | List<ZInfoUser> userInfo = zInfoUserService.list(lq); |
| | | // Map<Long, String> usi = userInfo.stream().collect(Collectors.toMap(ZInfoUser::getUserId,ZInfoUser::getNickName)); |
| | | return AjaxResult.success(userInfo); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.domain.ZfRelation; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.domain.dto.*; |
| | | import com.ruoyi.mapper.ZInfoUserMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult getInfoByfid(Long fid) { |
| | | LambdaQueryWrapper<ZInfoUser> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZInfoUser::getFamilyId, fid); |
| | | lqw.eq(ZInfoUser::getIsMyFamily, 1L); |
| | | lqw.isNull(ZInfoUser::getSpouseId); |
| | | List<ZInfoUser> list = list(lqw); |
| | | |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<ZInfoUser> buildCondition(ZInfoUser zInfoUser) { |
| | | |
| | | LambdaQueryWrapper<ZInfoUser> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | log.info("返回的数据为:{}", list); |
| | | return list; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult removeByUserName(List<String> userName) { |
| | | LambdaQueryWrapper<ZInfoUser> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ZInfoUser::getNickName,String.valueOf(userName.get(0))); |
| | | System.out.println(userName.get(0)); |
| | | List<ZInfoUser> beanRecords = list(lqw); |
| | | System.out.println("555555555555555555"+beanRecords); |
| | | List<Long> ids = list(lqw).stream().map(ZInfoUser::getUserId).collect(Collectors.toList());; |
| | | removeByIds(ids); |
| | | return AjaxResult.success("删除成功"); |
| | | } |
| | | |
| | | @Override |
| | | public List<ZInfoUser> selectByFamId(long fid) { |
| | | LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfFamily::getId, fid); |
| | | ZfFamily zfFamily = zfFamilyService.list(lqw).get(0); |
| | | LambdaQueryWrapper<ZInfoUser> lqws = new LambdaQueryWrapper<>(); |
| | | lqws.eq(ZInfoUser::getFatherId, zfFamily.getFid()); |
| | | // lqws.eq(ZInfoUser::getMomId, zfFamily.getMid()); |
| | | List<ZInfoUser> list = list(lqws); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | List<ZInfoUser> myFamilyPeopleList = allPeopleList.stream().filter(people -> people.getUserId() != 1 && people.getIsMyFamily() == 1).collect(Collectors.toList()); |
| | | |
| | | |
| | | result = allPeopleList.stream().filter(people -> people.getUserId() != 1 && (people.getFatherId() == 0 || people.getMomId() == 0) && people.getIsMyFamily() == 1) |
| | | result = allPeopleList.stream().filter(people -> people!=null && people.getUserId() != 1 && ((people.getFatherId()!=null &&people.getFatherId() == 0 )|| (people.getMomId()!=null&&people.getMomId() == 0)) && people.getIsMyFamily() == 1) |
| | | .map(people -> { |
| | | // System.out.println("======================================="); |
| | | // System.out.println(people); |
| | | if (depth > 1) { |
| | | people.setIdentity(1); |
| | | //根据配偶id查询配偶的数据,封装好一起返回 |
| | | Long spouseId = people.getSpouseId(); |
| | | ZInfoUser spouse = zInfoUserService.getById(spouseId); |
| | | spouse.setIdentity(1); |
| | | people.setSpouse(spouse); |
| | | people.setChildList(fillChildren(people, myFamilyPeopleList, depth - 1)); |
| | | if(people!=null) { |
| | | people.setIdentity(1); |
| | | //根据配偶id查询配偶的数据,封装好一起返回 |
| | | Long spouseId = people.getSpouseId(); |
| | | if (spouseId != null) { |
| | | ZInfoUser spouse = zInfoUserService.getById(spouseId); |
| | | spouse.setIdentity(1); |
| | | people.setSpouse(spouse); |
| | | } |
| | | people.setChildList(fillChildren(people, myFamilyPeopleList, depth - 1)); |
| | | } |
| | | } |
| | | // System.out.println("+++++++++++++++++++++++++++++"); |
| | | // System.out.println(people); |
| | | return people; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | |
| | | //System.out.println("--------------++++++++++++++++--------------"); |
| | | return AjaxResult.success(result); |
| | | |
| | | } |
| | |
| | | // List<ZInfoUser> allPeopleList = list(); |
| | | List<ZInfoUser> result = null; |
| | | try { |
| | | result = allPeopleList.stream().filter(people -> people.getUserId() != 1 && (people.getFatherId() == 0 || people.getMomId() == 0)) |
| | | result = allPeopleList.stream().filter(people -> people.getUserId() != 1 && ((people.getFatherId()!=null&&people.getFatherId() == 0) || (people.getMomId()!=null&&people.getMomId() == 0))) |
| | | .map(people -> { |
| | | if (depth > 1) { |
| | | people.setIdentity(1); |
| | |
| | | @Override |
| | | public ZInfoUser getInfoById(Long userId) { |
| | | ZInfoUser user = getById(userId); |
| | | Long familyId = user.getFamilyId(); |
| | | String familyName = zfFamilyService.getById(familyId).getName(); |
| | | String roleName = zfRoleService.getById(user.getRoleId()).getName(); |
| | | user.setFamilyName(familyName); |
| | | user.setRoleName(roleName); |
| | | |
| | | |
| | | if(user!=null) |
| | | { |
| | | Long familyId = user.getFamilyId(); |
| | | // System.out.println("dddddddddddddddddddd"); |
| | | |
| | | String roleName = zfRoleService.getById(user.getRoleId()).getName(); |
| | | |
| | | user.setRoleName(roleName); |
| | | System.out.println("dddddddddddddddddddd"); |
| | | System.out.println(familyId); |
| | | if(familyId!=-1) |
| | | { |
| | | String familyName = zfFamilyService.getById(familyId).getName(); |
| | | user.setFamilyName(familyName); |
| | | } |
| | | } |
| | | return user; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult listAllFamilyPeople() { |
| | | // List<ZInfoUser> lis = list(); |
| | | // for(ZInfoUser tm: lis) |
| | | // { |
| | | // System.out.println(tm.getRoleId()); |
| | | // } |
| | | List<ZInfoUser> collect = list().stream().filter(zInfoUser -> zInfoUser!=null&&zInfoUser.getRoleId()!=null&&zInfoUser.getRoleId()== 3).collect(Collectors.toList()); |
| | | return AjaxResult.success(collect); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult listMySelfAndSpouse(Long id) { |
| | | LambdaQueryWrapper<ZInfoUser> lqw1 = new LambdaQueryWrapper<>(); |
| | | lqw1.eq(ZInfoUser::getUserId, id); |
| | |
| | | // ).collect(Collectors.toList()); |
| | | |
| | | List<ZInfoUser> collect = allPeopleList.stream().filter( |
| | | one -> (one.getFatherId() == people.getUserId() || one.getMomId() == people.getUserId()) && (people.getIsMyFamily() == 1) |
| | | one -> ((one.getFamilyId()!=null && one.getFatherId() == people.getUserId()) || (one.getMomId()!=null&&one.getMomId() == people.getUserId())) && (people.getIsMyFamily() == 1) |
| | | ).map( |
| | | one -> { |
| | | if (depth == 1) { |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | 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.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.*; |
| | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | ZfDoctorShareService zfDoctorShareService; |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult selectDoctorList(ZfDoctor zfDoctor, Integer pageNum, Integer pageSize) { |
| | | // LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor); |
| | |
| | | // return AjaxResult.success(data); |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if (myself == null) { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | idList.add(familyId); |
| | | // String familyIds = listFamilyIds(); |
| | | // String secondFamilyAuthority = listSecondFamilyIds(); |
| | | LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor, idList); |
| | | |
| | | //查看别人分享 |
| | | List<ZfDoctor> bs = zfDoctorShareService.listUserId(myself.getUserId()); |
| | | |
| | | LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor, idList); |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNum, pageSize); |
| | | Page<ZfDoctor> pageResult = page(zfDoctorPage, lqw); |
| | |
| | | List<ZfDoctor> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | |
| | | List<ZfDoctor> dtoResult = markOwnData(familyId, beanRecords); |
| | | |
| | | dtoResult.addAll(bs); |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, dtoResult); |
| | | return AjaxResult.success(data); |
| | | } |
| | |
| | | //加上自己家庭的id |
| | | idList.add(familyId); |
| | | |
| | | //查看别人分享 |
| | | List<ZfDoctor> bs = zfDoctorShareService.listUserId(myself.getUserId()); |
| | | |
| | | LambdaQueryWrapper<ZfDoctor> lambdaQueryWrapper = buildCondition(zfDoctor, idList); |
| | | List<ZfDoctor> beanRecords = list(lambdaQueryWrapper); |
| | | beanRecords.addAll(bs); |
| | | log.info("从数据库中查到的为:{}", beanRecords); |
| | | return markOwnData(familyId, beanRecords); |
| | | } |
| | | |
| | | public List<ZfDoctor> markOwnData(Long familyId,List<ZfDoctor> beanRecords){ |
| | | public List<ZfDoctor> markOwnData(Long familyId, List<ZfDoctor> beanRecords) { |
| | | return beanRecords.stream().peek( |
| | | bean -> { |
| | | if (bean.getFamilyId() == familyId) { |
| | |
| | | bean.setOwnData(0); |
| | | } |
| | | } |
| | | ).sorted((a,b)-> b.getOwnData()-a.getOwnData()).collect(Collectors.toList()); |
| | | ).sorted((a, b) -> b.getOwnData() - a.getOwnData()).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | log.info("数据列表为:{}", dataList); |
| | | |
| | | for (ZfDoctor zfDoctor : dataList) { |
| | | zfDoctorService.addData(zfDoctor); |
| | | } |
| | | |
| | | for (ZfDoctor zfDoctor : dataList) { |
| | | if (zfDoctor.getSymptom().length() == 0 || zfDoctor.getSymptom() == null) { |
| | | throw new RuntimeException("症状为空,导入数据失败"); |
| | | } else { |
| | | zfDoctorService.addData(zfDoctor); |
| | | } |
| | | } |
| | | return AjaxResult.success("导入数据成功"); |
| | | |
| | | } |
| | |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | Long familyId = myself.getFamilyId(); |
| | | |
| | | if(familyId == null){ |
| | | if (familyId == null) { |
| | | throw new RuntimeException("您还未加入任何家庭"); |
| | | } |
| | | |
| | |
| | | List<Long> familyIdList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST_ADD)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | | familyIdList.add(familyId); |
| | | |
| | | if (zfDoctor.getFamilyId()!=null && !familyIdList.contains(zfDoctor.getFamilyId())) { |
| | | // List<ZfDoctorShare> authority1 = zfDoctorShareService.getAuthority(); |
| | | // List<Long> idList1 = authority1.stream().filter(auth -> auth.getShareContent().toString().equals(DOCTOR_LIST)).map(ZfDoctorShare::getShareId).collect(Collectors.toList()); |
| | | zfDoctorService.addData(zfDoctor); |
| | | |
| | | if (zfDoctor.getFamilyId() != null && !familyIdList.contains(zfDoctor.getFamilyId())) { |
| | | throw new RuntimeException("你没有权限操作此家庭的数据"); |
| | | } |
| | | |
| | | |
| | | if(zfDoctor.getFamilyId() == null){ |
| | | if (zfDoctor.getFamilyId() == null) { |
| | | //默认添加自己家庭的数据 |
| | | zfDoctor.setFamilyId(familyId); |
| | | } |
| | |
| | | LambdaQueryWrapper<ZfDoctor> lqw = uniqueCondition(zfDoctor); |
| | | List<ZfDoctor> list = list(lqw); |
| | | |
| | | if(list.size()>0){ |
| | | if (list.size() > 0) { |
| | | throw new RuntimeException("请勿新增重复数据"); |
| | | } |
| | | |
| | | if (save(zfDoctor)) { |
| | | EsModel esModel = new EsModel(); |
| | | Integer inte = zfDoctor.getId().intValue(); |
| | | String uuid = UUID.randomUUID().toString().replace("-",""); |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | esModel.setId(uuid); |
| | | esModel.setCtId(Long.valueOf(inte)); |
| | | esModel.setCtTableName("家庭小医生"); |
| | |
| | | esModel.setBy5("/family/zfDoctor"); |
| | | esModel.setBy6(zfDoctor.getCmedical()); |
| | | esModel.setBy7(zfDoctor.getWmedical()); |
| | | // esModel.setBy7(); |
| | | esModel.setRemark(zfDoctor.getRemark()); |
| | | esModel.setFid(familyId); |
| | | |
| | | |
| | | //这里存储查询详情的路径 |
| | | esService.insertTable(esModel); |
| | | return AjaxResult.success(); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | ZfLogService zfLogService; |
| | |
| | | List<Long> familyIdList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST_UPDATE)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | | familyIdList.add(familyId); |
| | | |
| | | if (dataFamilyId!=null && !familyIdList.contains(dataFamilyId)) { |
| | | if (dataFamilyId != null && !familyIdList.contains(dataFamilyId)) { |
| | | throw new RuntimeException("你没有权限操作此家庭的数据"); |
| | | } |
| | | |
| | |
| | | zfLog.setUpdater(zInfoUserService.getMyself().getNickName()); |
| | | zfLogService.save(zfLog); |
| | | |
| | | if(updateById(zfDoctor)){ |
| | | if (updateById(zfDoctor)) { |
| | | //到数据库中查询对应的数据 |
| | | ZfDoctor dataById = getById(zfDoctor.getId()); |
| | | |
| | | //先到es中查询到对应那条数据在es的id |
| | | EsModel esResult = esService.findByCtId(dataById.getId().intValue(), "家庭小医生"); |
| | | |
| | | if (esResult == null){ |
| | | if (esResult == null) { |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | //操作es修改数据 |
| | | EsModel newModel = new EsModel(); |
| | | if(zfDoctor.getType()!=null){ |
| | | if (zfDoctor.getType() != null) { |
| | | newModel.setBy1(zfDoctor.getType()); |
| | | }else { |
| | | } else { |
| | | newModel.setBy1(dataById.getType()); |
| | | } |
| | | |
| | | if(zfDoctor.getSymptom()!=null){ |
| | | if (zfDoctor.getSymptom() != null) { |
| | | newModel.setBy2(zfDoctor.getSymptom()); |
| | | }else { |
| | | } else { |
| | | newModel.setBy2(dataById.getSymptom()); |
| | | } |
| | | |
| | | if(zfDoctor.getEffect()!=null){ |
| | | if (zfDoctor.getEffect() != null) { |
| | | newModel.setBy3(zfDoctor.getEffect()); |
| | | }else { |
| | | } else { |
| | | newModel.setBy3(dataById.getEffect()); |
| | | } |
| | | |
| | | if(zfDoctor.getSuitable()!=null){ |
| | | if (zfDoctor.getSuitable() != null) { |
| | | newModel.setBy4(zfDoctor.getSuitable()); |
| | | }else { |
| | | } else { |
| | | newModel.setBy4(dataById.getSuitable()); |
| | | } |
| | | |
| | | if(zfDoctor.getCmedical()!=null){ |
| | | if (zfDoctor.getCmedical() != null) { |
| | | newModel.setBy6(zfDoctor.getCmedical()); |
| | | }else { |
| | | } else { |
| | | newModel.setBy6(dataById.getCmedical()); |
| | | } |
| | | |
| | | if(zfDoctor.getWmedical()!=null){ |
| | | if (zfDoctor.getWmedical() != null) { |
| | | newModel.setBy7(zfDoctor.getWmedical()); |
| | | }else { |
| | | } else { |
| | | newModel.setBy7(dataById.getWmedical()); |
| | | } |
| | | |
| | | if(zfDoctor.getRemark()!=null){ |
| | | if (zfDoctor.getRemark() != null) { |
| | | newModel.setRemark(zfDoctor.getRemark()); |
| | | }else { |
| | | } else { |
| | | newModel.setRemark(dataById.getRemark()); |
| | | } |
| | | |
| | | |
| | | UpdateRequest updateRequest = new UpdateRequest("allsearchdata", esResult.getId()); |
| | | updateRequest.doc( |
| | | "by1",newModel.getBy1(), |
| | | "by2",newModel.getBy2(), |
| | | "by3",newModel.getBy3(), |
| | | "by4",newModel.getBy4(), |
| | | "by6",newModel.getBy6(), |
| | | "by7",newModel.getBy7(), |
| | | "remark",newModel.getRemark() |
| | | "by1", newModel.getBy1(), |
| | | "by2", newModel.getBy2(), |
| | | "by3", newModel.getBy3(), |
| | | "by4", newModel.getBy4(), |
| | | "by6", newModel.getBy6(), |
| | | "by7", newModel.getBy7(), |
| | | "remark", newModel.getRemark() |
| | | ); |
| | | |
| | | try { |
| | |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | |
| | | return AjaxResult.success(); |
| | | }else { |
| | | } else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | |
| | | familyIdList.add(familyId); |
| | | |
| | | for (ZfDoctor data : dataList) { |
| | | if (!familyIdList.contains(data.getFamilyId())){ |
| | | if (!familyIdList.contains(data.getFamilyId())) { |
| | | throw new RuntimeException("你没有权限操作此家庭的数据"); |
| | | } |
| | | } |
| | |
| | | zfDoctors.stream().forEach(zfDoctor -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctor.getId().intValue(), "家庭小医生"); |
| | | |
| | | if (esModel != null){ |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest,RequestOptions.DEFAULT); |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | }else { |
| | | } else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | |
| | | lqw.eq(StringUtils.isNotEmpty(zfDoctor.getEffect()), ZfDoctor::getEffect, zfDoctor.getEffect()); |
| | | lqw.eq(StringUtils.isNotEmpty(zfDoctor.getSuitable()), ZfDoctor::getSuitable, zfDoctor.getSuitable()); |
| | | lqw.eq(StringUtils.isNotEmpty(zfDoctor.getRemark()), ZfDoctor::getRemark, zfDoctor.getRemark()); |
| | | lqw.eq(zfDoctor.getFamilyId()!=null,ZfDoctor::getFamilyId,zfDoctor.getFamilyId()); |
| | | lqw.eq(zfDoctor.getFamilyId() != null, ZfDoctor::getFamilyId, zfDoctor.getFamilyId()); |
| | | return lqw; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<ZfDoctor> buildCondition(ZfDoctor zfDoctor,List<Long> familyIdList) { |
| | | private LambdaQueryWrapper<ZfDoctor> buildCondition(ZfDoctor zfDoctor, List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfDoctor> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ZfDoctor::getFamilyId,familyIdList); |
| | | lqw.in(ZfDoctor::getFamilyId, familyIdList); |
| | | lqw.orderByDesc(ZfDoctor::getCreateTime); |
| | | lqw.like(StringUtils.isNotEmpty(zfDoctor.getType()), ZfDoctor::getType, zfDoctor.getType()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getSymptom()), ZfDoctor::getSymptom, zfDoctor.getSymptom()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getDuration()), ZfDoctor::getDuration, zfDoctor.getDuration()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getEffect()), ZfDoctor::getEffect, zfDoctor.getEffect()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getSuitable()), ZfDoctor::getSuitable, zfDoctor.getSuitable()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getWmedical()),ZfDoctor::getWmedical,zfDoctor.getWmedical()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getCmedical()),ZfDoctor::getCmedical,zfDoctor.getCmedical()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getWmedical()), ZfDoctor::getWmedical, zfDoctor.getWmedical()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getCmedical()), ZfDoctor::getCmedical, zfDoctor.getCmedical()) |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getRemark()), ZfDoctor::getRemark, zfDoctor.getRemark()); |
| | | if (StringUtils.isNotEmpty(zfDoctor.getPrescription())){ |
| | | if (StringUtils.isNotEmpty(zfDoctor.getPrescription())) { |
| | | lqw.and(wrapper -> { |
| | | wrapper.like(StringUtils.isNotEmpty(zfDoctor.getPrescription()),ZfDoctor::getWmedical,zfDoctor.getPrescription()) |
| | | wrapper.like(StringUtils.isNotEmpty(zfDoctor.getPrescription()), ZfDoctor::getWmedical, zfDoctor.getPrescription()) |
| | | .or() |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getPrescription()),ZfDoctor::getCmedical,zfDoctor.getPrescription()); |
| | | .like(StringUtils.isNotEmpty(zfDoctor.getPrescription()), ZfDoctor::getCmedical, zfDoctor.getPrescription()); |
| | | }); |
| | | } |
| | | return lqw; |
| | | } |
| | | } |
| | | |
| | | // private List<Long> buildCondition1(){ |
| | | // List<ZfDoctorShare> authority1 = zfDoctorShareService.getAuthority(); |
| | | // List<Long> idList1 = authority1.stream().filter(auth -> auth.getShareContent().toString().equals(DOCTOR_LIST)).map(ZfDoctorShare::getShareId).collect(Collectors.toList()); |
| | | // return idList1; |
| | | // } |
| | | // private LambdaQueryWrapper<ZfDoctor> buildCondition2(ZfDoctor zfDoctor, List<Long> IdList) { |
| | | // LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | // lqw.in(ZfDoctorShare::getShareId, IdList); |
| | | // List<ZfDoctorShare> beanRecords = list(lqw); |
| | | // for (ZfDoctorShare shareContent : beanRecords){ |
| | | // zfDoctorService.getById(shareContent); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.ShareMore; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfDoctor; |
| | | import com.ruoyi.domain.ZfDoctorShare; |
| | | import com.ruoyi.mapper.ZfDoctorShareMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfDoctorService; |
| | | import com.ruoyi.service.ZfDoctorShareService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class ZfDoctorShareServiceImpl extends ServiceImpl<ZfDoctorShareMapper, ZfDoctorShare> implements ZfDoctorShareService { |
| | | @Resource |
| | | private ZfDoctorService zfDoctorService; |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | private LambdaQueryWrapper<ZfDoctorShare> uniqueCondition(ZfDoctorShare zfDoctorShare) { |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDoctorShare.getShareId())), ZfDoctorShare::getShareId, zfDoctorShare.getShareId()); |
| | | lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfDoctorShare.getShareContent())), ZfDoctorShare::getShareContent, zfDoctorShare.getShareContent()); |
| | | return lqw; |
| | | } |
| | | @Override |
| | | public List<ZfDoctorShare> getAuthority() { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,userId); |
| | | |
| | | return list(lqw); |
| | | } |
| | | |
| | | @Resource |
| | | ZfDoctorShareService zfDoctorShareService; |
| | | |
| | | public void addData(ZfDoctorShare za) |
| | | { |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = uniqueCondition(za); |
| | | List<ZfDoctorShare> list = list(lqw); |
| | | |
| | | if(list.size()>0){ |
| | | throw new RuntimeException("请勿分享重复数据"); |
| | | } |
| | | else { |
| | | zfDoctorShareService.save(za); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult saveZa(ShareMore zfDoctor) { |
| | | // boolean bl = zAuthorityService.saveOrUpdate(zAuthority); |
| | | Long [] shareIds = zfDoctor.getShareIds(); |
| | | Long [] shareContents = zfDoctor.getShareContents(); |
| | | for (Long shareId : shareIds) { |
| | | for (Long shareContent : shareContents) { |
| | | ZfDoctorShare za = new ZfDoctorShare(); |
| | | za.setUserId(getUserId()); |
| | | za.setShareContent(shareContent); |
| | | za.setShareId(shareId); |
| | | addData(za); |
| | | } |
| | | } |
| | | // Long [] |
| | | // if(bl) |
| | | return AjaxResult.success("分享成功!"); |
| | | // else |
| | | // return AjaxResult.error("权限新增失败!"); |
| | | |
| | | |
| | | } |
| | | /** |
| | | * 根据UserId和分享人shareId查看已经授权给那些人那些数据 |
| | | */ |
| | | @Override |
| | | public AjaxResult listByFidAid(ShareMore zfDoctor) { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | Long [] shareIds = zfDoctor.getShareIds(); |
| | | List<ZfDoctor> beanRecord3 = new ArrayList<>(); |
| | | for (Long shareId : shareIds) { |
| | | { |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,shareId) |
| | | .eq(ZfDoctorShare::getUserId, getUserId()); |
| | | List<ZfDoctorShare> beanRecords = list(lqw); |
| | | for (ZfDoctorShare beanRecord : beanRecords ) { |
| | | beanRecord3.add(zfDoctorService.getById(beanRecord.getShareContent())); |
| | | } |
| | | } |
| | | } |
| | | log.info("从数据库中查到的为:{}", beanRecord3); |
| | | |
| | | return AjaxResult.success(beanRecord3); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteZa(ShareMore zfDoctor) { |
| | | Long [] shareIds = zfDoctor.getShareIds(); |
| | | Long [] shareContents = zfDoctor.getShareContents(); |
| | | for(Long shareId : shareIds) |
| | | for(Long shareContent: shareContents) |
| | | { |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,shareId) |
| | | .eq(ZfDoctorShare::getShareContent, shareContent) |
| | | .eq(ZfDoctorShare::getUserId, getUserId()); |
| | | |
| | | zfDoctorShareService.remove(lqw); |
| | | // addData(za); |
| | | } |
| | | return AjaxResult.success("数据收回成功!"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 用户自己查看别人分享的数据和分享人 |
| | | */ |
| | | @Override |
| | | public AjaxResult listByUserId() { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | HashMap<Long,ZfDoctor> bs = new HashMap<>(); |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,getUserId()); |
| | | List<ZfDoctorShare> beanRecords = list(lqw); |
| | | for (ZfDoctorShare beanRecord : beanRecords ) { |
| | | bs.put(beanRecord.getUserId(),zfDoctorService.getById(beanRecord.getShareContent())); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | return AjaxResult.success(bs); |
| | | |
| | | } |
| | | /** |
| | | * 用户自己查看别人分享的数据 |
| | | */ |
| | | @Override |
| | | public List<ZfDoctor> listUserId(Long shareId) { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | List<ZfDoctor> bs = new ArrayList<>(); |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,shareId); |
| | | List<ZfDoctorShare> beanRecords = list(lqw); |
| | | for (ZfDoctorShare beanRecord : beanRecords ) { |
| | | ZfDoctor bs2 = zfDoctorService.getById(beanRecord.getShareContent()); |
| | | bs2.setShareId(beanRecord.getUserId()); |
| | | bs.add(bs2); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | return bs; |
| | | |
| | | } |
| | | public Long getUserId(){ |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | return myself.getUserId(); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | // String secondFamilyIds = listSecondFamilyIds(); |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | System.out.println("================"); |
| | | |
| | | Long familyId = myself.getFamilyId(); |
| | | |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | |
| | | public AjaxResult selectDataList(ZfEvent zfEvent, Integer pageNum, Integer pageSize) { |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | System.out.println("++++++++++++++++"); |
| | | System.out.println(familyId); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | | //加上自己家庭的id |
| | | idList.add(familyId); |
| | | System.out.println(idList.size()); |
| | | // String familyIds = listFamilyIds(); |
| | | // String secondFamilyAuthority = listSecondFamilyIds(); |
| | | LambdaQueryWrapper<ZfEvent> lqw = buildCondition(zfEvent, idList); |
| | |
| | | |
| | | List<ZfEvent> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | |
| | | System.out.println(beanRecords); |
| | | System.out.println(beanRecords.size()); |
| | | List<ZfEvent> dtoResult = markOwnData(familyId, beanRecords); |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, dtoResult); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | ZfFamilyMapper zfFamilyMapper; |
| | | @Resource |
| | | ZfFamilyService zfFamilyService; |
| | | |
| | | @Override |
| | | public ZfFamily getByNameAndUser(ZfFamily zfFamily) { |
| | | LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfFamily::getName,zfFamily.getName()).or().eq(ZfFamily::getFid, zfFamily.getFid()); |
| | | return getOne(lqw); |
| | | } |
| | | |
| | | @Override |
| | | public ZfFamily getByName(String familyName) { |
| | | LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfFamily::getName,familyName); |
| | | return getOne(lqw); |
| | | } |
| | | |
| | | @Override |
| | | public ZfFamily getByFid(Long fid) { |
| | | LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfFamily::getFid,fid); |
| | | return getOne(lqw); } |
| | | |
| | | @Override |
| | | public ZfFamily getByFamId(Long fid) { |
| | | LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfFamily::getId,fid); |
| | | return getOne(lqw); |
| | | } |
| | | |
| | |
| | | return AjaxResult.success(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult addFamily(ZfFamily zfFamily) { |
| | | int res = zfFamilyMapper.insert(zfFamily); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateFam(ZfFamily zfFamily) { |
| | | int res = zfFamilyMapper.updateById(zfFamily); |
| | | |
| | | if(res!=0) { |
| | | return AjaxResult.success(); |
| | | }else |
| | | return AjaxResult.error("修改失败,家庭号不能重复"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteFam(Long[] ids) { |
| | | if (zfFamilyService.removeByIds(Arrays.asList(ids))) { |
| | | return AjaxResult.success(); |
| | | } |
| | | else |
| | | return AjaxResult.error(); |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | public SysUserRole1 selectUserRole(Long userId) { |
| | | LambdaQueryWrapper<SysUserRole1> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(SysUserRole1::getUserId,userId); |
| | | return getOne(lqw); |
| | | SysUserRole1 sys = getOne(lqw); |
| | | System.out.println(sys); |
| | | return sys; |
| | | } |
| | | } |