Bläddra i källkod

质控类型维护

gaodm 5 år sedan
förälder
incheckning
b40478fb6f

+ 16 - 8
src/main/java/com/diagbot/facade/QcTypeFacade.java

@@ -125,6 +125,7 @@ public class QcTypeFacade extends QcTypeServiceImpl {
         if (qcTypeSaveVO.getId() != null) {
             qcType = this.getOne(new QueryWrapper<QcType>()
                     .eq("id", id)
+                    .eq("hospital_id", qcTypeSaveVO.getHospitalId())
                     .eq("is_deleted", IsDeleteEnum.N.getKey()), false);
             if (qcType == null) { //校验
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控类型不存在【id=" + id + "】");
@@ -194,8 +195,10 @@ public class QcTypeFacade extends QcTypeServiceImpl {
      */
     public QcTypeDTO getById(QcTypeVO qcTypeVO) {
         QcTypeDTO qcTypeDTO = new QcTypeDTO();
+        qcTypeDTO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
         QcType qcType = this.getOne(new QueryWrapper<QcType>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", qcTypeVO.getHospitalId())
                 .eq("id", qcTypeVO.getId()), false
         );
         if (qcType == null) {
@@ -219,14 +222,19 @@ public class QcTypeFacade extends QcTypeServiceImpl {
         Date now = DateUtil.now();
         String person = SysUserUtils.getCurrentPrincipleID();
         // 更新主表
-        this.update(new UpdateWrapper<QcType>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .in("id", deleteQcTypeVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey())
-                .set("gmt_modified", now)
-                .set("modifier", person)
-        );
-
+        Boolean res =
+                this.update(new UpdateWrapper<QcType>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                        .in("id", deleteQcTypeVO.getIds())
+                        .set("is_deleted", IsDeleteEnum.Y.getKey())
+                        .set("gmt_modified", now)
+                        .set("modifier", person)
+                );
+
+        if (!res){
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
         // 删除明细表
         qcTypeCasesEntryService.removeByIds(deleteQcTypeVO.getIds());
         if (ListUtil.isNotEmpty(deleteQcTypeVO.getIds())) {

+ 2 - 0
src/main/java/com/diagbot/vo/QcTypeVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,5 +13,6 @@ import lombok.Setter;
 @Setter
 public class QcTypeVO {
     private Long id;
+    @ApiModelProperty(hidden = true)
     private Long hospitalId;
 }

+ 6 - 6
src/main/java/com/diagbot/web/QcTypeController.java

@@ -45,7 +45,7 @@ public class QcTypeController {
     @Autowired
     QcTypeFacade qcTypeFacade;
 
-    @ApiOperation(value = "新增或更新[by:zhoutg]",
+    @ApiOperation(value = "新增或更新[by:gaodm]",
             notes = "")
     @PostMapping("/saveOrUpdate")
     @SysLogger("saveOrUpdate")
@@ -55,7 +55,7 @@ public class QcTypeController {
         return RespDTO.onSuc(true);
     }
 
-    @ApiOperation(value = "分页列表[by:zhoutg]",
+    @ApiOperation(value = "分页列表[by:gaodm]",
             notes = "    // 名称\n" +
                     "     String name;")
     @PostMapping("/page")
@@ -65,7 +65,7 @@ public class QcTypeController {
         return RespDTO.onSuc(data);
     }
 
-    @ApiOperation(value = "新增时质控条目分组信息[by:zhoutg]",
+    @ApiOperation(value = "新增时质控条目分组信息[by:gaodm]",
             notes = "")
     @PostMapping("/getEntryByHospital")
     @SysLogger("getEntryByHospital")
@@ -74,7 +74,7 @@ public class QcTypeController {
         return RespDTO.onSuc(data);
     }
 
-    @ApiOperation(value = "质控条目检索[by:zhoutg]",
+    @ApiOperation(value = "质控条目检索[by:gaodm]",
             notes = "    // 界面输入\n" +
                     "     String input;\n" +
                     "    // 过滤caseEntryId\n" +
@@ -87,7 +87,7 @@ public class QcTypeController {
         return RespDTO.onSuc(data);
     }
 
-    @ApiOperation(value = "删除[by:zhoutg]",
+    @ApiOperation(value = "删除[by:gaodm]",
             notes = "")
     @PostMapping("/delete")
     @SysLogger("delete")
@@ -97,7 +97,7 @@ public class QcTypeController {
         return RespDTO.onSuc(true);
     }
 
-    @ApiOperation(value = "根据id返回内容[by:zhoutg]",
+    @ApiOperation(value = "根据id返回内容[by:gaodm]",
             notes = "id: qcTypeId<br>" )
     @PostMapping("/getById")
     @SysLogger("getById")