manage:代码结构调整

dev_2.0.0
xueqingkun 1 year ago
parent 6641bd4bbf
commit e93e8d6a83

@ -0,0 +1,29 @@
package com.supervision.manage.controller;
import com.supervision.manage.service.PhysicalLocationManageService;
import com.supervision.vo.manage.PhysicalLocationNode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "身体位置管理")
@RestController
@RequestMapping("physicalLocation")
@RequiredArgsConstructor
public class PhysicalLocationManageController {
private final PhysicalLocationManageService physicalLocationManageService;
@ApiOperation("查询身体部位树")
@GetMapping("/queryTree")
public List<PhysicalLocationNode> queryTree() {
return physicalLocationManageService.queryTree();
}
}

@ -22,6 +22,7 @@ public class PhysicalToolManageController {
@ApiOperation(value = "查询体格检查的工具列表")
@GetMapping("queryPhysicalToolList")
public List<ConfigPhysicalToolResVO> queryPhysicalToolList() {
return physicalToolManageService.queryPhysicalToolList();
}

@ -35,7 +35,7 @@ public class DiseaseTreatmentPlanManageController {
@ApiOperation("批量保存处置信息")
@PostMapping("/batchSave")
public boolean batchSaveTreatmentPlan(List<DiseaseTreatmentPlan> diseaseTreatmentPlanList) {
public boolean batchSaveTreatmentPlan(@RequestBody List<DiseaseTreatmentPlan> diseaseTreatmentPlanList) {
diseaseTreatmentPlanManageService.batchSaveTreatmentPlan(diseaseTreatmentPlanList);
return true;

@ -0,0 +1,12 @@
package com.supervision.manage.service;
import com.supervision.vo.manage.PhysicalLocationNode;
import java.util.List;
public interface PhysicalLocationManageService {
List<PhysicalLocationNode> queryTree();
}

@ -78,6 +78,8 @@ public class DiseasePhysicalManageServiceImpl implements DiseasePhysicalManageSe
Assert.notNull(diseasePhysical.getExpectedDiagnosisResult(),"预期诊断结果不能为空");
Assert.notNull(diseasePhysical.getLocationDiagnosisFlag(),"部位诊断结果不能为空");
}
}

@ -67,8 +67,8 @@ public class DiseaseTreatmentPlanManageServiceImpl implements DiseaseTreatmentPl
@Override
public List<DiseaseTreatmentPlanTreeNode> queryDiseaseTreatmentPlanTree(Integer disposalMethod, String diseaseId) {
List<TreatmentPlanTreeNode> treatmentPlanTreeNodes = configTreatmentPlanManageService.queryTree(disposalMethod);
List<TreatmentPlanTreeNode> treatmentPlanTreeNodes = configTreatmentPlanManageService.queryTree(disposalMethod);
if (CollUtil.isEmpty(treatmentPlanTreeNodes)){
return CollectionUtil.newArrayList();
}
@ -82,8 +82,6 @@ public class DiseaseTreatmentPlanManageServiceImpl implements DiseaseTreatmentPl
rootNode.initFlag(diseaseTreatmentPlanResVos.stream().map(DiseaseTreatmentPlanResVo::getPlanId).collect(Collectors.toList()));
}
return rootNode.getChild();
}

@ -0,0 +1,51 @@
package com.supervision.manage.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.supervision.manage.service.PhysicalLocationManageService;
import com.supervision.model.ConfigPhysicalLocation;
import com.supervision.service.ConfigPhysicalLocationService;
import com.supervision.vo.manage.PhysicalLocationNode;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
public class PhysicalLocationManageServiceImpl implements PhysicalLocationManageService {
private final ConfigPhysicalLocationService configPhysicalLocationService;
@Override
public List<PhysicalLocationNode> queryTree() {
List<ConfigPhysicalLocation> list = configPhysicalLocationService.list();
if (CollUtil.isEmpty(list)) {
return CollectionUtil.newArrayList();
}
Map<String, PhysicalLocationNode> map = list.stream().collect(
Collectors.toMap(ConfigPhysicalLocation::getId, p -> BeanUtil.toBean(p, PhysicalLocationNode.class)));
for (Map.Entry<String, PhysicalLocationNode> entry : map.entrySet()) {
PhysicalLocationNode value = entry.getValue();
if (StrUtil.isNotEmpty(value.getParentId())) {
PhysicalLocationNode physicalLocationNode = map.get(value.getParentId());
if (!Objects.isNull(physicalLocationNode)) {
List<ConfigPhysicalLocation> child = physicalLocationNode.getChild();
if (null == child) {
child = new ArrayList<>();
physicalLocationNode.setChild(child);
}
child.add(value);
}
}
}
return map.values().stream().filter(n -> StrUtil.isEmpty(n.getParentId())).collect(Collectors.toList());
}
}

@ -1,6 +1,6 @@
#服务器端口
server:
port: 8891
port: 8888
servlet:
context-path: /virtual-patient-manage
undertow:

@ -64,6 +64,9 @@ public class DiseasePhysical implements Serializable {
@ApiModelProperty("是否预期诊断结果 0正常 1 不正常")
private Integer expectedDiagnosisResult;
@ApiModelProperty("部位诊断结果 0正常 1 不正常")
private Integer locationDiagnosisFlag;
/**
*
*/

@ -1,6 +1,7 @@
package com.supervision.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.UUID;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.supervision.model.ConfigPhysicalTool;
import com.supervision.service.ConfigPhysicalToolService;
@ -28,6 +29,8 @@ public class ConfigPhysicalToolServiceImpl extends ServiceImpl<ConfigPhysicalToo
return list.stream().collect(Collectors.groupingBy(ConfigPhysicalTool::getType)).entrySet().stream().map(e ->{
ConfigPhysicalToolResVO tool = new ConfigPhysicalToolResVO();
tool.setToolType(e.getKey());
tool.setToolName(e.getKey());
tool.setId(UUID.fastUUID().toString());
int priority = 999;
if (CollectionUtil.isNotEmpty(e.getValue()) && null != e.getValue().get(0).getTypePriority()) {
priority = e.getValue().get(0).getTypePriority();

@ -8,8 +8,19 @@ import java.util.List;
@Data
public class ConfigPhysicalToolResVO {
/**
* 使
*/
private String id;
/**
* see @toolName
*/
@Deprecated
private String toolType;
private String toolName;
/**
* ,
*/

@ -19,8 +19,8 @@ public class DiseaseTreatmentPlanTreeNode {
@ApiModelProperty("节点名称")
private String name;
@ApiModelProperty("标识 0:未选择 1:已选择")
private int flag;
@ApiModelProperty("标识 true:已选择 false:未选择")
private boolean flag;
@ApiModelProperty("子节点")
private List<DiseaseTreatmentPlanTreeNode> child;
@ -53,7 +53,7 @@ public class DiseaseTreatmentPlanTreeNode {
return;
}
if (StrUtil.isNotEmpty(this.getId())){
this.setFlag(ids.stream().allMatch(i -> i.equals(this.getId())) ? 1 : 0);
this.setFlag(ids.stream().anyMatch(i -> i.equals(this.getId())));
}
if (CollUtil.isNotEmpty(this.getChild())){
for (DiseaseTreatmentPlanTreeNode treatmentPlanTreeNode : this.getChild()) {

@ -0,0 +1,15 @@
package com.supervision.vo.manage;
import com.supervision.model.ConfigPhysicalLocation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class PhysicalLocationNode extends ConfigPhysicalLocation{
private List<ConfigPhysicalLocation> child;
}

@ -16,6 +16,7 @@
<result property="diagnosisAssessmentFlag" column="diagnosis_assessment_flag" jdbcType="INTEGER"/>
<result property="expectedDiagnosisResult" column="expected_diagnosis_result" jdbcType="VARCHAR"/>
<result property="fullCheckFlag" column="full_check_flag" jdbcType="INTEGER"/>
<result property="locationDiagnosisFlag" column="location_diagnosis_flag" jdbcType="INTEGER"/>
<result property="result" column="result" jdbcType="VARCHAR"/>
<result property="trait" column="trait" jdbcType="VARCHAR"/>
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>

Loading…
Cancel
Save