huanghongfa
2021-01-24 cb07aef10f307403e2d8b3249bb9b7de7f3d295f
评论
12个文件已修改
2个文件已添加
225 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComActDiscussCommentUserDTO.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/PageComActDiscussCommentDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/community/ComActDiscussCommentUserDTO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/community/PageComActDiscussCommentDTO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/community/CommunityService.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/DiscussApi.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActDiscussService.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml
@@ -23,7 +23,19 @@
  </component>
  <component name="ChangeListManager">
    <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment="">
      <change afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/dtos/community/ComActDiscussCommentUserDTO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/dtos/community/PageComActDiscussCommentDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/dtos/community/PageComActDiscussCommentDTO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/service/community/CommunityService.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/service/community/CommunityService.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/api/DiscussApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/api/DiscussApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/ComActDiscussService.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/ComActDiscussService.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_community/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/resources/bootstrap.yml" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -406,7 +418,7 @@
      <workItem from="1610939265133" duration="8588000" />
      <workItem from="1610956684718" duration="7037000" />
      <workItem from="1611019208339" duration="94460000" />
      <workItem from="1611365644515" duration="28048000" />
      <workItem from="1611365644515" duration="32363000" />
    </task>
    <servers />
  </component>
@@ -430,10 +442,10 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="249" y="0" key="#Project_Structure/0.0.1536.824@0.0.1536.824" timestamp="1608546608273" />
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser" timestamp="1611449962791">
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser" timestamp="1611464583993">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1611449962791" />
    <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1611464583993" />
    <state x="405" y="335" key="#com.intellij.refactoring.move.MoveHandler.SelectRefactoringDialog" timestamp="1606099594079">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -462,54 +474,54 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1610606590056" />
    <state width="1031" height="477" key="GridCell.Tab.0.bottom" timestamp="1611460936374">
    <state width="1031" height="477" key="GridCell.Tab.0.bottom" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611460936374" />
    <state width="1031" height="477" key="GridCell.Tab.0.center" timestamp="1611460936374">
    <state width="1031" height="477" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.0.center" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1611460936374" />
    <state width="1031" height="477" key="GridCell.Tab.0.left" timestamp="1611460936374">
    <state width="1031" height="477" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.0.left" timestamp="1611465837492">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1611460936374" />
    <state width="1031" height="477" key="GridCell.Tab.0.right" timestamp="1611460936374">
    <state width="1031" height="477" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1611465837492" />
    <state width="1031" height="477" key="GridCell.Tab.0.right" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1611460936374" />
    <state width="1031" height="477" key="GridCell.Tab.1.bottom" timestamp="1611460936375">
    <state width="1031" height="477" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.1.bottom" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611460936375" />
    <state width="1031" height="477" key="GridCell.Tab.1.center" timestamp="1611460936374">
    <state width="1031" height="477" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.1.center" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1611460936374" />
    <state width="1031" height="477" key="GridCell.Tab.1.left" timestamp="1611460936374">
    <state width="1031" height="477" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.1.left" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1611460936374" />
    <state width="1031" height="477" key="GridCell.Tab.1.right" timestamp="1611460936374">
    <state width="1031" height="477" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.1.right" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1611460936374" />
    <state width="1031" height="477" key="GridCell.Tab.2.bottom" timestamp="1611460936375">
    <state width="1031" height="477" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.2.bottom" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611460936375" />
    <state width="1031" height="477" key="GridCell.Tab.2.center" timestamp="1611460936375">
    <state width="1031" height="477" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.2.center" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1611460936375" />
    <state width="1031" height="477" key="GridCell.Tab.2.left" timestamp="1611460936375">
    <state width="1031" height="477" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.2.left" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1611460936375" />
    <state width="1031" height="477" key="GridCell.Tab.2.right" timestamp="1611460936375">
    <state width="1031" height="477" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state width="1031" height="477" key="GridCell.Tab.2.right" timestamp="1611465837493">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="477" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1611460936375" />
    <state width="1031" height="477" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1611465837493" />
    <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1610611848124">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -546,10 +558,10 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="131" y="82" key="new project wizard/0.0.1536.824@0.0.1536.824" timestamp="1610606891357" />
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog" timestamp="1611121937197">
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog" timestamp="1611462424079">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog/0.0.1536.824@0.0.1536.824" timestamp="1611121937197" />
    <state x="545" y="169" key="refactoring.ChangeSignatureDialog/0.0.1536.824@0.0.1536.824" timestamp="1611462424079" />
    <state x="425" y="187" key="run.anything.popup" timestamp="1608280452280">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/DiscussApi.java
