Browse Source

质控类型模版需求撤回

chengyao 4 years ago
parent
commit
6097a703b0

+ 0 - 2
mrman-service/src/main/java/com/diagbot/dto/QcTypeDTO.java

@@ -18,8 +18,6 @@ public class QcTypeDTO {
     private Long id;
     // 医院ID
     private Long hospitalId;
-    //默认模版是否开启(0-否 1-是)
-    private Integer defaultModule =0;
     // 质控类型名称
     private String name;
     // 质控类型和质控条目对应关系

+ 0 - 5
mrman-service/src/main/java/com/diagbot/entity/QcType.java

@@ -46,11 +46,6 @@ public class QcType implements Serializable {
      */
     private String isDeleted;
 
-    /**
-     * 默认模版是否开启(0-否 1-是)
-     */
-    private Integer defaultModule =0;
-
     /**
      * 记录创建时间
      */

+ 12 - 122
mrman-service/src/main/java/com/diagbot/facade/QcTypeFacade.java

@@ -8,7 +8,6 @@ import com.diagbot.dto.QcCasesEntrySimpleDTO;
 import com.diagbot.dto.QcTypeDTO;
 import com.diagbot.dto.QcTypePageDTO;
 import com.diagbot.entity.CommonParam;
-import com.diagbot.entity.QcModuleInfo;
 import com.diagbot.entity.QcType;
 import com.diagbot.entity.QcTypeCasesEntry;
 import com.diagbot.enums.InsertOrUpdateEnum;
@@ -22,7 +21,13 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.UserUtils;
-import com.diagbot.vo.*;
+import com.diagbot.vo.DeleteQcTypeVO;
+import com.diagbot.vo.QcEntryHospitalVO;
+import com.diagbot.vo.QcTypeCasesEntryVO;
+import com.diagbot.vo.QcTypeIndexVO;
+import com.diagbot.vo.QcTypePageVO;
+import com.diagbot.vo.QcTypeSaveVO;
+import com.diagbot.vo.QcTypeVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
@@ -57,27 +62,12 @@ public class QcTypeFacade extends QcTypeServiceImpl {
      *
      * @param qcTypeSaveVO
      */
-    public Object saveOrUpdate(QcTypeSaveVO qcTypeSaveVO) {
+    public void saveOrUpdate(QcTypeSaveVO qcTypeSaveVO) {
         CommonParam param = initCommonParam();
         // 保存主表
-        Object data = null;
-        data = saveQcType(qcTypeSaveVO, param);
+        saveQcType(qcTypeSaveVO, param);
         // 保存质控类型和质控条目映射关系
         saveQcTypeCasesEntry(qcTypeSaveVO, param);
-        return data;
-    }
-
-    /**
-     * 模板列表首页默认模版设置
-     *
-     * @param qcTypeControlVO
-     */
-    public Object ControModuleInfo(QcTypeControlVO qcTypeControlVO) {
-        CommonParam param = initCommonParam();
-        // 保存主表
-        Object data = null;
-        data = ControModule(qcTypeControlVO);
-        return data;
     }
 
     /**
@@ -108,7 +98,6 @@ public class QcTypeFacade extends QcTypeServiceImpl {
                 .eq("type_id", qcTypeSaveVO.getId())
         );
         // 再插入新明细
-        boolean data = false;
         List<QcTypeCasesEntryVO> qcTypeCasesEntryVOList = qcTypeSaveVO.getQcTypeCasesEntryVOList();
         if (ListUtil.isNotEmpty(qcTypeCasesEntryVOList)) {
             List<QcTypeCasesEntry> saveQcTypeCasesEntry = new ArrayList<>();
@@ -122,68 +111,8 @@ public class QcTypeFacade extends QcTypeServiceImpl {
                 bean.setTypeId(qcTypeSaveVO.getId());
                 saveQcTypeCasesEntry.add(bean);
             }
-            data = qcTypeCasesEntryService.saveBatch(saveQcTypeCasesEntry);
-        }
-    }
-
-    /**
-     * 质控类型默认模版修改
-     *
-     * @param qcTypeControlVO
-     * @param
-     */
-    public Object ControModule(QcTypeControlVO qcTypeControlVO) {
-        Boolean flag = false;
-        //用户选择添加默认(标准)模块
-        if (1 == qcTypeControlVO.getDefaultModule()) {
-            //用户同意更换默认(标准)模版   校验标准模版是否存在之前,提示信息用户操作默认为0 当用户点击提示信息确定则1
-            if (1 == qcTypeControlVO.getDefineType()) {
-                //此时不会给出提示
-                flag = true;
-//            原有的标准模版设置为0 体现互斥行性
-                UpdateWrapper<QcType> serviceInfoWrapper = new UpdateWrapper<>();
-                serviceInfoWrapper
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", qcTypeControlVO.getHospitalId())
-                        .eq("default_module", 1)
-                        .set("default_module", "0");
-                this.update(new QcType(), serviceInfoWrapper);
-            }
-            //校验标准模版是否存在
-            int sum = this.count(new QueryWrapper<QcType>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", qcTypeControlVO.getHospitalId())
-                    .eq("default_module", 1));
-            if (sum > 0) {
-                //发现标准模版已经存在,默认给出提示
-                if (flag == false) {
-                    return null;
-                }
-            }
-            Boolean bac = false;
-            //更新模版状态
-            UpdateWrapper<QcType> serviceInfoWrapper = new UpdateWrapper<>();
-            serviceInfoWrapper
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", qcTypeControlVO.getHospitalId())
-                    .eq("name", qcTypeControlVO.getName())
-                    .set("default_module", "1");
-            bac = this.update(new QcType(), serviceInfoWrapper);
-            return bac;
-
-        } else {
-            //用户直接取消,无视互斥
-            UpdateWrapper<QcType> serviceWrapper = new UpdateWrapper<>();
-            serviceWrapper
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", qcTypeControlVO.getHospitalId())
-                    .eq("name", qcTypeControlVO.getName())
-                    .eq("default_module", 1)
-                    .set("default_module", qcTypeControlVO.getDefaultModule());
-            this.update(new QcType(), serviceWrapper);
-
+            qcTypeCasesEntryService.saveBatch(saveQcTypeCasesEntry);
         }
-        return true;
     }
 
     /**
@@ -192,45 +121,7 @@ public class QcTypeFacade extends QcTypeServiceImpl {
      * @param qcTypeSaveVO
      * @param param
      */
-    public Object saveQcType(QcTypeSaveVO qcTypeSaveVO, CommonParam param) {
-        Boolean flag = false;
-        //用户选择添加默认(标准)模块
-        if (1 == qcTypeSaveVO.getDefaultModule()) {
-            //用户同意更换默认(标准)模版   校验标准模版是否存在之前,提示信息用户操作默认为0 当用户点击提示信息确定则1
-            if (1 == qcTypeSaveVO.getDefineType()) {
-                //此时不会给出提示
-                flag = true;
-//            原有的标准模版设置为0 互斥行性
-                UpdateWrapper<QcType> serviceInfoWrapper = new UpdateWrapper<>();
-                serviceInfoWrapper
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", qcTypeSaveVO.getHospitalId())
-                        .eq("default_module", 1)
-                        .set("default_module", "0");
-                this.update(new QcType(), serviceInfoWrapper);
-            }
-            //校验标准模版是否存在
-            List<QcType> list = this.list(new QueryWrapper<QcType>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", qcTypeSaveVO.getHospitalId())
-                    .eq("default_module", 1));
-            if (list.size() > 0) {
-                //发现标准模版已经存在
-                if (flag == false) {
-                    //修改页面
-                    if (null != qcTypeSaveVO.getId()) {
-                        //当默认唯一模版提交修改按钮不提示
-                        if (!qcTypeSaveVO.getId().equals(list.get(0).getId())) {
-                            return null;
-                        }
-                    } else if (null == qcTypeSaveVO.getId()) {
-                        //新增时候互斥给出提示
-                        return null;
-                    }
-                }
-            }
-        }
-
+    public void saveQcType(QcTypeSaveVO qcTypeSaveVO, CommonParam param) {
         QcType qcType = new QcType();
         Long id = qcTypeSaveVO.getId();
 
@@ -260,9 +151,8 @@ public class QcTypeFacade extends QcTypeServiceImpl {
         }
         qcType.setGmtModified(param.getNow());//修改时间
         qcType.setModifier(param.getPerson());//修改人
-        boolean data = this.saveOrUpdate(qcType);
+        this.saveOrUpdate(qcType);
         qcTypeSaveVO.setId(qcType.getId());
-        return data;
     }
 
     /**

+ 0 - 4
mrman-service/src/main/java/com/diagbot/vo/QcTypeControlVO.java

@@ -17,10 +17,6 @@ public class QcTypeControlVO {
     private Long id;
     // 医院ID
     private Long hospitalId;
-    //默认模版是否开启(0-否 1-是)
-    private Integer defaultModule =0;
-    //校验时使用(0-不更换 1-更换)
-    private Integer defineType =0;
     // 质控类型名称
     private String name;
 }

+ 0 - 4
mrman-service/src/main/java/com/diagbot/vo/QcTypeSaveVO.java

@@ -17,10 +17,6 @@ public class QcTypeSaveVO {
     private Long id;
     // 医院ID
     private Long hospitalId;
-    //默认模版是否开启(0-否 1-是)
-    private Integer defaultModule =0;
-    //校验时使用(0-不更换 1-更换)
-    private Integer defineType =0;
     // 质控类型名称
     private String name;
     // 质控类型和质控条目关联信息

+ 3 - 19
mrman-service/src/main/java/com/diagbot/web/QcTypeController.java

@@ -44,25 +44,9 @@ public class QcTypeController {
     @PostMapping("/saveOrUpdate")
     @SysLogger("saveOrUpdate")
     @Transactional
-    public RespDTO<Object> saveOrUpdate(@RequestBody QcTypeSaveVO qcTypeSaveVO) {
-        Object data = qcTypeFacade.saveOrUpdate(qcTypeSaveVO);
-        if(null==data){
-            return RespDTO.onError("默认标准类型已存在,是否替换?");
-        }
-        return RespDTO.onSuc(data);
-    }
-
-    @ApiOperation(value = "质控类型列表首页[by:cy]",
-            notes = "")
-    @PostMapping("/ControModuleInfo")
-    @SysLogger("ControModuleInfo")
-    @Transactional
-    public RespDTO<Object> ControModuleInfo(@RequestBody QcTypeControlVO qcTypeControlVO) {
-        Object data = qcTypeFacade.ControModuleInfo(qcTypeControlVO);
-        if(null==data){
-            return RespDTO.onError("默认标准类型已存在,是否替换?");
-        }
-        return RespDTO.onSuc(data);
+    public RespDTO<Boolean> saveOrUpdate(@RequestBody QcTypeSaveVO qcTypeSaveVO) {
+        qcTypeFacade.saveOrUpdate(qcTypeSaveVO);
+        return RespDTO.onSuc(true);
     }