diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCommentController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCommentController.java index 382cc5322..e2fb757a7 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCommentController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCommentController.java @@ -4,6 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.CommentFormDTO; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.service.CommentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,7 +24,7 @@ public class ApiCommentController { private CommentService commentService; /** - * + * 提交评论或回复接口 * @param userDetail * @param commentFormDTO * @return @@ -34,5 +35,12 @@ public class ApiCommentController { } + /** + * 表态评论(赞/踩) + */ + @PostMapping("statement") + public Result statement(@LoginUser TokenDto userDetail, CommentStatementFormDTO commentStatementFormDTO) { + return commentService.statement(userDetail,commentStatementFormDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiIssueController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiIssueController.java index 8a4cf679e..95039aaf0 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiIssueController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiIssueController.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.UploadDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import com.elink.esua.epdc.service.IssueService; import org.springframework.beans.factory.annotation.Autowired; @@ -62,4 +63,10 @@ public class ApiIssueController { return issueService.upload(file); } + + @PostMapping("statement") + public Result statement(@LoginUser TokenDto userDetail, StatementFormDTO formDto) { + formDto.setUserId(userDetail.getUserId()); + return issueService.statement(formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java index cbacc8af9..f0e7434d8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java @@ -2,6 +2,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; @@ -28,4 +29,7 @@ public interface CommentFeignClient { Result submit(EventCommentDTO eventCommentDTO); + @PostMapping(value = "events/epdc-app/comment/statement", consumes = MediaType.APPLICATION_JSON_VALUE) + Result statement(CommentStatementFormDTO commentStatementFormDTO); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/IssueFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/IssueFeignClient.java index ad6445194..4090be860 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/IssueFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/IssueFeignClient.java @@ -4,6 +4,7 @@ import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import com.elink.esua.epdc.feign.fallback.IssueFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -40,4 +41,8 @@ public interface IssueFeignClient { */ @GetMapping(value = "events/epdc-app/issue/list", consumes = MediaType.APPLICATION_JSON_VALUE) Result> listIssues(IssueFormDTO formDto); + + + @PostMapping(value = "events/epdc-app/issue/statement", consumes = MediaType.APPLICATION_JSON_VALUE) + Result statement(StatementFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java index 9d9187ded..585d01dee 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; @@ -22,4 +23,8 @@ public class CommentFeignClientFallback implements CommentFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "submit", eventCommentDTO); } + @Override + public Result statement(CommentStatementFormDTO commentStatementFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "statement", commentStatementFormDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/IssueFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/IssueFeignClientFallback.java index 9ae2ade79..21e4708cf 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/IssueFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/IssueFeignClientFallback.java @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import com.elink.esua.epdc.feign.IssueFeignClient; import org.springframework.stereotype.Component; @@ -27,4 +28,9 @@ public class IssueFeignClientFallback implements IssueFeignClient { public Result> listIssues(IssueFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "listIssues", formDto); } + + @Override + public Result statement(StatementFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "statement", formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CommentService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CommentService.java index 2e815bc87..0c209d9b0 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CommentService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CommentService.java @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.CommentFormDTO; import com.elink.esua.epdc.dto.UploadDTO; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; @@ -20,4 +21,7 @@ import java.util.List; public interface CommentService { Result submit(@LoginUser TokenDto userDetail, CommentFormDTO commentFormDTO); + + Result statement(@LoginUser TokenDto userDetail, CommentStatementFormDTO commentStatementFormDTO); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/IssueService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/IssueService.java index c529bb090..651f9fe77 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/IssueService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/IssueService.java @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.UploadDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import org.springframework.web.multipart.MultipartFile; @@ -43,4 +44,7 @@ public interface IssueService { * @Date: 2019/9/8 18:34 */ Result upload(MultipartFile file); + + + Result statement(StatementFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java index 01ac4eda1..a9d55f3ac 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java @@ -4,6 +4,7 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.CommentFormDTO; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; import com.elink.esua.epdc.feign.CommentFeignClient; import com.elink.esua.epdc.service.CommentService; @@ -35,4 +36,9 @@ public class CommentServiceImpl implements CommentService { } return commentFeignClient.submit(eventCommentDTO); } + + @Override + public Result statement(TokenDto userDetail, CommentStatementFormDTO commentStatementFormDTO) { + return commentFeignClient.statement(commentStatementFormDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java index 59a253c1b..134056fad 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.dto.CompleteDeptDTO; import com.elink.esua.epdc.dto.UploadDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import com.elink.esua.epdc.feign.IssueFeignClient; import com.elink.esua.epdc.feign.OssFeignClient; @@ -66,4 +67,9 @@ public class IssueServiceImpl implements IssueService { public Result upload(MultipartFile file) { return ossFeignClient.upload(file); } + + @Override + public Result statement(StatementFormDTO formDto) { + return issueFeignClient.statement(formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/CommentStatementFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/CommentStatementFormDTO.java new file mode 100755 index 000000000..3865cd98d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/CommentStatementFormDTO.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.comment; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +@Data +public class CommentStatementFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private String attitude; + + private String commentId; + + private String useId; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/EventCommentUserAttitudeDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/EventCommentUserAttitudeDTO.java new file mode 100755 index 000000000..ee50c1501 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/EventCommentUserAttitudeDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.comment; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Data +public class EventCommentUserAttitudeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 事件评论ID + */ + private String eventCommentId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户点赞点踩标识 0:取消点赞,1:点赞 + */ + private String attitudeFlag; + + /** + * 删除标识 0:未删除,1:删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/EventUserAttitudeDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/EventUserAttitudeDTO.java new file mode 100755 index 000000000..7b7ba8530 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/EventUserAttitudeDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Data +public class EventUserAttitudeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 事件ID + */ + private String eventId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户点赞点踩标识 0:点赞,1:踩 + */ + private String attitudeFlag; + + /** + * 删除标识 0:未删除,1:删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/form/StatementFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/form/StatementFormDTO.java new file mode 100644 index 000000000..754166881 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/form/StatementFormDTO.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dto.issue.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 表态议题(赞/踩) + * + */ +@Data +public class StatementFormDTO { + + @NotBlank(message = "表态值不能为空") + private String attitude; + + @NotBlank(message = "议题id不能为空") + private String issueId; + + private String userId; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java index 184b5c74d..20cb70aab 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java @@ -18,26 +18,14 @@ package com.elink.esua.epdc.modules.comment.controller; import com.elink.esua.epdc.commons.tools.constant.Constant; -import com.elink.esua.epdc.commons.tools.page.PageData; -import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.commons.tools.validator.AssertUtils; -import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; -import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; -import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; -import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; -import com.elink.esua.epdc.modules.comment.excel.EventCommentExcel; import com.elink.esua.epdc.modules.comment.service.EventCommentService; -import com.elink.esua.epdc.modules.events.service.EpdcEventsService; +import com.elink.esua.epdc.modules.comment.service.EventCommentUserAttitudeService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; - @RestController @RequestMapping(Constant.EPDC_APP + "comment") @@ -46,12 +34,20 @@ public class AppEventCommentController { @Autowired private EventCommentService eventCommentService; + @Autowired + private EventCommentUserAttitudeService eventCommentUserAttitudeService; + //提交评论或回复接口 @PostMapping("submit") public Result submit(@RequestBody EventCommentDTO dto){ eventCommentService.submit(dto); return new Result(); } + @PostMapping("statement") + public Result statement(@RequestBody CommentStatementFormDTO formDto) { + eventCommentUserAttitudeService.statement(formDto); + return new Result(); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/EventCommentUserAttitudeController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/EventCommentUserAttitudeController.java new file mode 100755 index 000000000..d20c178a8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/EventCommentUserAttitudeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.comment.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; +import com.elink.esua.epdc.modules.comment.excel.EventCommentUserAttitudeExcel; +import com.elink.esua.epdc.modules.comment.service.EventCommentUserAttitudeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@RestController +@RequestMapping("eventcommentuserattitude") +public class EventCommentUserAttitudeController { + + @Autowired + private EventCommentUserAttitudeService eventCommentUserAttitudeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = eventCommentUserAttitudeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + EventCommentUserAttitudeDTO data = eventCommentUserAttitudeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody EventCommentUserAttitudeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + eventCommentUserAttitudeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody EventCommentUserAttitudeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + eventCommentUserAttitudeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + eventCommentUserAttitudeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = eventCommentUserAttitudeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, EventCommentUserAttitudeExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java index bc4836f7e..9e819acb7 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java @@ -30,4 +30,8 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface EventCommentDao extends BaseDao { + void updateApproveNumOrOpposeNum(String commentId, String attitudeFlag); + + void updateReplyCount(String commentId); + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentUserAttitudeDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentUserAttitudeDao.java new file mode 100755 index 000000000..95df425bd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentUserAttitudeDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.comment.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.comment.entity.EventCommentUserAttitudeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Mapper +public interface EventCommentUserAttitudeDao extends BaseDao { + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/entity/EventCommentUserAttitudeEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/entity/EventCommentUserAttitudeEntity.java new file mode 100755 index 000000000..e822e383f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/entity/EventCommentUserAttitudeEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.comment.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_event_comment_user_attitude") +public class EventCommentUserAttitudeEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 事件评论ID + */ + private String eventCommentId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户点赞点踩标识 0:取消点赞,1:点赞 + */ + private String attitudeFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/excel/EventCommentUserAttitudeExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/excel/EventCommentUserAttitudeExcel.java new file mode 100755 index 000000000..57c5219ed --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/excel/EventCommentUserAttitudeExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.comment.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Data +public class EventCommentUserAttitudeExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "事件评论ID") + private String eventCommentId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户点赞点踩标识 0:取消点赞,1:点赞") + private String attitudeFlag; + + @Excel(name = "删除标识 0:未删除,1:删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/redis/EventCommentUserAttitudeRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/redis/EventCommentUserAttitudeRedis.java new file mode 100755 index 000000000..cf5ea1632 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/redis/EventCommentUserAttitudeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.comment.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Component +public class EventCommentUserAttitudeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java index d6ed147e7..f2a3ec530 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java @@ -93,5 +93,13 @@ public interface EventCommentService extends BaseService { */ void delete(String[] ids); + //提交评论或回复接口 void submit(EventCommentDTO dto); + + /** + * 修改赞数或者踩数+1 + */ + void updateApproveNumOrOpposeNum(String commentId, String attitudeFlag); + + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentUserAttitudeService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentUserAttitudeService.java new file mode 100755 index 000000000..09d6bfbba --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentUserAttitudeService.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.comment.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; +import com.elink.esua.epdc.modules.comment.entity.EventCommentUserAttitudeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +public interface EventCommentUserAttitudeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author + * @date + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author + * @date + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return EventCommentUserAttitudeDTO + * @author + * @date + */ + EventCommentUserAttitudeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author + * @date + */ + void save(EventCommentUserAttitudeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author + * @date + */ + void update(EventCommentUserAttitudeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author + * @date + */ + void delete(String[] ids); + + void statement(CommentStatementFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java index 941e7cb6c..52fecf01b 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java @@ -106,13 +106,20 @@ public class EventCommentServiceImpl extends BaseServiceImpl + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.comment.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; +import com.elink.esua.epdc.modules.comment.dao.EventCommentUserAttitudeDao; +import com.elink.esua.epdc.modules.comment.entity.EventCommentUserAttitudeEntity; +import com.elink.esua.epdc.modules.comment.redis.EventCommentUserAttitudeRedis; +import com.elink.esua.epdc.modules.comment.service.EventCommentService; +import com.elink.esua.epdc.modules.comment.service.EventCommentUserAttitudeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件评论点赞点踩表 事件评论点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Service +public class EventCommentUserAttitudeServiceImpl extends BaseServiceImpl implements EventCommentUserAttitudeService { + + @Autowired + private EventCommentUserAttitudeRedis eventCommentUserAttitudeRedis; + + @Autowired + private EventCommentService eventCommentService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EventCommentUserAttitudeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, EventCommentUserAttitudeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public EventCommentUserAttitudeDTO get(String id) { + EventCommentUserAttitudeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, EventCommentUserAttitudeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(EventCommentUserAttitudeDTO dto) { + EventCommentUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, EventCommentUserAttitudeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(EventCommentUserAttitudeDTO dto) { + EventCommentUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, EventCommentUserAttitudeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void statement(CommentStatementFormDTO formDto) { + EventCommentUserAttitudeDTO eventCommentUserAttitudeDTO = new EventCommentUserAttitudeDTO(); + eventCommentUserAttitudeDTO.setEventCommentId(formDto.getCommentId()); + eventCommentUserAttitudeDTO.setUserId(formDto.getUseId()); + eventCommentUserAttitudeDTO.setAttitudeFlag(formDto.getAttitude()); + this.save(eventCommentUserAttitudeDTO); + + eventCommentService.updateApproveNumOrOpposeNum(formDto.getCommentId(),formDto.getAttitude()); + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java index 7a29c039d..7a73c8510 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java @@ -89,4 +89,8 @@ public interface EpdcEventsDao extends BaseDao { * 修改评论数+1 */ void updateCommentNum(String id); + + + //修改赞数或者踩数 + void updateApproveNumOrOpposeNum(String eventId, String attitudeFlag); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java index 392e52096..5bf66e7f7 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java @@ -111,4 +111,9 @@ public interface EpdcEventsService extends BaseService { * 修改评论数+1 */ void updateCommentNum(String id); + + /** + * 修改+1 + */ + void updateApproveNumOrOpposeNum(String eventId, String attitudeFlag); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java index 32b83e073..c93d40d49 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java @@ -218,7 +218,11 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.issue.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.issue.EventUserAttitudeDTO; +import com.elink.esua.epdc.modules.issue.excel.EventUserAttitudeExcel; +import com.elink.esua.epdc.modules.issue.service.EventUserAttitudeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@RestController +@RequestMapping("eventuserattitude") +public class EventUserAttitudeController { + + @Autowired + private EventUserAttitudeService eventUserAttitudeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = eventUserAttitudeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + EventUserAttitudeDTO data = eventUserAttitudeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody EventUserAttitudeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + eventUserAttitudeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody EventUserAttitudeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + eventUserAttitudeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + eventUserAttitudeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = eventUserAttitudeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, EventUserAttitudeExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/EventUserAttitudeDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/EventUserAttitudeDao.java new file mode 100755 index 000000000..76e0e0cf9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/EventUserAttitudeDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.issue.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.issue.entity.EventUserAttitudeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Mapper +public interface EventUserAttitudeDao extends BaseDao { + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/IssueDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/IssueDao.java index 44e3fa83b..fe50cb013 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/IssueDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/IssueDao.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.dto.issue.IssueJobFeedbackDTO; import com.elink.esua.epdc.dto.issue.IssueWaitHandleDetailDTO; import com.elink.esua.epdc.dto.issue.IssueWaitHandleOrClosedDTO; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import org.apache.ibatis.annotations.Mapper; diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/entity/EventUserAttitudeEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/entity/EventUserAttitudeEntity.java new file mode 100755 index 000000000..bc3cca026 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/entity/EventUserAttitudeEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.issue.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_event_user_attitude") +public class EventUserAttitudeEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 事件ID + */ + private String eventId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户点赞点踩标识 0:点赞,1:踩 + */ + private String attitudeFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/excel/EventUserAttitudeExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/excel/EventUserAttitudeExcel.java new file mode 100755 index 000000000..db763ffde --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/excel/EventUserAttitudeExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.issue.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Data +public class EventUserAttitudeExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "事件ID") + private String eventId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户点赞点踩标识 0:点赞,1:踩") + private String attitudeFlag; + + @Excel(name = "删除标识 0:未删除,1:删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/redis/EventUserAttitudeRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/redis/EventUserAttitudeRedis.java new file mode 100755 index 000000000..1933d9b7f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/redis/EventUserAttitudeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.issue.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Component +public class EventUserAttitudeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/EventUserAttitudeService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/EventUserAttitudeService.java new file mode 100755 index 000000000..99b738fe8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/EventUserAttitudeService.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.issue.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.issue.EventUserAttitudeDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; +import com.elink.esua.epdc.modules.issue.entity.EventUserAttitudeEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +public interface EventUserAttitudeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author + * @date + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author + * @date + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return EventUserAttitudeDTO + * @author + * @date + */ + EventUserAttitudeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author + * @date + */ + void save(EventUserAttitudeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author + * @date + */ + void update(EventUserAttitudeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author + * @date + */ + void delete(String[] ids); + + + void statement(StatementFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java index 323e6edb3..3233e64b5 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java @@ -21,12 +21,10 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO; -import com.elink.esua.epdc.dto.issue.IssueContentDetailDTO; -import com.elink.esua.epdc.dto.issue.IssueDTO; -import com.elink.esua.epdc.dto.issue.IssueWaitHandleDetailDTO; -import com.elink.esua.epdc.dto.issue.IssueWaitHandleOrClosedDTO; +import com.elink.esua.epdc.dto.issue.*; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueWaitHandleSubmitFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import com.elink.esua.epdc.modules.issue.entity.IssueEntity; @@ -154,4 +152,5 @@ public interface IssueService extends BaseService { * @Date: 2019/9/7 12:14 */ Result> listIssues(IssueFormDTO formDto); + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/EventUserAttitudeServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/EventUserAttitudeServiceImpl.java new file mode 100755 index 000000000..438086af0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/EventUserAttitudeServiceImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.issue.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.issue.EventUserAttitudeDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; +import com.elink.esua.epdc.modules.events.service.EpdcEventsService; +import com.elink.esua.epdc.modules.issue.dao.EventUserAttitudeDao; +import com.elink.esua.epdc.modules.issue.entity.EventUserAttitudeEntity; +import com.elink.esua.epdc.modules.issue.redis.EventUserAttitudeRedis; +import com.elink.esua.epdc.modules.issue.service.EventUserAttitudeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件点赞点踩表 事件点赞点踩表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-09-09 + */ +@Service +public class EventUserAttitudeServiceImpl extends BaseServiceImpl implements EventUserAttitudeService { + + @Autowired + private EventUserAttitudeRedis eventUserAttitudeRedis; + + @Autowired + private EpdcEventsService epdcEventsService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EventUserAttitudeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, EventUserAttitudeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public EventUserAttitudeDTO get(String id) { + EventUserAttitudeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, EventUserAttitudeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(EventUserAttitudeDTO dto) { + EventUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, EventUserAttitudeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(EventUserAttitudeDTO dto) { + EventUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, EventUserAttitudeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void statement(StatementFormDTO formDto) { + EventUserAttitudeDTO eventUserAttitudeDTO = new EventUserAttitudeDTO(); + eventUserAttitudeDTO.setEventId(formDto.getIssueId()); + eventUserAttitudeDTO.setAttitudeFlag(formDto.getAttitude()); + eventUserAttitudeDTO.setUserId(formDto.getUserId()); + this.save(eventUserAttitudeDTO); + + epdcEventsService.updateApproveNumOrOpposeNum(formDto.getIssueId(),formDto.getAttitude()); + + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java index c219b59a9..ff2e17b1f 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java @@ -32,11 +32,13 @@ import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO; import com.elink.esua.epdc.dto.issue.*; import com.elink.esua.epdc.dto.issue.form.IssueFormDTO; import com.elink.esua.epdc.dto.issue.form.IssueWaitHandleSubmitFormDTO; +import com.elink.esua.epdc.dto.issue.form.StatementFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueResultDTO; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import com.elink.esua.epdc.modules.issue.dao.IssueDao; import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import com.elink.esua.epdc.modules.issue.entity.IssueHandleEntity; +import com.elink.esua.epdc.modules.issue.service.EventUserAttitudeService; import com.elink.esua.epdc.modules.issue.service.IssueHandleService; import com.elink.esua.epdc.modules.issue.service.IssueService; import com.elink.esua.epdc.modules.item.entity.ItemEntity; @@ -74,6 +76,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Autowired private EpdcEventsService epdcEventsService; + @Autowired + private EventUserAttitudeService eventUserAttitudeService; + @Override public PageData listOfIssues(Map params) { IPage page = getPage(params); diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml index 4b142a421..64be95bb2 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml @@ -27,4 +27,23 @@ + + + UPDATE epdc_event_comment + + SET LIKE_COUNT = LIKE_COUNT + 1 + + + SET UN_LIKE_COUNT = UN_LIKE_COUNT + 1 + + WHERE ID = #{commentId} + + + + UPDATE epdc_event_comment + SET REPLY_COUNT = REPLY_COUNT + 1 + WHERE ID = #{commentId} + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml index 1c85bec76..082552aa6 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml @@ -164,4 +164,15 @@ UPDATE epdc_events SET COMMENT_NUM = COMMENT_NUM + 1 WHERE ID = #{id} + + UPDATE epdc_events + + SET APPROVE_NUM = APPROVE_NUM + 1 + + + SET OPPOSE_NUM = OPPOSE_NUM + 1 + + WHERE ID = #{eventId} + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/EventCommentUserAttitudeDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/EventCommentUserAttitudeDao.xml new file mode 100755 index 000000000..fdf136a15 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/EventCommentUserAttitudeDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/EventUserAttitudeDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/EventUserAttitudeDao.xml new file mode 100755 index 000000000..1475d0794 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/EventUserAttitudeDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml index b900735f6..aa6ba393b 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml @@ -286,4 +286,8 @@ ORDER BY img.CREATED_TIME + + + +