诊断模板
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run

This commit is contained in:
旺仔 2024-09-13 13:40:11 +08:00
parent 81f3d9f2ec
commit a6fd0ef154
9 changed files with 359 additions and 148 deletions

View File

@ -42,6 +42,7 @@ import cn.iocoder.yudao.module.tblist.dal.dataobject.patientexamlist.Patientexam
import cn.iocoder.yudao.module.tblist.service.patientexamlist.PatientexamlistService;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@ -173,6 +174,19 @@ public class PatientexamlistController {
return success(_out);
}
@GetMapping("/getCheckRecord")
@Operation(summary = "云胶片-getCheckRecord")
public CommonResult<Map<String, Object>> getCheckRecord(@RequestParam("no") String no, @RequestParam("orgId") String orgId) {
Map<String, Object> _out = null;
try {
_out = patientexamlistService.getCheckRecord(no, orgId);
} catch (Exception ex) {
_out = new HashMap<>();
_out.put("code", "error");
}
return success(_out);
}
@GetMapping("/dicomDataRefresh")
@Operation(summary = "dicomj检查后数据刷新")
@PreAuthorize("@ss.hasPermission('tblist:patientexamlist:query')")

View File

@ -102,5 +102,27 @@ public interface PatientexamlistMapper extends BaseMapperX<PatientexamlistDO> {
+ " ORDER BY date")
List<PatientexamlistCountVO> GetDateYYZDCount(@Param("orgId") String orgId);
//云胶片功能
@Select(" SELECT\n" +
" t1.ID as id, \n" +
" t1.examId as checkNumber, \n" +
" t1.pName as patientName, \n" +
" t1.gender as patientSex, \n" +
" '' as patientAge,t1.birthday as patientBirthday, \n" +
" '' as phone, \n" +
" t1.examItemCode as checkModuleId, \n" +
" t1.examItemName as checkModuleName, \n" +
" t1.examDescription as itemResult, \n" +
" t1.diagResults as diagResult, \n" +
" t1.examDate as checkDate, \n" +
" t1.diagDoctor as doctor, \n" +
" t1.orgId as orgId,\n" +
" t2.orgName as orgName, \n" +
" t2.dcmprefix as hostUrl \n" +
"FROM tb_patientexamlist t1\n" +
"LEFT JOIN tb_org t2 ON t1.orgId=t2.orgID AND t2.isdelete!=1\n" +
"WHERE 1=1\n" +
"AND t1.regId=#{regId}\n" +
"AND t1.orgId=#{orgId} ")
List<Map<String, Object>> getCheckRecord(@Param("regId") String regId, @Param("orgId") String orgId);
}

View File

@ -92,9 +92,16 @@ public interface PatientexamlistService extends IService<PatientexamlistDO> {
boolean dicomDataRefresh(String orgId);
boolean insertbatch(List<PatientexamlistDO> doList);
// 获取已检查的阴性阳性重大阳性统计
PatientexamlistCountVO GetWholeDiagFlagCount(String orgId);
// 获取一周已检查的阴性阳性重大阳性统计
//获取已检查的阴性阳性重大阳性统计
PatientexamlistCountVO GetWholeDiagFlagCount(String orgId);
//获取一周已检查的阴性阳性重大阳性统计
List<PatientexamlistCountVO> GetDateWholeDiagFlagCount(String orgId);
/**
* 云胶片功能
* getCheckRecord
*/
Map<String, Object> getCheckRecord(String regId, String orgId);
}

View File

@ -272,4 +272,25 @@ public class PatientexamlistServiceImpl extends ServiceImpl<PatientexamlistMappe
}
@Override
public Map<String, Object> getCheckRecord(String regId, String orgId) {
Map<String, Object> _out = new HashMap<>();
List<Map<String, Object>> _list = patientexamlistMapper.getCheckRecord(regId, orgId);
if (_list != null && _list.size() > 0) {
_out.put("code", "success");
_out.put("items", _list);
_out.put("no", regId);
_out.put("name", _list.get(0).get("patientName"));
_out.put("orgId", orgId);
_out.put("orgName", _list.get(0).get("orgName"));
_out.put("title", (_list.get(0).get("patientName") != null ? _list.get(0).get("patientName").toString().trim() : "") + " CT影像检查报告单和云胶片");
} else {
_out.put("code", "empty");
}
return _out;
}
}

