| | |
| | | System.out.println("2222222222222222222222222222222222/"); |
| | | infoUser.setFamilyId(mother.getFamilyId()); |
| | | } |
| | | // else if (user.getSpouseId()!=null) { |
| | | // ZInfoUser spouse = zInfoUserService.getById(user.getSpouseId()); |
| | | // System.out.println("33333333333333333333333333333333333333333/"); |
| | | // infoUser.setFamilyId(spouse.getFamilyId()); |
| | | // infoUser.setSpouseId(user.getSpouseId()); |
| | | // } |
| | | else if (user.getSpouseId()!=null) { |
| | | ZInfoUser spouse = zInfoUserService.getById(user.getSpouseId()); |
| | | System.out.println("33333333333333333333333333333333333333333/"); |
| | | infoUser.setFamilyId(spouse.getFamilyId()); |
| | | infoUser.setSpouseId(user.getSpouseId()); |
| | | } |
| | | |
| | | zInfoUserService.saveOrUpdate(infoUser); |
| | | if(user.getSpouseId()!=null) { |
| | |
| | | ZInfoUser mother = zInfoUserService.getById(userAll.getMid()); |
| | | if (father.getIsMyFamily() == 1) |
| | | infoUser.setFamilyId(father.getFamilyId()); |
| | | if (mother.getIsMyFamily() == 1) |
| | | else if (mother.getIsMyFamily() == 1) |
| | | infoUser.setFamilyId(mother.getFamilyId()); |
| | | } |
| | | // else { |
| | | // ZInfoUser spouse = zInfoUserService.getById(userAll.getSpouseId()); |
| | | // infoUser.setFamilyId(spouse.getFamilyId()); |
| | | // } |
| | | else { |
| | | ZInfoUser spouse = zInfoUserService.getById(userAll.getSpouseId()); |
| | | infoUser.setFamilyId(spouse.getFamilyId()); |
| | | } |
| | | |
| | | //前端保证了角色不为空 |
| | | // if(user.getRoleIds()[0]==102) |
| | |
| | | return AjaxResult.success(satisfyIds); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id判断是否是子孙 uid:长辈id,tpfid:我自己的zinfoid |
| | | */ |
| | | @GetMapping("/uidUJd/{uid}/{tpfid}") |
| | | public AjaxResult findByUidAndUid2(@PathVariable("uid") Long uid ,@PathVariable("tpfid") Long tpfid){ |
| | | return AjaxResult.success( zInfoUserService.findByuid(uid,tpfid)); |
| | | } |
| | | |
| | | @GetMapping("/sex/{sex}") |
| | | public AjaxResult findBySex(@PathVariable("sex") Integer sex) |
| | | { |
| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.MapUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.domain.ShareMore; |
| | | import com.ruoyi.domain.ZfDoctor; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; |
| | | import static com.ruoyi.common.core.page.TableSupport.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/ZfDoctorShare") |
| | |
| | | */ |
| | | @PostMapping("/getInfoByUserId") |
| | | public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){ |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | |
| | | return zfDoctorService.selectListById(zfDoctorShareService.listByFidAid(zfDoctor),pageNum,pageSize); |
| | | return zfDoctorShareService.listByFidAid(zfDoctor,pageNo,pageSize) ; |
| | | } |
| | | |
| | | /** |
| | | * 用户自己查看别人分享的数据和分享人 |
| | | */ |
| | | @GetMapping("/getInfoByShareId") |
| | | public AjaxResult empowerGetInfo2(){ |
| | | return zfDoctorShareService.listUserId(); |
| | | public AjaxResult empowerGetInfo2(@RequestBody ShareMore zfDoctor){ |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zfDoctorShareService.listUserId(zfDoctor,pageNo ,pageSize); |
| | | } |
| | | /** |
| | | * 根据userId和shareId收回已经授权给那些人 |
| | |
| | | * 展示下载分享的数据 |
| | | */ |
| | | @GetMapping("/all") |
| | | public List<ZfDoctor> data(ZfDoctorDownload zfDoctorDownload){ |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | public AjaxResult data(ZfDoctorDownload zfDoctorDownload){ |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | List<ZfDoctorDownload> as = zfDoctorDownloadService.selectDoctorList(zfDoctorDownload,pageNum,pageSize); |
| | | List<ZfDoctor> bs = new ArrayList<>(); |
| | | for (ZfDoctorDownload a: as) { |
| | | if (zfDoctorService.getById(a.getDownloadContent()) != null) { |
| | | ZfDoctor ds = zfDoctorService.getById(a.getDownloadContent()); |
| | | ds.setShareId(a.getShareId()); |
| | | bs.add(ds); |
| | | } |
| | | } |
| | | return bs; |
| | | return zfDoctorDownloadService.selectDoctorList(zfDoctorDownload,pageNo ,pageSize); |
| | | } |
| | | |
| | | } |
| | |
| | | public static final String PAGE_SIZE = "pageSize"; |
| | | |
| | | /** |
| | | * 当前页数 |
| | | */ |
| | | public static final String PAGE_NO = "pageNo"; |
| | | |
| | | /** |
| | | * 排序列 |
| | | */ |
| | | public static final String ORDER_BY_COLUMN = "orderByColumn"; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Version 1.0 |
| | |
| | | data.put("pageSize",pageResult.getSize()); |
| | | return data; |
| | | } |
| | | |
| | | public static HashMap<String,Object> getResult(Page pageResult, List record){ |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | data.put("data",record); |
| | | data.put("total",record.size()); |
| | | data.put("pageNo",pageResult.getCurrent()); |
| | | data.put("totalPage",pageResult.getTotal()); |
| | | data.put("pageSize",pageResult.getSize()); |
| | | return data; |
| | | } |
| | | } |
| | |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | |
| | | List<ZfDoctorDownload> selectDoctorList(ZfDoctorDownload zfDoctorDownload , Integer pageNum, Integer pageSize); |
| | | AjaxResult selectDoctorList(ZfDoctorDownload zfDoctorDownload,Integer pageNo ,Integer pageSize); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | AjaxResult listType(); |
| | | |
| | | AjaxResult selectListById(List<Long> ids, Integer pageNum, Integer pageSize); |
| | | // AjaxResult selectListById(List<Long> ids, Integer pageNum, Integer pageSize); |
| | | } |
| | |
| | | |
| | | AjaxResult saveZa(ShareMore zfDoctor); |
| | | |
| | | List<Long> listByFidAid(ShareMore zfDoctorInteger); |
| | | AjaxResult listByFidAid(ShareMore zfDoctorInteger,Integer pageNo ,Integer pageSize); |
| | | |
| | | AjaxResult deleteZa(ShareMore zfDoctor); |
| | | |
| | | AjaxResult listByUserId(); |
| | | |
| | | AjaxResult listUserId(); |
| | | AjaxResult listUserId(ShareMore zfDoctorInteger,Integer pageNo ,Integer pageSize); |
| | | |
| | | Long getShareId(ZfDoctorDownload zfDoctorDownload); |
| | | |
| | |
| | | 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.ZInfoUser; |
| | | import com.ruoyi.domain.ZfDoctor; |
| | | import com.ruoyi.domain.ZfDoctorDownload; |
| | | import com.ruoyi.mapper.ZfDoctorDownloadMapper; |
| | | import com.ruoyi.service.*; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class ZfDoctorDownloadServiceImpl extends ServiceImpl<ZfDoctorDownloadMapper, ZfDoctorDownload> implements ZfDoctorDownloadService { |
| | |
| | | |
| | | @Resource |
| | | ZfDoctorShareService zfDoctorShareService; |
| | | |
| | | @Resource |
| | | ZfDoctorService zfDoctorService; |
| | | |
| | | |
| | | @Resource |
| | | ZInfoUserService zInfoUserService; |
| | |
| | | return lqw; |
| | | } |
| | | @Override |
| | | public List<ZfDoctorDownload> selectDoctorList(ZfDoctorDownload zfDoctorDownload , Integer pageNum, Integer pageSize) { |
| | | public AjaxResult selectDoctorList(ZfDoctorDownload zfDoctorDownload,Integer pageNo ,Integer pageSize ) { |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | LambdaQueryWrapper<ZfDoctorDownload> lqw = buildCondition(zfDoctorDownload,myself.getUserId()); |
| | | List<ZfDoctorDownload> beanRecords = list(lqw); |
| | | return new ArrayList<>(beanRecords); |
| | | List<ZfDoctor> bs = new ArrayList<>(); |
| | | for (ZfDoctorDownload a: beanRecords) { |
| | | if (zfDoctorService.getById(a.getDownloadContent()) != null) { |
| | | ZfDoctor ds = zfDoctorService.getById(a.getDownloadContent()); |
| | | ds.setShareId(a.getShareId()); |
| | | bs.add(ds); |
| | | } |
| | | } |
| | | List<ZfDoctor> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (bs.size() -1) / pageSize +1; |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getResult(zfDoctorPage, record); |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | |
| | |
| | | return lqw; |
| | | } |
| | | |
| | | public LambdaQueryWrapper<ZfDoctor> buildCondition2(List<Long> ids) { |
| | | LambdaQueryWrapper<ZfDoctor> lqw = new LambdaQueryWrapper<>(); |
| | | |
| | | lqw.eq(ZfDoctor::getId, ids); |
| | | |
| | | return lqw; |
| | | } |
| | | @Override |
| | | public AjaxResult selectListById(List<Long> ids, Integer pageNum, Integer pageSize) { |
| | | List<ZfDoctor> lqw2 = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfDoctor> lqw = buildCondition2(ids); |
| | | List<ZfDoctor> bb = list(lqw); |
| | | System.out.println("15052222254"+bb); |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNum, pageSize); |
| | | Page<ZfDoctor> pageResult = page(zfDoctorPage, lqw); |
| | | List<ZfDoctor> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | System.out.println(beanRecords); |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | |
| | | |
| | | return AjaxResult.success(data); |
| | | // public LambdaQueryWrapper<ZfDoctor> buildCondition2(List<Long> ids) { |
| | | // LambdaQueryWrapper<ZfDoctor> lqw = new LambdaQueryWrapper<>(); |
| | | // lqw.eq(ZfDoctor::getId, ids); |
| | | // |
| | | // return lqw; |
| | | // } |
| | | // @Override |
| | | // public AjaxResult selectListById(List<Long> ids, Integer pageNum, Integer pageSize) { |
| | | // List<ZfDoctor> lqw2 = new ArrayList<>(); |
| | | // |
| | | // LambdaQueryWrapper<ZfDoctor> lqw = buildCondition2(ids); |
| | | // List<ZfDoctor> bb = list(lqw); |
| | | // System.out.println("15052222254"+bb); |
| | | // |
| | | // Page<ZfDoctor> zfDoctorPage = new Page<>(pageNum, pageSize); |
| | | // Page<ZfDoctor> pageResult = page(zfDoctorPage, lqw); |
| | | // List<ZfDoctor> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | // System.out.println(beanRecords); |
| | | // |
| | | // HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | // |
| | | // |
| | | // return AjaxResult.success(data); |
| | | //// } |
| | | |
| | | // private List<Long> buildCondition1(){ |
| | | // List<ZfDoctorShare> authority1 = zfDoctorShareService.getAuthority(); |
| | |
| | | // } |
| | | |
| | | |
| | | }} |
| | | } |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.alibaba.druid.sql.PagerUtils.limit; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | * 根据UserId和分享人shareId查看已经授权给那些人那些数据 |
| | | */ |
| | | @Override |
| | | public List<Long> listByFidAid(ShareMore zfDoctor) { |
| | | public AjaxResult listByFidAid(ShareMore zfDoctor,Integer pageNo ,Integer pageSize) { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | Long [] shareIds = zfDoctor.getShareIds(); |
| | | List<Long> beanRecord3 = new ArrayList<>(); |
| | | List<ZfDoctor> beanRecord3 = new ArrayList<>(); |
| | | for (Long shareId : shareIds) { |
| | | { |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | .eq(ZfDoctorShare::getUserId, getUserId()); |
| | | List<ZfDoctorShare> beanRecords = list(lqw); |
| | | for (ZfDoctorShare beanRecord : beanRecords ) { |
| | | beanRecord3.add(beanRecord.getShareContent()); |
| | | beanRecord3.add(zfDoctorService.getById(beanRecord.getShareContent())); |
| | | } |
| | | } |
| | | } |
| | | List<ZfDoctor> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | return beanRecord3; |
| | | int totalPage = (beanRecord3.size() -1) / pageSize +1; |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getResult(zfDoctorPage, record); |
| | | |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | @Override |
| | |
| | | * 用户自己查看别人分享的数据==用户自己查看别人分享的数据和分享人 |
| | | */ |
| | | @Override |
| | | public AjaxResult listUserId() { |
| | | public AjaxResult listUserId(ShareMore zfDoctorInteger,Integer pageNo ,Integer pageSize) { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | List<ZfDoctor> bs = new ArrayList<>(); |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | bs.add(bs2); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | return AjaxResult.success(bs); |
| | | List<ZfDoctor> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (bs.size() -1) / pageSize +1; |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getResult(zfDoctorPage, record); |
| | | return AjaxResult.success(data); |
| | | |
| | | } |
| | | public Long getUserId(){ |