From 3bc3540db22b837bb37ac66f2bb3e0a56cd1cb67 Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期五, 18 十一月 2022 14:32:19 +0800
Subject: [PATCH] Merge branch 'local_20221104' into huacheng_test
---
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java | 217 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 194 insertions(+), 23 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
index 11c5138..3f45bf0 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
@@ -1,16 +1,14 @@
package com.panzhihua.applets.api;
-import javax.annotation.Resource;
-
-import org.springframework.util.ObjectUtils;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
+import cn.hutool.core.util.StrUtil;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.constants.Constants;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.CommonDTO;
import com.panzhihua.common.model.dtos.PageDTO;
+import com.panzhihua.common.model.dtos.common.EditComActEasyPhotoHandlerDto;
+import com.panzhihua.common.model.dtos.common.EvaluateEasyDto;
+import com.panzhihua.common.model.dtos.common.PageComActEasyPhotoHandlerDto;
import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO;
import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO;
import com.panzhihua.common.model.dtos.community.NoticeReadDTO;
@@ -18,19 +16,26 @@
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.advertisement.ComOpsAdvVO;
+import com.panzhihua.common.model.vos.common.ComActEasyPhotoHandlerVo;
import com.panzhihua.common.model.vos.community.*;
+import com.panzhihua.common.model.vos.community.easyPhoto.BannerVO;
import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoClassifyVO;
import com.panzhihua.common.model.vos.user.NoticeUnReadVO;
import com.panzhihua.common.model.vos.user.SysUserAgreementVO;
import com.panzhihua.common.model.vos.user.SysUserNoticeVO;
+import com.panzhihua.common.service.community.ComActEasyPhotoEvaluateFeign;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.validated.AddGroup;
import com.panzhihua.common.validated.PageGroup;
-
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
+import org.springframework.util.ObjectUtils;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
/**
* @program: springcloud_k8s_panzhihuazhihuishequ
@@ -48,6 +53,8 @@
private UserService userService;
@Resource
private CheckService checkService;
+ @Resource
+ private ComActEasyPhotoEvaluateFeign easyPhotoEvaluateFeign;
@ApiOperation(value = "分页展示社区随手拍", response = ComActEasyPhotoVO.class)
@PostMapping("pageeasyphoto")
@@ -56,17 +63,44 @@
if (loginUserInfo != null) {
comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId());
comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId());
+ comActEasyPhotoVO.setIsDpcMember(loginUserInfo.getIsDpcMember());
}
return communityService.pageEasyPhotoApplets(comActEasyPhotoVO);
+ }
+
+ @ApiOperation(value = "分页展示社区随手拍-脱敏", response = ComActEasyPhotoVO.class)
+ @PostMapping("pageEasyPhotoDesensitize")
+ public R pageEasyPhotoDesensitize(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) {
+ LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
+ if (loginUserInfo != null) {
+ comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId());
+ comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId());
+ comActEasyPhotoVO.setIsDpcMember(loginUserInfo.getIsDpcMember());
+ }
+ return communityService.pageEasyPhotoAppletsDesensitize(comActEasyPhotoVO);
}
@ApiOperation("上传随手拍")
@PostMapping("easyphoto")
public R addEasyPhoto(@RequestBody @Validated(AddGroup.class) ComActEasyPhotoVO comActEasyPhotoVO) {
// 微信内容审核
- String msg = comActEasyPhotoVO.getDetail();
- if (!checkService.checkMessage(msg)) {
- return R.fail("内容违规");
+ String openid = this.getLoginUserInfo().getOpenid();
+ String appId = this.getAppId();
+ // 微信内容审核
+ String detail = comActEasyPhotoVO.getDetail();
+ if (StrUtil.isNotBlank(detail)) {
+ String result = checkService.checkMessageBy(detail, openid, appId);
+ if (StrUtil.isNotBlank(result)) {
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
+ }
+ }
+
+ //微信图片审核
+ String photoPathList = comActEasyPhotoVO.getPhotoPathList();
+ if (StrUtil.isNotBlank(photoPathList)) {
+ if (!checkService.checkImageBy(photoPathList, appId)) {
+ return R.fail(501, "上传图片存在违规信息");
+ }
}
LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
Long communityId = loginUserInfo.getCommunityId();
@@ -78,6 +112,42 @@
comActEasyPhotoVO.setSponsorId(userId);
comActEasyPhotoVO.setStatus(1);
return communityService.addEasyPhoto(comActEasyPhotoVO);
+ }
+
+ /**
+ * description queryByPage 分页查询
+ *
+ * @param comActEasyPhotoHandler 请求参数
+ * @return 分页查询返回参数
+ * @author lyq
+ * @date 2022-03-01 13:45:10
+ */
+ @ApiOperation(value = "查询处理列表", response = ComActEasyPhotoHandlerVo.class)
+ @PostMapping("/handleList")
+ public R handleList(@RequestBody PageComActEasyPhotoHandlerDto comActEasyPhotoHandler) {
+ comActEasyPhotoHandler.setUserId(this.getUserId());
+ return this.communityService.queryEasyPhotoHandler(comActEasyPhotoHandler);
+ }
+
+ /**
+ * description edit 编辑数据
+ *
+ * @param comActEasyPhotoHandler 请求参数
+ * @return 编辑结果
+ * @author lyq
+ * @date 2022-03-01 13:45:10
+ */
+ @ApiOperation(value = "提交反馈")
+ @PostMapping("/editEasyPhotoHandler")
+ public R editEasyPhotoHandler(@RequestBody EditComActEasyPhotoHandlerDto comActEasyPhotoHandler) {
+ return this.communityService.editEasyPhotoHandler(comActEasyPhotoHandler);
+ }
+
+ @ApiOperation(value = "查询处理详情", response = ComActEasyPhotoHandlerVo.class)
+ @ApiImplicitParam(name = "id", value = "处理id", required = true)
+ @GetMapping("/easyPhotoHandler")
+ public R detailEasyPhotoHandler(@RequestParam("id") Long id) {
+ return this.communityService.detailEasyPhotoHandler(id);
}
@ApiOperation(value = "查询随手拍是否有活动", response = ComActEasyPhotoActivityVO.class)
@@ -102,6 +172,17 @@
}
return communityService.detailEasyPhoto(id, userId);
}
+ @ApiOperation(value = "随手拍详情-脱敏", response = ComActEasyPhotoVO.class)
+ @GetMapping("detailEasyPhotoDesensitize")
+ @ApiImplicitParam(name = "id", value = "随手拍主键")
+ public R detailEasyPhotoDesensitize(@RequestParam("id") Long id) {
+ Long userId = 0L;
+ LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
+ if (loginUserInfo != null) {
+ userId = loginUserInfo.getUserId();
+ }
+ return communityService.detailEasyPhotoDesensitize(id, userId);
+ }
@ApiOperation(value = "随手拍--评论--分页查询", response = ComActEasyPhotoCommentVO.class)
@PostMapping("pagecomacteasyphotocomment")
@@ -115,9 +196,32 @@
return communityService.pageComActEasyPhotoComment(pageComActEasyPhotoCommentDTO);
}
+ @ApiOperation(value = "随手拍--评论--分页查询-脱敏", response = ComActEasyPhotoCommentVO.class)
+ @PostMapping("pageComActEasyPhotoCommentDesensitize")
+ public R pageComActEasyPhotoCommentDesensitize(@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO) {
+ Long userId = 0L;
+ LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
+ if (loginUserInfo != null) {
+ userId = loginUserInfo.getUserId();
+ }
+ pageComActEasyPhotoCommentDTO.setUserId(userId);
+ return communityService.pageComActEasyPhotoCommentDesensitize(pageComActEasyPhotoCommentDTO);
+ }
+
@ApiOperation(value = "随手拍--评论--新增评论")
@PostMapping("comacteasyphotocomment")
public R addComActEasyPhotoComment(@RequestBody ComActEasyPhotoCommentDTO comActEasyPhotoCommentDTO) {
+ // 微信内容审核
+ String openid = this.getLoginUserInfo().getOpenid();
+ String appId = this.getAppId();
+ // 微信内容审核
+ String comment = comActEasyPhotoCommentDTO.getComment();
+ if (StrUtil.isNotBlank(comment)) {
+ String result = checkService.checkMessageBy(comment, openid, appId);
+ if (StrUtil.isNotBlank(result)) {
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
+ }
+ }
comActEasyPhotoCommentDTO.setUserId(this.getUserId());
return communityService.addComActEasyPhotoComment(comActEasyPhotoCommentDTO);
}
@@ -155,7 +259,20 @@
}
comActMicroWishVO.setIsApplets(1);
comActMicroWishVO.setIsPageMyWish(null);
- return communityService.pageMicroWish(comActMicroWishVO);
+ return communityService.pageMicroWishApplets(comActMicroWishVO);
+ }
+
+ @ApiOperation(value = "分页展示社区微心愿-脱敏", response = ComActMicroWishVO.class)
+ @PostMapping("pageMicroWishDesensitize")
+ public R pageMicroWishDesensitize(@RequestBody ComActMicroWishVO comActMicroWishVO) {
+ LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
+ if (loginUserInfo != null) {
+ comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId());
+ comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());// 责任人暂时放登录用户id
+ }
+ comActMicroWishVO.setIsApplets(1);
+ comActMicroWishVO.setIsPageMyWish(null);
+ return communityService.pageMicroWishAppletsDesensitize(comActMicroWishVO);
}
@ApiOperation("发布微心愿")
@@ -163,8 +280,11 @@
public R addMicroWish(@RequestBody @Validated(AddGroup.class) ComActMicroWishVO comActMicroWishVO) {
// 微信内容审核
String msg = comActMicroWishVO.getDetail();
- if (!checkService.checkMessage(msg)) {
- return R.fail("内容违规");
+ if (StrUtil.isNotBlank(msg)) {
+ String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
+ if (StrUtil.isNotBlank(result)) {
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
+ }
}
LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
Long communityId = loginUserInfo.getCommunityId();
@@ -195,6 +315,18 @@
return communityService.detailMicroWish(id, userId);
}
+ @ApiOperation(value = "心愿详情-脱敏", response = ComActMicroWishVO.class)
+ @GetMapping("microwishDesensitize")
+ @ApiImplicitParam(name = "id", value = "微心愿主键")
+ public R detailMicroWishDesensitize(@RequestParam("id") Long id) {
+ Long userId = 0L;
+ LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
+ if (loginUserInfo != null) {
+ userId = loginUserInfo.getUserId();
+ }
+ return communityService.detailMicroWishDesensitize(id, userId);
+ }
+
@ApiOperation("点赞/取消点赞微心愿")
@PutMapping("microwish")
public R putMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO) {
@@ -209,8 +341,8 @@
@ApiOperation(value = "首页广告banner", response = ComOpsAdvVO.class)
@GetMapping("listadvertisement/noToken")
- public R listAdvertisement() {
- return communityService.listAdvertisement();
+ public R listAdvertisement(@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) {
+ return communityService.listAdvertisement(type);
}
@ApiOperation(value = "分页通知列表", response = SysUserNoticeVO.class)
@@ -240,7 +372,7 @@
@GetMapping("agreement")
@ApiImplicitParam(name = "type", value = "1居民端app协议 2网格员端app协议 3商家端app协议 4隐私政策")
public R agreement(@RequestParam("type") Integer type) {
- return userService.agreement(type);
+ return userService.agreement(type, this.getAppId());
}
@ApiOperation("发布留言")
@@ -248,8 +380,11 @@
public R addMessage(@RequestBody @Validated(AddGroup.class) ComActMessageVO comActMessageVO) {
// 微信内容审核
String msg = comActMessageVO.getMsgContent();
- if (!checkService.checkMessage(msg)) {
- return R.fail("内容违规");
+ if (StrUtil.isNotBlank(msg)) {
+ String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
+ if (StrUtil.isNotBlank(result)) {
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
+ }
}
LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
Long communityId = loginUserInfo.getCommunityId();
@@ -275,8 +410,11 @@
public R addMessageBack(@RequestBody @Validated(AddGroup.class) ComActMessageBackVO comActMessageBackVO) {
// 微信内容审核
String msg = comActMessageBackVO.getMsgContent();
- if (!checkService.checkMessage(msg)) {
- return R.fail("内容违规");
+ if (StrUtil.isNotBlank(msg)) {
+ String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
+ if (StrUtil.isNotBlank(result)) {
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
+ }
}
LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
Long communityId = loginUserInfo.getCommunityId();
@@ -343,16 +481,42 @@
return R.ok(Constants.IS_SHOP_OPEN);
}
- @ApiOperation(value = "获取最新活动和用户最新收益", response = ComActEasyPhotoRewardVO.class)
+ @ApiOperation(value = "获取最新活动和用户最新收益", response = BannerVO.class)
@GetMapping("getUserReward")
public R getUserReward(@RequestParam("communityId") Long communityId) {
Long userId = 0L;
LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
if (loginUserInfo != null) {
userId = loginUserInfo.getUserId();
- communityId = loginUserInfo.getCommunityId();
+ if (loginUserInfo.getCommunityId() != null) {
+ communityId = loginUserInfo.getCommunityId();
+ }
}
return communityService.getUserReward(userId, communityId);
+ }
+
+ @ApiOperation(value = "获取首页弹窗接口", response = ComActEasyPhotoRewardVO.class)
+ @GetMapping("getUserRewards")
+ public R getUserRewards(@RequestParam("communityId") Long communityId) {
+ Long userId = 0L;
+ LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
+ if (loginUserInfo != null) {
+ userId = loginUserInfo.getUserId();
+ communityId = loginUserInfo.getCommunityId();
+ }
+ return communityService.getUserRewards(userId, communityId);
+ }
+
+ @ApiOperation(value = "获取普达首页弹窗接口", response = ComActEasyPhotoRewardVO.class)
+ @GetMapping("getUserRewardsNew")
+ public R getUserRewardsNew(@RequestParam("communityId") Long communityId) {
+ Long userId = 0L;
+ LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
+ if (loginUserInfo != null) {
+ userId = loginUserInfo.getUserId();
+ communityId = loginUserInfo.getCommunityId();
+ }
+ return communityService.getUserRewardsNew(userId, communityId);
}
@ApiOperation(value = "读取用户随手拍奖励")
@@ -364,6 +528,13 @@
@ApiOperation(value = "随手拍分类列表", response = ComActEasyPhotoClassifyVO.class)
@GetMapping("easyphoto/classify/list")
public R easyPhotoClassifyList() {
- return communityService.listPhotoClassify();
+ return communityService.listPhotoClassify(this.getAreaCode());
+ }
+
+ @ApiOperation(value = "随手拍评价")
+ @PostMapping("easyphoto/whistle/evaluate")
+ public R evaluateEasyPhotoWhistle(@RequestBody EvaluateEasyDto whistleDto) {
+ whistleDto.setUserId(this.getUserId());
+ return easyPhotoEvaluateFeign.evaluateEasyApplets(whistleDto);
}
}
--
Gitblit v1.7.1