太湖英才

This commit is contained in:
wuchunlei
2025-05-13 17:55:37 +08:00
parent e4730b8a2a
commit 6ec399baff
7 changed files with 267 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
package com.peanut.modules.common.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.peanut.common.utils.R;
import com.peanut.common.utils.ShiroUtils;
import com.peanut.modules.common.entity.AiRecordFolder;
import com.peanut.modules.common.service.AiRecordFolderService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@Slf4j
@RestController("commonAiRecordFolder")
@RequestMapping("common/aiRecordFolder")
public class AiRecordFolderController {
@Autowired
private AiRecordFolderService aiRecordFolderService;
//病历夹列表
@RequestMapping("/getRecordFolders")
public R getRecordFolders(@RequestBody Map<String,Object> params){
LambdaQueryWrapper<AiRecordFolder> wrapper = new LambdaQueryWrapper();
wrapper.eq(AiRecordFolder::getUserId, ShiroUtils.getUId());
if (StringUtils.isNotEmpty(params.get("title").toString())||StringUtils.isNotEmpty(params.get("patientName").toString())){
wrapper.like(StringUtils.isNotEmpty(params.get("title").toString()),AiRecordFolder::getTitle,params.get("title"));
wrapper.like(StringUtils.isNotEmpty(params.get("patientName").toString()),AiRecordFolder::getPatientName,params.get("patientName"));
}else {
wrapper.select(AiRecordFolder::getTitle);
wrapper.groupBy(AiRecordFolder::getTitle);
}
wrapper.orderByDesc(AiRecordFolder::getCreateTime);
return R.ok().put("list",aiRecordFolderService.list(wrapper));
}
//将聊天记录加入病历夹
@RequestMapping("/addRecordFolder")
public R addRecordFolder(@RequestBody AiRecordFolder aiRecordFolder){
aiRecordFolder.setUserId(ShiroUtils.getUId());
aiRecordFolderService.save(aiRecordFolder) ;
return R.ok();
}
}

View File

@@ -0,0 +1,78 @@
package com.peanut.modules.common.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.TaihuTalent;
import com.peanut.modules.common.entity.UserCertificate;
import com.peanut.modules.common.service.TaihuTalentService;
import com.peanut.modules.common.service.UserCertificateService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
@Slf4j
@RestController("commonTaihuTalent")
@RequestMapping("common/taihuTalent")
public class TaihuTalentController {
@Autowired
private TaihuTalentService taihuTalentService;
@Autowired
private UserCertificateService userCertificateService;
//太湖英才列表
@RequestMapping("/getTaihuTalents")
public R getTaihuTalents(@RequestBody Map<String,Object> params){
LambdaQueryWrapper<TaihuTalent> wrapper = new LambdaQueryWrapper<>();
wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name"));
wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region"));
return R.ok().put("list",taihuTalentService.list(wrapper));
}
//太湖英才详情
@RequestMapping("/taihuTalentInfo")
public R taihuTalentInfo(@RequestBody Map<String,Object> params){
TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString());
List<UserCertificate> certificates = userCertificateService.list(new LambdaQueryWrapper<UserCertificate>()
.eq(UserCertificate::getUserId,taihuTalent.getUserId()));
List<UserCertificate> res = new ArrayList<>();
Set<String> label = new HashSet<>();
//出师证、太湖国际中医师证、太湖国际针灸师证排在前面
for (UserCertificate uc:certificates) {
if (uc.getLabelId()==22){
res.add(uc);
label.add("出师证");
}
}
for (UserCertificate uc:certificates) {
if (uc.getLabelId()==13){
res.add(uc);
label.add("太湖国际中医师");
}
}
for (UserCertificate uc:certificates) {
if (uc.getLabelId()==19){
res.add(uc);
label.add("太湖国际针灸师");
}
}
for (UserCertificate uc:certificates) {
if (uc.getLabelId()!=22&&uc.getLabelId()!=13&&uc.getLabelId()!=19){
res.add(uc);
}
}
return R.ok()
.put("taihuTalent",taihuTalent)
.put("label",taihuTalent)
.put("certificates",res);
}
}