| | |
| | | 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; |
| | |
| | | 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<>(); |
| | |
| | | for (Long shareId : shareIds) { |
| | | for (Long shareContent : shareContents) { |
| | | ZfDoctorShare za = new ZfDoctorShare(); |
| | | za.setUserId(zfDoctor.getUserId()); |
| | | za.setUserId(getUserId()); |
| | | za.setShareContent(shareContent); |
| | | za.setShareId(shareId); |
| | | addData(za); |
| | |
| | | { |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,shareId) |
| | | .eq(ZfDoctorShare::getUserId, zfDoctor.getUserId()); |
| | | .eq(ZfDoctorShare::getUserId, getUserId()); |
| | | List<ZfDoctorShare> beanRecords = list(lqw); |
| | | for (ZfDoctorShare beanRecord : beanRecords ) { |
| | | beanRecord3.add(zfDoctorService.getById(beanRecord.getShareContent())); |
| | |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,shareId) |
| | | .eq(ZfDoctorShare::getShareContent, shareContent) |
| | | .eq(ZfDoctorShare::getUserId, zfDoctor.getUserId()); |
| | | .eq(ZfDoctorShare::getUserId, getUserId()); |
| | | |
| | | zfDoctorShareService.remove(lqw); |
| | | // addData(za); |
| | |
| | | * 用户自己查看别人分享的数据和分享人 |
| | | */ |
| | | @Override |
| | | public AjaxResult listByUserId(Long shareId) { |
| | | public AjaxResult listByUserId() { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | HashMap<Long,ZfDoctor> bs = new HashMap<>(); |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfDoctorShare::getShareId,shareId); |
| | | lqw.eq(ZfDoctorShare::getShareId,getUserId()); |
| | | List<ZfDoctorShare> beanRecords = list(lqw); |
| | | for (ZfDoctorShare beanRecord : beanRecords ) { |
| | | bs.put(beanRecord.getUserId(),zfDoctorService.getById(beanRecord.getShareContent())); |
| | |
| | | return bs; |
| | | |
| | | } |
| | | public Long getUserId(){ |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | return myself.getUserId(); |
| | | |
| | | } |
| | | |
| | | } |