gaodm 5 лет назад
Родитель
Сommit
28cb7396c0
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      src/main/java/com/diagbot/facade/QcTypeFacade.java

+ 5 - 5
src/main/java/com/diagbot/facade/QcTypeFacade.java

@@ -130,15 +130,16 @@ public class QcTypeFacade extends QcTypeServiceImpl {
             if (qcType == null) { //校验
             if (qcType == null) { //校验
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控类型不存在【id=" + id + "】");
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控类型不存在【id=" + id + "】");
             }
             }
+            param.setInsertOrUpdate(InsertOrUpdateEnum.Update.getKey());
         }
         }
         BeanUtil.copyProperties(qcTypeSaveVO, qcType);
         BeanUtil.copyProperties(qcTypeSaveVO, qcType);
-        List<QcType> qcTypeList = this.list(new QueryWrapper<QcType>()
+        Integer count = this.count(new QueryWrapper<QcType>()
                 .eq("name", qcTypeSaveVO.getName())
                 .eq("name", qcTypeSaveVO.getName())
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", qcTypeSaveVO.getHospitalId())
                 .eq("hospital_id", qcTypeSaveVO.getHospitalId())
                 .ne("id", id == null ? -1 : id));
                 .ne("id", id == null ? -1 : id));
         // 质控类型hospitalId、name唯一
         // 质控类型hospitalId、name唯一
-        if (ListUtil.isNotEmpty(qcTypeList)) {
+        if (count > 0) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "质控类型已存在");
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "质控类型已存在");
         }
         }
         if (InsertOrUpdateEnum.Insert.getKey() == param.getInsertOrUpdate()) {
         if (InsertOrUpdateEnum.Insert.getKey() == param.getInsertOrUpdate()) {
@@ -195,7 +196,7 @@ public class QcTypeFacade extends QcTypeServiceImpl {
      */
      */
     public QcTypeDTO getById(QcTypeVO qcTypeVO) {
     public QcTypeDTO getById(QcTypeVO qcTypeVO) {
         QcTypeDTO qcTypeDTO = new QcTypeDTO();
         QcTypeDTO qcTypeDTO = new QcTypeDTO();
-        qcTypeDTO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        qcTypeVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
         QcType qcType = this.getOne(new QueryWrapper<QcType>()
         QcType qcType = this.getOne(new QueryWrapper<QcType>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", qcTypeVO.getHospitalId())
                 .eq("hospital_id", qcTypeVO.getHospitalId())
@@ -232,11 +233,10 @@ public class QcTypeFacade extends QcTypeServiceImpl {
                         .set("modifier", person)
                         .set("modifier", person)
                 );
                 );
 
 
-        if (!res){
+        if (!res) {
             throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
             throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
         }
         }
         // 删除明细表
         // 删除明细表
-        qcTypeCasesEntryService.removeByIds(deleteQcTypeVO.getIds());
         if (ListUtil.isNotEmpty(deleteQcTypeVO.getIds())) {
         if (ListUtil.isNotEmpty(deleteQcTypeVO.getIds())) {
             qcTypeCasesEntryService.remove(new QueryWrapper<QcTypeCasesEntry>()
             qcTypeCasesEntryService.remove(new QueryWrapper<QcTypeCasesEntry>()
                     .in("type_id", deleteQcTypeVO.getIds())
                     .in("type_id", deleteQcTypeVO.getIds())