Browse Source

feat: [试验管理] 权限控制

master
memorylkf 4 days ago
parent
commit
4a1d862511
6 changed files with 58 additions and 4 deletions
  1. +10
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudySubjectController.java
  2. +25
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillListDto.java
  3. +6
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudySubjectService.java
  4. +2
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java
  5. +9
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java
  6. +6
    -3
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml

+ 10
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudySubjectController.java View File

@ -72,4 +72,14 @@ public class StudySubjectController extends BaseController
return AjaxResult.success(studySubjectService.isMatchSubject(studySubjectId));
}
/**
* 判断用户是否是QA部门
*/
@GetMapping("/isQa")
public AjaxResult isQa()
{
return AjaxResult.success(studySubjectService.isQA());
}
}

+ 25
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillListDto.java View File

@ -8,4 +8,29 @@ import com.hxhq.business.domain.StudyFormFill;
*/
public class StudyFormFillListDto extends StudyFormFill {
/**
* 学科负责人id
*/
private Long subjectLeader;
/**
* 试验SD(试验负责人)
*/
private Long studyLeader;
public Long getSubjectLeader() {
return subjectLeader;
}
public void setSubjectLeader(Long subjectLeader) {
this.subjectLeader = subjectLeader;
}
public Long getStudyLeader() {
return studyLeader;
}
public void setStudyLeader(Long studyLeader) {
this.studyLeader = studyLeader;
}
}

+ 6
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudySubjectService.java View File

@ -40,4 +40,10 @@ public interface IStudySubjectService extends IService
*/
Boolean isMatchSubject(Long studySubjectId);
/**
* 判断是否是QA部门的用户
* @return
*/
Boolean isQA();
}

+ 2
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java View File

@ -120,7 +120,8 @@ public class StudyServiceImpl extends ServiceImpl implements
// 总结有这个菜单特殊部QA可以看所有+审核表单其他只能看部门级下级部门的列表部长可以操作+审核表单
Long deptId = sysUserService.selectUserById(SecurityUtils.getLoginUser().getUserid()).getDeptId();
if (!deptId.equals(216L))
Long qaDeptId = 216L;
if (!deptId.equals(qaDeptId))
{
queryWrapper.apply("(\n" +
"s.dept_id IN(\n" +

+ 9
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java View File

@ -20,6 +20,7 @@ import com.hxhq.business.service.IStudySubjectUserService;
import com.hxhq.business.utils.JctUtil;
import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.StudySubjectMapper;
@ -43,6 +44,8 @@ public class StudySubjectServiceImpl extends ServiceImpl
private IStudySubjectUserService studySubjectUserService;
@Autowired
private IStudyJcgjService studyJcgjService;
@Autowired
private ISysUserService sysUserService;
/**
* 获取试验下的学科设置信息(含未设置的学科)
@ -180,4 +183,10 @@ public class StudySubjectServiceImpl extends ServiceImpl
return studySubjectUserService.count(queryWrapper)>0;
}
}
@Override
public Boolean isQA() {
Long qaDeptId = 216L;
return sysUserService.selectUserById(SecurityUtils.getUserId()).getDeptId().equals(qaDeptId);
}
}

+ 6
- 3
hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml View File

@ -5,8 +5,11 @@
<mapper namespace="com.hxhq.business.mapper.StudyFormFillMapper">
<select id="queryList" resultType="com.hxhq.business.dto.study.StudyFormFillListDto">
select t.id,t.bdbh,t.bdmc,t.create_time,t.user_mc,t.user_id,t.bdzt,t.bdzt,t.tjsj,tm.name as templateMc,tm.sn as templateSn,tm.dept_id as templateDeptId
,ss.leader as subjectLeader,s.id as studyLeader
FROM `t_study_form_fill` t
left join t_template tm on tm.id=t.template_id
join t_template tm on tm.id=t.template_id
join t_study_subject ss on t.study_subject_id=ss.id
join t_study s on t.study_id=s.id
<if test="ew.sqlSegment != '' and ew.sqlSegment != null">
<where>
${ew.sqlSegment}
@ -18,8 +21,8 @@
select t.*,tm.name as templateMc,tm.sn as templateSn,tm.dept_id as templateDeptId
,ts.sn as studySn,ts.name as studyMc
FROM `t_study_form_fill` t
left join t_template tm on tm.id=t.template_id
left join t_study ts on ts.id=t.study_id
join t_template tm on tm.id=t.template_id
join t_study ts on ts.id=t.study_id
where t.id=#{id}
</select>
</mapper>

Loading…
Cancel
Save