| | |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.AddComActIntegralUserDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; |
| | |
| | | @ApiOperation(value = "一起议-分页查询",response = ComActDiscussVO.class) |
| | | @PostMapping("pagediscuss") |
| | | public R pageDiscuss(@RequestBody PageComActDiscussDTO pageComActDiscussDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | pageComActDiscussDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | Integer isMy = pageComActDiscussDTO.getIsMy(); |
| | | if (null!=isMy&&isMy.intValue()==1) { |
| | | pageComActDiscussDTO.setUserId(loginUserInfo.getUserId()); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | pageComActDiscussDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | pageComActDiscussDTO.setLoginUserId(loginUserInfo.getUserId()); |
| | | |
| | | Integer isMy = pageComActDiscussDTO.getIsMy(); |
| | | if (null!=isMy&&isMy.intValue()==1) { |
| | | pageComActDiscussDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | } |
| | | pageComActDiscussDTO.setLoginUserId(loginUserInfo.getUserId()); |
| | | return communityService.pageDiscussApplets(pageComActDiscussDTO); |
| | | } |
| | | |
| | |
| | | return R.fail("一起议主键不能为空"); |
| | | } |
| | | comActDiscussCommentDTO.setUserId(this.getUserId()); |
| | | //议事投票计算积分 |
| | | AddComActIntegralUserDTO integralUserDTO = new AddComActIntegralUserDTO(discussId,AddComActIntegralUserDTO.integralType.cyystp,this.getCommunityId(),this.getUserId()); |
| | | integralUserDTO.setIsComment(1); |
| | | communityService.addIntegralTradeAdmin(integralUserDTO); |
| | | return communityService.addDiscussComment(comActDiscussCommentDTO); |
| | | |
| | | } |
| | |
| | | @GetMapping("discuss") |
| | | @ApiImplicitParam(name = "id",value = "一起议主键",required = true) |
| | | public R detailDiscuss(@RequestParam("id") Long id) { |
| | | Long userId = this.getUserId(); |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailDiscussApplets(id,userId); |
| | | } |
| | | |
| | |
| | | if (null==id||0==id) { |
| | | return R.fail("一起议主键不能为空"); |
| | | } |
| | | pageComActDiscussCommentDTO.setLoginUserId(this.getUserId()); |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | pageComActDiscussCommentDTO.setLoginUserId(userId); |
| | | return communityService.pageDiscussCommentApplets(pageComActDiscussCommentDTO); |
| | | } |
| | | |
| | |
| | | ComActDiscussOptionUserDTO comActDiscussOptionUserDTO=new ComActDiscussOptionUserDTO(); |
| | | comActDiscussOptionUserDTO.setDiscussOptionId(id); |
| | | comActDiscussOptionUserDTO.setUserId(this.getUserId()); |
| | | //议事投票计算积分 |
| | | AddComActIntegralUserDTO integralUserDTO = new AddComActIntegralUserDTO(id,AddComActIntegralUserDTO.integralType.cyystp,this.getCommunityId(),this.getUserId()); |
| | | integralUserDTO.setIsComment(2); |
| | | communityService.addIntegralTradeAdmin(integralUserDTO); |
| | | return communityService.addDiscussOptionUser(comActDiscussOptionUserDTO); |
| | | } |
| | | |