太湖云医 医案、文章
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
package com.peanut.modules.common.controller;
|
package com.peanut.modules.common.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
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.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
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;
|
||||||
@@ -11,6 +12,7 @@ import com.vladsch.flexmark.html.HtmlRenderer;
|
|||||||
import com.vladsch.flexmark.parser.Parser;
|
import com.vladsch.flexmark.parser.Parser;
|
||||||
import com.vladsch.flexmark.util.data.MutableDataSet;
|
import com.vladsch.flexmark.util.data.MutableDataSet;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.ai.chat.client.ChatClient;
|
import org.springframework.ai.chat.client.ChatClient;
|
||||||
import org.springframework.ai.tool.ToolCallbackProvider;
|
import org.springframework.ai.tool.ToolCallbackProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -18,10 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("commonMedicalRecords")
|
@RestController("commonMedicalRecords")
|
||||||
@@ -32,9 +31,11 @@ public class MedicalRecordsController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsService medicalRecordsService;
|
private MedicalRecordsService medicalRecordsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsLabelService medicalRecordsLabelService;
|
private DeptLabelService deptLabelService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsToLabelService medicalRecordsToLabelService;
|
private MedicalRecordsToDeptLabelService medicalRecordsToDeptLabelService;
|
||||||
|
@Autowired
|
||||||
|
private MedicalRecordsCheckUserService medicalRecordsCheckUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaihuTalentService taihuTalentService;
|
private TaihuTalentService taihuTalentService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -52,16 +53,16 @@ public class MedicalRecordsController {
|
|||||||
public R getMedicalRecordsLabelList(){
|
public R getMedicalRecordsLabelList(){
|
||||||
return R.ok().put("Medicals", medicalRecordsLabels(0));
|
return R.ok().put("Medicals", medicalRecordsLabels(0));
|
||||||
}
|
}
|
||||||
private List<MedicalRecordsLabel> medicalRecordsLabels(int id){
|
private List<DeptLabel> medicalRecordsLabels(int id){
|
||||||
List<MedicalRecordsLabel> medicalRecordsLabelList = medicalRecordsLabelService.list(new LambdaQueryWrapper<MedicalRecordsLabel>()
|
List<DeptLabel> deptLabelList = deptLabelService.list(new LambdaQueryWrapper<DeptLabel>()
|
||||||
.eq(MedicalRecordsLabel::getPid, id));
|
.eq(DeptLabel::getPid, id));
|
||||||
for (MedicalRecordsLabel m : medicalRecordsLabelList){
|
for (DeptLabel m : deptLabelList){
|
||||||
if(m.getIsLast()!=1){
|
if(m.getIsLast()!=1){
|
||||||
List<MedicalRecordsLabel> so = this.medicalRecordsLabels(m.getId());
|
List<DeptLabel> so = this.medicalRecordsLabels(m.getId());
|
||||||
m.setChildren(so);
|
m.setChildren(so);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return medicalRecordsLabelList;
|
return deptLabelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MedicalRecordsController(ChatClient.Builder chatClientBuilder, ToolCallbackProvider tools) {
|
public MedicalRecordsController(ChatClient.Builder chatClientBuilder, ToolCallbackProvider tools) {
|
||||||
@@ -163,11 +164,11 @@ public class MedicalRecordsController {
|
|||||||
MedicalRecords mr = medicalRecordsService.getOne(new MPJLambdaWrapper<MedicalRecords>()
|
MedicalRecords mr = medicalRecordsService.getOne(new MPJLambdaWrapper<MedicalRecords>()
|
||||||
.disableLogicDel()
|
.disableLogicDel()
|
||||||
.eq(MedicalRecords::getId,parmas.get("id").toString()));
|
.eq(MedicalRecords::getId,parmas.get("id").toString()));
|
||||||
MedicalRecordsToLabel toLabel = medicalRecordsToLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToLabel>()
|
MedicalRecordsToDeptLabel toLabel = medicalRecordsToDeptLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToDeptLabel>()
|
||||||
.eq(MedicalRecordsToLabel::getRecordId,mr.getId()));
|
.eq(MedicalRecordsToDeptLabel::getRecordId,mr.getId()));
|
||||||
if (toLabel!=null){
|
if (toLabel!=null){
|
||||||
mr.setLabelId(toLabel.getLabelId());
|
mr.setLabelId(toLabel.getLabelId());
|
||||||
MedicalRecordsLabel label = medicalRecordsLabelService.getById(toLabel.getLabelId());
|
DeptLabel label = deptLabelService.getById(toLabel.getLabelId());
|
||||||
if (label!=null){
|
if (label!=null){
|
||||||
mr.setLabelTitle(label.getTitle());
|
mr.setLabelTitle(label.getTitle());
|
||||||
}
|
}
|
||||||
@@ -204,15 +205,17 @@ public class MedicalRecordsController {
|
|||||||
+medicalRecords.getPhysicaExamination()+medicalRecords.getDiagnosis()+medicalRecords.getTreatmentPlan());
|
+medicalRecords.getPhysicaExamination()+medicalRecords.getDiagnosis()+medicalRecords.getTreatmentPlan());
|
||||||
medicalRecordsService.saveOrUpdate(medicalRecords);
|
medicalRecordsService.saveOrUpdate(medicalRecords);
|
||||||
//绑定标签
|
//绑定标签
|
||||||
MedicalRecordsToLabel toLabel = medicalRecordsToLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToLabel>()
|
if (medicalRecords.getLabelId()!=null&&medicalRecords.getLabelId()!=0){
|
||||||
.eq(MedicalRecordsToLabel::getLabelId, medicalRecords.getLabelId())
|
MedicalRecordsToDeptLabel toLabel = medicalRecordsToDeptLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToDeptLabel>()
|
||||||
.eq(MedicalRecordsToLabel::getRecordId,medicalRecords.getId()));
|
.eq(MedicalRecordsToDeptLabel::getLabelId, medicalRecords.getLabelId())
|
||||||
if (toLabel==null){
|
.eq(MedicalRecordsToDeptLabel::getRecordId,medicalRecords.getId()));
|
||||||
toLabel = new MedicalRecordsToLabel();
|
if (toLabel==null){
|
||||||
|
toLabel = new MedicalRecordsToDeptLabel();
|
||||||
|
}
|
||||||
|
toLabel.setRecordId(medicalRecords.getId());
|
||||||
|
toLabel.setLabelId(medicalRecords.getLabelId());
|
||||||
|
medicalRecordsToDeptLabelService.saveOrUpdate(toLabel);
|
||||||
}
|
}
|
||||||
toLabel.setRecordId(medicalRecords.getId());
|
|
||||||
toLabel.setLabelId(medicalRecords.getLabelId());
|
|
||||||
medicalRecordsToLabelService.saveOrUpdate(toLabel);
|
|
||||||
return R.ok().put("medicalRecords",medicalRecords);
|
return R.ok().put("medicalRecords",medicalRecords);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,9 +229,15 @@ public class MedicalRecordsController {
|
|||||||
//医案列表
|
//医案列表
|
||||||
@RequestMapping(value = "/medicalRecordsList")
|
@RequestMapping(value = "/medicalRecordsList")
|
||||||
public R medicalRecordsList(@RequestBody Map<String,Object> parmas) {
|
public R medicalRecordsList(@RequestBody Map<String,Object> parmas) {
|
||||||
List<MedicalRecords> medicalRecordsList = medicalRecordsService.list(new LambdaQueryWrapper<MedicalRecords>()
|
LambdaQueryWrapper<MedicalRecords> wrapper = new LambdaQueryWrapper<>();
|
||||||
.eq(MedicalRecords::getUserId,ShiroUtils.getUId())
|
wrapper.eq(MedicalRecords::getUserId,ShiroUtils.getUId());
|
||||||
.eq(MedicalRecords::getState,parmas.get("state")));
|
if (parmas.get("state").toString().contains(",")){
|
||||||
|
wrapper.and(t->t.eq(MedicalRecords::getState,parmas.get("state").toString().split(",")[0])
|
||||||
|
.or().eq(MedicalRecords::getState,parmas.get("state").toString().split(",")[1]));
|
||||||
|
}else {
|
||||||
|
wrapper.in(MedicalRecords::getState,parmas.get("state"));
|
||||||
|
}
|
||||||
|
List<MedicalRecords> medicalRecordsList = medicalRecordsService.list(wrapper);
|
||||||
return R.ok().put("medicalRecordsList",medicalRecordsList);
|
return R.ok().put("medicalRecordsList",medicalRecordsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,10 +260,93 @@ public class MedicalRecordsController {
|
|||||||
article.setTitle(medicalRecords.getTitle());
|
article.setTitle(medicalRecords.getTitle());
|
||||||
article.setContent(medicalRecords.getData());
|
article.setContent(medicalRecords.getData());
|
||||||
article.setImg(medicalRecords.getImg());
|
article.setImg(medicalRecords.getImg());
|
||||||
|
article.setCome(1);
|
||||||
taihuTalentArticleService.save(article);
|
taihuTalentArticleService.save(article);
|
||||||
medicalRecords.setArticleFlag(1);
|
medicalRecords.setArticleFlag(1);
|
||||||
medicalRecordsService.updateById(medicalRecords);
|
medicalRecordsService.updateById(medicalRecords);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//能否审批
|
||||||
|
@RequestMapping("/canCheck")
|
||||||
|
public R canCheck(){
|
||||||
|
boolean flag = false;
|
||||||
|
long c = medicalRecordsCheckUserService.count(new LambdaQueryWrapper<MedicalRecordsCheckUser>()
|
||||||
|
.eq(MedicalRecordsCheckUser::getUserId,ShiroUtils.getUId()));
|
||||||
|
if (c>0){
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return R.ok().put("flag",flag);
|
||||||
|
}
|
||||||
|
//审批列表
|
||||||
|
@RequestMapping("/getMedicalRecordsCheckList")
|
||||||
|
public R getMedicalRecordsCheckList(@RequestBody Map<String,Object> parmas){
|
||||||
|
MPJLambdaWrapper<MedicalRecords> wrapper = new MPJLambdaWrapper();
|
||||||
|
wrapper.rightJoin(MedicalRecordsToDeptLabel.class, MedicalRecordsToDeptLabel::getRecordId,MedicalRecords::getId);
|
||||||
|
wrapper.rightJoin(MedicalRecordsCheckUser.class,MedicalRecordsCheckUser::getLabelId,MedicalRecordsToDeptLabel::getLabelId);
|
||||||
|
wrapper.selectAll(MedicalRecords.class);
|
||||||
|
wrapper.eq(MedicalRecordsCheckUser::getUserId,ShiroUtils.getUId());
|
||||||
|
wrapper.eq(MedicalRecords::getState,3);
|
||||||
|
if (parmas.containsKey("flag")&&parmas.get("flag")!=null){
|
||||||
|
if ("0".equals(parmas.get("flag").toString())){
|
||||||
|
wrapper.notLike(MedicalRecords::getStateInfo,"\""+ShiroUtils.getUId()+"\"");
|
||||||
|
}else if ("1".equals(parmas.get("flag").toString())){
|
||||||
|
wrapper.like(MedicalRecords::getStateInfo,"\""+ShiroUtils.getUId()+"\"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<MedicalRecords> list = medicalRecordsService.list(wrapper);
|
||||||
|
return R.ok().put("list",list);
|
||||||
|
}
|
||||||
|
//审批医案
|
||||||
|
@RequestMapping("/medicalRecordsCheck")
|
||||||
|
public R medicalRecordsCheck(@RequestBody Map<String,Object> parmas){
|
||||||
|
String stateInfo = "";
|
||||||
|
String state = parmas.get("state").toString();
|
||||||
|
String id = parmas.get("id").toString();
|
||||||
|
MedicalRecords medicalRecords = medicalRecordsService.getById(id);
|
||||||
|
Map<String,Object> userIdAndState = new HashMap<>();
|
||||||
|
if (StringUtils.isNotEmpty(medicalRecords.getStateInfo())){
|
||||||
|
boolean flag = true;//判断是否评价过
|
||||||
|
userIdAndState = JSON.parseObject(medicalRecords.getStateInfo());
|
||||||
|
for (Map.Entry<String,Object> key : userIdAndState.entrySet()) {
|
||||||
|
if (key.equals(ShiroUtils.getUId().toString())){
|
||||||
|
flag = false;
|
||||||
|
key.setValue(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
userIdAndState.put(""+ShiroUtils.getUId(),state);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
userIdAndState.put(""+ShiroUtils.getUId(),state);
|
||||||
|
}
|
||||||
|
stateInfo = JSON.toJSONString(userIdAndState);
|
||||||
|
medicalRecords.setStateInfo(stateInfo);
|
||||||
|
LambdaUpdateWrapper<MedicalRecords> wrapper = new LambdaUpdateWrapper<>();
|
||||||
|
wrapper.eq(MedicalRecords::getId,id);
|
||||||
|
wrapper.set(MedicalRecords::getStateInfo,stateInfo);
|
||||||
|
wrapper.set(MedicalRecords::getInfoCount,userIdAndState.size());
|
||||||
|
int same = 0;
|
||||||
|
for (Map.Entry<String,Object> key : userIdAndState.entrySet()) {
|
||||||
|
if (userIdAndState.size()==2&&key.getValue().equals(state)){
|
||||||
|
same++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (same==2){
|
||||||
|
if ("A".equals(state)){
|
||||||
|
wrapper.set(MedicalRecords::getState,6);
|
||||||
|
wrapper.set(MedicalRecords::getTrain,1);
|
||||||
|
}else if ("B".equals(state)){
|
||||||
|
wrapper.set(MedicalRecords::getState,5);
|
||||||
|
}else {
|
||||||
|
wrapper.set(MedicalRecords::getState,4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
medicalRecordsService.update(wrapper);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.common.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.common.entity.DeptLabel;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DeptLabelDao extends MPJBaseMapper<DeptLabel> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.common.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.common.entity.MedicalRecordsCheckUser;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MedicalRecordsCheckUserDao extends MPJBaseMapper<MedicalRecordsCheckUser> {
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package com.peanut.modules.common.dao;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
|
||||||
import com.peanut.modules.common.entity.MedicalRecordsLabel;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface MedicalRecordsLabelDao extends MPJBaseMapper<MedicalRecordsLabel> {
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.common.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.common.entity.MedicalRecordsToDeptLabel;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MedicalRecordsToDeptLabelDao extends MPJBaseMapper<MedicalRecordsToDeptLabel> {
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package com.peanut.modules.common.dao;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
|
||||||
import com.peanut.modules.common.entity.MedicalRecordsToLabel;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface MedicalRecordsToLabelDao extends MPJBaseMapper<MedicalRecordsToLabel> {
|
|
||||||
}
|
|
||||||
@@ -9,8 +9,8 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("medical_records_label")
|
@TableName("dept_label")
|
||||||
public class MedicalRecordsLabel {
|
public class DeptLabel {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableId
|
@TableId
|
||||||
@@ -30,7 +30,7 @@ public class MedicalRecordsLabel {
|
|||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<MedicalRecordsLabel> children;
|
private List<DeptLabel> children;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<MedicalRecords> medicalRecordsList;
|
private List<MedicalRecords> medicalRecordsList;
|
||||||
}
|
}
|
||||||
@@ -23,8 +23,12 @@ public class MedicalRecords {
|
|||||||
private Integer articleFlag;
|
private Integer articleFlag;
|
||||||
//标题
|
//标题
|
||||||
private String title;
|
private String title;
|
||||||
//0暂存1提交审核2审核拒绝3审核成功
|
//0暂存1提交审核2审核拒绝3审核成功4C 5B 6A
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
//二审详情
|
||||||
|
private String stateInfo;
|
||||||
|
//二审次数
|
||||||
|
private Integer infoCount;
|
||||||
//是否加入ai训练库0否1是
|
//是否加入ai训练库0否1是
|
||||||
private Integer train;
|
private Integer train;
|
||||||
//未加入训练库原因
|
//未加入训练库原因
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("medical_records_check_user")
|
||||||
|
public class MedicalRecordsCheckUser {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
//科室id
|
||||||
|
private Integer labelId;
|
||||||
|
//用户id
|
||||||
|
private Integer userId;
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
@@ -8,8 +8,8 @@ import lombok.Data;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("medical_records_to_label")
|
@TableName("medical_records_to_dept_label")
|
||||||
public class MedicalRecordsToLabel {
|
public class MedicalRecordsToDeptLabel {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableId
|
@TableId
|
||||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("taihu_talent_article")
|
@TableName("taihu_talent_article")
|
||||||
@@ -26,6 +27,10 @@ public class TaihuTalentArticle implements Serializable {
|
|||||||
private Integer readCount;
|
private Integer readCount;
|
||||||
//转发数
|
//转发数
|
||||||
private Integer forwardCount;
|
private Integer forwardCount;
|
||||||
|
//0文章1医案转
|
||||||
|
private Integer come;
|
||||||
|
//0下架1显示
|
||||||
|
private Integer showFlag;
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
@@ -36,6 +41,8 @@ public class TaihuTalentArticle implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer likeCount;
|
private Integer likeCount;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
private List likeList;
|
||||||
|
@TableField(exist = false)
|
||||||
private Integer likeFlag;
|
private Integer likeFlag;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private TaihuTalent taihuTalent;
|
private TaihuTalent taihuTalent;
|
||||||
|
|||||||
@@ -29,4 +29,6 @@ public class TaihuTalentArticleComment implements Serializable {
|
|||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<TaihuTalentArticleComment> children;
|
private List<TaihuTalentArticleComment> children;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private MyUserEntity user;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.peanut.modules.common.entity;
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@@ -17,4 +18,6 @@ public class TaihuTalentArticleLike implements Serializable {
|
|||||||
private Integer userId;
|
private Integer userId;
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private MyUserEntity user;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.peanut.modules.common.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.DeptLabel;
|
||||||
|
|
||||||
|
public interface DeptLabelService extends IService<DeptLabel> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.peanut.modules.common.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.MedicalRecordsCheckUser;
|
||||||
|
|
||||||
|
public interface MedicalRecordsCheckUserService extends IService<MedicalRecordsCheckUser> {
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package com.peanut.modules.common.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.peanut.modules.common.entity.MedicalRecordsLabel;
|
|
||||||
|
|
||||||
public interface MedicalRecordsLabelService extends IService<MedicalRecordsLabel> {
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.peanut.modules.common.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.MedicalRecordsToDeptLabel;
|
||||||
|
|
||||||
|
public interface MedicalRecordsToDeptLabelService extends IService<MedicalRecordsToDeptLabel> {
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package com.peanut.modules.common.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.peanut.modules.common.entity.MedicalRecordsToLabel;
|
|
||||||
|
|
||||||
public interface MedicalRecordsToLabelService extends IService<MedicalRecordsToLabel> {
|
|
||||||
}
|
|
||||||
@@ -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.DeptLabelDao;
|
||||||
|
import com.peanut.modules.common.entity.DeptLabel;
|
||||||
|
import com.peanut.modules.common.service.DeptLabelService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("commonMedicalRecordsLabelService")
|
||||||
|
public class DeptLabelServiceImpl extends ServiceImpl<DeptLabelDao, DeptLabel> implements DeptLabelService {
|
||||||
|
}
|
||||||
@@ -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.MedicalRecordsCheckUserDao;
|
||||||
|
import com.peanut.modules.common.entity.MedicalRecordsCheckUser;
|
||||||
|
import com.peanut.modules.common.service.MedicalRecordsCheckUserService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("commonMedicalRecordsCheckUserService")
|
||||||
|
public class MedicalRecordsCheckUserServiceImpl extends ServiceImpl<MedicalRecordsCheckUserDao, MedicalRecordsCheckUser> implements MedicalRecordsCheckUserService {
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.peanut.modules.common.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.peanut.modules.common.dao.MedicalRecordsLabelDao;
|
|
||||||
import com.peanut.modules.common.entity.MedicalRecordsLabel;
|
|
||||||
import com.peanut.modules.common.service.MedicalRecordsLabelService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Service("commonMedicalRecordsLabelService")
|
|
||||||
public class MedicalRecordsLabelServiceImpl extends ServiceImpl<MedicalRecordsLabelDao, MedicalRecordsLabel> implements MedicalRecordsLabelService {
|
|
||||||
}
|
|
||||||
@@ -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.MedicalRecordsToDeptLabelDao;
|
||||||
|
import com.peanut.modules.common.entity.MedicalRecordsToDeptLabel;
|
||||||
|
import com.peanut.modules.common.service.MedicalRecordsToDeptLabelService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("commonMedicalRecordsToLabelService")
|
||||||
|
public class MedicalRecordsToDeptLabelServiceImpl extends ServiceImpl<MedicalRecordsToDeptLabelDao, MedicalRecordsToDeptLabel> implements MedicalRecordsToDeptLabelService {
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.peanut.modules.common.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.peanut.modules.common.dao.MedicalRecordsToLabelDao;
|
|
||||||
import com.peanut.modules.common.entity.MedicalRecordsToLabel;
|
|
||||||
import com.peanut.modules.common.service.MedicalRecordsToLabelService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Service("commonMedicalRecordsToLabelService")
|
|
||||||
public class MedicalRecordsToLabelServiceImpl extends ServiceImpl<MedicalRecordsToLabelDao, MedicalRecordsToLabel> implements MedicalRecordsToLabelService {
|
|
||||||
}
|
|
||||||
@@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.common.entity.*;
|
import com.peanut.modules.common.entity.*;
|
||||||
import com.peanut.modules.common.service.MedicalRecordsLabelService;
|
import com.peanut.modules.common.service.*;
|
||||||
import com.peanut.modules.common.service.MedicalRecordsService;
|
|
||||||
import com.peanut.modules.common.service.MedicalRecordsToLabelService;
|
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.master.service.MyUserService;
|
import com.peanut.modules.master.service.MyUserService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -28,34 +26,48 @@ public class MedicalRecordsController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsService medicalRecordsService;
|
private MedicalRecordsService medicalRecordsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsLabelService medicalRecordsLabelService;
|
private TaihuTalentService talentService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsToLabelService toLabelService;
|
private DeptLabelService deptLabelService;
|
||||||
|
@Autowired
|
||||||
|
private MedicalRecordsToDeptLabelService toLabelService;
|
||||||
|
@Autowired
|
||||||
|
private MedicalRecordsCheckUserService medicalRecordsCheckUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MyUserService userService;
|
private MyUserService userService;
|
||||||
|
|
||||||
//获取医案待审核、拒绝列表
|
//获取医案待审核、拒绝、审核不同结果列表
|
||||||
@RequestMapping("/getMedicalRecordsListCheck")
|
@RequestMapping("/getMedicalRecordsListCheck")
|
||||||
public R getMedicalRecordsListCheck(@RequestBody Map<String,Object> params){
|
public R getMedicalRecordsListCheck(@RequestBody Map<String,Object> params){
|
||||||
MPJLambdaWrapper<MedicalRecords> wrapper = new MPJLambdaWrapper();
|
MPJLambdaWrapper<MedicalRecords> wrapper = new MPJLambdaWrapper();
|
||||||
if ("3".equals(params.get("state"))){
|
if (params.containsKey("infoCount")&¶ms.get("infoCount")!=null&&StringUtils.isNotEmpty(params.get("infoCount").toString())&&
|
||||||
wrapper.leftJoin(MedicalRecordsToLabel.class,MedicalRecordsToLabel::getRecordId,MedicalRecords::getId);
|
"2".equals(params.get("infoCount").toString())&&"3".equals(params.get("state").toString())){
|
||||||
wrapper.leftJoin(MedicalRecordsLabel.class,MedicalRecordsLabel::getId,MedicalRecordsToLabel::getLabelId);
|
wrapper.leftJoin(MedicalRecordsToDeptLabel.class, MedicalRecordsToDeptLabel::getRecordId,MedicalRecords::getId);
|
||||||
wrapper.selectAs(MedicalRecordsLabel::getTitle,"labelTitle");
|
wrapper.leftJoin(DeptLabel.class, DeptLabel::getId, MedicalRecordsToDeptLabel::getLabelId);
|
||||||
}
|
wrapper.selectAs(DeptLabel::getTitle,"labelTitle");
|
||||||
if ("0".equals(params.get("state"))){
|
wrapper.eq(MedicalRecords::getInfoCount,2);
|
||||||
wrapper.eq(MedicalRecords::getUserId,"1");
|
}else {
|
||||||
|
if ("3".equals(params.get("state").toString())){
|
||||||
|
wrapper.leftJoin(MedicalRecordsToDeptLabel.class, MedicalRecordsToDeptLabel::getRecordId,MedicalRecords::getId);
|
||||||
|
wrapper.leftJoin(DeptLabel.class, DeptLabel::getId, MedicalRecordsToDeptLabel::getLabelId);
|
||||||
|
wrapper.selectAs(DeptLabel::getTitle,"labelTitle");
|
||||||
|
wrapper.lt(MedicalRecords::getInfoCount,2);
|
||||||
|
}
|
||||||
|
if ("0".equals(params.get("state").toString())){
|
||||||
|
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"));
|
||||||
|
wrapper.orderByAsc(MedicalRecords::getCreateTime);
|
||||||
Page<MedicalRecords> page = medicalRecordsService.page(new Page<>(
|
Page<MedicalRecords> page = medicalRecordsService.page(new Page<>(
|
||||||
Long.parseLong(params.get("current").toString()),Long.parseLong(params.get("limit").toString())),wrapper);
|
Long.parseLong(params.get("current").toString()),Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
for (MedicalRecords mr:page.getRecords()){
|
for (MedicalRecords mr:page.getRecords()){
|
||||||
mr.setUser(userService.getById(mr.getUserId()));
|
mr.setUser(userService.getById(mr.getUserId()));
|
||||||
MedicalRecordsToLabel toLabel = toLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToLabel>()
|
MedicalRecordsToDeptLabel toLabel = toLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToDeptLabel>()
|
||||||
.eq(MedicalRecordsToLabel::getRecordId,mr.getId()));
|
.eq(MedicalRecordsToDeptLabel::getRecordId,mr.getId()));
|
||||||
if (toLabel!=null){
|
if (toLabel!=null){
|
||||||
MedicalRecordsLabel label = medicalRecordsLabelService.getById(toLabel.getLabelId());
|
DeptLabel label = deptLabelService.getById(toLabel.getLabelId());
|
||||||
mr.setLabelId(label.getId());
|
mr.setLabelId(label.getId());
|
||||||
mr.setLabelTitle(label.getTitle());
|
mr.setLabelTitle(label.getTitle());
|
||||||
}
|
}
|
||||||
@@ -67,11 +79,11 @@ public class MedicalRecordsController {
|
|||||||
@RequestMapping("/getMedicalRecordsList")
|
@RequestMapping("/getMedicalRecordsList")
|
||||||
public R getMedicalRecordsList(@RequestBody Map<String,Object> params){
|
public R getMedicalRecordsList(@RequestBody Map<String,Object> params){
|
||||||
MPJLambdaWrapper<MedicalRecords> wrapper = new MPJLambdaWrapper();
|
MPJLambdaWrapper<MedicalRecords> wrapper = new MPJLambdaWrapper();
|
||||||
wrapper.rightJoin(MedicalRecordsToLabel.class,MedicalRecordsToLabel::getRecordId,MedicalRecords::getId);
|
wrapper.rightJoin(MedicalRecordsToDeptLabel.class, MedicalRecordsToDeptLabel::getRecordId,MedicalRecords::getId);
|
||||||
wrapper.leftJoin(MyUserEntity.class,MyUserEntity::getId,MedicalRecords::getUserId);
|
wrapper.leftJoin(MyUserEntity.class,MyUserEntity::getId,MedicalRecords::getUserId);
|
||||||
wrapper.selectAll(MedicalRecords.class);
|
wrapper.selectAll(MedicalRecords.class);
|
||||||
wrapper.eq(MedicalRecordsToLabel::getLabelId,params.get("labelId"));
|
wrapper.eq(MedicalRecordsToDeptLabel::getLabelId,params.get("labelId"));
|
||||||
wrapper.eq(MedicalRecords::getState,3);
|
wrapper.gt(MedicalRecords::getState,4);
|
||||||
wrapper.like(StringUtils.isNotBlank(params.get("tel").toString()),MyUserEntity::getTel,params.get("tel"));
|
wrapper.like(StringUtils.isNotBlank(params.get("tel").toString()),MyUserEntity::getTel,params.get("tel"));
|
||||||
wrapper.eq(StringUtils.isNotBlank(params.get("train").toString()),MedicalRecords::getTrain,params.get("train"));
|
wrapper.eq(StringUtils.isNotBlank(params.get("train").toString()),MedicalRecords::getTrain,params.get("train"));
|
||||||
wrapper.like(StringUtils.isNotBlank(params.get("title").toString()),MedicalRecords::getTitle,params.get("title"));
|
wrapper.like(StringUtils.isNotBlank(params.get("title").toString()),MedicalRecords::getTitle,params.get("title"));
|
||||||
@@ -88,7 +100,7 @@ public class MedicalRecordsController {
|
|||||||
public R addMedicalRecords(@RequestBody MedicalRecords medicalRecords){
|
public R addMedicalRecords(@RequestBody MedicalRecords medicalRecords){
|
||||||
medicalRecords.setState(3);
|
medicalRecords.setState(3);
|
||||||
medicalRecordsService.save(medicalRecords);
|
medicalRecordsService.save(medicalRecords);
|
||||||
MedicalRecordsToLabel toLabel = new MedicalRecordsToLabel();
|
MedicalRecordsToDeptLabel toLabel = new MedicalRecordsToDeptLabel();
|
||||||
toLabel.setLabelId(medicalRecords.getLabelId());
|
toLabel.setLabelId(medicalRecords.getLabelId());
|
||||||
toLabel.setRecordId(medicalRecords.getId());
|
toLabel.setRecordId(medicalRecords.getId());
|
||||||
toLabelService.save(toLabel);
|
toLabelService.save(toLabel);
|
||||||
@@ -98,13 +110,13 @@ public class MedicalRecordsController {
|
|||||||
@RequestMapping("/editMedicalRecords")
|
@RequestMapping("/editMedicalRecords")
|
||||||
@Transactional
|
@Transactional
|
||||||
public R editMedicalRecords(@RequestBody MedicalRecords medicalRecords){
|
public R editMedicalRecords(@RequestBody MedicalRecords medicalRecords){
|
||||||
MedicalRecordsToLabel toLabel = toLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToLabel>()
|
MedicalRecordsToDeptLabel toLabel = toLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsToDeptLabel>()
|
||||||
.eq(MedicalRecordsToLabel::getRecordId,medicalRecords.getId()));
|
.eq(MedicalRecordsToDeptLabel::getRecordId,medicalRecords.getId()));
|
||||||
if (toLabel!=null){
|
if (toLabel!=null){
|
||||||
toLabel.setLabelId(medicalRecords.getLabelId());
|
toLabel.setLabelId(medicalRecords.getLabelId());
|
||||||
toLabelService.updateById(toLabel);
|
toLabelService.updateById(toLabel);
|
||||||
}else {
|
}else {
|
||||||
toLabel = new MedicalRecordsToLabel();
|
toLabel = new MedicalRecordsToDeptLabel();
|
||||||
toLabel.setRecordId(medicalRecords.getId());
|
toLabel.setRecordId(medicalRecords.getId());
|
||||||
toLabel.setLabelId(medicalRecords.getLabelId());
|
toLabel.setLabelId(medicalRecords.getLabelId());
|
||||||
toLabelService.save(toLabel);
|
toLabelService.save(toLabel);
|
||||||
@@ -119,43 +131,69 @@ public class MedicalRecordsController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//医案审核员列表
|
||||||
|
@RequestMapping("/getMedicalRecordsCheckUserListByLabelId")
|
||||||
|
public R getMedicalRecordsCheckUserListByLabelId(@RequestBody Map<String,Object> params){
|
||||||
|
MPJLambdaWrapper<MyUserEntity> wrapper = new MPJLambdaWrapper();
|
||||||
|
wrapper.rightJoin(MedicalRecordsCheckUser.class, MedicalRecordsCheckUser::getUserId,MyUserEntity::getId);
|
||||||
|
wrapper.selectAll(MyUserEntity.class);
|
||||||
|
wrapper.eq(MedicalRecordsCheckUser::getLabelId,params.get("labelId"));
|
||||||
|
Page<MyUserEntity> page = userService.page(new Page<>(
|
||||||
|
Long.parseLong(params.get("current").toString()),Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
|
return R.ok().put("page",page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/addMedicalRecordsCheckUser")
|
||||||
|
public R addMedicalRecordsCheckUser(@RequestBody MedicalRecordsCheckUser checkUser){
|
||||||
|
medicalRecordsCheckUserService.save(checkUser);
|
||||||
|
return R.ok().put("MedicalRecordsCheckUser", checkUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/delMedicalRecordsCheckUser")
|
||||||
|
public R delMedicalRecordsCheckUser(@RequestBody MedicalRecordsCheckUser checkUser){
|
||||||
|
medicalRecordsCheckUserService.remove(new LambdaQueryWrapper<MedicalRecordsCheckUser>()
|
||||||
|
.eq(MedicalRecordsCheckUser::getUserId,checkUser.getUserId())
|
||||||
|
.eq(MedicalRecordsCheckUser::getLabelId,checkUser.getLabelId()));
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//科室标签
|
||||||
@RequestMapping("/getMedicalRecordsLabelList")
|
@RequestMapping("/getMedicalRecordsLabelList")
|
||||||
public R getMedicalRecordsLabelList(){
|
public R getMedicalRecordsLabelList(){
|
||||||
return R.ok().put("Medicals", medicalRecordsLabels(0));
|
return R.ok().put("Medicals", medicalRecordsLabels(0));
|
||||||
}
|
}
|
||||||
private List<MedicalRecordsLabel> medicalRecordsLabels(int id){
|
private List<DeptLabel> medicalRecordsLabels(int id){
|
||||||
List<MedicalRecordsLabel> medicalRecordsLabelList = medicalRecordsLabelService.list(new LambdaQueryWrapper<MedicalRecordsLabel>()
|
List<DeptLabel> deptLabelList = deptLabelService.list(new LambdaQueryWrapper<DeptLabel>()
|
||||||
.eq(MedicalRecordsLabel::getPid, id));
|
.eq(DeptLabel::getPid, id));
|
||||||
for (MedicalRecordsLabel m : medicalRecordsLabelList){
|
for (DeptLabel m : deptLabelList){
|
||||||
if(m.getIsLast()!=1){
|
if(m.getIsLast()!=1){
|
||||||
List<MedicalRecordsLabel> so = this.medicalRecordsLabels(m.getId());
|
List<DeptLabel> so = this.medicalRecordsLabels(m.getId());
|
||||||
m.setChildren(so);
|
m.setChildren(so);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return medicalRecordsLabelList;
|
return deptLabelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/addMedicalRecordsLabel")
|
@RequestMapping("/addMedicalRecordsLabel")
|
||||||
public R addMedicalRecordsLabel(@RequestBody MedicalRecordsLabel medicalRecordsLabel){
|
public R addMedicalRecordsLabel(@RequestBody DeptLabel deptLabel){
|
||||||
medicalRecordsLabelService.save(medicalRecordsLabel);
|
deptLabelService.save(deptLabel);
|
||||||
return R.ok().put("medicalRecordsLabel", medicalRecordsLabel);
|
return R.ok().put("medicalRecordsLabel", deptLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/delMedicalRecordsLabel")
|
@RequestMapping("/delMedicalRecordsLabel")
|
||||||
public R delMedicalRecordsLabel(@RequestBody ParamTo param){
|
public R delMedicalRecordsLabel(@RequestBody ParamTo param){
|
||||||
//查看下一级是否存在
|
//查看下一级是否存在
|
||||||
long count = medicalRecordsLabelService.count(new LambdaQueryWrapper<MedicalRecordsLabel>()
|
long count = deptLabelService.count(new LambdaQueryWrapper<DeptLabel>()
|
||||||
.eq(MedicalRecordsLabel::getPid, param.getId()));
|
.eq(DeptLabel::getPid, param.getId()));
|
||||||
if(count>0){
|
if(count>0){
|
||||||
return R.error(501,"删除失败,请先删除子项目后再尝试");
|
return R.error(501,"删除失败,请先删除子项目后再尝试");
|
||||||
}
|
}
|
||||||
//查看绑定关系是否存在
|
//查看绑定关系是否存在
|
||||||
List<MedicalRecordsToLabel> toLabels = toLabelService.list(new LambdaQueryWrapper<MedicalRecordsToLabel>()
|
List<MedicalRecordsToDeptLabel> toLabels = toLabelService.list(new LambdaQueryWrapper<MedicalRecordsToDeptLabel>()
|
||||||
.eq(MedicalRecordsToLabel::getLabelId, param.getId()));
|
.eq(MedicalRecordsToDeptLabel::getLabelId, param.getId()));
|
||||||
for (MedicalRecordsToLabel toLabel:toLabels){
|
for (MedicalRecordsToDeptLabel toLabel:toLabels){
|
||||||
MedicalRecords c = medicalRecordsService.getById(toLabel.getRecordId());
|
MedicalRecords c = medicalRecordsService.getById(toLabel.getRecordId());
|
||||||
if (c!=null){
|
if (c!=null){
|
||||||
return R.error(502,"删除失败,请先解绑医案与标签的绑定关系");
|
return R.error(502,"删除失败,请先解绑医案与标签的绑定关系");
|
||||||
@@ -163,29 +201,55 @@ public class MedicalRecordsController {
|
|||||||
toLabelService.removeById(toLabel.getId());
|
toLabelService.removeById(toLabel.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
medicalRecordsLabelService.removeById(param.getId());
|
//查看绑定关系是否存在
|
||||||
|
long taihuTalents = talentService.count(new LambdaQueryWrapper<TaihuTalent>()
|
||||||
|
.eq(TaihuTalent::getDeptLabelId, param.getId()));
|
||||||
|
if (taihuTalents>0){
|
||||||
|
return R.error(502,"删除失败,请先解绑太湖英才与标签的绑定关系");
|
||||||
|
}
|
||||||
|
//查看绑定关系是否存在
|
||||||
|
long checkUsers = medicalRecordsCheckUserService.count(new LambdaQueryWrapper<MedicalRecordsCheckUser>()
|
||||||
|
.eq(MedicalRecordsCheckUser::getLabelId, param.getId()));
|
||||||
|
if (checkUsers>0){
|
||||||
|
return R.error(502,"删除失败,请先解绑医案审核员与标签的绑定关系");
|
||||||
|
}
|
||||||
|
deptLabelService.removeById(param.getId());
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/editMedicalRecordsLabel")
|
@RequestMapping("/editMedicalRecordsLabel")
|
||||||
public R editMedicalRecordsLabel(@RequestBody MedicalRecordsLabel medicalRecordsLabel){
|
public R editMedicalRecordsLabel(@RequestBody DeptLabel deptLabel){
|
||||||
MedicalRecordsLabel old = medicalRecordsLabelService.getById(medicalRecordsLabel.getId());
|
DeptLabel old = deptLabelService.getById(deptLabel.getId());
|
||||||
if(old.getIsLast()==0&& medicalRecordsLabel.getIsLast()==1){
|
if(old.getIsLast()==0&& deptLabel.getIsLast()==1){
|
||||||
MedicalRecordsLabel one = medicalRecordsLabelService.getOne(new LambdaQueryWrapper<MedicalRecordsLabel>()
|
DeptLabel one = deptLabelService.getOne(new LambdaQueryWrapper<DeptLabel>()
|
||||||
.eq(MedicalRecordsLabel::getPid, medicalRecordsLabel.getId()));
|
.eq(DeptLabel::getPid, deptLabel.getId()));
|
||||||
if(one!=null){
|
if(one!=null){
|
||||||
return R.error(501,"更新失败,请先清空此项的下级标签,才能将此标签变成终极标签");
|
return R.error(501,"更新失败,请先清空此项的下级标签,才能将此标签变成终极标签");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(old.getIsLast()==1&& medicalRecordsLabel.getIsLast()==0){
|
if(old.getIsLast()==1&& deptLabel.getIsLast()==0){
|
||||||
long c = toLabelService.count(new LambdaQueryWrapper<MedicalRecordsToLabel>()
|
long c = toLabelService.count(new LambdaQueryWrapper<MedicalRecordsToDeptLabel>()
|
||||||
.eq(MedicalRecordsToLabel::getLabelId, medicalRecordsLabel.getId()));
|
.eq(MedicalRecordsToDeptLabel::getLabelId, deptLabel.getId()));
|
||||||
if(c>0){
|
if(c>0){
|
||||||
return R.error(502,"更新失败,请先把此项与医案的关联关系清空后才可把此标签变成普通标签");
|
return R.error(502,"更新失败,请先把此项与医案的关联关系清空后才可把此标签变成普通标签");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
medicalRecordsLabelService.updateById(medicalRecordsLabel);
|
if(old.getIsLast()==0&& deptLabel.getIsLast()==1){
|
||||||
return R.ok().put("medicalRecordsLabel", medicalRecordsLabel);
|
long c = talentService.count(new LambdaQueryWrapper<TaihuTalent>()
|
||||||
|
.eq(TaihuTalent::getDeptLabelId, deptLabel.getId()));
|
||||||
|
if(c>0){
|
||||||
|
return R.error(502,"更新失败,请先把此项与太湖英才的关联关系清空后才可把此标签变成普通标签");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(old.getIsLast()==0&& deptLabel.getIsLast()==1){
|
||||||
|
long checkUsers = medicalRecordsCheckUserService.count(new LambdaQueryWrapper<MedicalRecordsCheckUser>()
|
||||||
|
.eq(MedicalRecordsCheckUser::getLabelId, deptLabel.getId()));
|
||||||
|
if (checkUsers>0){
|
||||||
|
return R.error(502,"删除失败,请先解绑医案审核员与标签的绑定关系");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
deptLabelService.updateById(deptLabel);
|
||||||
|
return R.ok().put("medicalRecordsLabel", deptLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ 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.*;
|
import com.peanut.modules.common.entity.*;
|
||||||
|
import com.peanut.modules.common.service.MyUserService;
|
||||||
import com.peanut.modules.common.service.TaihuTalentArticleCommentService;
|
import com.peanut.modules.common.service.TaihuTalentArticleCommentService;
|
||||||
import com.peanut.modules.common.service.TaihuTalentArticleService;
|
import com.peanut.modules.common.service.TaihuTalentArticleService;
|
||||||
import com.peanut.modules.common.service.TaihuTalentService;
|
import com.peanut.modules.common.service.TaihuTalentService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -29,6 +31,8 @@ public class TaihuTalentArticleController {
|
|||||||
private TaihuTalentService taihuTalentService;
|
private TaihuTalentService taihuTalentService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaihuTalentArticleCommentService taihuTalentArticleCommentService;
|
private TaihuTalentArticleCommentService taihuTalentArticleCommentService;
|
||||||
|
@Autowired
|
||||||
|
private MyUserService userService;
|
||||||
|
|
||||||
//太湖英才文章列表
|
//太湖英才文章列表
|
||||||
@RequestMapping("/getArticleList")
|
@RequestMapping("/getArticleList")
|
||||||
@@ -57,10 +61,20 @@ public class TaihuTalentArticleController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//编辑文章
|
||||||
|
@RequestMapping("/editArticle")
|
||||||
|
public R editArticle(@RequestBody TaihuTalentArticle taihuTalentArticle){
|
||||||
|
taihuTalentArticleService.updateById(taihuTalentArticle);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
//删除文章
|
//删除文章
|
||||||
@RequestMapping("/delArticle")
|
@RequestMapping("/delArticle")
|
||||||
|
@Transactional
|
||||||
public R delArticle(@RequestBody TaihuTalentArticle taihuTalentArticle){
|
public R delArticle(@RequestBody TaihuTalentArticle taihuTalentArticle){
|
||||||
taihuTalentArticleService.removeById(taihuTalentArticle);
|
taihuTalentArticleService.removeById(taihuTalentArticle);
|
||||||
|
taihuTalentArticleCommentService.remove(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,taihuTalentArticle.getId()));
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +84,7 @@ public class TaihuTalentArticleController {
|
|||||||
MPJLambdaWrapper<TaihuTalentArticleComment> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<TaihuTalentArticleComment> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.leftJoin(MyUserEntity.class,MyUserEntity::getId,TaihuTalentArticleComment::getUserId);
|
wrapper.leftJoin(MyUserEntity.class,MyUserEntity::getId,TaihuTalentArticleComment::getUserId);
|
||||||
wrapper.selectAll(TaihuTalentArticleComment.class);
|
wrapper.selectAll(TaihuTalentArticleComment.class);
|
||||||
wrapper.like(TaihuTalentArticleComment::getContent,params.get("conten"));
|
wrapper.like(TaihuTalentArticleComment::getContent,params.get("content"));
|
||||||
if (StringUtils.isNotEmpty(params.get("userInfo").toString())) {
|
if (StringUtils.isNotEmpty(params.get("userInfo").toString())) {
|
||||||
wrapper.and(t->t.like(MyUserEntity::getName,params.get("userInfo")).or().like(MyUserEntity::getNickname,params.get("userInfo"))
|
wrapper.and(t->t.like(MyUserEntity::getName,params.get("userInfo")).or().like(MyUserEntity::getNickname,params.get("userInfo"))
|
||||||
.or().like(MyUserEntity::getTel,params.get("userInfo")).or().like(MyUserEntity::getEmail,params.get("userInfo")));
|
.or().like(MyUserEntity::getTel,params.get("userInfo")).or().like(MyUserEntity::getEmail,params.get("userInfo")));
|
||||||
@@ -78,6 +92,9 @@ public class TaihuTalentArticleController {
|
|||||||
wrapper.orderByDesc(TaihuTalentArticle::getCreateTime);
|
wrapper.orderByDesc(TaihuTalentArticle::getCreateTime);
|
||||||
Page<TaihuTalentArticleComment> page = taihuTalentArticleCommentService.page(new Page<>(Long.parseLong(params.get("current").toString()),
|
Page<TaihuTalentArticleComment> page = taihuTalentArticleCommentService.page(new Page<>(Long.parseLong(params.get("current").toString()),
|
||||||
Long.parseLong(params.get("limit").toString())), wrapper);
|
Long.parseLong(params.get("limit").toString())), wrapper);
|
||||||
|
for (TaihuTalentArticleComment comment : page.getRecords()) {
|
||||||
|
comment.setUser(userService.getById(comment.getUserId()));
|
||||||
|
}
|
||||||
return R.ok().put("page",page);
|
return R.ok().put("page",page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ import com.peanut.common.utils.R;
|
|||||||
import com.peanut.modules.common.entity.*;
|
import com.peanut.modules.common.entity.*;
|
||||||
import com.peanut.modules.common.service.CourseToTaihumedService;
|
import com.peanut.modules.common.service.CourseToTaihumedService;
|
||||||
import com.peanut.modules.common.service.CourseToTalentService;
|
import com.peanut.modules.common.service.CourseToTalentService;
|
||||||
import com.peanut.modules.common.service.MedicalRecordsLabelService;
|
import com.peanut.modules.common.service.DeptLabelService;
|
||||||
import com.peanut.modules.common.service.TaihuTalentService;
|
import com.peanut.modules.common.service.TaihuTalentService;
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
|
||||||
import com.peanut.modules.master.service.CourseService;
|
import com.peanut.modules.master.service.CourseService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -21,7 +20,6 @@ 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("masterTaihuTalent")
|
@RestController("masterTaihuTalent")
|
||||||
@@ -37,7 +35,7 @@ public class TaihuTalentController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CourseToTaihumedService courseToTaihumedService;
|
private CourseToTaihumedService courseToTaihumedService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsLabelService medicalRecordsLabelService;
|
private DeptLabelService deptLabelService;
|
||||||
|
|
||||||
|
|
||||||
//太湖英才课程列表
|
//太湖英才课程列表
|
||||||
@@ -109,9 +107,9 @@ public class TaihuTalentController {
|
|||||||
@RequestMapping("/getTaihuTalents")
|
@RequestMapping("/getTaihuTalents")
|
||||||
public R getTaihuTalents(@RequestBody Map<String,Object> params){
|
public R getTaihuTalents(@RequestBody Map<String,Object> params){
|
||||||
MPJLambdaWrapper<TaihuTalent> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<TaihuTalent> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.leftJoin(MedicalRecordsLabel.class,MedicalRecordsLabel::getId,TaihuTalent::getDeptLabelId);
|
wrapper.leftJoin(DeptLabel.class, DeptLabel::getId,TaihuTalent::getDeptLabelId);
|
||||||
wrapper.selectAll(TaihuTalent.class);
|
wrapper.selectAll(TaihuTalent.class);
|
||||||
wrapper.selectAs(MedicalRecordsLabel::getTitle,TaihuTalent::getDepartment);
|
wrapper.selectAs(DeptLabel::getTitle,TaihuTalent::getDepartment);
|
||||||
wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name"));
|
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"));
|
wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region"));
|
||||||
wrapper.orderByDesc(TaihuTalent::getCreateTime);
|
wrapper.orderByDesc(TaihuTalent::getCreateTime);
|
||||||
@@ -123,6 +121,10 @@ public class TaihuTalentController {
|
|||||||
//新增太湖英才
|
//新增太湖英才
|
||||||
@RequestMapping("/addTaihuTalent")
|
@RequestMapping("/addTaihuTalent")
|
||||||
public R addTaihuTalent(@RequestBody TaihuTalent taihuTalent){
|
public R addTaihuTalent(@RequestBody TaihuTalent taihuTalent){
|
||||||
|
if (taihuTalentService.count(new LambdaQueryWrapper<TaihuTalent>()
|
||||||
|
.eq(TaihuTalent::getUserId,taihuTalent.getUserId()))>0){
|
||||||
|
return R.error("已绑定过");
|
||||||
|
}
|
||||||
taihuTalentService.save(taihuTalent);
|
taihuTalentService.save(taihuTalent);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@@ -148,7 +150,7 @@ public class TaihuTalentController {
|
|||||||
@RequestMapping("/taihuTalentInfo")
|
@RequestMapping("/taihuTalentInfo")
|
||||||
public R taihuTalentInfo(@RequestBody Map<String,Object> params){
|
public R taihuTalentInfo(@RequestBody Map<String,Object> params){
|
||||||
TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString());
|
TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString());
|
||||||
taihuTalent.setDepartment(medicalRecordsLabelService.getById(taihuTalent.getDeptLabelId()).getTitle());
|
taihuTalent.setDepartment(deptLabelService.getById(taihuTalent.getDeptLabelId()).getTitle());
|
||||||
return R.ok().put("taihuTalent",taihuTalent);
|
return R.ok().put("taihuTalent",taihuTalent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.peanut.modules.taihumed.controller;
|
package com.peanut.modules.taihumed.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.common.utils.ShiroUtils;
|
import com.peanut.common.utils.ShiroUtils;
|
||||||
@@ -10,14 +12,12 @@ import com.peanut.modules.sys.entity.SysSensitiveWords;
|
|||||||
import com.peanut.modules.sys.service.SysSensitiveWordsService;
|
import com.peanut.modules.sys.service.SysSensitiveWordsService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("commonTaihuTalentArticle")
|
@RestController("commonTaihuTalentArticle")
|
||||||
@@ -34,11 +34,16 @@ public class TaihuTalentArticleController {
|
|||||||
private TaihuTalentArticleLikeService taihuTalentArticleLikeService;
|
private TaihuTalentArticleLikeService taihuTalentArticleLikeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysSensitiveWordsService sysSensitiveWordsService;
|
private SysSensitiveWordsService sysSensitiveWordsService;
|
||||||
|
@Autowired
|
||||||
|
private MyUserService userService;
|
||||||
|
@Autowired
|
||||||
|
private MedicalRecordsService medicalRecordsService;
|
||||||
|
|
||||||
//太湖英才文章列表
|
//太湖英才文章列表
|
||||||
@RequestMapping("/getArticleList")
|
@RequestMapping("/getArticleList")
|
||||||
public R getArticleList(@RequestBody Map<String,Object> params){
|
public R getArticleList(@RequestBody Map<String,Object> params){
|
||||||
LambdaQueryWrapper<TaihuTalentArticle> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<TaihuTalentArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(TaihuTalentArticle::getShowFlag,1);
|
||||||
wrapper.orderByDesc(TaihuTalentArticle::getCreateTime);
|
wrapper.orderByDesc(TaihuTalentArticle::getCreateTime);
|
||||||
Page<TaihuTalentArticle> page = taihuTalentArticleService.page(new Page<>(Long.parseLong(params.get("current").toString()),
|
Page<TaihuTalentArticle> page = taihuTalentArticleService.page(new Page<>(Long.parseLong(params.get("current").toString()),
|
||||||
Long.parseLong(params.get("limit").toString())), wrapper);
|
Long.parseLong(params.get("limit").toString())), wrapper);
|
||||||
@@ -49,6 +54,12 @@ public class TaihuTalentArticleController {
|
|||||||
.eq(TaihuTalentArticleComment::getArticleId,article.getId())));
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())));
|
||||||
article.setLikeCount((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
article.setLikeCount((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
.eq(TaihuTalentArticleLike::getArticleId,article.getId())));
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId())));
|
||||||
|
List<TaihuTalentArticleLike> likeList = taihuTalentArticleLikeService.list(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId()));
|
||||||
|
for (TaihuTalentArticleLike like: likeList) {
|
||||||
|
like.setUser(userService.getById(like.getUserId()));
|
||||||
|
}
|
||||||
|
article.setLikeList(likeList);
|
||||||
article.setLikeFlag((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
article.setLikeFlag((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
.eq(TaihuTalentArticleLike::getArticleId,article.getId())
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId())
|
||||||
.eq(TaihuTalentArticleLike::getUserId, ShiroUtils.getUId())));
|
.eq(TaihuTalentArticleLike::getUserId, ShiroUtils.getUId())));
|
||||||
@@ -64,9 +75,14 @@ public class TaihuTalentArticleController {
|
|||||||
.eq(TaihuTalent::getUserId, article.getUserId())));
|
.eq(TaihuTalent::getUserId, article.getUserId())));
|
||||||
article.setCommentCount((int) taihuTalentArticleCommentService.count(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
article.setCommentCount((int) taihuTalentArticleCommentService.count(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
.eq(TaihuTalentArticleComment::getArticleId,article.getId())));
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())));
|
||||||
article.setLikeCount((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
List<TaihuTalentArticleLike> likeList = taihuTalentArticleLikeService.list(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
.eq(TaihuTalentArticleLike::getArticleId,article.getId())));
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId()));
|
||||||
article.setLikeCount((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
for (TaihuTalentArticleLike like: likeList) {
|
||||||
|
like.setUser(userService.getById(like.getUserId()));
|
||||||
|
}
|
||||||
|
article.setLikeList(likeList);
|
||||||
|
article.setLikeCount(likeList.size());
|
||||||
|
article.setLikeFlag((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
.eq(TaihuTalentArticleLike::getArticleId,article.getId())
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId())
|
||||||
.eq(TaihuTalentArticleLike::getUserId, ShiroUtils.getUId())));
|
.eq(TaihuTalentArticleLike::getUserId, ShiroUtils.getUId())));
|
||||||
List<TaihuTalentArticleComment> comments = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
List<TaihuTalentArticleComment> comments = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
@@ -74,10 +90,15 @@ public class TaihuTalentArticleController {
|
|||||||
.eq(TaihuTalentArticleComment::getPid,0)
|
.eq(TaihuTalentArticleComment::getPid,0)
|
||||||
.orderByDesc(TaihuTalentArticleComment::getCreateTime));
|
.orderByDesc(TaihuTalentArticleComment::getCreateTime));
|
||||||
for (TaihuTalentArticleComment comment : comments) {
|
for (TaihuTalentArticleComment comment : comments) {
|
||||||
comment.setChildren(taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
List<TaihuTalentArticleComment> childrenList = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
.eq(TaihuTalentArticleComment::getArticleId,article.getId())
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())
|
||||||
.ne(TaihuTalentArticleComment::getPid,0)
|
.eq(TaihuTalentArticleComment::getPid,comment.getId())
|
||||||
.orderByAsc(TaihuTalentArticleComment::getCreateTime)));
|
.orderByAsc(TaihuTalentArticleComment::getCreateTime));
|
||||||
|
for (TaihuTalentArticleComment cc : childrenList) {
|
||||||
|
cc.setUser(userService.getById(cc.getUserId()));
|
||||||
|
}
|
||||||
|
comment.setChildren(childrenList);
|
||||||
|
comment.setUser(userService.getById(comment.getUserId()));
|
||||||
}
|
}
|
||||||
if (!Objects.equals(article.getUserId(), ShiroUtils.getUId())){
|
if (!Objects.equals(article.getUserId(), ShiroUtils.getUId())){
|
||||||
article.setReadCount(article.getReadCount()+1);
|
article.setReadCount(article.getReadCount()+1);
|
||||||
@@ -86,12 +107,63 @@ public class TaihuTalentArticleController {
|
|||||||
return R.ok().put("article",article).put("comments",comments);
|
return R.ok().put("article",article).put("comments",comments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//太湖英才文章点赞和评论数量
|
||||||
|
@RequestMapping("/getArticleLikeAndComment")
|
||||||
|
public R getArticleLikeAndComment(@RequestBody Map<String,Object> params){
|
||||||
|
TaihuTalentArticle article = taihuTalentArticleService.getById(params.get("articleId").toString());
|
||||||
|
article.setCommentCount((int) taihuTalentArticleCommentService.count(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())));
|
||||||
|
List<TaihuTalentArticleLike> likeList = taihuTalentArticleLikeService.list(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId()));
|
||||||
|
for (TaihuTalentArticleLike like: likeList) {
|
||||||
|
like.setUser(userService.getById(like.getUserId()));
|
||||||
|
}
|
||||||
|
article.setLikeList(likeList);
|
||||||
|
article.setLikeCount(likeList.size());
|
||||||
|
article.setLikeFlag((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId())
|
||||||
|
.eq(TaihuTalentArticleLike::getUserId, ShiroUtils.getUId())));
|
||||||
|
List<TaihuTalentArticleComment> comments = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())
|
||||||
|
.eq(TaihuTalentArticleComment::getPid,0)
|
||||||
|
.orderByDesc(TaihuTalentArticleComment::getCreateTime));
|
||||||
|
for (TaihuTalentArticleComment comment : comments) {
|
||||||
|
List<TaihuTalentArticleComment> childrenList = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())
|
||||||
|
.eq(TaihuTalentArticleComment::getPid,comment.getId())
|
||||||
|
.orderByAsc(TaihuTalentArticleComment::getCreateTime));
|
||||||
|
for (TaihuTalentArticleComment cc : childrenList) {
|
||||||
|
cc.setUser(userService.getById(cc.getUserId()));
|
||||||
|
}
|
||||||
|
comment.setChildren(childrenList);
|
||||||
|
comment.setUser(userService.getById(comment.getUserId()));
|
||||||
|
}
|
||||||
|
return R.ok().put("article",article).put("comments",comments);
|
||||||
|
}
|
||||||
|
|
||||||
|
//增加阅读数
|
||||||
|
@RequestMapping("/addReadCount")
|
||||||
|
public R addReadCount(@RequestBody Map<String,Object> params){
|
||||||
|
TaihuTalentArticle article = taihuTalentArticleService.getById(params.get("articleId").toString());
|
||||||
|
if (article!=null){
|
||||||
|
article.setReadCount(article.getReadCount()+1);
|
||||||
|
taihuTalentArticleService.updateById(article);
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
//太湖英才文章点赞或取消
|
//太湖英才文章点赞或取消
|
||||||
@RequestMapping("/addOrCancelArticleLike")
|
@RequestMapping("/addOrCancelArticleLike")
|
||||||
|
@Transactional
|
||||||
public R addOrCancelArticleLike(@RequestBody Map<String,Object> params){
|
public R addOrCancelArticleLike(@RequestBody Map<String,Object> params){
|
||||||
TaihuTalentArticleLike like = taihuTalentArticleLikeService.getOne(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
TaihuTalentArticleLike like = taihuTalentArticleLikeService.getOne(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
.eq(TaihuTalentArticleLike::getArticleId,params.get("articleId").toString())
|
.eq(TaihuTalentArticleLike::getArticleId,params.get("articleId").toString())
|
||||||
.eq(TaihuTalentArticleLike::getUserId,ShiroUtils.getUId()));
|
.eq(TaihuTalentArticleLike::getUserId,ShiroUtils.getUId()));
|
||||||
|
TaihuTalentArticle article = taihuTalentArticleService.getById(params.get("articleId").toString());
|
||||||
|
if (article!=null){
|
||||||
|
article.setReadCount(article.getReadCount()+1);
|
||||||
|
taihuTalentArticleService.updateById(article);
|
||||||
|
}
|
||||||
if (like != null) {
|
if (like != null) {
|
||||||
taihuTalentArticleLikeService.removeById(like);
|
taihuTalentArticleLikeService.removeById(like);
|
||||||
}else {
|
}else {
|
||||||
@@ -105,7 +177,13 @@ public class TaihuTalentArticleController {
|
|||||||
|
|
||||||
//新增文章评论
|
//新增文章评论
|
||||||
@RequestMapping("/addArticleComment")
|
@RequestMapping("/addArticleComment")
|
||||||
|
@Transactional
|
||||||
public R addArticleComment(@RequestBody TaihuTalentArticleComment comment){
|
public R addArticleComment(@RequestBody TaihuTalentArticleComment comment){
|
||||||
|
TaihuTalentArticle article = taihuTalentArticleService.getById(comment.getArticleId());
|
||||||
|
if (article!=null){
|
||||||
|
article.setReadCount(article.getReadCount()+1);
|
||||||
|
taihuTalentArticleService.updateById(article);
|
||||||
|
}
|
||||||
R result = new R();
|
R result = new R();
|
||||||
LambdaQueryWrapper<SysSensitiveWords> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysSensitiveWords> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.last(" where instr(\""+comment.getContent()+"\",word)>0");
|
wrapper.last(" where instr(\""+comment.getContent()+"\",word)>0");
|
||||||
@@ -121,34 +199,38 @@ public class TaihuTalentArticleController {
|
|||||||
}
|
}
|
||||||
result.put("tip","您的评论含有敏感词:"+str+",请重新输入。");
|
result.put("tip","您的评论含有敏感词:"+str+",请重新输入。");
|
||||||
}else {
|
}else {
|
||||||
|
comment.setUserId(ShiroUtils.getUId());
|
||||||
taihuTalentArticleCommentService.save(comment);
|
taihuTalentArticleCommentService.save(comment);
|
||||||
result.put("tip","评论成功!");
|
result.put("tip","评论成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//评论提醒
|
//评论提醒
|
||||||
@RequestMapping("/getCommentRemind")
|
@RequestMapping("/getCommentRemind")
|
||||||
public R getCommentRemind(@RequestBody Map<String,Object> params){
|
public R getCommentRemind(){
|
||||||
List<TaihuTalentArticleComment> list = new ArrayList<>();
|
Set<TaihuTalentArticle> set = new HashSet<>();
|
||||||
List<TaihuTalentArticleComment> userComments = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
List<TaihuTalentArticleComment> userComments = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
.eq(TaihuTalentArticleComment::getUserId,ShiroUtils.getUId())
|
.eq(TaihuTalentArticleComment::getUserId,ShiroUtils.getUId())
|
||||||
.eq(TaihuTalentArticleComment::getArticleId,params.get("articleId").toString()));
|
.eq(TaihuTalentArticleComment::getReadFlag,0));
|
||||||
for (TaihuTalentArticleComment comment : userComments) {
|
for (TaihuTalentArticleComment comment : userComments) {
|
||||||
if(comment.getPid().equals(0)){
|
TaihuTalentArticle article = taihuTalentArticleService.getById(comment.getArticleId());
|
||||||
list.addAll(taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
if (article!=null){
|
||||||
.eq(TaihuTalentArticleComment::getPid,comment.getId())
|
set.add(article);
|
||||||
.eq(TaihuTalentArticleComment::getReadFlag,0)
|
|
||||||
.eq(TaihuTalentArticleComment::getArticleId,params.get("articleId").toString())));
|
|
||||||
}else {
|
|
||||||
list.addAll(taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
|
||||||
.eq(TaihuTalentArticleComment::getPid,comment.getPid())
|
|
||||||
.eq(TaihuTalentArticleComment::getReadFlag,0)
|
|
||||||
.eq(TaihuTalentArticleComment::getArticleId,params.get("articleId").toString())));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return R.ok().put("list",list);
|
return R.ok().put("set",set);
|
||||||
|
}
|
||||||
|
|
||||||
|
//评论提醒
|
||||||
|
@RequestMapping("/setReadFlag")
|
||||||
|
public R setReadFlag(@RequestBody Map<String,Object> params){
|
||||||
|
taihuTalentArticleCommentService.update(new LambdaUpdateWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getUserId,ShiroUtils.getUId())
|
||||||
|
.eq(TaihuTalentArticleComment::getReadFlag,0)
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,params.get("articleId").toString())
|
||||||
|
.set(TaihuTalentArticleComment::getReadFlag,1));
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
//我的文章列表
|
//我的文章列表
|
||||||
@@ -156,17 +238,103 @@ public class TaihuTalentArticleController {
|
|||||||
public R myArticleList(@RequestBody Map<String,Object> params){
|
public R myArticleList(@RequestBody Map<String,Object> params){
|
||||||
LambdaQueryWrapper<TaihuTalentArticle> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<TaihuTalentArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(TaihuTalentArticle::getUserId,ShiroUtils.getUId());
|
wrapper.eq(TaihuTalentArticle::getUserId,ShiroUtils.getUId());
|
||||||
|
wrapper.eq(TaihuTalentArticle::getShowFlag,params.get("showFlag").toString());
|
||||||
wrapper.orderByDesc(TaihuTalentArticle::getCreateTime);
|
wrapper.orderByDesc(TaihuTalentArticle::getCreateTime);
|
||||||
Page<TaihuTalentArticle> page = taihuTalentArticleService.page(new Page<>(Long.parseLong(params.get("current").toString()),
|
Page<TaihuTalentArticle> page = taihuTalentArticleService.page(new Page<>(Long.parseLong(params.get("current").toString()),
|
||||||
Long.parseLong(params.get("limit").toString())), wrapper);
|
Long.parseLong(params.get("limit").toString())), wrapper);
|
||||||
|
for (TaihuTalentArticle article : page.getRecords()) {
|
||||||
|
article.setCommentCount((int) taihuTalentArticleCommentService.count(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())));
|
||||||
|
List<TaihuTalentArticleLike> likeList = taihuTalentArticleLikeService.list(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId()));
|
||||||
|
for (TaihuTalentArticleLike like: likeList) {
|
||||||
|
like.setUser(userService.getById(like.getUserId()));
|
||||||
|
}
|
||||||
|
article.setLikeList(likeList);
|
||||||
|
article.setLikeCount(likeList.size());
|
||||||
|
article.setLikeFlag((int) taihuTalentArticleLikeService.count(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
|
.eq(TaihuTalentArticleLike::getArticleId,article.getId())
|
||||||
|
.eq(TaihuTalentArticleLike::getUserId, ShiroUtils.getUId())));
|
||||||
|
List<TaihuTalentArticleComment> comments = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())
|
||||||
|
.eq(TaihuTalentArticleComment::getPid,0)
|
||||||
|
.orderByDesc(TaihuTalentArticleComment::getCreateTime));
|
||||||
|
for (TaihuTalentArticleComment comment : comments) {
|
||||||
|
List<TaihuTalentArticleComment> childrenList = taihuTalentArticleCommentService.list(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,article.getId())
|
||||||
|
.eq(TaihuTalentArticleComment::getPid,comment.getId())
|
||||||
|
.orderByAsc(TaihuTalentArticleComment::getCreateTime));
|
||||||
|
for (TaihuTalentArticleComment cc : childrenList) {
|
||||||
|
cc.setUser(userService.getById(cc.getUserId()));
|
||||||
|
}
|
||||||
|
comment.setChildren(childrenList);
|
||||||
|
comment.setUser(userService.getById(comment.getUserId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
return R.ok().put("page",page);
|
return R.ok().put("page",page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//当前用户是否能新增文章
|
||||||
|
@RequestMapping("/getArticleRoleByUser")
|
||||||
|
public R getArticleRoleByUser(){
|
||||||
|
return R.ok().put("roleFlag", taihuTalentService.count(new LambdaQueryWrapper<TaihuTalent>()
|
||||||
|
.eq(TaihuTalent::getUserId,ShiroUtils.getUId())));
|
||||||
|
}
|
||||||
|
|
||||||
//新增文章
|
//新增文章
|
||||||
@RequestMapping("/addArticle")
|
@RequestMapping("/addArticle")
|
||||||
public R addArticle(@RequestBody TaihuTalentArticle taihuTalentArticle){
|
public R addArticle(@RequestBody TaihuTalentArticle taihuTalentArticle){
|
||||||
taihuTalentArticle.setUserId(ShiroUtils.getUId());
|
LambdaQueryWrapper<SysSensitiveWords> wrapper = new LambdaQueryWrapper<>();
|
||||||
taihuTalentArticleService.save(taihuTalentArticle);
|
wrapper.last(" where instr(\""+taihuTalentArticle.getTitle()+"\",word)>0");
|
||||||
|
List<SysSensitiveWords> list = sysSensitiveWordsService.list(wrapper);
|
||||||
|
if (list.size() > 0){
|
||||||
|
String str = "";
|
||||||
|
for (SysSensitiveWords words:list) {
|
||||||
|
if ("".equals(str)){
|
||||||
|
str = words.getWord();
|
||||||
|
}else {
|
||||||
|
str = str + "、" + words.getWord();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.error("您的标题含有敏感词:"+str+",请重新输入。");
|
||||||
|
}else {
|
||||||
|
LambdaQueryWrapper<SysSensitiveWords> cwrapper = new LambdaQueryWrapper<>();
|
||||||
|
cwrapper.last(" where instr(\""+taihuTalentArticle.getContent()+"\",word)>0");
|
||||||
|
List<SysSensitiveWords> clist = sysSensitiveWordsService.list(cwrapper);
|
||||||
|
if (clist.size() > 0){
|
||||||
|
String str = "";
|
||||||
|
for (SysSensitiveWords words:clist) {
|
||||||
|
if ("".equals(str)){
|
||||||
|
str = words.getWord();
|
||||||
|
}else {
|
||||||
|
str = str + "、" + words.getWord();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.error("您的内容含有敏感词:"+str+",请重新输入。");
|
||||||
|
}else {
|
||||||
|
taihuTalentArticle.setUserId(ShiroUtils.getUId());
|
||||||
|
taihuTalentArticleService.save(taihuTalentArticle);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除文章
|
||||||
|
@RequestMapping("/delArticle")
|
||||||
|
@Transactional
|
||||||
|
public R delArticle(@RequestBody TaihuTalentArticle taihuTalentArticle){
|
||||||
|
taihuTalentArticle = taihuTalentArticleService.getById(taihuTalentArticle.getId());
|
||||||
|
if (taihuTalentArticle.getCome()==1){
|
||||||
|
medicalRecordsService.update(new LambdaUpdateWrapper<MedicalRecords>()
|
||||||
|
.eq(MedicalRecords::getUserId,taihuTalentArticle.getUserId())
|
||||||
|
.eq(MedicalRecords::getTitle,taihuTalentArticle.getTitle())
|
||||||
|
.set(MedicalRecords::getArticleFlag,0));
|
||||||
|
}
|
||||||
|
taihuTalentArticleCommentService.remove(new LambdaQueryWrapper<TaihuTalentArticleComment>()
|
||||||
|
.eq(TaihuTalentArticleComment::getArticleId,taihuTalentArticle.getId()));
|
||||||
|
taihuTalentArticleLikeService.remove(new LambdaQueryWrapper<TaihuTalentArticleLike>()
|
||||||
|
.eq(TaihuTalentArticleLike::getArticleId,taihuTalentArticle.getId()));
|
||||||
|
taihuTalentArticleService.removeById(taihuTalentArticle);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,15 +31,15 @@ public class TaihuTalentController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsService medicalRecordsService;
|
private MedicalRecordsService medicalRecordsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordsLabelService medicalRecordsLabelService;
|
private DeptLabelService deptLabelService;
|
||||||
|
|
||||||
//太湖英才列表
|
//太湖英才列表
|
||||||
@RequestMapping("/getTaihuTalents")
|
@RequestMapping("/getTaihuTalents")
|
||||||
public R getTaihuTalents(@RequestBody Map<String,Object> params){
|
public R getTaihuTalents(@RequestBody Map<String,Object> params){
|
||||||
MPJLambdaWrapper<TaihuTalent> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<TaihuTalent> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.leftJoin(MedicalRecordsLabel.class,MedicalRecordsLabel::getId,TaihuTalent::getDeptLabelId);
|
wrapper.leftJoin(DeptLabel.class, DeptLabel::getId,TaihuTalent::getDeptLabelId);
|
||||||
wrapper.selectAll(TaihuTalent.class);
|
wrapper.selectAll(TaihuTalent.class);
|
||||||
wrapper.selectAs(MedicalRecordsLabel::getTitle,TaihuTalent::getDepartment);
|
wrapper.selectAs(DeptLabel::getTitle,TaihuTalent::getDepartment);
|
||||||
wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name"));
|
wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name"));
|
||||||
wrapper.eq(StringUtils.isNotEmpty(params.get("deptLabelId").toString()),TaihuTalent::getDeptLabelId,params.get("deptLabelId"));
|
wrapper.eq(StringUtils.isNotEmpty(params.get("deptLabelId").toString()),TaihuTalent::getDeptLabelId,params.get("deptLabelId"));
|
||||||
wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region"));
|
wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region"));
|
||||||
@@ -68,7 +68,7 @@ public class TaihuTalentController {
|
|||||||
@RequestMapping("/taihuTalentInfo")
|
@RequestMapping("/taihuTalentInfo")
|
||||||
public R taihuTalentInfo(@RequestBody Map<String,Object> params){
|
public R taihuTalentInfo(@RequestBody Map<String,Object> params){
|
||||||
TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString());
|
TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString());
|
||||||
taihuTalent.setDepartment(medicalRecordsLabelService.getById(taihuTalent.getDeptLabelId()).getTitle());
|
taihuTalent.setDepartment(deptLabelService.getById(taihuTalent.getDeptLabelId()).getTitle());
|
||||||
List<UserCertificateLabel> labels = userCertificateLabelService.list(new LambdaQueryWrapper<UserCertificateLabel>()
|
List<UserCertificateLabel> labels = userCertificateLabelService.list(new LambdaQueryWrapper<UserCertificateLabel>()
|
||||||
.eq(UserCertificateLabel::getPid,0));
|
.eq(UserCertificateLabel::getPid,0));
|
||||||
List<UserCertificateLabel> filterLabels = new ArrayList<>();
|
List<UserCertificateLabel> filterLabels = new ArrayList<>();
|
||||||
@@ -115,7 +115,7 @@ public class TaihuTalentController {
|
|||||||
List<CourseEntity> courseList = courseService.list(wrapper);
|
List<CourseEntity> courseList = courseService.list(wrapper);
|
||||||
//精彩医案
|
//精彩医案
|
||||||
List<MedicalRecords> medicalRecords = medicalRecordsService.list(new LambdaQueryWrapper<MedicalRecords>()
|
List<MedicalRecords> medicalRecords = medicalRecordsService.list(new LambdaQueryWrapper<MedicalRecords>()
|
||||||
.eq(MedicalRecords::getState,3)
|
.ge(MedicalRecords::getState,5)
|
||||||
.eq(MedicalRecords::getShowFlag,1)
|
.eq(MedicalRecords::getShowFlag,1)
|
||||||
.eq(MedicalRecords::getUserId,taihuTalent.getUserId())
|
.eq(MedicalRecords::getUserId,taihuTalent.getUserId())
|
||||||
.orderByDesc(MedicalRecords::getTrain));
|
.orderByDesc(MedicalRecords::getTrain));
|
||||||
|
|||||||
Reference in New Issue
Block a user