修改了医院处理的问题
This commit is contained in:
parent
b9bf589000
commit
5cc3a7043c
@ -0,0 +1,67 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.controller;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleAddForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo.UserCommentClinicalArticleVO;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.service.UserCommentClinicalArticleService;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import net.lab1024.sa.base.common.domain.ValidateList;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 Controller
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Tag(name = "用户评论-临床病例-文章")
|
||||
public class UserCommentClinicalArticleController {
|
||||
|
||||
@Resource
|
||||
private UserCommentClinicalArticleService userCommentClinicalArticleService;
|
||||
|
||||
@Operation(summary = "分页查询 @author xing")
|
||||
@PostMapping("/userCommentClinicalArticle/queryPage")
|
||||
@SaCheckPermission("userCommentClinicalArticle:query")
|
||||
public ResponseDTO<PageResult<UserCommentClinicalArticleVO>> queryPage(@RequestBody @Valid UserCommentClinicalArticleQueryForm queryForm) {
|
||||
return ResponseDTO.ok(userCommentClinicalArticleService.queryPage(queryForm));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加 @author xing")
|
||||
@PostMapping("/userCommentClinicalArticle/add")
|
||||
@SaCheckPermission("userCommentClinicalArticle:add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid UserCommentClinicalArticleAddForm addForm) {
|
||||
return userCommentClinicalArticleService.add(addForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新 @author xing")
|
||||
@PostMapping("/userCommentClinicalArticle/update")
|
||||
@SaCheckPermission("userCommentClinicalArticle:update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid UserCommentClinicalArticleUpdateForm updateForm) {
|
||||
return userCommentClinicalArticleService.update(updateForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除 @author xing")
|
||||
@PostMapping("/userCommentClinicalArticle/batchDelete")
|
||||
@SaCheckPermission("userCommentClinicalArticle:delete")
|
||||
public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
|
||||
return userCommentClinicalArticleService.batchDelete(idList);
|
||||
}
|
||||
|
||||
@Operation(summary = "单个删除 @author xing")
|
||||
@GetMapping("/userCommentClinicalArticle/delete/{commentId}")
|
||||
@SaCheckPermission("userCommentClinicalArticle:delete")
|
||||
public ResponseDTO<String> batchDelete(@PathVariable Long commentId) {
|
||||
return userCommentClinicalArticleService.delete(commentId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.UserCommentClinicalArticleEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo.UserCommentClinicalArticleVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 Dao
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface UserCommentClinicalArticleDao extends BaseMapper<UserCommentClinicalArticleEntity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<UserCommentClinicalArticleVO> queryPage(Page page, @Param("queryForm") UserCommentClinicalArticleQueryForm queryForm);
|
||||
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 实体类
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("user_comment_clinical_article")
|
||||
public class UserCommentClinicalArticleEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long commentId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 临床文章id
|
||||
*/
|
||||
private Long articleId;
|
||||
|
||||
/**
|
||||
* 父级id,一级评论为null
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 根评论id,一级评论时为null。其余为一级评论id
|
||||
*/
|
||||
private Long rootId;
|
||||
|
||||
/**
|
||||
* 评论状态(0:禁用 1:正常)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否存在敏感词(0:否 1:是)
|
||||
*/
|
||||
private Integer isSensitive;
|
||||
|
||||
/**
|
||||
* 是否置顶(0:否 1:是)
|
||||
*/
|
||||
private Integer isTop;
|
||||
|
||||
/**
|
||||
* 点赞数量
|
||||
*/
|
||||
private Integer likeNum;
|
||||
|
||||
/**
|
||||
* 是否作者评论(0:否 1:是)
|
||||
*/
|
||||
private Integer isAuthor;
|
||||
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 评论内容(原版)
|
||||
*/
|
||||
private String contentWord;
|
||||
|
||||
/**
|
||||
* 评论图片
|
||||
*/
|
||||
private String commentImage;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 新建表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentClinicalArticleAddForm {
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form;
|
||||
|
||||
import net.lab1024.sa.base.common.domain.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 分页查询表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class UserCommentClinicalArticleQueryForm extends PageParam {
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String keywords;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 更新表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentClinicalArticleUpdateForm {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "主键id 不能为空")
|
||||
private Long commentId;
|
||||
|
||||
@Schema(description = "评论状态(0:禁用 1:正常)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "评论内容")
|
||||
private String content;
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 列表VO
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentClinicalArticleVO {
|
||||
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long commentId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "临床文章id")
|
||||
private Long articleId;
|
||||
|
||||
@Schema(description = "父级id,一级评论为null")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "根评论id,一级评论时为null。其余为一级评论id")
|
||||
private Long rootId;
|
||||
|
||||
@Schema(description = "评论状态(0:禁用 1:正常)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否存在敏感词(0:否 1:是)")
|
||||
private Integer isSensitive;
|
||||
|
||||
@Schema(description = "是否置顶(0:否 1:是)")
|
||||
private Integer isTop;
|
||||
|
||||
@Schema(description = "点赞数量")
|
||||
private Integer likeNum;
|
||||
|
||||
@Schema(description = "是否作者评论(0:否 1:是)")
|
||||
private Integer isAuthor;
|
||||
|
||||
@Schema(description = "评论内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评论内容(原版)")
|
||||
private String contentWord;
|
||||
|
||||
@Schema(description = "评论图片")
|
||||
private String commentImage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.manager;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.dao.UserCommentClinicalArticleDao;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.UserCommentClinicalArticleEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 Manager
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
@Service
|
||||
public class UserCommentClinicalArticleManager extends ServiceImpl<UserCommentClinicalArticleDao, UserCommentClinicalArticleEntity> {
|
||||
|
||||
|
||||
}
|
||||
@ -23,9 +23,8 @@ import net.lab1024.sa.admin.util.Replace;
|
||||
import net.lab1024.sa.base.common.exception.BusinessException;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticleAuthor.dao.CaseClinicalArticleAuthorDao;
|
||||
@ -696,6 +695,7 @@ public class CaseClinicalArticleService {
|
||||
}
|
||||
|
||||
// 删除
|
||||
Set<String> deleteHospitalSet = new LinkedHashSet<>();
|
||||
for (CaseClinicalArticleAuthorEntity author : deleteList){
|
||||
// 获取医生数据
|
||||
LambdaQueryWrapper<CaseClinicalDoctorEntity> doctorQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@ -714,8 +714,8 @@ public class CaseClinicalArticleService {
|
||||
// 减少作者统计
|
||||
caseClinicalService.DecStatsCaseClinicalDoctor(String.valueOf(caseClinicalDoctor.getDoctorId()),1);
|
||||
|
||||
// 减少医院统计
|
||||
caseClinicalService.DecStatsCaseClinicalHospital(String.valueOf(caseClinicalDoctor.getHospitalId()),1,1);
|
||||
// 增加需要减少的医院数据
|
||||
deleteHospitalSet.add(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
||||
|
||||
// 删除该作者
|
||||
caseClinicalArticleAuthorDao.deleteById(author.getAuthorId());
|
||||
@ -728,7 +728,15 @@ public class CaseClinicalArticleService {
|
||||
caseClinicalDoctorCertDao.delete(certWrapper);
|
||||
}
|
||||
|
||||
if (!deleteHospitalSet.isEmpty()){
|
||||
// 减少医院统计
|
||||
for (String hospitalId : deleteHospitalSet ){
|
||||
caseClinicalService.DecStatsCaseClinicalHospital(hospitalId,1,1);
|
||||
}
|
||||
}
|
||||
|
||||
// 新增新的作者
|
||||
Set<String> addHospitalSet = new LinkedHashSet<>();
|
||||
for (CaseClinicalArticleAuthorForm author : addList){
|
||||
CaseClinicalDoctorEntity caseClinicalDoctor = caseClinicalDoctorDao.selectById(author.getDoctorId());
|
||||
|
||||
@ -742,9 +750,8 @@ public class CaseClinicalArticleService {
|
||||
// 新增作者统计
|
||||
caseClinicalService.IncStatsCaseClinicalDoctor(String.valueOf(caseClinicalDoctor.getDoctorId()),1,lastPushDate);
|
||||
|
||||
// 新增医院统计
|
||||
caseClinicalService.IncStatsCaseClinicalHospital(String.valueOf(caseClinicalDoctor.getHospitalId()),1,
|
||||
lastPushDate,1);
|
||||
// 增加需要增加的医院数据
|
||||
addHospitalSet.add(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
||||
|
||||
// 生成用户证书-文章/视频
|
||||
if (qrCodeBytes == null || qrCodeBytes.length == 0) {
|
||||
@ -790,6 +797,16 @@ public class CaseClinicalArticleService {
|
||||
avatarByte
|
||||
);
|
||||
}
|
||||
|
||||
if (!addHospitalSet.isEmpty()){
|
||||
// 增加医院统计
|
||||
for (String hospitalId : addHospitalSet ){
|
||||
LocalDateTime lastPushDate = caseClinicalArticleDao.selectLastArticlePushDateByHospitalId(Long.valueOf(hospitalId));
|
||||
|
||||
caseClinicalService.IncStatsCaseClinicalHospital(hospitalId,1,
|
||||
lastPushDate,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理文章标签
|
||||
|
||||
@ -0,0 +1,86 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalArticle.service;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.dao.UserCommentClinicalArticleDao;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.UserCommentClinicalArticleEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleAddForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo.UserCommentClinicalArticleVO;
|
||||
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-文章 Service
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:11:31
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class UserCommentClinicalArticleService {
|
||||
|
||||
@Resource
|
||||
private UserCommentClinicalArticleDao userCommentClinicalArticleDao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
public PageResult<UserCommentClinicalArticleVO> queryPage(UserCommentClinicalArticleQueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
List<UserCommentClinicalArticleVO> list = userCommentClinicalArticleDao.queryPage(page, queryForm);
|
||||
return SmartPageUtil.convert2PageResult(page, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public ResponseDTO<String> add(UserCommentClinicalArticleAddForm addForm) {
|
||||
UserCommentClinicalArticleEntity userCommentClinicalArticleEntity = SmartBeanUtil.copy(addForm, UserCommentClinicalArticleEntity.class);
|
||||
userCommentClinicalArticleDao.insert(userCommentClinicalArticleEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
*/
|
||||
public ResponseDTO<String> update(UserCommentClinicalArticleUpdateForm updateForm) {
|
||||
UserCommentClinicalArticleEntity userCommentClinicalArticleEntity = SmartBeanUtil.copy(updateForm, UserCommentClinicalArticleEntity.class);
|
||||
userCommentClinicalArticleDao.updateById(userCommentClinicalArticleEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
public ResponseDTO<String> batchDelete(List<Long> idList) {
|
||||
if (CollectionUtils.isEmpty(idList)){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
userCommentClinicalArticleDao.deleteBatchIds(idList);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个删除
|
||||
*/
|
||||
public ResponseDTO<String> delete(Long commentId) {
|
||||
if (null == commentId){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
userCommentClinicalArticleDao.deleteById(commentId);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.controller;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoAddForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo.UserCommentClinicalVideoVO;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.service.UserCommentClinicalVideoService;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import net.lab1024.sa.base.common.domain.ValidateList;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 Controller
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Tag(name = "用户评论-临床病例-视频")
|
||||
public class UserCommentClinicalVideoController {
|
||||
|
||||
@Resource
|
||||
private UserCommentClinicalVideoService userCommentClinicalVideoService;
|
||||
|
||||
@Operation(summary = "分页查询 @author xing")
|
||||
@PostMapping("/userCommentClinicalVideo/queryPage")
|
||||
@SaCheckPermission("userCommentClinicalVideo:query")
|
||||
public ResponseDTO<PageResult<UserCommentClinicalVideoVO>> queryPage(@RequestBody @Valid UserCommentClinicalVideoQueryForm queryForm) {
|
||||
return ResponseDTO.ok(userCommentClinicalVideoService.queryPage(queryForm));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加 @author xing")
|
||||
@PostMapping("/userCommentClinicalVideo/add")
|
||||
@SaCheckPermission("userCommentClinicalVideo:add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid UserCommentClinicalVideoAddForm addForm) {
|
||||
return userCommentClinicalVideoService.add(addForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新 @author xing")
|
||||
@PostMapping("/userCommentClinicalVideo/update")
|
||||
@SaCheckPermission("userCommentClinicalVideo:update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid UserCommentClinicalVideoUpdateForm updateForm) {
|
||||
return userCommentClinicalVideoService.update(updateForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除 @author xing")
|
||||
@PostMapping("/userCommentClinicalVideo/batchDelete")
|
||||
@SaCheckPermission("userCommentClinicalVideo:delete")
|
||||
public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
|
||||
return userCommentClinicalVideoService.batchDelete(idList);
|
||||
}
|
||||
|
||||
@Operation(summary = "单个删除 @author xing")
|
||||
@GetMapping("/userCommentClinicalVideo/delete/{commentId}")
|
||||
@SaCheckPermission("userCommentClinicalVideo:delete")
|
||||
public ResponseDTO<String> batchDelete(@PathVariable Long commentId) {
|
||||
return userCommentClinicalVideoService.delete(commentId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.entity.UserCommentClinicalVideoEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo.UserCommentClinicalVideoVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 Dao
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface UserCommentClinicalVideoDao extends BaseMapper<UserCommentClinicalVideoEntity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<UserCommentClinicalVideoVO> queryPage(Page page, @Param("queryForm") UserCommentClinicalVideoQueryForm queryForm);
|
||||
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 实体类
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("user_comment_clinical_video")
|
||||
public class UserCommentClinicalVideoEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long commentId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 临床视频id
|
||||
*/
|
||||
private Long videoId;
|
||||
|
||||
/**
|
||||
* 父级id,一级评论为null
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 根评论id,一级评论时为null。其余为一级评论id
|
||||
*/
|
||||
private Long rootId;
|
||||
|
||||
/**
|
||||
* 评论状态(0:禁用 1:正常)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否存在敏感词(0:否 1:是)
|
||||
*/
|
||||
private Integer isSensitive;
|
||||
|
||||
/**
|
||||
* 是否置顶(0:否 1:是)
|
||||
*/
|
||||
private Integer isTop;
|
||||
|
||||
/**
|
||||
* 点赞数量
|
||||
*/
|
||||
private Integer likeNum;
|
||||
|
||||
/**
|
||||
* 是否作者评论(0:否 1:是)
|
||||
*/
|
||||
private Integer isAuthor;
|
||||
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 评论内容(原版)
|
||||
*/
|
||||
private String contentWord;
|
||||
|
||||
/**
|
||||
* 评论图片
|
||||
*/
|
||||
private String commentImage;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 新建表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentClinicalVideoAddForm {
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form;
|
||||
|
||||
import net.lab1024.sa.base.common.domain.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 分页查询表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class UserCommentClinicalVideoQueryForm extends PageParam {
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String keywords;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 更新表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentClinicalVideoUpdateForm {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "主键id 不能为空")
|
||||
private Long commentId;
|
||||
|
||||
@Schema(description = "评论状态(0:禁用 1:正常)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "评论内容")
|
||||
private String content;
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 列表VO
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentClinicalVideoVO {
|
||||
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long commentId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "临床视频id")
|
||||
private Long videoId;
|
||||
|
||||
@Schema(description = "父级id,一级评论为null")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "根评论id,一级评论时为null。其余为一级评论id")
|
||||
private Long rootId;
|
||||
|
||||
@Schema(description = "评论状态(0:禁用 1:正常)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否存在敏感词(0:否 1:是)")
|
||||
private Integer isSensitive;
|
||||
|
||||
@Schema(description = "是否置顶(0:否 1:是)")
|
||||
private Integer isTop;
|
||||
|
||||
@Schema(description = "点赞数量")
|
||||
private Integer likeNum;
|
||||
|
||||
@Schema(description = "是否作者评论(0:否 1:是)")
|
||||
private Integer isAuthor;
|
||||
|
||||
@Schema(description = "评论内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评论内容(原版)")
|
||||
private String contentWord;
|
||||
|
||||
@Schema(description = "评论图片")
|
||||
private String commentImage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.manager;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.dao.UserCommentClinicalVideoDao;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.entity.UserCommentClinicalVideoEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 Manager
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
@Service
|
||||
public class UserCommentClinicalVideoManager extends ServiceImpl<UserCommentClinicalVideoDao, UserCommentClinicalVideoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@ -23,9 +23,8 @@ import net.lab1024.sa.admin.util.Replace;
|
||||
import net.lab1024.sa.base.common.exception.BusinessException;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.dao.CaseClinicalVideoAuthorDao;
|
||||
@ -609,6 +608,7 @@ public class CaseClinicalVideoService {
|
||||
}
|
||||
|
||||
// 删除
|
||||
Set<String> deleteHospitalSet = new LinkedHashSet<>();
|
||||
for (CaseClinicalVideoAuthorEntity author : deleteList){
|
||||
// 获取医生数据
|
||||
LambdaQueryWrapper<CaseClinicalDoctorEntity> doctorQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@ -627,8 +627,8 @@ public class CaseClinicalVideoService {
|
||||
// 减少作者统计
|
||||
caseClinicalService.DecStatsCaseClinicalDoctor(String.valueOf(caseClinicalDoctor.getDoctorId()),2);
|
||||
|
||||
// 减少医院统计
|
||||
caseClinicalService.DecStatsCaseClinicalHospital(String.valueOf(caseClinicalDoctor.getHospitalId()),2,1);
|
||||
// 增加需要减少的医院数据
|
||||
deleteHospitalSet.add(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
||||
|
||||
// 删除该作者
|
||||
caseClinicalVideoAuthorDao.deleteById(author.getAuthorId());
|
||||
@ -641,7 +641,15 @@ public class CaseClinicalVideoService {
|
||||
caseClinicalDoctorCertDao.delete(certWrapper);
|
||||
}
|
||||
|
||||
if (!deleteHospitalSet.isEmpty()){
|
||||
// 减少医院统计
|
||||
for (String hospitalId : deleteHospitalSet ){
|
||||
caseClinicalService.DecStatsCaseClinicalHospital(hospitalId,2,1);
|
||||
}
|
||||
}
|
||||
|
||||
// 新增新的作者
|
||||
Set<String> addHospitalSet = new LinkedHashSet<>();
|
||||
for (CaseClinicalVideoAuthorForm author : addList){
|
||||
CaseClinicalDoctorEntity caseClinicalDoctor = caseClinicalDoctorDao.selectById(author.getDoctorId());
|
||||
|
||||
@ -655,9 +663,8 @@ public class CaseClinicalVideoService {
|
||||
// 新增作者统计
|
||||
caseClinicalService.IncStatsCaseClinicalDoctor(String.valueOf(caseClinicalDoctor.getDoctorId()),2,lastPushDate);
|
||||
|
||||
// 新增医院统计
|
||||
caseClinicalService.IncStatsCaseClinicalHospital(String.valueOf(caseClinicalDoctor.getHospitalId()),2,
|
||||
lastPushDate,1);
|
||||
// 增加需要增加的医院数据
|
||||
addHospitalSet.add(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
||||
|
||||
// 生成用户证书-文章/视频
|
||||
if (qrCodeBytes == null || qrCodeBytes.length == 0) {
|
||||
@ -703,6 +710,17 @@ public class CaseClinicalVideoService {
|
||||
avatarByte
|
||||
);
|
||||
}
|
||||
|
||||
if (!addHospitalSet.isEmpty()){
|
||||
// 增加医院统计
|
||||
for (String hospitalId : addHospitalSet ){
|
||||
LocalDateTime lastPushDate = caseClinicalVideoDao.selectLastVideoPushDateByHospitalId(Long.valueOf(hospitalId));
|
||||
|
||||
// 新增医院统计
|
||||
caseClinicalService.IncStatsCaseClinicalHospital(hospitalId,2,
|
||||
lastPushDate,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,86 @@
|
||||
package net.lab1024.sa.admin.module.business.caseClinicalVideo.service;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.dao.UserCommentClinicalVideoDao;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.entity.UserCommentClinicalVideoEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoAddForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo.UserCommentClinicalVideoVO;
|
||||
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户评论-临床病例-视频 Service
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:12:42
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class UserCommentClinicalVideoService {
|
||||
|
||||
@Resource
|
||||
private UserCommentClinicalVideoDao userCommentClinicalVideoDao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
public PageResult<UserCommentClinicalVideoVO> queryPage(UserCommentClinicalVideoQueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
List<UserCommentClinicalVideoVO> list = userCommentClinicalVideoDao.queryPage(page, queryForm);
|
||||
return SmartPageUtil.convert2PageResult(page, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public ResponseDTO<String> add(UserCommentClinicalVideoAddForm addForm) {
|
||||
UserCommentClinicalVideoEntity userCommentClinicalVideoEntity = SmartBeanUtil.copy(addForm, UserCommentClinicalVideoEntity.class);
|
||||
userCommentClinicalVideoDao.insert(userCommentClinicalVideoEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
*/
|
||||
public ResponseDTO<String> update(UserCommentClinicalVideoUpdateForm updateForm) {
|
||||
UserCommentClinicalVideoEntity userCommentClinicalVideoEntity = SmartBeanUtil.copy(updateForm, UserCommentClinicalVideoEntity.class);
|
||||
userCommentClinicalVideoDao.updateById(userCommentClinicalVideoEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
public ResponseDTO<String> batchDelete(List<Long> idList) {
|
||||
if (CollectionUtils.isEmpty(idList)){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
userCommentClinicalVideoDao.deleteBatchIds(idList);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个删除
|
||||
*/
|
||||
public ResponseDTO<String> delete(Long commentId) {
|
||||
if (null == commentId){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
userCommentClinicalVideoDao.deleteById(commentId);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.controller;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeAddForm;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.UserCommentExchangeVO;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.service.UserCommentExchangeService;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import net.lab1024.sa.base.common.domain.ValidateList;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 Controller
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Tag(name = "用户评论-病例交流")
|
||||
public class UserCommentExchangeController {
|
||||
|
||||
@Resource
|
||||
private UserCommentExchangeService userCommentExchangeService;
|
||||
|
||||
@Operation(summary = "分页查询 @author xing")
|
||||
@PostMapping("/userCommentExchange/queryPage")
|
||||
@SaCheckPermission("userCommentExchange:query")
|
||||
public ResponseDTO<PageResult<UserCommentExchangeVO>> queryPage(@RequestBody @Valid UserCommentExchangeQueryForm queryForm) {
|
||||
return ResponseDTO.ok(userCommentExchangeService.queryPage(queryForm));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加 @author xing")
|
||||
@PostMapping("/userCommentExchange/add")
|
||||
@SaCheckPermission("userCommentExchange:add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid UserCommentExchangeAddForm addForm) {
|
||||
return userCommentExchangeService.add(addForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新 @author xing")
|
||||
@PostMapping("/userCommentExchange/update")
|
||||
@SaCheckPermission("userCommentExchange:update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid UserCommentExchangeUpdateForm updateForm) {
|
||||
return userCommentExchangeService.update(updateForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除 @author xing")
|
||||
@PostMapping("/userCommentExchange/batchDelete")
|
||||
@SaCheckPermission("userCommentExchange:delete")
|
||||
public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
|
||||
return userCommentExchangeService.batchDelete(idList);
|
||||
}
|
||||
|
||||
@Operation(summary = "单个删除 @author xing")
|
||||
@GetMapping("/userCommentExchange/delete/{commentId}")
|
||||
@SaCheckPermission("userCommentExchange:delete")
|
||||
public ResponseDTO<String> batchDelete(@PathVariable Long commentId) {
|
||||
return userCommentExchangeService.delete(commentId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.entity.UserCommentExchangeEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.UserCommentExchangeVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 Dao
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface UserCommentExchangeDao extends BaseMapper<UserCommentExchangeEntity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<UserCommentExchangeVO> queryPage(Page page, @Param("queryForm") UserCommentExchangeQueryForm queryForm);
|
||||
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 实体类
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("user_comment_exchange")
|
||||
public class UserCommentExchangeEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long commentId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 病例交流id
|
||||
*/
|
||||
private Long exchangeId;
|
||||
|
||||
/**
|
||||
* 父级id,一级评论为null
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 根评论id,一级评论时为null。其余为一级评论id
|
||||
*/
|
||||
private Long rootId;
|
||||
|
||||
/**
|
||||
* 评论状态(0:禁用 1:正常)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否存在敏感词(0:否 1:是)
|
||||
*/
|
||||
private Integer isSensitive;
|
||||
|
||||
/**
|
||||
* 是否置顶(0:否 1:是)
|
||||
*/
|
||||
private Integer isTop;
|
||||
|
||||
/**
|
||||
* 点赞数量
|
||||
*/
|
||||
private Integer likeNum;
|
||||
|
||||
/**
|
||||
* 是否作者评论(0:否 1:是)
|
||||
*/
|
||||
private Integer isAuthor;
|
||||
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 评论内容(原版)
|
||||
*/
|
||||
private String contentWord;
|
||||
|
||||
/**
|
||||
* 评论图片
|
||||
*/
|
||||
private String commentImage;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.domain.form;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 新建表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentExchangeAddForm {
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.domain.form;
|
||||
|
||||
import net.lab1024.sa.base.common.domain.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 分页查询表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class UserCommentExchangeQueryForm extends PageParam {
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String keywords;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.domain.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 更新表单
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentExchangeUpdateForm {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "主键id 不能为空")
|
||||
private Long commentId;
|
||||
|
||||
@Schema(description = "评论状态(0:禁用 1:正常)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "评论内容")
|
||||
private String content;
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 列表VO
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserCommentExchangeVO {
|
||||
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long commentId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "病例交流id")
|
||||
private Long exchangeId;
|
||||
|
||||
@Schema(description = "父级id,一级评论为null")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "根评论id,一级评论时为null。其余为一级评论id")
|
||||
private Long rootId;
|
||||
|
||||
@Schema(description = "评论状态(0:禁用 1:正常)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否存在敏感词(0:否 1:是)")
|
||||
private Integer isSensitive;
|
||||
|
||||
@Schema(description = "是否置顶(0:否 1:是)")
|
||||
private Integer isTop;
|
||||
|
||||
@Schema(description = "点赞数量")
|
||||
private Integer likeNum;
|
||||
|
||||
@Schema(description = "是否作者评论(0:否 1:是)")
|
||||
private Integer isAuthor;
|
||||
|
||||
@Schema(description = "评论内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评论内容(原版)")
|
||||
private String contentWord;
|
||||
|
||||
@Schema(description = "评论图片")
|
||||
private String commentImage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.manager;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.dao.UserCommentExchangeDao;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.entity.UserCommentExchangeEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 Manager
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
@Service
|
||||
public class UserCommentExchangeManager extends ServiceImpl<UserCommentExchangeDao, UserCommentExchangeEntity> {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package net.lab1024.sa.admin.module.business.caseExchange.service;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.dao.UserCommentExchangeDao;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.entity.UserCommentExchangeEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeAddForm;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.UserCommentExchangeVO;
|
||||
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户评论-病例交流 Service
|
||||
*
|
||||
* @Author xing
|
||||
* @Date 2025-08-12 09:13:30
|
||||
* @Copyright gdxz
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class UserCommentExchangeService {
|
||||
|
||||
@Resource
|
||||
private UserCommentExchangeDao userCommentExchangeDao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
public PageResult<UserCommentExchangeVO> queryPage(UserCommentExchangeQueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
List<UserCommentExchangeVO> list = userCommentExchangeDao.queryPage(page, queryForm);
|
||||
return SmartPageUtil.convert2PageResult(page, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public ResponseDTO<String> add(UserCommentExchangeAddForm addForm) {
|
||||
UserCommentExchangeEntity userCommentExchangeEntity = SmartBeanUtil.copy(addForm, UserCommentExchangeEntity.class);
|
||||
userCommentExchangeDao.insert(userCommentExchangeEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
*/
|
||||
public ResponseDTO<String> update(UserCommentExchangeUpdateForm updateForm) {
|
||||
UserCommentExchangeEntity userCommentExchangeEntity = SmartBeanUtil.copy(updateForm, UserCommentExchangeEntity.class);
|
||||
userCommentExchangeDao.updateById(userCommentExchangeEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
public ResponseDTO<String> batchDelete(List<Long> idList) {
|
||||
if (CollectionUtils.isEmpty(idList)){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
userCommentExchangeDao.deleteBatchIds(idList);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个删除
|
||||
*/
|
||||
public ResponseDTO<String> delete(Long commentId) {
|
||||
if (null == commentId){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
userCommentExchangeDao.deleteById(commentId);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.admin.module.business.caseClinicalArticle.dao.UserCommentClinicalArticleDao">
|
||||
|
||||
<!-- 查询结果列 -->
|
||||
<sql id="base_columns">
|
||||
user_comment_clinical_article.comment_id,
|
||||
user_comment_clinical_article.user_id,
|
||||
user_comment_clinical_article.article_id,
|
||||
user_comment_clinical_article.parent_id,
|
||||
user_comment_clinical_article.root_id,
|
||||
user_comment_clinical_article.status,
|
||||
user_comment_clinical_article.is_sensitive,
|
||||
user_comment_clinical_article.is_top,
|
||||
user_comment_clinical_article.like_num,
|
||||
user_comment_clinical_article.is_author,
|
||||
user_comment_clinical_article.content,
|
||||
user_comment_clinical_article.content_word,
|
||||
user_comment_clinical_article.comment_image,
|
||||
user_comment_clinical_article.created_at,
|
||||
user_comment_clinical_article.updated_at
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo.UserCommentClinicalArticleVO">
|
||||
SELECT
|
||||
<include refid="base_columns"/>
|
||||
FROM user_comment_clinical_article
|
||||
<where>
|
||||
<!--内容-->
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND INSTR(user_comment_clinical_article.content,#{queryForm.keywords})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.admin.module.business.caseClinicalVideo.dao.UserCommentClinicalVideoDao">
|
||||
|
||||
<!-- 查询结果列 -->
|
||||
<sql id="base_columns">
|
||||
user_comment_clinical_video.comment_id,
|
||||
user_comment_clinical_video.user_id,
|
||||
user_comment_clinical_video.video_id,
|
||||
user_comment_clinical_video.parent_id,
|
||||
user_comment_clinical_video.root_id,
|
||||
user_comment_clinical_video.status,
|
||||
user_comment_clinical_video.is_sensitive,
|
||||
user_comment_clinical_video.is_top,
|
||||
user_comment_clinical_video.like_num,
|
||||
user_comment_clinical_video.is_author,
|
||||
user_comment_clinical_video.content,
|
||||
user_comment_clinical_video.content_word,
|
||||
user_comment_clinical_video.comment_image,
|
||||
user_comment_clinical_video.created_at,
|
||||
user_comment_clinical_video.updated_at
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.vo.UserCommentClinicalVideoVO">
|
||||
SELECT
|
||||
<include refid="base_columns"/>
|
||||
FROM user_comment_clinical_video
|
||||
<where>
|
||||
<!--内容-->
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND INSTR(user_comment_clinical_video.content,#{queryForm.keywords})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.admin.module.business.caseExchange.dao.UserCommentExchangeDao">
|
||||
|
||||
<!-- 查询结果列 -->
|
||||
<sql id="base_columns">
|
||||
user_comment_exchange.comment_id,
|
||||
user_comment_exchange.user_id,
|
||||
user_comment_exchange.exchange_id,
|
||||
user_comment_exchange.parent_id,
|
||||
user_comment_exchange.root_id,
|
||||
user_comment_exchange.status,
|
||||
user_comment_exchange.is_sensitive,
|
||||
user_comment_exchange.is_top,
|
||||
user_comment_exchange.like_num,
|
||||
user_comment_exchange.is_author,
|
||||
user_comment_exchange.content,
|
||||
user_comment_exchange.content_word,
|
||||
user_comment_exchange.comment_image,
|
||||
user_comment_exchange.created_at,
|
||||
user_comment_exchange.updated_at
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.caseExchange.domain.vo.UserCommentExchangeVO">
|
||||
SELECT
|
||||
<include refid="base_columns"/>
|
||||
FROM user_comment_exchange
|
||||
<where>
|
||||
<!--内容-->
|
||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||
AND INSTR(user_comment_exchange.content,#{queryForm.keywords})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user