This commit is contained in:
wuchunlei
2025-07-29 13:43:16 +08:00
parent 8e3be17839
commit d6a638bb80
2 changed files with 22 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ package com.peanut.modules.common.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.R; import com.peanut.common.utils.R;
import com.peanut.common.utils.ShiroUtils; import com.peanut.common.utils.ShiroUtils;
import com.peanut.modules.common.entity.MedicalRecords; import com.peanut.modules.common.entity.MedicalRecords;
@@ -95,6 +96,7 @@ public class MedicalRecordsController {
个人信息等如果存在要进行脱敏处理,用*代替; 个人信息等如果存在要进行脱敏处理,用*代替;
如果有标题放到一般信息中开头必须是1.一般信息1.一般信息这种要h1样式 如果有标题放到一般信息中开头必须是1.一般信息1.一般信息这种要h1样式
如果有刻诊内容,应该放到体格检查中; 如果有刻诊内容,应该放到体格检查中;
每个模块之间用end分割
结果必须是markdown格式 结果必须是markdown格式
按照以下模板整理: 按照以下模板整理:
1.一般信息 1.一般信息
@@ -109,7 +111,7 @@ public class MedicalRecordsController {
4.既往史 4.既往史
... ...
end end
5.家族史 5.个人史与家族史
... ...
end end
6.体格检查 6.体格检查
@@ -159,20 +161,19 @@ public class MedicalRecordsController {
//查询正在拆分的医案 //查询正在拆分的医案
@RequestMapping(value = "/medicalRecordsQuerySplit") @RequestMapping(value = "/medicalRecordsQuerySplit")
public R medicalRecordsQuerySplit(@RequestBody Map<String,Object> parmas) { public R medicalRecordsQuerySplit(@RequestBody Map<String,Object> parmas) {
List<MedicalRecords> list = medicalRecordsService.list(new LambdaQueryWrapper<MedicalRecords>() MedicalRecords mr = medicalRecordsService.getOne(new MPJLambdaWrapper<MedicalRecords>()
.eq(MedicalRecords::getId, parmas.get("id"))); .disableLogicDel()
for (MedicalRecords mr : list){ .eq(MedicalRecords::getId,parmas.get("id").toString()));
MedicalRecordsToLabel toLabel = medicalRecordsToLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToLabel>() MedicalRecordsToLabel toLabel = medicalRecordsToLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToLabel>()
.eq(MedicalRecordsToLabel::getRecordId,mr.getId())); .eq(MedicalRecordsToLabel::getRecordId,mr.getId()));
if (toLabel!=null){ if (toLabel!=null){
mr.setLabelId(toLabel.getLabelId()); mr.setLabelId(toLabel.getLabelId());
MedicalRecordsLabel label = medicalRecordsLabelService.getById(toLabel.getLabelId()); MedicalRecordsLabel label = medicalRecordsLabelService.getById(toLabel.getLabelId());
if (label!=null){ if (label!=null){
mr.setLabelTitle(label.getTitle()); mr.setLabelTitle(label.getTitle());
}
} }
} }
return R.ok().put("medicalRecords",list.size()>0?list.get(0):null); return R.ok().put("medicalRecords",mr);
} }
//暂存或者保存医案 //暂存或者保存医案

View File

@@ -19,7 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RestController("masterMedicalRecordsController") @RestController("masterMedicalRecordsController")
@@ -44,7 +43,9 @@ public class MedicalRecordsController {
wrapper.leftJoin(MedicalRecordsLabel.class,MedicalRecordsLabel::getId,MedicalRecordsToLabel::getLabelId); wrapper.leftJoin(MedicalRecordsLabel.class,MedicalRecordsLabel::getId,MedicalRecordsToLabel::getLabelId);
wrapper.selectAs(MedicalRecordsLabel::getTitle,"labelTitle"); wrapper.selectAs(MedicalRecordsLabel::getTitle,"labelTitle");
} }
wrapper.leftJoin(MyUserEntity.class,MyUserEntity::getId,MedicalRecords::getUserId); if ("0".equals(params.get("state"))){
wrapper.eq(MedicalRecords::getUserId,"1");
}
wrapper.selectAll(MedicalRecords.class); wrapper.selectAll(MedicalRecords.class);
wrapper.eq(MedicalRecords::getState,params.get("state")); wrapper.eq(MedicalRecords::getState,params.get("state"));
Page<MedicalRecords> page = medicalRecordsService.page(new Page<>( Page<MedicalRecords> page = medicalRecordsService.page(new Page<>(
@@ -102,6 +103,11 @@ public class MedicalRecordsController {
if (toLabel!=null){ if (toLabel!=null){
toLabel.setLabelId(medicalRecords.getLabelId()); toLabel.setLabelId(medicalRecords.getLabelId());
toLabelService.updateById(toLabel); toLabelService.updateById(toLabel);
}else {
toLabel = new MedicalRecordsToLabel();
toLabel.setRecordId(medicalRecords.getId());
toLabel.setLabelId(medicalRecords.getLabelId());
toLabelService.save(toLabel);
} }
medicalRecordsService.updateById(medicalRecords); medicalRecordsService.updateById(medicalRecords);
return R.ok(); return R.ok();