@@ -96,11 +96,19 @@
        return communityService.putDiscussUser(comActDiscussUserDTO);
    }
    @ApiOperation(value = "一起议-评论-点赞、取消点赞")
    @PutMapping("discusscommentuser")
    public R putDiscussCommentUser(@RequestBody @Validated ComActDiscussCommentUserDTO comActDiscussUserDTO) {
        comActDiscussUserDTO.setUserId(this.getUserId());
        return communityService.putDiscussCommentUser(comActDiscussUserDTO);
    }
    @ApiOperation(value = "一起议-详情",response = ComActDiscussVO.class)
    @GetMapping("discuss")
    @ApiImplicitParam(name = "id",value = "一起议主键",required = true)
    public R detailDiscuss(@RequestParam("id") Long id) {
        return communityService.detailDiscussApplets(id);
        Long userId = this.getUserId();
        return communityService.detailDiscussApplets(id,userId);
    }
    @ApiOperation(value = "一起议-评论-分页查询",response = ComActDiscussCommentVO.class)
@@ -110,6 +118,7 @@
        if (null==id||0==id) {
            return R.fail("一起议主键不能为空");
        }
        pageComActDiscussCommentDTO.setLoginUserId(this.getUserId());
        return communityService.pageDiscussCommentApplets(pageComActDiscussCommentDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComActDiscussCommentUserDTO.java
New file
@@ -0,0 +1,29 @@
package com.panzhihua.common.model.dtos.community;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 一起议评论点赞
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2021-01-24 12:58
 **/
@Data
@ApiModel("一起议评论点赞")
public class ComActDiscussCommentUserDTO {
    @ApiModelProperty("评论主键")
    @Min(value = 1,message = "评论主键不能为空")
    private Long id;
    @ApiModelProperty(value = "用户主键",hidden = true)
    private Long userId;
    @ApiModelProperty("操作类型 1 点赞 2 取消点赞")
    @Min(value = 1,message = "操作类型不能为空")
    private Integer type;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/PageComActDiscussCommentDTO.java
@@ -31,4 +31,7 @@
    @ApiModelProperty(value = "一起议主键id")
    private Long id;
    @ApiModelProperty(value = "登录用户",required = true)
    private Long loginUserId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.java
@@ -57,6 +57,9 @@
    @ApiModelProperty("点赞数量")
    private Integer num;
    @ApiModelProperty("是否点赞 1 是 0 否")
    private Integer haveSign;
    @ApiModelProperty("回复内容")
    private String commentBack;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -786,10 +786,11 @@
    /**
     * 一起议-详情 小程序
     * @param id 主键
     * @param userId 登录用户主键
     * @return ComActDiscussVO
     */
    @PostMapping("detaildiscussapplets")
    R detailDiscussApplets(@RequestParam("id") Long id);
    R detailDiscussApplets(@RequestParam("id") Long id, @RequestParam("userId")Long userId);
    /**
     * 一起议-投票
@@ -798,4 +799,12 @@
     */
    @PostMapping("adddiscussoptionuser")
    R addDiscussOptionUser(@RequestBody ComActDiscussOptionUserDTO comActDiscussOptionUserDTO);
    /**
     * 一起议-评论-点赞、取消点赞
     * @param comActDiscussUserDTO 评论点赞
     * @return 点赞结果
     */
    @PostMapping("putdiscusscommentuser")
    R putDiscussCommentUser(@RequestBody ComActDiscussCommentUserDTO comActDiscussUserDTO);
}
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/community/ComActDiscussCommentUserDTO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/community/PageComActDiscussCommentDTO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActDiscussCommentVO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/community/CommunityService.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/DiscussApi.java
@@ -145,11 +145,12 @@
    /**
     * 一起议-详情 小程序
     * @param id 主键
     * @param userId 用户主键
     * @return ComActDiscussVO
     */
    @PostMapping("detaildiscussapplets")
    public R detailDiscussApplets(@RequestParam("id") Long id){
        return comActDiscussService.detailDiscussApplets(id);
    public R detailDiscussApplets(@RequestParam("id") Long id,@RequestParam("userId")Long userId){
        return comActDiscussService.detailDiscussApplets(id,userId);
    }
    /**
@@ -162,4 +163,14 @@
        return comActDiscussService.addDiscussOptionUser(comActDiscussOptionUserDTO);
    }
    /**
     * 一起议-评论-点赞、取消点赞
     * @param comActDiscussUserDTO 评论点赞
     * @return 点赞结果
     */
    @PostMapping("putdiscusscommentuser")
    public R putDiscussCommentUser(@RequestBody ComActDiscussCommentUserDTO comActDiscussUserDTO){
        return comActDiscussService.putDiscussCommentUser(comActDiscussUserDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
@@ -40,7 +40,7 @@
            "d.id,\n" +
            "d.`discuss_subject`,\n" +
            "d.type,\n" +
            "COUNT( c.id ) commentNum,\n" +
            "COUNT( DISTINCT c.id ) commentNum,\n" +
            "u.name userName,\n" +
            "d.create_at \n" +
            "FROM\n" +
@@ -68,7 +68,7 @@
            "u.phone,\n" +
            "c.`comment`,\n" +
            "c.`parent_id`,\n" +
            "COUNT( cu.id ) num,\n" +
            "COUNT(DISTINCT  cu.id ) num,\n" +
            "c.create_at,\n" +
            "c.id \n" +
            "FROM\n" +
@@ -100,8 +100,8 @@
            "d.photo_pah,\n" +
            "d.`discuss_subject`,\n" +
            "d.type,\n" +
            "COUNT( c.id ) commentNum,\n" +
            "COUNT( du.id ) signNum,\n" +
            "COUNT( DISTINCT c.id ) commentNum,\n" +
            "COUNT( DISTINCT du.id ) signNum,\n" +
            "if(u.type=1,u.name,a.name) userName,\n" +
            "if(du.id is not null,1,0) haveSign,\n" +
            "if(ou.id is not null,1,0) haveVote,\n" +
@@ -169,4 +169,17 @@
    @Select("select name from com_act where community_id=#{communityId}")
    ComActVO selectCommunity(Long communityId);
    @Select("SELECT \n" +
            "if(du.id is not null,1,0)haveSign,\n" +
            "if(ou.id is not null,1,0)haveVote\n" +
            "FROM\n" +
            "com_act_discuss d \n" +
            "LEFT JOIN com_act_discuss_user du on d.id=du.discuss_id and du.`user_id`=#{loginUserId}\n" +
            "LEFT JOIN com_act_discuss_option op on d.id=op.discuss_id\n" +
            "LEFT JOIN com_act_discuss_option_user ou on op.id=ou.discuss_option_id and ou.user_id=#{loginUserId}\n" +
            "WHERE\n" +
            "d.id =#{id}\n" +
            "GROUP BY d.id")
    ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId")Long loginUserId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActDiscussService.java
@@ -85,13 +85,20 @@
    /**
     * 一起议-详情 小程序
     * @param id 主键
     * @param userId 用户主键
     * @return ComActDiscussVO
     */
    R detailDiscussApplets(Long id);
    R detailDiscussApplets(Long id, Long userId);
    /**
     * 一起议-投票
     * @param comActDiscussOptionUserDTO 投票信息
     * @return 投票结果
     */
    R addDiscussOptionUser(ComActDiscussOptionUserDTO comActDiscussOptionUserDTO);
    /**
     * 一起议-评论-点赞、取消点赞
     * @param comActDiscussUserDTO 评论点赞
     * @return 点赞结果
     */
    R putDiscussCommentUser(ComActDiscussCommentUserDTO comActDiscussUserDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java
@@ -340,6 +340,12 @@
                    });
                    comActDiscussVO.setComActDiscussOptionVOS(comActDiscussOptionVOS);
                }
                Integer integer = comActDiscussUserDAO.selectCount(new QueryWrapper<ComActDiscussUserDO>().lambda().eq(ComActDiscussUserDO::getDiscussId, comActDiscussVO.getId()).eq(ComActDiscussUserDO::getUserId, pageComActDiscussDTO.getLoginUserId()));
                if (integer>0) {
                    comActDiscussVO.setHaveSign(1);
                }else{
                    comActDiscussVO.setHaveSign(0);
                }
            });
        }
        return R.ok(iPage);
