修改文章病例库管理相关操作问题
This commit is contained in:
parent
f83f74f592
commit
11f455aa0c
@ -0,0 +1,40 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseClinicalRecordScore.controller;
|
||||||
|
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.form.CaseClinicalRecordScoreQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.vo.CaseClinicalRecordScoreVO;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.service.CaseClinicalRecordScoreService;
|
||||||
|
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||||
|
import net.lab1024.sa.base.common.domain.PageResult;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
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-11 18:09:51
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Tag(name = "积分发放记录")
|
||||||
|
public class CaseClinicalRecordScoreController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CaseClinicalRecordScoreService caseClinicalRecordScoreService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询 @author xing")
|
||||||
|
@PostMapping("/caseClinicalRecordScore/queryPage")
|
||||||
|
@SaCheckPermission("caseClinicalRecordScore:query")
|
||||||
|
public ResponseDTO<PageResult<CaseClinicalRecordScoreVO>> queryPage(@RequestBody @Valid CaseClinicalRecordScoreQueryForm queryForm) {
|
||||||
|
return ResponseDTO.ok(caseClinicalRecordScoreService.queryPage(queryForm));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseClinicalRecordScore.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.entity.CaseClinicalRecordScoreEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.form.CaseClinicalRecordScoreQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.vo.CaseClinicalRecordScoreVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分发放记录 Dao
|
||||||
|
*
|
||||||
|
* @Author xing
|
||||||
|
* @Date 2025-08-11 18:09:51
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CaseClinicalRecordScoreDao extends BaseMapper<CaseClinicalRecordScoreEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页 查询
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param queryForm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CaseClinicalRecordScoreVO> queryPage(Page page, @Param("queryForm") CaseClinicalRecordScoreQueryForm queryForm);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseClinicalRecordScore.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-11 18:09:51
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("case_clinical_record_score")
|
||||||
|
public class CaseClinicalRecordScoreEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long scoreId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id(根据type不同,对应不同类型)
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型(1:文章 2:视频 3:病例交流)
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分类型(1:完成阅读 2:阅读时间满足 3:优质留言 4:再次优质留言 5:病例互动-病例库)
|
||||||
|
*/
|
||||||
|
private Integer scoreType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取积分节点名称(如:阅读时间足够)
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分
|
||||||
|
*/
|
||||||
|
private Integer score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.form;
|
||||||
|
|
||||||
|
import net.lab1024.sa.base.common.domain.PageParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分发放记录 分页查询表单
|
||||||
|
*
|
||||||
|
* @Author xing
|
||||||
|
* @Date 2025-08-11 18:09:51
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class CaseClinicalRecordScoreQueryForm extends PageParam {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分发放记录 列表VO
|
||||||
|
*
|
||||||
|
* @Author xing
|
||||||
|
* @Date 2025-08-11 18:09:51
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CaseClinicalRecordScoreVO {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long scoreId;
|
||||||
|
|
||||||
|
@Schema(description = "id(根据type不同,对应不同类型)")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "类型(1:文章 2:视频 3:病例交流)")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "用户名称")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@Schema(description = "积分类型(1:完成阅读 2:阅读时间满足 3:优质留言 4:再次优质留言 5:病例互动-病例库)")
|
||||||
|
private Integer scoreType;
|
||||||
|
|
||||||
|
@Schema(description = "获取积分节点名称(如:阅读时间足够)")
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
@Schema(description = "积分")
|
||||||
|
private Integer score;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseClinicalRecordScore.manager;
|
||||||
|
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.dao.CaseClinicalRecordScoreDao;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.entity.CaseClinicalRecordScoreEntity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分发放记录 Manager
|
||||||
|
*
|
||||||
|
* @Author xing
|
||||||
|
* @Date 2025-08-11 18:09:51
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CaseClinicalRecordScoreManager extends ServiceImpl<CaseClinicalRecordScoreDao, CaseClinicalRecordScoreEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseClinicalRecordScore.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.dao.CaseClinicalRecordScoreDao;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.entity.CaseClinicalRecordScoreEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.form.CaseClinicalRecordScoreQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.vo.CaseClinicalRecordScoreVO;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分发放记录 Service
|
||||||
|
*
|
||||||
|
* @Author xing
|
||||||
|
* @Date 2025-08-11 18:09:51
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CaseClinicalRecordScoreService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CaseClinicalRecordScoreDao caseClinicalRecordScoreDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
public PageResult<CaseClinicalRecordScoreVO> queryPage(CaseClinicalRecordScoreQueryForm queryForm) {
|
||||||
|
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||||
|
List<CaseClinicalRecordScoreVO> list = caseClinicalRecordScoreDao.queryPage(page, queryForm);
|
||||||
|
return SmartPageUtil.convert2PageResult(page, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@ import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchang
|
|||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeStatusUpdateForm;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeStatusUpdateForm;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeSelectedUpdateForm;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeSelectedUpdateForm;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeVoteUpdateForm;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeVoteUpdateForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeAuditStatusUpdateForm;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeVO;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeVO;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeVoteDetailVO;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeVoteDetailVO;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.service.CaseExchangeService;
|
import net.lab1024.sa.admin.module.business.caseExchange.service.CaseExchangeService;
|
||||||
@ -111,4 +112,11 @@ public class CaseExchangeController {
|
|||||||
public ResponseDTO<String> selectedUpdate(@RequestBody @Valid CaseExchangeSelectedUpdateForm updateForm) {
|
public ResponseDTO<String> selectedUpdate(@RequestBody @Valid CaseExchangeSelectedUpdateForm updateForm) {
|
||||||
return caseExchangeService.updateSelected(updateForm.getExchangeId(), updateForm.getIsSelected());
|
return caseExchangeService.updateSelected(updateForm.getExchangeId(), updateForm.getIsSelected());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "更新审核状态 @author xing")
|
||||||
|
@PostMapping("/caseExchange/auditStatus/update")
|
||||||
|
@SaCheckPermission("caseExchange:auditStatusUpdate")
|
||||||
|
public ResponseDTO<String> auditStatusUpdate(@RequestBody @Valid CaseExchangeAuditStatusUpdateForm updateForm) {
|
||||||
|
return caseExchangeService.updateAuditStatus(updateForm.getExchangeId(), updateForm.getAuditStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,6 +48,11 @@ public class CaseExchangeEntity {
|
|||||||
*/
|
*/
|
||||||
private Integer isSelected;
|
private Integer isSelected;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态(0:否 1:是)
|
||||||
|
*/
|
||||||
|
private Integer auditStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 阅读量
|
* 阅读量
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
package net.lab1024.sa.admin.module.business.caseExchange.domain.form;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 病例库-病例交流 审核状态更新表单
|
||||||
|
*
|
||||||
|
* @Author xing
|
||||||
|
* @Date 2025-08-08 18:28:17
|
||||||
|
* @Copyright gdxz
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "病例库-病例交流 审核状态更新表单")
|
||||||
|
public class CaseExchangeAuditStatusUpdateForm {
|
||||||
|
|
||||||
|
@Schema(description = "病例交流ID")
|
||||||
|
@NotNull(message = "病例交流ID不能为空")
|
||||||
|
private Long exchangeId;
|
||||||
|
|
||||||
|
@Schema(description = "审核状态 0:待审核 1:审核通过 2:审核不通过")
|
||||||
|
@NotNull(message = "审核状态不能为空")
|
||||||
|
private Integer auditStatus;
|
||||||
|
}
|
||||||
@ -43,6 +43,9 @@ public class CaseExchangeVO {
|
|||||||
@Schema(description = "是否被精选(0:否 1:是)")
|
@Schema(description = "是否被精选(0:否 1:是)")
|
||||||
private Integer isSelected;
|
private Integer isSelected;
|
||||||
|
|
||||||
|
@Schema(description = "审核状态(0:否 1:是)")
|
||||||
|
private Integer auditStatus;
|
||||||
|
|
||||||
@Schema(description = "阅读量")
|
@Schema(description = "阅读量")
|
||||||
private Integer readNum;
|
private Integer readNum;
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import net.lab1024.sa.admin.module.business.basicHospital.domain.entity.BasicHospitalEntity;
|
import net.lab1024.sa.admin.module.business.basicHospital.domain.entity.BasicHospitalEntity;
|
||||||
import net.lab1024.sa.admin.module.business.basicSensitiveWord.service.BasicSensitiveWordService;
|
import net.lab1024.sa.admin.module.business.basicSensitiveWord.service.BasicSensitiveWordService;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.CaseClinicalArticleEntity;
|
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.CaseClinicalArticleEntity;
|
||||||
@ -14,6 +15,8 @@ import net.lab1024.sa.admin.module.business.caseClinicalArticleAuthor.domain.ent
|
|||||||
import net.lab1024.sa.admin.module.business.caseClinicalArticleAuthor.domain.vo.CaseClinicalArticleAuthorVO;
|
import net.lab1024.sa.admin.module.business.caseClinicalArticleAuthor.domain.vo.CaseClinicalArticleAuthorVO;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.entity.CaseClinicalDoctorEntity;
|
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.entity.CaseClinicalDoctorEntity;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.vo.CaseClinicalDoctorVO;
|
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.vo.CaseClinicalDoctorVO;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.dao.CaseClinicalRecordScoreDao;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.entity.CaseClinicalRecordScoreEntity;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.dao.CaseExchangeDao;
|
import net.lab1024.sa.admin.module.business.caseExchange.dao.CaseExchangeDao;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.dao.CaseExchangeLabelDao;
|
import net.lab1024.sa.admin.module.business.caseExchange.dao.CaseExchangeLabelDao;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.entity.CaseExchangeEntity;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.entity.CaseExchangeEntity;
|
||||||
@ -25,6 +28,7 @@ import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchang
|
|||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeSelectedUpdateForm;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.form.CaseExchangeSelectedUpdateForm;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeLabelVO;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeLabelVO;
|
||||||
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeVO;
|
import net.lab1024.sa.admin.module.business.caseExchange.domain.vo.CaseExchangeVO;
|
||||||
|
import net.lab1024.sa.admin.module.business.user.service.UserService;
|
||||||
import net.lab1024.sa.admin.util.RegularUtil;
|
import net.lab1024.sa.admin.util.RegularUtil;
|
||||||
import net.lab1024.sa.admin.util.Replace;
|
import net.lab1024.sa.admin.util.Replace;
|
||||||
import net.lab1024.sa.base.common.exception.BusinessException;
|
import net.lab1024.sa.base.common.exception.BusinessException;
|
||||||
@ -61,6 +65,12 @@ public class CaseExchangeService {
|
|||||||
@Resource
|
@Resource
|
||||||
private RegularUtil regularUtil;
|
private RegularUtil regularUtil;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CaseClinicalRecordScoreDao caseClinicalRecordScoreDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@ -273,6 +283,10 @@ public class CaseExchangeService {
|
|||||||
return ResponseDTO.userErrorParam("病例交流不存在");
|
return ResponseDTO.userErrorParam("病例交流不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (caseExchange.getAuditStatus() == 0) {
|
||||||
|
return ResponseDTO.userErrorParam("请先审核");
|
||||||
|
}
|
||||||
|
|
||||||
// 如果精选状态没有变化,直接返回
|
// 如果精选状态没有变化,直接返回
|
||||||
if (Objects.equals(caseExchange.getIsSelected(), isSelected)) {
|
if (Objects.equals(caseExchange.getIsSelected(), isSelected)) {
|
||||||
return ResponseDTO.ok();
|
return ResponseDTO.ok();
|
||||||
@ -282,6 +296,64 @@ public class CaseExchangeService {
|
|||||||
caseExchange.setIsSelected(isSelected);
|
caseExchange.setIsSelected(isSelected);
|
||||||
caseExchangeDao.updateById(caseExchange);
|
caseExchangeDao.updateById(caseExchange);
|
||||||
|
|
||||||
|
// 检测是否已发放积分
|
||||||
|
if (isSelected == 1){
|
||||||
|
LambdaQueryWrapper<CaseClinicalRecordScoreEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getId, exchangeId);
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getType, caseExchange.getUserId());
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getUserId, caseExchange.getUserId());
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getScoreType, 6);
|
||||||
|
CaseClinicalRecordScoreEntity caseClinicalRecordScore = caseClinicalRecordScoreDao.selectOne(queryWrapper);
|
||||||
|
if (caseClinicalRecordScore == null) {
|
||||||
|
// 发放积分
|
||||||
|
userService.ReportUserScore(String.valueOf(exchangeId),3, String.valueOf(caseExchange.getUserId()),100,6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新审核状态
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> updateAuditStatus(Long exchangeId, Integer auditStatus) {
|
||||||
|
if (null == exchangeId) {
|
||||||
|
return ResponseDTO.userErrorParam("病例交流ID不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
CaseExchangeEntity caseExchange = caseExchangeDao.selectById(exchangeId);
|
||||||
|
if (caseExchange == null) {
|
||||||
|
return ResponseDTO.userErrorParam("病例交流不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (caseExchange.getExchangeStatus() == 2) {
|
||||||
|
return ResponseDTO.userErrorParam("状态为 禁用 禁止审核");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果精选状态没有变化,直接返回
|
||||||
|
if (Objects.equals(caseExchange.getAuditStatus(), auditStatus)) {
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新精选状态
|
||||||
|
caseExchange.setAuditStatus(auditStatus);
|
||||||
|
caseExchangeDao.updateById(caseExchange);
|
||||||
|
|
||||||
|
// 检测是否已发放积分
|
||||||
|
if (auditStatus == 1){
|
||||||
|
LambdaQueryWrapper<CaseClinicalRecordScoreEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getId, exchangeId);
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getType, caseExchange.getUserId());
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getUserId, caseExchange.getUserId());
|
||||||
|
queryWrapper.eq(CaseClinicalRecordScoreEntity::getScoreType, 7);
|
||||||
|
CaseClinicalRecordScoreEntity caseClinicalRecordScore = caseClinicalRecordScoreDao.selectOne(queryWrapper);
|
||||||
|
if (caseClinicalRecordScore == null) {
|
||||||
|
// 发放积分
|
||||||
|
userService.ReportUserScore(String.valueOf(exchangeId),3, String.valueOf(caseExchange.getUserId()),50,7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return ResponseDTO.ok();
|
return ResponseDTO.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.Year;
|
import java.time.Year;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@ -12,14 +13,18 @@ import java.util.Objects;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import net.lab1024.sa.admin.config.EnvConfig;
|
import net.lab1024.sa.admin.config.EnvConfig;
|
||||||
import net.lab1024.sa.admin.extend.aliyun.Oss;
|
import net.lab1024.sa.admin.extend.aliyun.Oss;
|
||||||
|
import net.lab1024.sa.admin.extend.app.Score.Score;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.dao.CaseClinicalArticleDao;
|
import net.lab1024.sa.admin.module.business.caseClinicalArticle.dao.CaseClinicalArticleDao;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.CaseClinicalArticleEntity;
|
import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.entity.CaseClinicalArticleEntity;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.dao.CaseClinicalDoctorCertDao;
|
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.dao.CaseClinicalDoctorCertDao;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.dao.CaseClinicalDoctorDao;
|
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.dao.CaseClinicalDoctorDao;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.entity.CaseClinicalDoctorCertEntity;
|
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.entity.CaseClinicalDoctorCertEntity;
|
||||||
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.entity.CaseClinicalDoctorEntity;
|
import net.lab1024.sa.admin.module.business.caseClinicalDoctor.domain.entity.CaseClinicalDoctorEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.dao.CaseClinicalRecordScoreDao;
|
||||||
|
import net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.entity.CaseClinicalRecordScoreEntity;
|
||||||
import net.lab1024.sa.admin.module.business.statsCaseClinical.dao.StatsCaseClinicalDao;
|
import net.lab1024.sa.admin.module.business.statsCaseClinical.dao.StatsCaseClinicalDao;
|
||||||
import net.lab1024.sa.admin.module.business.statsCaseClinical.domain.entity.StatsCaseClinicalEntity;
|
import net.lab1024.sa.admin.module.business.statsCaseClinical.domain.entity.StatsCaseClinicalEntity;
|
||||||
import net.lab1024.sa.admin.module.business.user.dao.UserDao;
|
import net.lab1024.sa.admin.module.business.user.dao.UserDao;
|
||||||
@ -72,6 +77,12 @@ public class UserService {
|
|||||||
@Resource
|
@Resource
|
||||||
private EnvConfig envConfig;
|
private EnvConfig envConfig;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private Score score;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CaseClinicalRecordScoreDao caseClinicalRecordScoreDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@ -276,4 +287,48 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发放积分
|
||||||
|
* @param type 类型(1:文章 2:视频 3:病例交流)
|
||||||
|
* @throws BusinessException
|
||||||
|
*/
|
||||||
|
public boolean ReportUserScore(String id,Integer type,String userId,Integer point,Integer scoreType) throws BusinessException{
|
||||||
|
// 获取积分发放记录
|
||||||
|
// 获取今天的日期,并设置时间为 00:00:00
|
||||||
|
LocalDateTime startOfToday = LocalDate.now().atStartOfDay(); // 例如:2025-07-30 00:00:00
|
||||||
|
|
||||||
|
QueryWrapper<CaseClinicalRecordScoreEntity> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("user_id", userId)
|
||||||
|
.ge("created_at", startOfToday) // created_at >= 今天 00:00:00
|
||||||
|
.ge("score_type", 5)
|
||||||
|
.orderByDesc("created_at"); // 最新的在前
|
||||||
|
List<CaseClinicalRecordScoreEntity> caseClinicalRecordScores = caseClinicalRecordScoreDao.selectList(queryWrapper);
|
||||||
|
if (caseClinicalRecordScores.size() >= 3){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户数据
|
||||||
|
UserEntity user = userDao.selectById(userId);
|
||||||
|
if (user == null){
|
||||||
|
throw new BusinessException("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发放积分
|
||||||
|
score.ReportUserScore(user.getUserIden(),5,"病例库-病例互动");
|
||||||
|
|
||||||
|
// 添加打赏记录
|
||||||
|
CaseClinicalRecordScoreEntity data = new CaseClinicalRecordScoreEntity();
|
||||||
|
data.setUserId(Long.valueOf(userId));
|
||||||
|
data.setScore(point);
|
||||||
|
data.setId(Long.valueOf(id));
|
||||||
|
data.setUserName(user.getUserName());
|
||||||
|
data.setNodeName("病例库-病例互动");
|
||||||
|
data.setType(type);
|
||||||
|
data.setScoreType(scoreType);
|
||||||
|
caseClinicalRecordScoreDao.insert(data);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,4 +19,11 @@ server:
|
|||||||
# 环境
|
# 环境
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: '@profiles.active@'
|
active: '@profiles.active@'
|
||||||
|
|
||||||
|
# 文件上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 5MB
|
||||||
|
max-request-size: 5MB
|
||||||
|
enabled: true
|
||||||
@ -27,21 +27,29 @@
|
|||||||
<include refid="base_columns"/>
|
<include refid="base_columns"/>
|
||||||
FROM case_clinical_article
|
FROM case_clinical_article
|
||||||
<where>
|
<where>
|
||||||
<!--关键字-->
|
<!--关键字搜索:支持疾病名称、标题、作者搜索-->
|
||||||
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
<if test="queryForm.keywords != null and queryForm.keywords != ''">
|
||||||
AND (
|
AND (
|
||||||
INSTR(case_clinical_article.article_title,#{queryForm.keywords})
|
INSTR(case_clinical_article.article_title, #{queryForm.keywords}) > 0
|
||||||
OR INSTR(case_clinical_article.article_content,#{queryForm.keywords})
|
OR EXISTS (
|
||||||
|
SELECT 1 FROM case_clinical_article_author caa
|
||||||
|
INNER JOIN case_clinical_doctor cd ON caa.doctor_id = cd.doctor_id
|
||||||
|
WHERE caa.article_id = case_clinical_article.article_id
|
||||||
|
AND INSTR(cd.doctor_name, #{queryForm.keywords}) > 0
|
||||||
|
)
|
||||||
|
OR EXISTS (
|
||||||
|
SELECT 1 FROM case_clinical_article_label cal
|
||||||
|
WHERE cal.article_id = case_clinical_article.article_id
|
||||||
|
AND INSTR(cal.label_name, #{queryForm.keywords}) > 0
|
||||||
|
)
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<!--删除状态-->
|
||||||
|
AND case_clinical_article.delete_status = 0
|
||||||
<!--状态-->
|
<!--状态-->
|
||||||
<if test="queryForm.articleStatus != null">
|
<if test="queryForm.articleStatus != null">
|
||||||
AND case_clinical_article.article_status = #{queryForm.articleStatus}
|
AND case_clinical_article.article_status = #{queryForm.articleStatus}
|
||||||
</if>
|
</if>
|
||||||
<!--删除状态-->
|
|
||||||
<if test="queryForm.deleteStatus != null">
|
|
||||||
AND case_clinical_article.delete_status = #{queryForm.deleteStatus}
|
|
||||||
</if>
|
|
||||||
<!--发表时间-->
|
<!--发表时间-->
|
||||||
<if test="queryForm.pushDateBegin != null">
|
<if test="queryForm.pushDateBegin != null">
|
||||||
AND case_clinical_article.push_date >= #{queryForm.pushDateBegin}
|
AND case_clinical_article.push_date >= #{queryForm.pushDateBegin}
|
||||||
@ -50,6 +58,7 @@
|
|||||||
AND case_clinical_article.push_date <= #{queryForm.pushDateEnd}
|
AND case_clinical_article.push_date <= #{queryForm.pushDateEnd}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY case_clinical_article.created_at DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectLastArticlePushDateByHospitalId" resultType="java.time.LocalDateTime">
|
<select id="selectLastArticlePushDateByHospitalId" resultType="java.time.LocalDateTime">
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
<?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.caseClinicalRecordScore.dao.CaseClinicalRecordScoreDao">
|
||||||
|
|
||||||
|
<!-- 查询结果列 -->
|
||||||
|
<sql id="base_columns">
|
||||||
|
case_clinical_record_score.score_id,
|
||||||
|
case_clinical_record_score.id,
|
||||||
|
case_clinical_record_score.type,
|
||||||
|
case_clinical_record_score.user_id,
|
||||||
|
case_clinical_record_score.user_name,
|
||||||
|
case_clinical_record_score.score_type,
|
||||||
|
case_clinical_record_score.node_name,
|
||||||
|
case_clinical_record_score.score,
|
||||||
|
case_clinical_record_score.created_at,
|
||||||
|
case_clinical_record_score.updated_at
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.caseClinicalRecordScore.domain.vo.CaseClinicalRecordScoreVO">
|
||||||
|
SELECT
|
||||||
|
<include refid="base_columns"/>
|
||||||
|
FROM case_clinical_record_score
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -10,6 +10,7 @@
|
|||||||
case_exchange.exchange_status,
|
case_exchange.exchange_status,
|
||||||
case_exchange.delete_status,
|
case_exchange.delete_status,
|
||||||
case_exchange.is_selected,
|
case_exchange.is_selected,
|
||||||
|
case_exchange.audit_status,
|
||||||
case_exchange.read_num,
|
case_exchange.read_num,
|
||||||
case_exchange.collect_num,
|
case_exchange.collect_num,
|
||||||
case_exchange.comment_num,
|
case_exchange.comment_num,
|
||||||
|
|||||||
@ -19,4 +19,11 @@ server:
|
|||||||
# 环境
|
# 环境
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: '@profiles.active@'
|
active: '@profiles.active@'
|
||||||
|
|
||||||
|
# 文件上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
enabled: true
|
||||||
@ -19,4 +19,11 @@ server:
|
|||||||
# 环境
|
# 环境
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: '@profiles.active@'
|
active: '@profiles.active@'
|
||||||
|
|
||||||
|
# 文件上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
enabled: true
|
||||||
@ -19,4 +19,11 @@ server:
|
|||||||
# 环境
|
# 环境
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: '@profiles.active@'
|
active: '@profiles.active@'
|
||||||
|
|
||||||
|
# 文件上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
enabled: true
|
||||||
Loading…
x
Reference in New Issue
Block a user