View File

@ -68,6 +68,23 @@ public class ReporttemplateController {
return success(reporttemplate);
}
@GetMapping("/hasChildren")
@Operation(summary = "诊断模板是否存在子数据")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:reporttemplate:query')")
public CommonResult<Boolean> hasReporttemplateChildren(@RequestParam("id") String id) {
boolean _out = reporttemplateService.hasReporttemplateChildren(id);
return success(_out);
}
@GetMapping("/getroot")
@Operation(summary = "获得诊断模板root节点")
@PreAuthorize("@ss.hasPermission('system:reporttemplate:query')")
public CommonResult<List<ReporttemplateTreeView>> getReporttemplateRoot() {
List<ReporttemplateTreeView> reporttemplates = reporttemplateService.getReporttemplateRoot();
return success(reporttemplates);
}
@GetMapping("/getlist")
@Operation(summary = "获得诊断模板list")
@PreAuthorize("@ss.hasPermission('system:reporttemplate:query')")

View File

@ -1,12 +1,10 @@
package cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate.vo.*;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.*;
import java.util.*;
@ -20,30 +18,31 @@ import java.util.*;
public interface ReporttemplateMapper extends BaseMapperX<ReporttemplateDO> {
//查询
default List<ReporttemplateDO> selectList(String pid, String orgId) {
return selectList(new LambdaQueryWrapperX<ReporttemplateDO>()
.neIfPresent(ReporttemplateDO::getIsdelete, '1')
.eq(ReporttemplateDO::getPid, pid)
.eqIfPresent(ReporttemplateDO::getOrgId, orgId)
.orderByAsc(ReporttemplateDO::getTemplateName));
}
default List<ReporttemplateDO> selectNodes(ReporttemplatePageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ReporttemplateDO>()
.neIfPresent(ReporttemplateDO::getIsdelete, '1')
.eq(ReporttemplateDO::getOrgId, reqVO.getOrgId())
.likeIfPresent(ReporttemplateDO::getTemplateName, reqVO.getTemplateName())
.isNull(reqVO.getTemplateLimitsType() != null && reqVO.getTemplateLimitsType().trim().equals("1"),
ReporttemplateDO::getPrivateDoctorId)
.isNotNull(reqVO.getTemplateLimitsType() != null && reqVO.getTemplateLimitsType().trim().equals("2"),
ReporttemplateDO::getPrivateDoctorId)
.orderByAsc(ReporttemplateDO::getTemplateName));
}
default List<ReporttemplateDO> selectNodes(String orgId) {
return selectList(new LambdaQueryWrapperX<ReporttemplateDO>()
.neIfPresent(ReporttemplateDO::getIsdelete, '1')
.eq(ReporttemplateDO::getOrgId, orgId)
.orderByAsc(ReporttemplateDO::getTemplateName));
}
default List<ReporttemplateDO> selectNodes(String orgId, String Pid) {
return selectList(new LambdaQueryWrapperX<ReporttemplateDO>()
.neIfPresent(ReporttemplateDO::getIsdelete, '1')
.eq(ReporttemplateDO::getOrgId, orgId)
.isNotNull(ReporttemplateDO::getPid)
.eq(ReporttemplateDO::getPid, (Pid == null ? "" : Pid.trim()))
.orderByAsc(ReporttemplateDO::getTemplateName));
}
default List<ReporttemplateDO> selectNodes_Root(String orgId) {
return selectList(new LambdaQueryWrapperX<ReporttemplateDO>()
.neIfPresent(ReporttemplateDO::getIsdelete, '1')
.eq(ReporttemplateDO::getDataType, '1')
.eq(ReporttemplateDO::getOrgId, orgId)
.orderByAsc(ReporttemplateDO::getTemplateName));
}
//私有通用
@Select(" ${sql} ")
List<ReporttemplateDO> use_selectList(@Param("sql") String sql);
}

View File

