From f91133c056282f9b89c6596e5b6e307437fc5bb5 Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期三, 02 十一月 2022 09:55:17 +0800
Subject: [PATCH] #feat 优化文件上传
---
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java | 70 ++++++++++++++++++++--------------
1 files changed, 41 insertions(+), 29 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java
index 767556f..e2a5240 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java
@@ -2,6 +2,7 @@
import cn.hutool.core.util.StrUtil;
import com.panzhihua.applets.weixin.CheckService;
+import com.panzhihua.common.constants.Constants;
import com.panzhihua.common.constants.NeighborCircleConstants;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.neighbor.*;
@@ -65,18 +66,20 @@
if (userId == null) {
return R.fail("请重新登录");
}
- String releaseContent = addNeighborCircleAppDTO.getReleaseContent();
- if (StrUtil.isNotBlank(releaseContent)) {
- String result = checkService.checkMessageBy(releaseContent, this.getLoginUserInfo().getOpenid(), this.getAppId());
- if (StrUtil.isNotBlank(result)) {
- return R.fail("填写内容存在 " + result + " 违规信息");
+ if (!this.getAppId().equals("wx118de8a734d269f0")){
+ String releaseContent = addNeighborCircleAppDTO.getReleaseContent();
+ if (StrUtil.isNotBlank(releaseContent)) {
+ String result = checkService.checkMessageBy(releaseContent, this.getLoginUserInfo().getOpenid(), this.getAppId());
+ if (StrUtil.isNotBlank(result)) {
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
+ }
}
- }
- String releaseImages = addNeighborCircleAppDTO.getReleaseImages();
- if (StrUtil.isNotBlank(releaseImages)) {
- if (checkService.checkImageBy(releaseImages, this.getAppId())) {
- return R.fail("上传图片存在违规信息");
- }
+ /* String releaseImages = addNeighborCircleAppDTO.getReleaseImages();
+ if (StrUtil.isNotBlank(releaseImages)) {
+ if (checkService.checkImageBy(releaseImages, this.getAppId())) {
+ return R.fail(501, "上传图片存在违规信息");
+ }
+ }*/
}
addNeighborCircleAppDTO.setUserId(userId);
if (StringUtils.isNotEmpty(loginUser.getPhone())) {
@@ -87,28 +90,37 @@
}
//查询社区自动审核是否开着
- String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE;
- R isOk = communityService.getSysConfValue(key + communityId, communityId);
- if (R.isOk(isOk)) {
- if (isOk.getData() != null) {
- String value = isOk.getData().toString();
- if (value.equals("1")) {
- addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no);
- String msg = addNeighborCircleAppDTO.getReleaseContent();
- if (checkService.checkMessage(msg)) {
- addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes);
+
+ if (this.getAppId().equals("wx118de8a734d269f0")) {
+ //花城直接通过
+ addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no);
+ addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes);
+
+ } else {
+ //西区
+ String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE;
+ R isOk = communityService.getSysConfValue(key + communityId, communityId);
+ if (R.isOk(isOk)) {
+ if (isOk.getData() != null) {
+ String value = isOk.getData().toString();
+ if (value.equals("1")) {
+ addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no);
+ String msg = addNeighborCircleAppDTO.getReleaseContent();
+ if (StrUtil.isEmpty(checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(), this.getAppId()))) {
+ addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes);
+ } else {
+ addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.no);
+ }
} else {
- addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.no);
+ addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes);
}
} else {
- addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes);
+ communityService.addSysConfValue(key + communityId, communityId, "社区邻里圈自动审核参数", "1");
+ addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no);
}
} else {
- communityService.addSysConfValue(key + communityId, communityId, "社区邻里圈自动审核参数", "1");
- addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no);
+ addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes);
}
- } else {
- addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes);
}
return communityService.addNeighborByApp(addNeighborCircleAppDTO);
@@ -177,7 +189,7 @@
if (StrUtil.isNotBlank(content)) {
String result = checkService.checkMessageBy(content, this.getLoginUserInfo().getOpenid(), this.getAppId());
if (StrUtil.isNotBlank(result)) {
- return R.fail("填写内容存在 " + result + " 违规信息");
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
}
}
commentAppDTO.setUserId(userId);
@@ -195,7 +207,7 @@
if (StrUtil.isNotBlank(content)) {
String result = checkService.checkMessageBy(content, this.getLoginUserInfo().getOpenid(), this.getAppId());
if (StrUtil.isNotBlank(result)) {
- return R.fail("填写内容存在 " + result + " 违规信息");
+ return R.fail(501, "填写内容存在 " + result + " 违规信息");
}
}
replyAppDTO.setUserId(userId);
--
Gitblit v1.7.1