|
@@ -1,8 +1,8 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.LisMappingPageDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
@@ -10,14 +10,17 @@ import com.diagbot.entity.LisMapping;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
+import com.diagbot.service.LisMappingService;
|
|
|
import com.diagbot.service.impl.LisMappingServiceImpl;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
-import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
+import com.diagbot.vo.IdListVO;
|
|
|
+import com.diagbot.vo.IdVO;
|
|
|
import com.diagbot.vo.LisMappingPageVO;
|
|
|
import com.diagbot.vo.LisMappingVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Date;
|
|
@@ -34,6 +37,9 @@ import java.util.stream.Collectors;
|
|
|
public class LisMappingFacade extends LisMappingServiceImpl {
|
|
|
@Autowired
|
|
|
private UserServiceClient userServiceClient;
|
|
|
+ @Autowired
|
|
|
+ @Qualifier("lisMappingServiceImpl")
|
|
|
+ private LisMappingService lisMappingService;
|
|
|
|
|
|
/**
|
|
|
* 化验公表映射分页信息
|
|
@@ -57,7 +63,7 @@ public class LisMappingFacade extends LisMappingServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 新增化验映射关系
|
|
|
+ * 新增化验公表映射关系
|
|
|
*
|
|
|
* @param lisMappingVO
|
|
|
* @return
|
|
@@ -116,4 +122,40 @@ public class LisMappingFacade extends LisMappingServiceImpl {
|
|
|
Boolean state = this.updateById(lisMapping);
|
|
|
return state;
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除单条化验公表映射关系
|
|
|
+ *
|
|
|
+ * @param idVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean delLisMappingById(IdVO idVO) {
|
|
|
+ String userId = UserUtils.getCurrentPrincipleID();
|
|
|
+ Date now = DateUtil.now();
|
|
|
+ LisMapping lisMapping = this.getById(idVO.getId());
|
|
|
+ if (lisMapping == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "映射关系不存在,不允许删除");
|
|
|
+ }
|
|
|
+ lisMapping.setIsDeleted(IsDeleteEnum.Y.getKey());
|
|
|
+ lisMapping.setModifier(userId);
|
|
|
+ lisMapping.setGmtModified(now);
|
|
|
+ Boolean state = this.updateById(lisMapping);
|
|
|
+ return state;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除化验公表映射关系
|
|
|
+ *
|
|
|
+ * @param idListVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean delLisMappingByIds(IdListVO idListVO) {
|
|
|
+ String userId = UserUtils.getCurrentPrincipleID();
|
|
|
+ Date now = DateUtil.now();
|
|
|
+ UpdateWrapper<LisMapping> lisMappingUpdateWrapper = new UpdateWrapper<>();
|
|
|
+ lisMappingUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).in("id", idListVO.getIdList()).
|
|
|
+ set("is_deleted", IsDeleteEnum.Y.getKey()).set("modifier", userId).set("gmt_modified", now);
|
|
|
+ Boolean state = lisMappingService.update(new LisMapping(), lisMappingUpdateWrapper);
|
|
|
+ return state;
|
|
|
+ }
|
|
|
+}
|