@ -27,6 +27,8 @@ public interface ReporttemplateService {
PageResult<ReporttemplateTreeView> getReporttemplatePage(ReporttemplatePageReqVO pageReqVO);
List<ReporttemplateTreeView> getReporttemplatelist();
List<ReporttemplateTreeView> getReporttemplateRoot();
boolean hasReporttemplateChildren(String id);
}

View File

@ -1,24 +1,20 @@
package cn.iocoder.yudao.module.ultrasoniccom.service.reporttemplate;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.*;
import cn.iocoder.yudao.module.system.service.user.*;
import cn.iocoder.yudao.module.ultrasoniccom.controller.admin.reporttemplate.vo.*;
import cn.iocoder.yudao.module.ultrasoniccom.dal.reporttemplate.*;
import cn.iocoder.yudao.module.system.service.user.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.*;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.*;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -110,83 +106,187 @@ public class ReporttemplateServiceImpl implements ReporttemplateService {
@Override
public PageResult<ReporttemplateTreeView> getReporttemplatePage(ReporttemplatePageReqVO pageReqVO) {
List<ReporttemplateTreeView> _viewPage = Collections.emptyList();
List<ReporttemplateTreeView> _view = null;
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
pageReqVO.setOrgId(user.getOrgId());
//全部数据(缓存)
List<ReporttemplateDO> _tempAll = reporttemplateMapper.selectNodes(user.getOrgId());
List<ReporttemplateTreeView> _tempVAll = null;
//直接符合的叶和根
List<ReporttemplateDO> _temp = reporttemplateMapper.selectNodes(pageReqVO);
List<ReporttemplateTreeView> _tempV = null;
//经推导符合的根
List<ReporttemplateDO> _tempOther = null;
List<ReporttemplateTreeView> _tempVOther = null;
List<ReporttemplateDO> Nodes_all = reporttemplateMapper.selectNodes(pageReqVO.getOrgId());
List<ReporttemplateDO> Nodes_res = null;
if (_temp != null && _temp.size() > 0) {
//计算_tempOther
ReporttemplateDO _tempDO = null;
ReporttemplateDO _tempDO2 = null;
boolean doNext = true;
_tempOther = new ArrayList<>();
for (ReporttemplateDO item : _temp) {
_tempDO = item;
doNext = true;
while (doNext) {
_tempDO2 = null;
final String pid = _tempDO.getPid();
_tempDO = _tempAll.stream().filter(it -> it.getId() != null && pid != null && !pid.trim().equals("0") && it.getId().equals(pid))
.findFirst().orElse(null);
if (_tempDO == null || _tempDO.getId() == null || _tempDO.getPid() == null)
doNext = false;
else {
final String id = _tempDO.getId();
_tempDO2 = _temp.stream().filter(it -> it.getId() != null && it.getId().equals(id))
.findFirst().orElse(null);
if (_tempDO2 != null)
doNext = false;
else if (_tempOther.contains(_tempDO))
doNext = false;
else {
_tempOther.add(_tempDO);
if (_tempDO.getPid().trim().equals("0"))
doNext = false;
//计算Nodes_res
if (isEmptyList(Nodes_all) ||
(pageReqVO.getTemplateName() == null || pageReqVO.getTemplateName().trim().equals("")) &&
(pageReqVO.getTemplateLimitsType() == null || !new ArrayList<String>(Arrays.asList("1", "2")).contains(pageReqVO.getTemplateLimitsType().trim())) &&
(pageReqVO.getTemplateType() == null || pageReqVO.getTemplateType().trim().equals(""))) {
Nodes_res = Nodes_all;
} else {
Nodes_res = null;
List<ReporttemplateDO> Nodes_select_name = null;
List<ReporttemplateDO> Nodes_select_private = null;
List<ReporttemplateDO> Nodes_select_Type = null;
//姓名
if (pageReqVO.getTemplateName() != null && !pageReqVO.getTemplateName().trim().equals("")) {
Nodes_select_name = Collections.emptyList();
List<ReporttemplateDO> Nodes_name = Nodes_all.stream().filter(it -> it.getId() != null && it.getTemplateName() != null && it.getTemplateName().trim().contains(pageReqVO.getTemplateName().trim()))
.collect(Collectors.toList());
if (!isEmptyList(Nodes_name)) {
List<ReporttemplateDO> Nodes_name_tree = new ArrayList<>(Nodes_name);
List<ReporttemplateDO> Nodes_name_temp = null;
List<ReporttemplateDO> Nodes_name_temp2 = null;
List<ReporttemplateDO> Nodes_name_temp3 = null;
Nodes_name_temp = Nodes_name_tree.stream().filter(it -> it.getId() != null && it.getDataType() != null && it.getDataType().trim().equals("1"))
.collect(Collectors.toList());
while (!isEmptyList(Nodes_name_temp)) {
Nodes_name_temp2 = new ArrayList<>();
for (ReporttemplateDO item : Nodes_name_temp) {
String id = (item.getId() == null ? "" : item.getId().trim());
Nodes_name_temp3 = Nodes_all.stream().filter(it -> it.getId() != null && it.getPid() != null && it.getPid().trim().equals(id))
.collect(Collectors.toList());
if (!isEmptyList(Nodes_name_temp3)) {
for (ReporttemplateDO item2 : Nodes_name_temp3) {
if (item2 != null && !Nodes_name_tree.contains(item2)) {
Nodes_name_tree.add(item2);
if (item2.getDataType() != null && item2.getDataType().trim().equals("1") && !Nodes_name_temp2.contains(item2))
Nodes_name_temp2.add(item2);
}
}
}
}
Nodes_name_temp = Nodes_name_temp2;
}
Nodes_select_name = Nodes_name_tree.stream().filter(it -> it.getId() != null && (it.getDataType() == null || it.getDataType().trim().equals("0")))
.collect(Collectors.toList());
}
if (isEmptyList(Nodes_select_name))
Nodes_select_name = Collections.emptyList();
}
//权限
if (pageReqVO.getTemplateLimitsType() != null && new ArrayList<String>(Arrays.asList("1", "2")).contains(pageReqVO.getTemplateLimitsType().trim())) {
Nodes_select_private = Nodes_all.stream().filter(it -> it.getId() != null && it.getDataType() != null && it.getDataType().trim().equals("0") &&
(pageReqVO.getTemplateLimitsType().trim().equals("1") ? (it.getPrivateDoctorId() == null || it.getPrivateDoctorId().trim().equals("")) : (it.getPrivateDoctorId() != null && !it.getPrivateDoctorId().trim().equals(""))))
.collect(Collectors.toList());
if (isEmptyList(Nodes_select_private))
Nodes_select_private = Collections.emptyList();
}
//类型
if (pageReqVO.getTemplateType() != null && !pageReqVO.getTemplateType().trim().equals("")) {
Nodes_select_Type = Nodes_all.stream().filter(it -> it.getId() != null && it.getTemplateType() != null && it.getTemplateType().trim().equals(pageReqVO.getTemplateType().trim()))
.collect(Collectors.toList());
List<ReporttemplateDO> Nodes_type_tree = null;
if (!isEmptyList(Nodes_select_Type))
Nodes_type_tree = Nodes_select_Type.stream().filter(it -> it.getPid() != null && it.getPid().trim().equals("0") && it.getDataType() != null && it.getDataType().trim().equals("1"))
.collect(Collectors.toList());
if (!isEmptyList(Nodes_select_Type) && !isEmptyList(Nodes_type_tree)) {
List<ReporttemplateDO> Nodes_type_temp = null;
List<ReporttemplateDO> Nodes_type_temp2 = null;
List<ReporttemplateDO> Nodes_type_temp3 = null;
Nodes_type_temp = new ArrayList<>(Nodes_type_tree);
while (!isEmptyList(Nodes_type_temp)) {
Nodes_type_temp2 = new ArrayList<>();
for (ReporttemplateDO item : Nodes_type_temp) {
String id = (item.getId() == null ? "" : item.getId().trim());
Nodes_type_temp3 = Nodes_select_Type.stream().filter(it -> it.getId() != null && it.getPid() != null && it.getPid().trim().equals(id))
.collect(Collectors.toList());
if (!isEmptyList(Nodes_type_temp3)) {
for (ReporttemplateDO item2 : Nodes_type_temp3) {
if (item2 != null && !Nodes_type_tree.contains(item2)) {
Nodes_type_tree.add(item2);
if (item2.getDataType() != null && item2.getDataType().trim().equals("1") && !Nodes_type_temp2.contains(item2))
Nodes_type_temp2.add(item2);
}
}
}
}
Nodes_type_temp = Nodes_type_temp2;
}
Nodes_select_Type = Nodes_type_tree.stream().filter(it -> it.getId() != null && (it.getDataType() == null || it.getDataType().trim().equals("0")))
.collect(Collectors.toList());
} else
Nodes_select_Type = Collections.emptyList();
if (isEmptyList(Nodes_select_Type))
Nodes_select_Type = Collections.emptyList();
}
//整理Nodes_res
if (Nodes_select_name == null && Nodes_select_private == null && Nodes_select_Type == null) {
Nodes_res = Nodes_all;
} else if ((Nodes_select_name != null && Nodes_select_name.size() <= 0) ||
(Nodes_select_private != null && Nodes_select_private.size() <= 0) ||
(Nodes_select_Type != null && Nodes_select_Type.size() <= 0)) {
Nodes_res = null;
} else {
Nodes_res = new ArrayList<>();
boolean canAdd = false;
for (ReporttemplateDO it : Nodes_all) {
canAdd = false;
if (it != null && it.getDataType() != null && it.getDataType().trim().equals("0")) {
if ((Nodes_select_name == null || Nodes_select_name.contains(it)) &&
(Nodes_select_private == null || Nodes_select_private.contains(it)) &&
(Nodes_select_Type == null || Nodes_select_Type.contains(it))) {
canAdd = true;
}
}
if (canAdd && !Nodes_res.contains(it))
Nodes_res.add(it);
}
if(!isEmptyList(Nodes_res))
{
List<ReporttemplateDO> Nodes_name_temp = null;
List<ReporttemplateDO> Nodes_name_temp2 = null;
ReporttemplateDO Node_temp = null;
Nodes_name_temp = new ArrayList<>(Nodes_res);
while (!isEmptyList(Nodes_name_temp)) {
Nodes_name_temp2 = new ArrayList<>();
for (ReporttemplateDO item : Nodes_name_temp) {
String Pid = (item.getPid() == null ? "" : item.getPid().trim());
Node_temp = Nodes_all.stream().filter(it -> it.getId() != null && it.getId().trim().equals(Pid) && it.getDataType() != null && it.getDataType().trim().equals("1"))
.findFirst().orElse(null);
if (Node_temp != null && !Nodes_res.contains(Node_temp)) {
Nodes_res.add(Node_temp);
if (!Nodes_name_temp2.contains(Node_temp))
Nodes_name_temp2.add(Node_temp);
}
}
Nodes_name_temp = Nodes_name_temp2;
}
}
}
//计算_tempV
if (!(pageReqVO.getTemplateLimitsType() != null && (pageReqVO.getTemplateLimitsType().trim().equals("1") || pageReqVO.getTemplateLimitsType().trim().equals("2"))) &&
!StringUtils.hasText(pageReqVO.getTemplateName())) {
//判断查询条件优化渲染速度
_tempV = treeViewBuild(null, "0", user.getOrgId());
_tempVOther = new ArrayList<>();
} else {
_tempV = BeanUtils.toBean(_temp, ReporttemplateTreeView.class);
for (ReporttemplateTreeView item : _tempV) {
if (item != null && item.getDataType() != null && item.getDataType().trim().equals("1"))
treeViewBuild(item, item.getId(), item.getOrgId());
}
_tempVOther = BeanUtils.toBean(_tempOther, ReporttemplateTreeView.class);
}
_tempVAll = Stream.concat(_tempV.stream(), _tempVOther.stream())
.distinct().collect(Collectors.toList());
//计算_view
_view = _tempVAll.stream().filter(it -> it.getId() != null && it.getPid() != null && it.getPid().trim().equals("0"))
.sorted(Comparator.comparing(ReporttemplateTreeView::getTemplateName)).collect(Collectors.toList());
if (_view != null && _view.size() > 0) {
for (ReporttemplateTreeView item : _view) {
if (item != null && item.getDataType() != null && item.getDataType().trim().equals("1"))
treeViewBuild(item, item.getId(), _tempVAll);
}
} else
_view = null;
}
//结果
if (_view != null && _view.size() > 0) {
//计算_view
if (!isEmptyList(Nodes_res)) {
List<ReporttemplateTreeView> _viewTemp = relationViewBuild(BeanUtils.toBean(Nodes_res, ReporttemplateTreeView.class));
if (!isEmptyList(_viewTemp)) {
for (ReporttemplateTreeView item : _viewTemp) {
if (isEmptyList(item.children))
item.children = null;
else {
item.children.sort(Comparator.comparing(ReporttemplateTreeView::getTemplateName));
}
}
_view = _viewTemp.stream().filter(it -> it.getId() != null && it.getPid() != null && it.getPid().trim().equals("0"))
.collect(Collectors.toList());
if (isEmptyList(_view))
_view = null;
else
_view.sort(Comparator.comparing(ReporttemplateTreeView::getTemplateName));
}
}
//计算_viewPage
if (!isEmptyList(_view)) {
if (!PageParam.PAGE_SIZE_NONE.equals(pageReqVO.getPageSize())) {
int index_start = (pageReqVO.getPageNo() - 1) * pageReqVO.getPageSize();
int index_end = pageReqVO.getPageNo() * pageReqVO.getPageSize() - 1;
@ -199,20 +299,50 @@ public class ReporttemplateServiceImpl implements ReporttemplateService {
_viewPage = _view;
}
}
return new PageResult<>(_viewPage, Long.valueOf(_view == null ? 0 : _view.size()));
return new PageResult<>(_viewPage, Long.valueOf(isEmptyList(_view) ? 0 : _view.size()));
}
@Override
public List<ReporttemplateTreeView> getReporttemplatelist() {
List<ReporttemplateTreeView> _out = null;
public List<ReporttemplateTreeView> getReporttemplateRoot() {
List<ReporttemplateTreeView> _view = null;
//当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
List<ReporttemplateDO> _viewDO = reporttemplateMapper.selectNodes_Root(user.getOrgId());
_out = treeViewBuild(null, "0", user.getOrgId());
if (!isEmptyList(_viewDO)) {
List<ReporttemplateTreeView> _viewTemp = relationViewBuild(BeanUtils.toBean(_viewDO, ReporttemplateTreeView.class));
if (!isEmptyList(_viewTemp)) {
for (ReporttemplateTreeView item : _viewTemp) {
if (isEmptyList(item.children))
item.children = null;
else {
item.children.sort(Comparator.comparing(ReporttemplateTreeView::getTemplateName));
}
}
_view = _viewTemp.stream().filter(it -> it.getId() != null && it.getPid() != null && it.getPid().trim().equals("0"))
.collect(Collectors.toList());
}
}
if (isEmptyList(_view))
_view = Collections.emptyList();
else
_view.sort(Comparator.comparing(ReporttemplateTreeView::getTemplateName));
return _view;
}
@Override
public boolean hasReporttemplateChildren(String id) {
boolean _out = false;
AdminUserDO user = userService.getUser(getLoginUserId());
List<ReporttemplateDO> _viewDO = reporttemplateMapper.selectNodes(user.getOrgId(), id);
if (!isEmptyList(_viewDO))
_out = true;
if (!(_out != null && _out.size() > 0))
_out = Collections.emptyList();
return _out;
}
@ -223,46 +353,39 @@ public class ReporttemplateServiceImpl implements ReporttemplateService {
}
}
private List<ReporttemplateTreeView> treeViewBuild(ReporttemplateTreeView view, String pid, List<ReporttemplateTreeView> source) {
private List<ReporttemplateTreeView> relationViewBuild(List<ReporttemplateTreeView> source) {
List<ReporttemplateTreeView> _out = null;
if (view != null && view.children != null)
return view.children;
if (source != null && source.size() > 0)
_out = source.stream().filter(it -> it.getId() != null && it.getPid() != null && it.getPid().trim().equals(pid))
.sorted(Comparator.comparing(ReporttemplateTreeView::getTemplateName)).collect(Collectors.toList());
if (_out != null && _out.size() > 0) {
if (view != null)
view.children = _out;
for (ReporttemplateTreeView item : _out) {
if (item != null && item.getDataType() != null && item.getDataType().trim().equals("1") && item.children == null)
treeViewBuild(item, item.getId(), source);
if (!isEmptyList(source)) {
ReporttemplateTreeView temp = null;
for (ReporttemplateTreeView item : source) {
temp = null;
if (item != null) {
String Pid = item.getPid() != null ? item.getPid().trim() : "";
temp = source.stream().filter(it -> it.getId() != null && it.getId().trim().equals(Pid) &&
it.getDataType() != null && it.getDataType().trim().equals("1"))
.findFirst().orElse(null);
if (temp != null) {
if (temp.children == null)
temp.children = new ArrayList<>();
if (!temp.children.contains(item))
temp.children.add(item);
}
}
}
}
_out = source;
} else
_out = null;
if (!(_out != null && _out.size() > 0))
if (isEmptyList(_out))
_out = null;
return _out;
}
private List<ReporttemplateTreeView> treeViewBuild(ReporttemplateTreeView view, String pid, String orgId) {
List<ReporttemplateTreeView> _out = null;
List<ReporttemplateDO> _temp = null;
_temp = reporttemplateMapper.selectList(pid, orgId);
if (_temp != null && _temp.size() > 0) {
_out = BeanUtils.toBean(_temp, ReporttemplateTreeView.class);
if (view != null)
view.children = _out;
for (ReporttemplateTreeView item : _out) {
if (item != null && item.getDataType() != null && item.getDataType().trim().equals("1"))
treeViewBuild(item, item.getId(), item.getOrgId());
}
}
if (!(_out != null && _out.size() > 0))
_out = null;
return _out;
private <T> boolean isEmptyList(List<T> list) {
if (list != null && list.size() > 0)
return false;
else
return true;
}
}

View File

@ -17,8 +17,8 @@ spring:
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER # 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题,参见 SpringFoxHandlerProviderBeanPostProcessor 类
# throw-exception-if-no-handler-found: true # 404 错误时抛出异常,方便统一处理
# static-path-pattern: /static/** # 静态资源路径; 注意:如果不配置,则 throw-exception-if-no-handler-found 不生效!!! TODO 芋艿:不能配置,会导致 swagger 不生效
# throw-exception-if-no-handler-found: true # 404 错误时抛出异常,方便统一处理
# static-path-pattern: /static/** # 静态资源路径; 注意:如果不配置,则 throw-exception-if-no-handler-found 不生效!!! TODO 芋艿:不能配置,会导致 swagger 不生效
# Jackson 配置项
jackson:
@ -68,9 +68,9 @@ mybatis-plus:
global-config:
db-config:
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
# id-type: AUTO # 自增 ID适合 MySQL 等直接自增的数据库
# id-type: INPUT # 用户输入 ID适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
# id-type: ASSIGN_ID # 分配 ID默认使用雪花算法。注意Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
# id-type: AUTO # 自增 ID适合 MySQL 等直接自增的数据库
# id-type: INPUT # 用户输入 ID适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
# id-type: ASSIGN_ID # 分配 ID默认使用雪花算法。注意Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
banner: false # 关闭控制台的 Banner 打印
@ -152,10 +152,12 @@ yudao:
admin-ui:
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
security:
permit-all_urls:
permit-all-urls:
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
# 自定义接口
- /admin-api/ultrasoniccom/ultrasonic/getdcm
- /admin-api/org/org/getone
- /admin-api/tblist/patientexamlist/getCheckRecord
websocket:
enable: true # websocket的开关
path: /infra/ws # 路径
@ -195,6 +197,10 @@ yudao:
- /admin-api/pay/notify/** # 支付回调通知,不携带租户编号
- /jmreport/* # 积木报表,无法携带租户编号
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,无法携带租户编号
# 自定义接口
- /admin-api/ultrasoniccom/ultrasonic/getdcm
- /admin-api/org/org/getone
- /admin-api/tblist/patientexamlist/getCheckRecord
ignore-tables:
- system_tenant
- system_tenant_package