|
@@ -4,11 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.diagbot.client.UserServiceClient;
|
|
import com.diagbot.client.UserServiceClient;
|
|
-import com.diagbot.dto.GetModuleInfoOneDTO;
|
|
|
|
-import com.diagbot.dto.MedRecordAnalyzeDTO;
|
|
|
|
-import com.diagbot.dto.ModuleInfoListDTO;
|
|
|
|
-import com.diagbot.dto.QcModuleDetailDTO;
|
|
|
|
-import com.diagbot.dto.QuestionDTO;
|
|
|
|
|
|
+import com.diagbot.dto.*;
|
|
import com.diagbot.entity.MedModuleMapping;
|
|
import com.diagbot.entity.MedModuleMapping;
|
|
import com.diagbot.entity.QcModuleDetail;
|
|
import com.diagbot.entity.QcModuleDetail;
|
|
import com.diagbot.entity.QcModuleInfo;
|
|
import com.diagbot.entity.QcModuleInfo;
|
|
@@ -21,12 +17,7 @@ import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.util.UserUtils;
|
|
-import com.diagbot.vo.AddModuleInfoVO;
|
|
|
|
-import com.diagbot.vo.GetModuleInfoOneVO;
|
|
|
|
-import com.diagbot.vo.GetModuleInfoVO;
|
|
|
|
-import com.diagbot.vo.ModuleIndexVO;
|
|
|
|
-import com.diagbot.vo.QuestionIdsVO;
|
|
|
|
-import com.diagbot.vo.UpdateModuleInfoVO;
|
|
|
|
|
|
+import com.diagbot.vo.*;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -94,13 +85,116 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 模板列表首页
|
|
|
|
+ *
|
|
|
|
+ * @param defaultModuleVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Object saveDefaultModuleInfo(DefaultModuleVO defaultModuleVO) {
|
|
|
|
+ Boolean flag = false;
|
|
|
|
+ //用户选择添加默认(标准)模块
|
|
|
|
+ if (1 == defaultModuleVO.getDefaultModule()) {
|
|
|
|
+ //用户同意更换默认(标准)模版 校验标准模版是否存在之前,提示信息用户操作默认为0 当用户点击提示信息确定则1
|
|
|
|
+ if (1 == defaultModuleVO.getDefineType()) {
|
|
|
|
+ //此时不会给出提示
|
|
|
|
+ flag = true;
|
|
|
|
+// 原有的标准模版设置为0 体现互斥行性
|
|
|
|
+ UpdateWrapper<QcModuleInfo> serviceInfoWrapper = new UpdateWrapper<>();
|
|
|
|
+ serviceInfoWrapper
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("mode_id", defaultModuleVO.getModeId())
|
|
|
|
+ .eq("hospital_id", defaultModuleVO.getHospitalId())
|
|
|
|
+ .eq("default_module", 1)
|
|
|
|
+ .set("default_module", "0");
|
|
|
|
+ this.update(new QcModuleInfo(), serviceInfoWrapper);
|
|
|
|
+ }
|
|
|
|
+ //校验标准模版是否存在
|
|
|
|
+ int sum = this.count(new QueryWrapper<QcModuleInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("mode_id", defaultModuleVO.getModeId())
|
|
|
|
+ .eq("hospital_id", defaultModuleVO.getHospitalId())
|
|
|
|
+ .eq("default_module", 1));
|
|
|
|
+ if (sum > 0) {
|
|
|
|
+ //发现标准模版已经存在,默认给出提示
|
|
|
|
+ if (flag == false) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Boolean bac = false;
|
|
|
|
+ //更新模版状态
|
|
|
|
+ UpdateWrapper<QcModuleInfo> serviceInfoWrapper = new UpdateWrapper<>();
|
|
|
|
+ serviceInfoWrapper
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("mode_id", defaultModuleVO.getModeId())
|
|
|
|
+ .eq("hospital_id", defaultModuleVO.getHospitalId())
|
|
|
|
+ .eq("name", defaultModuleVO.getName())
|
|
|
|
+ .set("default_module", "1");
|
|
|
|
+ bac = this.update(new QcModuleInfo(), serviceInfoWrapper);
|
|
|
|
+ return bac;
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ //用户直接取消,无视互斥
|
|
|
|
+ UpdateWrapper<QcModuleInfo> serviceWrapper = new UpdateWrapper<>();
|
|
|
|
+ serviceWrapper
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("mode_id", defaultModuleVO.getModeId())
|
|
|
|
+ .eq("hospital_id", defaultModuleVO.getHospitalId())
|
|
|
|
+ .eq("name", defaultModuleVO.getName())
|
|
|
|
+ .eq("default_module", 1)
|
|
|
|
+ .set("default_module", defaultModuleVO.getDefaultModule());
|
|
|
|
+ this.update(new QcModuleInfo(), serviceWrapper);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 添加模板
|
|
* 添加模板
|
|
*
|
|
*
|
|
* @param addModulInfoVO
|
|
* @param addModulInfoVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Boolean saveOrUpdateModuleInfo(AddModuleInfoVO addModulInfoVO) {
|
|
|
|
|
|
+ public Object saveOrUpdateModuleInfo(AddModuleInfoVO addModulInfoVO) {
|
|
|
|
+ Boolean flag = false;
|
|
|
|
+ //用户选择添加默认(标准)模块
|
|
|
|
+ if (1 == addModulInfoVO.getDefaultModule()) {
|
|
|
|
+ //用户同意更换默认(标准)模版 校验标准模版是否存在之前,提示信息用户操作默认为0 当用户点击提示信息确定则1
|
|
|
|
+ if (1 == addModulInfoVO.getDefineType()) {
|
|
|
|
+ //此时不会给出提示
|
|
|
|
+ flag = true;
|
|
|
|
+// 原有的标准模版设置为0 互斥行性
|
|
|
|
+ UpdateWrapper<QcModuleInfo> serviceInfoWrapper = new UpdateWrapper<>();
|
|
|
|
+ serviceInfoWrapper
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("mode_id", addModulInfoVO.getModeId())
|
|
|
|
+ .eq("hospital_id", addModulInfoVO.getHospitalId())
|
|
|
|
+ .eq("default_module", 1)
|
|
|
|
+ .set("default_module", "0");
|
|
|
|
+ this.update(new QcModuleInfo(), serviceInfoWrapper);
|
|
|
|
+ }
|
|
|
|
+ //校验标准模版是否存在
|
|
|
|
+ List<QcModuleInfo> list = this.list(new QueryWrapper<QcModuleInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("mode_id", addModulInfoVO.getModeId())
|
|
|
|
+ .eq("hospital_id", addModulInfoVO.getHospitalId())
|
|
|
|
+ .eq("default_module", 1));
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ //发现标准模版已经存在
|
|
|
|
+ if (flag == false) {
|
|
|
|
+ //修改页面
|
|
|
|
+ if (null != addModulInfoVO.getId()) {
|
|
|
|
+ //当默认唯一模版提交修改按钮不提示
|
|
|
|
+ if (!addModulInfoVO.getId().equals(list.get(0).getId())) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ } else if (null == addModulInfoVO.getId()) {
|
|
|
|
+ //新增时候互斥给出提示
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 校验名称是否相同
|
|
// 校验名称是否相同
|
|
int count = this.count(new QueryWrapper<QcModuleInfo>()
|
|
int count = this.count(new QueryWrapper<QcModuleInfo>()
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -171,6 +265,7 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
.eq("id", updateModuleInfoVO.getId())
|
|
.eq("id", updateModuleInfoVO.getId())
|
|
.set("name", updateModuleInfoVO.getName())
|
|
.set("name", updateModuleInfoVO.getName())
|
|
.set("mode_id", updateModuleInfoVO.getModeId())
|
|
.set("mode_id", updateModuleInfoVO.getModeId())
|
|
|
|
+ .set("default_module", updateModuleInfoVO.getDefaultModule())
|
|
// .set("record_module_id", updateModuleInfoVO.getRecordModuleId())
|
|
// .set("record_module_id", updateModuleInfoVO.getRecordModuleId())
|
|
.set("modifier", userId)
|
|
.set("modifier", userId)
|
|
.set("gmt_modified", DateUtil.now())
|
|
.set("gmt_modified", DateUtil.now())
|