@@ -408,9 +414,22 @@
                            String userName = collect1.get(0).getUserName();
                            comActDiscussCommentVO1.setUserNameBack(userName);
                        }
                        Integer integer = comActDiscussCommentUserDAO.selectCount(new QueryWrapper<ComActDiscussCommentUserDO>().lambda().eq(ComActDiscussCommentUserDO::getDisscussCommentId, comActDiscussCommentVO1.getId()).eq(ComActDiscussCommentUserDO::getUserId, pageComActDiscussCommentDTO.getLoginUserId()));
                        if (integer>0) {
                            comActDiscussCommentVO1.setHaveSign(1);
                        }else {
                            comActDiscussCommentVO1.setHaveSign(0);
                        }
                    });
                    comActDiscussCommentVO.setComActDiscussCommentVOList(comActDiscussCommentVOList);
                }
                Integer integer = comActDiscussCommentUserDAO.selectCount(new QueryWrapper<ComActDiscussCommentUserDO>().lambda().eq(ComActDiscussCommentUserDO::getDisscussCommentId, comActDiscussCommentVO.getId()).eq(ComActDiscussCommentUserDO::getUserId, pageComActDiscussCommentDTO.getLoginUserId()));
                if (integer>0) {
                    comActDiscussCommentVO.setHaveSign(1);
                }else {
                    comActDiscussCommentVO.setHaveSign(0);
                }
            });
        }
        return R.ok(iPage);
