diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/controller/UserCommentClinicalArticleController.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/controller/UserCommentClinicalArticleController.java index e7e431b..dc870f1 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/controller/UserCommentClinicalArticleController.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/controller/UserCommentClinicalArticleController.java @@ -5,6 +5,7 @@ import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.User import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateForm; import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentStatusUpdateForm; import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentTopUpdateForm; +import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateDeleteStatusForm; 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; @@ -80,4 +81,11 @@ public class UserCommentClinicalArticleController { public ResponseDTO delete(@PathVariable Long commentId) { return userCommentClinicalArticleService.delete(commentId); } + + @Operation(summary = "更新删除状态 @author xing") + @PostMapping("/userCommentClinicalArticle/updateDeleteStatus") + @SaCheckPermission("userCommentClinicalArticle:delete") + public ResponseDTO updateDeleteStatus(@RequestBody @Valid UserCommentClinicalArticleUpdateDeleteStatusForm updateForm) { + return userCommentClinicalArticleService.updateDeleteStatus(updateForm); + } } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/entity/UserCommentClinicalArticleEntity.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/entity/UserCommentClinicalArticleEntity.java index 7fea6a0..708a95d 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/entity/UserCommentClinicalArticleEntity.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/entity/UserCommentClinicalArticleEntity.java @@ -53,6 +53,11 @@ public class UserCommentClinicalArticleEntity { */ private Integer isSensitive; + /** + * 删除状态(0:否 1:是) + */ + private Integer deleteStatus; + /** * 是否置顶(0:否 1:是) */ diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/form/UserCommentClinicalArticleQueryForm.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/form/UserCommentClinicalArticleQueryForm.java index 4742e22..e5060eb 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/form/UserCommentClinicalArticleQueryForm.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/form/UserCommentClinicalArticleQueryForm.java @@ -23,6 +23,6 @@ public class UserCommentClinicalArticleQueryForm extends PageParam { @Schema(description = "是否置顶(0:否 1:是)") private Integer isTop; - @Schema(description = "是否存在敏感词(0:否 1:是)") - private Integer isSensitive; + @Schema(description = "删除状态(0:否 1:是)") + private Integer deleteStatus; } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/vo/UserCommentClinicalArticleVO.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/vo/UserCommentClinicalArticleVO.java index c009ee1..9b60186 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/vo/UserCommentClinicalArticleVO.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/domain/vo/UserCommentClinicalArticleVO.java @@ -34,6 +34,9 @@ public class UserCommentClinicalArticleVO { @Schema(description = "是否存在敏感词(0:否 1:是)") private Integer isSensitive; + @Schema(description = "删除状态(0:否 1:是)") + private Integer deleteStatus; + @Schema(description = "是否置顶(0:否 1:是)") private Integer isTop; diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/service/UserCommentClinicalArticleService.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/service/UserCommentClinicalArticleService.java index 2f70b72..ac2260f 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/service/UserCommentClinicalArticleService.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalArticle/service/UserCommentClinicalArticleService.java @@ -7,6 +7,7 @@ import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.User import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateForm; import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentStatusUpdateForm; import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentTopUpdateForm; +import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.form.UserCommentClinicalArticleUpdateDeleteStatusForm; import net.lab1024.sa.admin.module.business.caseClinicalArticle.domain.vo.UserCommentClinicalArticleVO; import net.lab1024.sa.base.common.exception.BusinessException; import net.lab1024.sa.base.common.util.SmartBeanUtil; @@ -216,4 +217,51 @@ public class UserCommentClinicalArticleService { userCommentClinicalArticleDao.deleteById(commentId); return ResponseDTO.ok(); } + + /** + * 更新删除状态 + */ + @Transactional + public ResponseDTO updateDeleteStatus(UserCommentClinicalArticleUpdateDeleteStatusForm updateForm) { + if (null == updateForm.getCommentId() || null == updateForm.getDeleteStatus()){ + return ResponseDTO.userErrorParam("参数不能为空"); + } + + // 获取评论数据 + UserCommentClinicalArticleEntity userCommentClinicalArticle = userCommentClinicalArticleDao.selectById(updateForm.getCommentId()); + if (null == userCommentClinicalArticle) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + + // 更新删除状态 + userCommentClinicalArticle.setDeleteStatus(updateForm.getDeleteStatus()); + userCommentClinicalArticleDao.updateById(userCommentClinicalArticle); + + // 如果是从删除状态恢复,需要增加统计字段 + if (updateForm.getDeleteStatus() == 0) { + boolean r = caseClinicalArticleService.IncClinicalArticleStats( + String.valueOf(userCommentClinicalArticle.getArticleId()), + 3, + 1 + ); + if (!r){ + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + } else { + // 如果是设置为删除状态,需要减少统计字段 + boolean r = caseClinicalArticleService.DecClinicalArticleStats( + String.valueOf(userCommentClinicalArticle.getArticleId()), + 3, + 1 + ); + if (!r){ + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + } + + return ResponseDTO.ok(); + } } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/controller/UserCommentClinicalVideoController.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/controller/UserCommentClinicalVideoController.java index 7141b3f..4a1c1f6 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/controller/UserCommentClinicalVideoController.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/controller/UserCommentClinicalVideoController.java @@ -5,6 +5,7 @@ import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCo import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoUpdateForm; import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentStatusUpdateForm; import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentTopUpdateForm; +import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoUpdateDeleteStatusForm; 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; @@ -80,4 +81,11 @@ public class UserCommentClinicalVideoController { public ResponseDTO delete(@PathVariable Long commentId) { return userCommentClinicalVideoService.delete(commentId); } + + @Operation(summary = "更新删除状态 @author xing") + @PostMapping("/userCommentClinicalVideo/updateDeleteStatus") + @SaCheckPermission("userCommentClinicalVideo:delete") + public ResponseDTO updateDeleteStatus(@RequestBody @Valid UserCommentClinicalVideoUpdateDeleteStatusForm updateForm) { + return userCommentClinicalVideoService.updateDeleteStatus(updateForm); + } } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/entity/UserCommentClinicalVideoEntity.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/entity/UserCommentClinicalVideoEntity.java index e6a0893..74695a8 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/entity/UserCommentClinicalVideoEntity.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/entity/UserCommentClinicalVideoEntity.java @@ -53,6 +53,11 @@ public class UserCommentClinicalVideoEntity { */ private Integer isSensitive; + /** + * 删除状态(0:否 1:是) + */ + private Integer deleteStatus; + /** * 是否置顶(0:否 1:是) */ diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/form/UserCommentClinicalVideoQueryForm.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/form/UserCommentClinicalVideoQueryForm.java index 78c883f..3fd9bb2 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/form/UserCommentClinicalVideoQueryForm.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/form/UserCommentClinicalVideoQueryForm.java @@ -23,6 +23,6 @@ public class UserCommentClinicalVideoQueryForm extends PageParam { @Schema(description = "是否置顶(0:否 1:是)") private Integer isTop; - @Schema(description = "是否存在敏感词(0:否 1:是)") - private Integer isSensitive; + @Schema(description = "删除状态(0:否 1:是)") + private Integer deleteStatus; } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/vo/UserCommentClinicalVideoVO.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/vo/UserCommentClinicalVideoVO.java index 15496b3..706b56e 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/vo/UserCommentClinicalVideoVO.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/domain/vo/UserCommentClinicalVideoVO.java @@ -34,6 +34,9 @@ public class UserCommentClinicalVideoVO { @Schema(description = "是否存在敏感词(0:否 1:是)") private Integer isSensitive; + @Schema(description = "删除状态(0:否 1:是)") + private Integer deleteStatus; + @Schema(description = "是否置顶(0:否 1:是)") private Integer isTop; diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/service/UserCommentClinicalVideoService.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/service/UserCommentClinicalVideoService.java index dc52cca..9a2d6a1 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/service/UserCommentClinicalVideoService.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseClinicalVideo/service/UserCommentClinicalVideoService.java @@ -24,6 +24,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.util.List; import java.util.Objects; +import net.lab1024.sa.admin.module.business.caseClinicalVideo.domain.form.UserCommentClinicalVideoUpdateDeleteStatusForm; /** * 用户评论-临床病例-视频 Service @@ -197,10 +198,10 @@ public class UserCommentClinicalVideoService { UserCommentClinicalVideoEntity userCommentClinicalVideo = userCommentClinicalVideoDao.selectById(commentId); if (null == userCommentClinicalVideo) { TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return ResponseDTO.userErrorParam("操作失败1"); + return ResponseDTO.userErrorParam("操作失败"); } - // 减少文章的统计字段 + // 减少视频的统计字段 boolean r = caseClinicalVideoService.DecClinicalVideoStats( String.valueOf(userCommentClinicalVideo.getVideoId()), 3, @@ -208,10 +209,57 @@ public class UserCommentClinicalVideoService { ); if (!r){ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return ResponseDTO.userErrorParam("操作失败2"); + return ResponseDTO.userErrorParam("操作失败"); } userCommentClinicalVideoDao.deleteById(commentId); return ResponseDTO.ok(); } + + /** + * 更新删除状态 + */ + @Transactional + public ResponseDTO updateDeleteStatus(UserCommentClinicalVideoUpdateDeleteStatusForm updateForm) { + if (null == updateForm.getCommentId() || null == updateForm.getDeleteStatus()){ + return ResponseDTO.userErrorParam("参数不能为空"); + } + + // 获取评论数据 + UserCommentClinicalVideoEntity userCommentClinicalVideo = userCommentClinicalVideoDao.selectById(updateForm.getCommentId()); + if (null == userCommentClinicalVideo) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + + // 更新删除状态 + userCommentClinicalVideo.setDeleteStatus(updateForm.getDeleteStatus()); + userCommentClinicalVideoDao.updateById(userCommentClinicalVideo); + + // 如果是从删除状态恢复,需要增加统计字段 + if (updateForm.getDeleteStatus() == 0) { + boolean r = caseClinicalVideoService.IncClinicalVideoStats( + String.valueOf(userCommentClinicalVideo.getVideoId()), + 3, + 1 + ); + if (!r){ + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + } else { + // 如果是设置为删除状态,需要减少统计字段 + boolean r = caseClinicalVideoService.DecClinicalVideoStats( + String.valueOf(userCommentClinicalVideo.getVideoId()), + 3, + 1 + ); + if (!r){ + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + } + + return ResponseDTO.ok(); + } } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/controller/UserCommentExchangeController.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/controller/UserCommentExchangeController.java index dee7ce6..0eb62df 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/controller/UserCommentExchangeController.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/controller/UserCommentExchangeController.java @@ -5,6 +5,7 @@ import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserComment import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateForm; import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentStatusUpdateForm; import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentTopUpdateForm; +import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateDeleteStatusForm; 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; @@ -80,4 +81,11 @@ public class UserCommentExchangeController { public ResponseDTO delete(@PathVariable Long commentId) { return userCommentExchangeService.delete(commentId); } + + @Operation(summary = "更新删除状态 @author xing") + @PostMapping("/userCommentExchange/updateDeleteStatus") + @SaCheckPermission("userCommentExchange:delete") + public ResponseDTO updateDeleteStatus(@RequestBody @Valid UserCommentExchangeUpdateDeleteStatusForm updateForm) { + return userCommentExchangeService.updateDeleteStatus(updateForm); + } } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/entity/UserCommentExchangeEntity.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/entity/UserCommentExchangeEntity.java index 0531b27..e168956 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/entity/UserCommentExchangeEntity.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/entity/UserCommentExchangeEntity.java @@ -53,6 +53,11 @@ public class UserCommentExchangeEntity { */ private Integer isSensitive; + /** + * 删除状态(0:否 1:是) + */ + private Integer deleteStatus; + /** * 是否置顶(0:否 1:是) */ diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/form/UserCommentExchangeQueryForm.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/form/UserCommentExchangeQueryForm.java index 43ec578..2f1e1fd 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/form/UserCommentExchangeQueryForm.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/form/UserCommentExchangeQueryForm.java @@ -23,6 +23,6 @@ public class UserCommentExchangeQueryForm extends PageParam { @Schema(description = "是否置顶(0:否 1:是)") private Integer isTop; - @Schema(description = "是否存在敏感词(0:否 1:是)") - private Integer isSensitive; + @Schema(description = "删除状态(0:否 1:是)") + private Integer deleteStatus; } diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/vo/UserCommentExchangeVO.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/vo/UserCommentExchangeVO.java index 263d588..a994768 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/vo/UserCommentExchangeVO.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/domain/vo/UserCommentExchangeVO.java @@ -34,6 +34,9 @@ public class UserCommentExchangeVO { @Schema(description = "是否存在敏感词(0:否 1:是)") private Integer isSensitive; + @Schema(description = "删除状态(0:否 1:是)") + private Integer deleteStatus; + @Schema(description = "是否置顶(0:否 1:是)") private Integer isTop; diff --git a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/service/UserCommentExchangeService.java b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/service/UserCommentExchangeService.java index 5250e93..8d518ce 100644 --- a/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/service/UserCommentExchangeService.java +++ b/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/caseExchange/service/UserCommentExchangeService.java @@ -8,6 +8,7 @@ import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserComment import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateForm; import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentStatusUpdateForm; import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentTopUpdateForm; +import net.lab1024.sa.admin.module.business.caseExchange.domain.form.UserCommentExchangeUpdateDeleteStatusForm; 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; @@ -212,4 +213,50 @@ public class UserCommentExchangeService { userCommentExchangeDao.deleteById(commentId); return ResponseDTO.ok(); } + + /** + * 更新删除状态 + */ + @Transactional + public ResponseDTO updateDeleteStatus(UserCommentExchangeUpdateDeleteStatusForm updateForm) { + if (null == updateForm.getCommentId() || null == updateForm.getDeleteStatus()){ + return ResponseDTO.userErrorParam("参数不能为空"); + } + + // 获取评论数据 + UserCommentExchangeEntity userCommentExchange = userCommentExchangeDao.selectById(updateForm.getCommentId()); + if (null == userCommentExchange) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + + // 更新删除状态 + userCommentExchange.setDeleteStatus(updateForm.getDeleteStatus()); + userCommentExchangeDao.updateById(userCommentExchange); + + // 如果是从删除状态恢复,需要增加统计字段 + if (updateForm.getDeleteStatus() == 0) { + boolean r = caseExchangeService.IncCaseExchangeStats( + String.valueOf(userCommentExchange.getExchangeId()), + 3 + ); + if (!r){ + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + } else { + // 如果是设置为删除状态,需要减少统计字段 + boolean r = caseExchangeService.DecCaseExchangeStats( + String.valueOf(userCommentExchange.getExchangeId()), + 3, + 1 + ); + if (!r){ + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return ResponseDTO.userErrorParam("操作失败"); + } + } + + return ResponseDTO.ok(); + } } diff --git a/sa-admin/src/main/resources/mapper/business/caseClinicalArticle/UserCommentClinicalArticleMapper.xml b/sa-admin/src/main/resources/mapper/business/caseClinicalArticle/UserCommentClinicalArticleMapper.xml index 89924c8..fa66690 100644 --- a/sa-admin/src/main/resources/mapper/business/caseClinicalArticle/UserCommentClinicalArticleMapper.xml +++ b/sa-admin/src/main/resources/mapper/business/caseClinicalArticle/UserCommentClinicalArticleMapper.xml @@ -10,6 +10,7 @@ user_comment_clinical_article.status, user_comment_clinical_article.parent_id, user_comment_clinical_article.is_sensitive, + user_comment_clinical_article.delete_status, user_comment_clinical_article.is_top, user_comment_clinical_article.like_num, user_comment_clinical_article.is_author, @@ -40,9 +41,9 @@ AND user_comment_clinical_article.is_top = #{queryForm.isTop} - - - AND user_comment_clinical_article.is_sensitive = #{queryForm.isSensitive} + + + AND user_comment_clinical_article.delete_status = #{queryForm.deleteStatus} ORDER BY user_comment_clinical_article.created_at DESC diff --git a/sa-admin/src/main/resources/mapper/business/caseClinicalVideo/UserCommentClinicalVideoMapper.xml b/sa-admin/src/main/resources/mapper/business/caseClinicalVideo/UserCommentClinicalVideoMapper.xml index 4868804..61ebfd7 100644 --- a/sa-admin/src/main/resources/mapper/business/caseClinicalVideo/UserCommentClinicalVideoMapper.xml +++ b/sa-admin/src/main/resources/mapper/business/caseClinicalVideo/UserCommentClinicalVideoMapper.xml @@ -10,6 +10,7 @@ user_comment_clinical_video.status, user_comment_clinical_video.parent_id, user_comment_clinical_video.is_sensitive, + user_comment_clinical_video.delete_status, user_comment_clinical_video.is_top, user_comment_clinical_video.like_num, user_comment_clinical_video.is_author, @@ -40,9 +41,9 @@ AND user_comment_clinical_video.is_top = #{queryForm.isTop} - - - AND user_comment_clinical_video.is_sensitive = #{queryForm.isSensitive} + + + AND user_comment_clinical_video.delete_status = #{queryForm.deleteStatus} ORDER BY user_comment_clinical_video.created_at DESC diff --git a/sa-admin/src/main/resources/mapper/business/caseExchange/UserCommentExchangeMapper.xml b/sa-admin/src/main/resources/mapper/business/caseExchange/UserCommentExchangeMapper.xml index f4ccdfe..5879eb6 100644 --- a/sa-admin/src/main/resources/mapper/business/caseExchange/UserCommentExchangeMapper.xml +++ b/sa-admin/src/main/resources/mapper/business/caseExchange/UserCommentExchangeMapper.xml @@ -10,6 +10,7 @@ user_comment_exchange.status, user_comment_exchange.parent_id, user_comment_exchange.is_sensitive, + user_comment_exchange.delete_status, user_comment_exchange.is_top, user_comment_exchange.like_num, user_comment_exchange.is_author, @@ -40,9 +41,9 @@ AND user_comment_exchange.is_top = #{queryForm.isTop} - - - AND user_comment_exchange.is_sensitive = #{queryForm.isSensitive} + + + AND user_comment_exchange.delete_status = #{queryForm.deleteStatus} ORDER BY user_comment_exchange.created_at DESC diff --git a/sa-base/src/main/resources/prod/sa-base.yaml b/sa-base/src/main/resources/prod/sa-base.yaml index eb76986..e81b50b 100644 --- a/sa-base/src/main/resources/prod/sa-base.yaml +++ b/sa-base/src/main/resources/prod/sa-base.yaml @@ -1,9 +1,9 @@ spring: # 数据库连接信息 datasource: - url: jdbc:mysql://127.0.0.1:3306/smart_admin_v3?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai + url: jdbc:mysql://172.27.16.10:3306/case?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai username: root - password: SmartAdmin666 + password: sKptsVOiTf6m3lt_ driver-class-name: com.mysql.cj.jdbc.Driver initial-size: 10 min-idle: 10