|
@@ -1,9 +1,11 @@
|
|
|
package com.zd.laboratory.service.impl;
|
|
package com.zd.laboratory.service.impl;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.zd.common.core.annotation.DataScope;
|
|
import com.zd.common.core.annotation.DataScope;
|
|
|
import com.zd.common.core.exception.ServiceException;
|
|
import com.zd.common.core.exception.ServiceException;
|
|
|
import com.zd.common.core.utils.Assert;
|
|
import com.zd.common.core.utils.Assert;
|
|
|
import com.zd.common.core.utils.DateUtils;
|
|
import com.zd.common.core.utils.DateUtils;
|
|
|
|
|
+import com.zd.common.core.utils.DictUtils;
|
|
|
import com.zd.common.core.utils.SecurityUtils;
|
|
import com.zd.common.core.utils.SecurityUtils;
|
|
|
import com.zd.laboratory.api.vo.LabSubClassVO;
|
|
import com.zd.laboratory.api.vo.LabSubClassVO;
|
|
|
import com.zd.laboratory.domain.*;
|
|
import com.zd.laboratory.domain.*;
|
|
@@ -24,15 +26,16 @@ import com.zd.model.domain.per.PerPrefix;
|
|
|
import com.zd.model.entity.SysUser;
|
|
import com.zd.model.entity.SysUser;
|
|
|
import com.zd.model.entity.TotalByID;
|
|
import com.zd.model.entity.TotalByID;
|
|
|
import com.zd.model.enums.HazardTypeEnum;
|
|
import com.zd.model.enums.HazardTypeEnum;
|
|
|
|
|
+import com.zd.system.api.entity.SysDictData;
|
|
|
import com.zd.system.api.feign.RemoteUserService;
|
|
import com.zd.system.api.feign.RemoteUserService;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 实验室Service业务层处理
|
|
* 实验室Service业务层处理
|
|
@@ -546,7 +549,70 @@ public class LabSubjectServiceImpl implements ILabSubjectService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Map<String,Object> selectLabSubjectInfoId(Long id) {
|
|
public Map<String,Object> selectLabSubjectInfoId(Long id) {
|
|
|
- return labSubjectMapper.selectXxpLabSubjectById(id);
|
|
|
|
|
|
|
+ Map<String,Object> labMap=labSubjectMapper.selectXxpLabSubjectById(id);
|
|
|
|
|
+ //进入检查
|
|
|
|
|
+ //设置
|
|
|
|
|
+ String checkIn=String.valueOf(labMap.get("check_in"));
|
|
|
|
|
+ String inspectCheckIn=String.valueOf(labMap.get("inspect_check_in"));
|
|
|
|
|
+ if (StrUtil.isNotBlank(checkIn)) {
|
|
|
|
|
+ List<SysDictData> check_in = DictUtils.getDictCache("sub_check_in");
|
|
|
|
|
+ Optional.ofNullable(checkIn.split(","))
|
|
|
|
|
+ .filter(a -> a.length > 0)
|
|
|
|
|
+ .ifPresent(a -> {
|
|
|
|
|
+ List<Map<String, String>> list = new ArrayList<>();
|
|
|
|
|
+ labMap.put("checkIn",list);
|
|
|
|
|
+ Arrays.stream(a).map(c -> {
|
|
|
|
|
+ Optional<SysDictData> first = check_in.stream().filter(d -> c.equals(d.getDictValue())).findFirst();
|
|
|
|
|
+ return first;
|
|
|
|
|
+ }).filter(c -> c.isPresent())
|
|
|
|
|
+ .forEach(c -> {
|
|
|
|
|
+ c.ifPresent(d -> {
|
|
|
|
|
+ Map<String, String> map = new HashMap<>(2);
|
|
|
|
|
+ map.put("code", d.getDictValue());
|
|
|
|
|
+ map.put("name", d.getDictLabel());
|
|
|
|
|
+ list.add(map);
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StrUtil.isNotBlank(inspectCheckIn)) {
|
|
|
|
|
+ List<SysDictData> check_in = DictUtils.getDictCache("sub_check_in");
|
|
|
|
|
+ Optional.ofNullable(inspectCheckIn.split(","))
|
|
|
|
|
+ .filter(a -> a.length > 0)
|
|
|
|
|
+ .ifPresent(a -> {
|
|
|
|
|
+ List<Map<String, String>> list = new ArrayList<>();
|
|
|
|
|
+ labMap.put("inspectCheckIn",list);
|
|
|
|
|
+ Arrays.stream(a).map(c -> {
|
|
|
|
|
+ Optional<SysDictData> first = check_in.stream().filter(d -> c.equals(d.getDictValue())).findFirst();
|
|
|
|
|
+ return first;
|
|
|
|
|
+ }).filter(c -> c.isPresent())
|
|
|
|
|
+ .forEach(c -> {
|
|
|
|
|
+ c.ifPresent(d -> {
|
|
|
|
|
+ Map<String, String> map = new HashMap<>(2);
|
|
|
|
|
+ map.put("code", d.getDictValue());
|
|
|
|
|
+ map.put("name", d.getDictLabel());
|
|
|
|
|
+ list.add(map);
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ List<SysDictData> dictDatas = DictUtils.getDictCache("lab_onepc_outcheck");
|
|
|
|
|
+ List<String> newDictDatas = new ArrayList<>();
|
|
|
|
|
+ String checkOut=String.valueOf(labMap.get("check_out"));
|
|
|
|
|
+ if(StringUtils.isNotBlank(checkOut)){
|
|
|
|
|
+ newDictDatas = Optional.ofNullable(checkOut).map(b -> b.split(",")).map(b -> Arrays.asList(b))
|
|
|
|
|
+ .orElse(new ArrayList <>()).stream().map(b -> Optional.ofNullable(dictDatas).filter(a -> a.size() > 0)
|
|
|
|
|
+ .orElseGet(Collections::emptyList).stream()
|
|
|
|
|
+ .filter(a -> b.equals(a.getDictValue())).findFirst().orElse(new SysDictData()))
|
|
|
|
|
+ .map(SysDictData::getDictLabel).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ newDictDatas.removeIf(x->StringUtils.isEmpty(x));
|
|
|
|
|
+ labMap.put("checkOut",newDictDatas);
|
|
|
|
|
+ return labMap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|