From 6ec399bafff0bd834dbb596b6fe5055aca626ce1 Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Tue, 13 May 2025 17:55:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=AA=E6=B9=96=E8=8B=B1=E6=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AiRecordFolderController.java | 50 ++++++++++++ .../controller/TaihuTalentController.java | 78 +++++++++++++++++++ .../modules/common/dao/TaihuTalentDao.java | 9 +++ .../modules/common/entity/TaihuTalent.java | 49 ++++++++++++ .../common/service/TaihuTalentService.java | 7 ++ .../service/impl/TaihuTalentServiceImpl.java | 13 ++++ .../controller/TaihuTalentController.java | 61 +++++++++++++++ 7 files changed, 267 insertions(+) create mode 100644 src/main/java/com/peanut/modules/common/controller/AiRecordFolderController.java create mode 100644 src/main/java/com/peanut/modules/common/controller/TaihuTalentController.java create mode 100644 src/main/java/com/peanut/modules/common/dao/TaihuTalentDao.java create mode 100644 src/main/java/com/peanut/modules/common/entity/TaihuTalent.java create mode 100644 src/main/java/com/peanut/modules/common/service/TaihuTalentService.java create mode 100644 src/main/java/com/peanut/modules/common/service/impl/TaihuTalentServiceImpl.java create mode 100644 src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java diff --git a/src/main/java/com/peanut/modules/common/controller/AiRecordFolderController.java b/src/main/java/com/peanut/modules/common/controller/AiRecordFolderController.java new file mode 100644 index 00000000..238c4e65 --- /dev/null +++ b/src/main/java/com/peanut/modules/common/controller/AiRecordFolderController.java @@ -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 params){ + LambdaQueryWrapper 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(); + } + + +} diff --git a/src/main/java/com/peanut/modules/common/controller/TaihuTalentController.java b/src/main/java/com/peanut/modules/common/controller/TaihuTalentController.java new file mode 100644 index 00000000..ad797874 --- /dev/null +++ b/src/main/java/com/peanut/modules/common/controller/TaihuTalentController.java @@ -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 params){ + LambdaQueryWrapper 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 params){ + TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString()); + List certificates = userCertificateService.list(new LambdaQueryWrapper() + .eq(UserCertificate::getUserId,taihuTalent.getUserId())); + List res = new ArrayList<>(); + Set 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); + } + + + + +} diff --git a/src/main/java/com/peanut/modules/common/dao/TaihuTalentDao.java b/src/main/java/com/peanut/modules/common/dao/TaihuTalentDao.java new file mode 100644 index 00000000..9d1ea7ac --- /dev/null +++ b/src/main/java/com/peanut/modules/common/dao/TaihuTalentDao.java @@ -0,0 +1,9 @@ +package com.peanut.modules.common.dao; + +import com.github.yulichang.base.MPJBaseMapper; +import com.peanut.modules.common.entity.TaihuTalent; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface TaihuTalentDao extends MPJBaseMapper { +} diff --git a/src/main/java/com/peanut/modules/common/entity/TaihuTalent.java b/src/main/java/com/peanut/modules/common/entity/TaihuTalent.java new file mode 100644 index 00000000..61880f0c --- /dev/null +++ b/src/main/java/com/peanut/modules/common/entity/TaihuTalent.java @@ -0,0 +1,49 @@ +package com.peanut.modules.common.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +@TableName("taihu_talent") +public class TaihuTalent implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId + private Integer id; + + private Integer userId; + + //姓名 + private String name; + + //职称 + private String title; + + //头像 + private String icon; + + //地域 + private String region; + + //介绍 + private String introduce; + + //业务专长 + private String specialty; + + //出诊信息 + private String clinic; + + //预约 + private String reservation; + + private Date createTime; + + @TableLogic + private Integer delFlag; +} diff --git a/src/main/java/com/peanut/modules/common/service/TaihuTalentService.java b/src/main/java/com/peanut/modules/common/service/TaihuTalentService.java new file mode 100644 index 00000000..48194fa0 --- /dev/null +++ b/src/main/java/com/peanut/modules/common/service/TaihuTalentService.java @@ -0,0 +1,7 @@ +package com.peanut.modules.common.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.peanut.modules.common.entity.TaihuTalent; + +public interface TaihuTalentService extends IService { +} diff --git a/src/main/java/com/peanut/modules/common/service/impl/TaihuTalentServiceImpl.java b/src/main/java/com/peanut/modules/common/service/impl/TaihuTalentServiceImpl.java new file mode 100644 index 00000000..d151b9f0 --- /dev/null +++ b/src/main/java/com/peanut/modules/common/service/impl/TaihuTalentServiceImpl.java @@ -0,0 +1,13 @@ +package com.peanut.modules.common.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.peanut.modules.common.dao.TaihuTalentDao; +import com.peanut.modules.common.entity.TaihuTalent; +import com.peanut.modules.common.service.TaihuTalentService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service("commonTaihuTalentService") +public class TaihuTalentServiceImpl extends ServiceImpl implements TaihuTalentService { +} diff --git a/src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java b/src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java new file mode 100644 index 00000000..1b6c1f36 --- /dev/null +++ b/src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java @@ -0,0 +1,61 @@ +package com.peanut.modules.master.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.service.TaihuTalentService; +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("masterTaihuTalent") +@RequestMapping("master/taihuTalent") +public class TaihuTalentController { + + @Autowired + private TaihuTalentService taihuTalentService; + + //太湖英才列表 + @RequestMapping("/getTaihuTalents") + public R getTaihuTalents(@RequestBody Map params){ + LambdaQueryWrapper 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("/addTaihuTalent") + public R addTaihuTalent(@RequestBody TaihuTalent taihuTalent){ + taihuTalentService.save(taihuTalent); + return R.ok(); + } + + //修改太湖英才 + @RequestMapping("/updateTaihuTalent") + public R updateTaihuTalent(@RequestBody TaihuTalent taihuTalent){ + taihuTalentService.updateById(taihuTalent); + return R.ok(); + } + + //删除太湖英才 + @RequestMapping("/delTaihuTalent") + public R delTaihuTalent(@RequestBody TaihuTalent taihuTalent){ + taihuTalentService.removeById(taihuTalent); + return R.ok(); + } + + //太湖英才详情 + @RequestMapping("/taihuTalentInfo") + public R taihuTalentInfo(@RequestBody Map params){ + TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString()); + return R.ok().put("taihuTalent",taihuTalent); + } + + +}