yanghui
2022-10-10 fe5975b8fc4592e3925a678c28a26563669574e9
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java
@@ -1,25 +1,22 @@
package com.panzhihua.applets.api;
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 javax.annotation.Resource;
import com.panzhihua.common.model.vos.neighbor.*;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.*;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.neighbor.*;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.neighbor.*;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import static java.util.Objects.isNull;
import javax.annotation.Resource;
/**
 * @auther lyq
@@ -69,6 +66,19 @@
        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(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        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())) {
            addNeighborCircleAppDTO.setPhone(this.getLoginUserInfo().getPhone());
@@ -78,6 +88,14 @@
        }
        //查询社区自动审核是否开着
        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)){
@@ -86,7 +104,7 @@
                if(value.equals("1")){
                    addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no);
                    String msg = addNeighborCircleAppDTO.getReleaseContent();
                    if (checkService.checkMessage(msg)) {
                        if (StrUtil.isEmpty(checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(), this.getAppId()))) {
                        addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes);
                    }else{
                        addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.no);
@@ -100,6 +118,7 @@
            }
        }else{
            addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes);
            }
        }
        return communityService.addNeighborByApp(addNeighborCircleAppDTO);
@@ -164,6 +183,13 @@
        if (userId == null) {
            return R.fail("请先登录");
        }
        String content = commentAppDTO.getContent();
        if (StrUtil.isNotBlank(content)) {
            String result = checkService.checkMessageBy(content, this.getLoginUserInfo().getOpenid(), this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        commentAppDTO.setUserId(userId);
        return communityService.neighborCommentByApp(commentAppDTO);
    }
@@ -174,6 +200,13 @@
        Long userId = this.getLoginUserInfo().getUserId();
        if (userId == null) {
            return R.fail("请先登录");
        }
        String content = replyAppDTO.getContent();
        if (StrUtil.isNotBlank(content)) {
            String result = checkService.checkMessageBy(content, this.getLoginUserInfo().getOpenid(), this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        replyAppDTO.setUserId(userId);
        return communityService.neighborReplyByApp(replyAppDTO);
@@ -238,8 +271,7 @@
    /**
     * 分页查询邻里圈列表
     *
     * @param neighborCircleAppDTO
     *            请求参数
     * @param neighborCircleAppDTO 请求参数
     * @return 邻里圈列表
     */
    @ApiOperation(value = "新版接单问题",response =ComActNeighborCircleAppVO.class )
@@ -252,6 +284,7 @@
    /**
     * 修改数据
     *
     * @param editNeighborCircleAdminVO
     * @return
     */
@@ -269,6 +302,7 @@
    /**
     * 求助我的问题数量统计
     *
     * @param type
     * @param phone
     * @return