|
|
|
@ -23,6 +23,7 @@ import com.hxhq.common.core.exception.ServiceException; |
|
|
|
import com.hxhq.common.core.utils.DateUtils; |
|
|
|
import com.hxhq.common.core.utils.StringUtils; |
|
|
|
import com.hxhq.common.core.web.domain.AjaxResult; |
|
|
|
import com.hxhq.common.security.auth.AuthUtil; |
|
|
|
import com.hxhq.common.security.utils.SecurityUtils; |
|
|
|
import com.hxhq.system.service.ISysUserService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -75,6 +76,21 @@ public class StudyServiceImpl extends ServiceImpl implements |
|
|
|
if(form.getStatus()!=null && form.getStatus().intValue()>0){ |
|
|
|
queryWrapper.eq("s.status",form.getStatus()); |
|
|
|
} |
|
|
|
//又新增权限的表示SD,SD能看所有试验,其他只能看自己进入的试验 |
|
|
|
String sdPermit = "business:study:add"; |
|
|
|
if (!AuthUtil.hasPermi(sdPermit)) |
|
|
|
{ |
|
|
|
queryWrapper.apply("(\n" + |
|
|
|
"s.id IN (\n" + |
|
|
|
"SELECT study_id FROM t_study_subject WHERE del_flag='0' AND leader={0}\n" + |
|
|
|
")\n" + |
|
|
|
"OR \n" + |
|
|
|
"s.id IN (\n" + |
|
|
|
"SELECT study_id FROM `t_study_subject_user` WHERE del_flag='0' AND user_id={0}\n" + |
|
|
|
")\n" + |
|
|
|
"OR create_by={0}\n" + |
|
|
|
")",SecurityUtils.getUserId()); |
|
|
|
} |
|
|
|
queryWrapper.orderByDesc("s.id"); |
|
|
|
return baseMapper.queryList(queryWrapper); |
|
|
|
} |
|
|
|
|