| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.domain.ZHealthNote; |
| | | import com.ruoyi.domain.ZHealthNow; |
| | | import com.ruoyi.domain.ZHealthNow; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.dto.ZHealthNowDto; |
| | | import com.ruoyi.domain.dto.ZHealthNowDto; |
| | | import com.ruoyi.domain.health.*; |
| | | import com.ruoyi.mapper.ZHealthNowMapper; |
| | | import com.ruoyi.service.ZHealthNowService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.sql.rowset.BaseRowSet; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author Jinquan_Ou |
| | |
| | | **/ |
| | | @Service |
| | | public class ZHealthNowServiceImpl extends ServiceImpl<ZHealthNowMapper, ZHealthNow> implements ZHealthNowService { |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Override |
| | | public AjaxResult selectData() { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | |
| | | lqw.eq(ZHealthNow::getUid,userId); |
| | | ZHealthNow zHealthNow = getOne(lqw); |
| | | |
| | | if(zHealthNow==null) |
| | | { |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | // System.out.println("sdfsdf999000550"); |
| | | |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | System.out.println(fms.size()); |
| | | |
| | | for(Long id:fms) |
| | | { |
| | | LambdaQueryWrapper<ZHealthNow> lqw1 = new LambdaQueryWrapper<>(); |
| | | |
| | | if(!id.equals(userId)) |
| | | { |
| | | lqw1.eq(ZHealthNow::getUid, id); |
| | | zHealthNow = getOne(lqw1); |
| | | break; |
| | | } |
| | | } |
| | | System.out.println(zHealthNow); |
| | | System.out.println("sdfsdf9990000"); |
| | | System.out.println("sdfsdf9990000"); |
| | | System.out.println("sdfsdf9990000"); |
| | | } |
| | | //如果是第一次进来,之前没有这个用户的数据,抛异常让用户先插入数据 |
| | | if(zHealthNow == null){ |
| | | throw new RuntimeException("第一次进来,请先填写好数据"); |