@@ -420,10 +439,11 @@
     * 一起议-详情 小程序
     *
     * @param id 主键
     * @param loginUserId 登录用户主键
     * @return ComActDiscussVO
     */
    @Override
    public R detailDiscussApplets(Long id) {
    public R detailDiscussApplets(Long id, Long loginUserId) {
        ComActDiscussDO comActDiscussDO = comActDiscussDAO.selectById(id);
        if (ObjectUtils.isEmpty(comActDiscussDO)) {
            return R.fail("一起议不存在");
@@ -458,6 +478,9 @@
            ComActVO comActVO=comActDiscussDAO.selectCommunity(communityId);
            comActDiscussVO.setUserName(comActVO.getName());
        }
        ComActDiscussVO comActDiscussVO1=comActDiscussDAO.selectHaveSignAndHaveVote(id,loginUserId);
        comActDiscussVO.setHaveSign(comActDiscussVO1.getHaveSign());
        comActDiscussVO.setHaveVote(comActDiscussVO1.getHaveVote());
        return R.ok(comActDiscussVO);
    }
@@ -491,4 +514,32 @@
        }
        return R.fail();
    }
    /**
     * 一起议-评论-点赞、取消点赞
     *
     * @param comActDiscussCommentUserDTO 评论点赞
     * @return 点赞结果
     */
    @Override
    public R putDiscussCommentUser(ComActDiscussCommentUserDTO comActDiscussCommentUserDTO) {
        ComActDiscussCommentDO comActDiscussCommentDO = comActDiscussCommentDAO.selectById(comActDiscussCommentUserDTO.getId());
        if (ObjectUtils.isEmpty(comActDiscussCommentDO)) {
            return R.fail("评论不存在");
        }
        Integer type = comActDiscussCommentUserDTO.getType();
        int num=0;
        if (type.intValue()==1) {
            ComActDiscussCommentUserDO comActDiscussCommentUserDO=new ComActDiscussCommentUserDO();
            comActDiscussCommentUserDO.setUserId(comActDiscussCommentUserDTO.getUserId());
            comActDiscussCommentUserDO.setDisscussCommentId(comActDiscussCommentUserDTO.getId());
            num=comActDiscussCommentUserDAO.insert(comActDiscussCommentUserDO);
        } else {
            num=comActDiscussCommentUserDAO.delete(new QueryWrapper<ComActDiscussCommentUserDO>().lambda().eq(ComActDiscussCommentUserDO::getUserId,comActDiscussCommentUserDTO.getUserId()).eq(ComActDiscussCommentUserDO::getDisscussCommentId,comActDiscussCommentUserDTO.getId()));
        }
        if (num>0) {
            return R.ok();
        }
        return R.fail();
    }
}