This commit is contained in:
zhangheng 2024-03-06 17:55:43 +08:00
parent 62b6d99c23
commit 1e71dfff1c
8 changed files with 105 additions and 2 deletions

View File

@ -52,6 +52,14 @@ public class DepartmentController extends BaseController {
return AjaxResult.success(departmentService.selectDepartmentList(department)); return AjaxResult.success(departmentService.selectDepartmentList(department));
} }
/**
* 查询科室信息列表 问卷使用
*/
@GetMapping("/selectUserDepartment")
public AjaxResult selectUserDepartment() {
return departmentService.selectUserDepartment();
}
/** /**
* 查询科室或病区信息列表 不分页 * 查询科室或病区信息列表 不分页
*/ */

View File

@ -38,6 +38,14 @@ public class DepartmentDiseaseTypeController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询科室病种信息列表 不分页 问卷使用
*/
@GetMapping("/diseaseList")
public AjaxResult diseaseList(DepartmentDiseaseType departmentDiseaseType) {
return AjaxResult.success(departmentDiseaseTypeService.selectDepartmentDiseaseTypeList(departmentDiseaseType));
}
/** /**
* 导出科室病种信息列表 * 导出科室病种信息列表
*/ */

View File

@ -66,7 +66,7 @@ public class QuestionInfoController extends BaseController {
} }
/** /**
* 新增问卷基本信息 * 新增问卷信息
*/ */
@PreAuthorize("@ss.hasPermi('system:question:add')") @PreAuthorize("@ss.hasPermi('system:question:add')")
@Log(title = "问卷基本信息", businessType = BusinessType.INSERT) @Log(title = "问卷基本信息", businessType = BusinessType.INSERT)
@ -79,7 +79,7 @@ public class QuestionInfoController extends BaseController {
} }
/** /**
* 修改问卷基本信息 * 修改问卷信息
*/ */
@PreAuthorize("@ss.hasPermi('system:question:edit')") @PreAuthorize("@ss.hasPermi('system:question:edit')")
@Log(title = "问卷基本信息", businessType = BusinessType.UPDATE) @Log(title = "问卷基本信息", businessType = BusinessType.UPDATE)
@ -97,4 +97,12 @@ public class QuestionInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long id) { public AjaxResult remove(@PathVariable Long id) {
return toAjax(questionInfoService.deleteQuestionInfoById(id)); return toAjax(questionInfoService.deleteQuestionInfoById(id));
} }
/**
* 修改问卷基本信息
*/
@PostMapping("/updateQuestion")
public AjaxResult updateQuestionByDepartment(QuestionInfo questionInfo) {
return questionInfoService.updateQuestionByDepartment(questionInfo);
}
} }

View File

@ -32,6 +32,13 @@ public interface IDepartmentService {
*/ */
List<Department> selectDepartmentList(Department department); List<Department> selectDepartmentList(Department department);
/**
* 查询科室信息列表 问卷使用
*
* @return 科室信息集合
*/
AjaxResult selectUserDepartment();
/** /**
* 查询科室或病区信息列表 不分页 * 查询科室或病区信息列表 不分页
* *
@ -114,6 +121,7 @@ public interface IDepartmentService {
/** /**
* 查询科室信息列表及包含服务包数量 * 查询科室信息列表及包含服务包数量
*
* @param departmentDto * @param departmentDto
* @return * @return
*/ */

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.service.department.impl; package com.xinelu.manage.service.department.impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysUser;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
@ -13,6 +14,7 @@ import com.xinelu.manage.mapper.department.DepartmentMapper;
import com.xinelu.manage.service.department.IDepartmentService; import com.xinelu.manage.service.department.IDepartmentService;
import com.xinelu.manage.vo.department.DepartmentListVO; import com.xinelu.manage.vo.department.DepartmentListVO;
import com.xinelu.manage.vo.department.DepartmentVO; import com.xinelu.manage.vo.department.DepartmentVO;
import com.xinelu.system.mapper.SysUserMapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -38,6 +40,8 @@ public class DepartmentServiceImpl implements IDepartmentService {
private DepartmentMapper departmentMapper; private DepartmentMapper departmentMapper;
@Resource @Resource
private RegexUtil regexUtil; private RegexUtil regexUtil;
@Resource
private SysUserMapper sysUserMapper;
/** /**
* 查询科室信息 * 查询科室信息
@ -61,6 +65,23 @@ public class DepartmentServiceImpl implements IDepartmentService {
return departmentMapper.selectDepartmentList(department); return departmentMapper.selectDepartmentList(department);
} }
/**
* 查询科室信息列表 问卷使用
*
* @return 科室信息集合
*/
@Override
public AjaxResult selectUserDepartment() {
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
List<Department> departments = new ArrayList<>();
if (Objects.nonNull(sysUser) && Objects.nonNull(sysUser.getAgencyId())) {
Department department = new Department();
department.setAgencyId(sysUser.getAgencyId());
departments = departmentMapper.selectDepartmentList(department);
}
return AjaxResult.success(departments);
}
/** /**
* 查询科室或病区信息列表 不分页 * 查询科室或病区信息列表 不分页
* *

View File

@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
@ -44,6 +45,9 @@ public class DepartmentDiseaseTypeServiceImpl implements IDepartmentDiseaseTypeS
*/ */
@Override @Override
public List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType) { public List<DepartmentDiseaseType> selectDepartmentDiseaseTypeList(DepartmentDiseaseType departmentDiseaseType) {
if (Objects.isNull(departmentDiseaseType) || Objects.isNull(departmentDiseaseType.getDepartmentId())) {
return new ArrayList<>();
}
return departmentDiseaseTypeMapper.selectDepartmentDiseaseTypeList(departmentDiseaseType); return departmentDiseaseTypeMapper.selectDepartmentDiseaseTypeList(departmentDiseaseType);
} }

View File

@ -61,4 +61,12 @@ public interface IQuestionInfoService {
* @return 结果 * @return 结果
*/ */
int deleteQuestionInfoById(Long id); int deleteQuestionInfoById(Long id);
/**
* 修改问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
AjaxResult updateQuestionByDepartment(QuestionInfo questionInfo);
} }

View File

@ -241,4 +241,42 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
} }
return questionInfoMapper.deleteQuestionInfoById(id); return questionInfoMapper.deleteQuestionInfoById(id);
} }
/**
* 修改问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
@Override
public AjaxResult updateQuestionByDepartment(QuestionInfo questionInfo) {
if (Objects.isNull(questionInfo) || Objects.isNull(questionInfo.getId())) {
return AjaxResult.success();
}
if (Objects.nonNull(questionInfo.getQuestionnaireStatus()) && "PUBLISHED".equals(questionInfo.getQuestionnaireStatus())) {
QuestionInfo dataBaseQuestion = questionInfoMapper.selectQuestionInfoById(questionInfo.getId());
if (Objects.nonNull(dataBaseQuestion) && Objects.nonNull(dataBaseQuestion.getDepartmentId()) && Objects.nonNull(questionInfo.getDiseaseTypeId())) {
int questionCount = questionInfoMapper.updateQuestionInfo(questionInfo);
if (questionCount <= 0) {
return AjaxResult.error("修改问卷失败!请联系管理员!");
}
} else {
return AjaxResult.error("请选择问卷所属的科室以及科室病种后发布!");
}
}
if (Objects.nonNull(questionInfo.getQuestionnaireStatus()) && "UNPUBLISHED".equals(questionInfo.getQuestionnaireStatus())) {
int questionCount = questionInfoMapper.updateQuestionInfo(questionInfo);
if (questionCount <= 0) {
return AjaxResult.error("修改问卷失败!请联系管理员!");
}
}
if (Objects.isNull(questionInfo.getDepartmentId()) && Objects.isNull(questionInfo.getDiseaseTypeId())) {
return AjaxResult.success();
}
int questionCount = questionInfoMapper.updateQuestionInfo(questionInfo);
if (questionCount <= 0) {
return AjaxResult.success("修改问卷失败!请联系管理员!");
}
return AjaxResult.success(questionCount);
}
} }