Skip to content

Commit

Permalink
Merge pull request #53 from lianluoyi/dev
Browse files Browse the repository at this point in the history
V1.37.0.1版本更新
  • Loading branch information
lianluoyi authored Nov 12, 2024
2 parents bb81667 + fcc7344 commit 5f375d6
Show file tree
Hide file tree
Showing 85 changed files with 2,246 additions and 187 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.easyink.web.controller.openapi;


import com.easyink.common.core.domain.AjaxResult;
import com.easyink.wecom.handler.third.SessionArchiveHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

/**
* 类名: 对外开放的api接口
*
* @author : silver_chariot
* @date : 2022/3/14 15:44
*/
@RestController
@RequestMapping("/transfer")
@Api(tags = {"迁移接口"})
@AllArgsConstructor
@Slf4j
public class TransferApiController {

private final SessionArchiveHandler sessionArchiveHandler;

@PostMapping("/import/sessionArchive")
@ApiOperation("导入会话存档")
public AjaxResult<String> importSessionArchive(MultipartFile file, @RequestParam String corpId) {
try (InputStream is = file.getInputStream()) {
sessionArchiveHandler.importSessionArchive(is, corpId);
} catch (Exception e) {
log.info("导入会话存档失败: {}", e.getMessage());
return AjaxResult.error("导入会话存档失败");
}
return AjaxResult.success();
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.easyink.web.controller.wecom;


import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;
import com.easyink.common.core.controller.BaseController;
import com.easyink.common.core.domain.AjaxResult;
import com.easyink.common.core.page.TableDataInfo;
Expand All @@ -21,6 +23,7 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
Expand All @@ -37,6 +40,7 @@
@RestController
@RequestMapping(value = "/wecom/communityPresTagGroupV2")
@Api(tags = "老客进群")
@Slf4j
public class WeCommunityPresTagGroupV2Controller extends BaseController {

private final WePresTagGroupTaskService taskService;
Expand All @@ -53,9 +57,11 @@ public WeCommunityPresTagGroupV2Controller(WePresTagGroupTaskService taskService
public TableDataInfo<WePresTagGroupTaskVO> getList(QueryPresTagGroupDTO queryPresTagGroupDTO) {
String corpId = LoginTokenService.getLoginUser().getCorpId();
startPage();
TimeInterval timer = DateUtil.timer();
List<WePresTagGroupTaskVO> wePresTagGroupTaskVoList =
taskService.selectTaskList(corpId, queryPresTagGroupDTO.getTaskName(), queryPresTagGroupDTO.getSendType()
, queryPresTagGroupDTO.getCreateBy(), queryPresTagGroupDTO.getBeginTime(), queryPresTagGroupDTO.getEndTime());
log.info("查询老客进群列表耗时:{}ms", timer.interval());
return getDataTable(wePresTagGroupTaskVoList);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.easyink.web.controller.wecom;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;
import com.easyink.common.annotation.Log;
import com.easyink.common.constant.WeConstans;
import com.easyink.common.core.controller.BaseController;
Expand Down Expand Up @@ -116,7 +118,10 @@ public AjaxResult<WeCustomerSumVO> sum(@RequestBody WeCustomerSearchDTO weCustom
weCustomerSearchDTO.setCorpId(LoginTokenService.getLoginUser().getCorpId());
WeCustomer weCustomer=weCustomerService.changeWecustomer(weCustomerSearchDTO);
weCustomer.setCorpId(LoginTokenService.getLoginUser().getCorpId());
return AjaxResult.success(weCustomerService.weCustomerCount(weCustomer));
TimeInterval timer = DateUtil.timer();
WeCustomerSumVO weCustomerSumVO = weCustomerService.weCustomerCountV2(weCustomer);
log.info("从客户去重count耗时: {}ms", timer.interval());
return AjaxResult.success(weCustomerSumVO);
}

@PreAuthorize("@ss.hasPermi('customerManage:lossRemind:view') || @ss.hasPermi('customerManage:customer:view')")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.easyink.web.controller.wecom;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;
import com.easyink.common.annotation.RepeatSubmit;
import com.easyink.common.core.controller.BaseController;
import com.easyink.common.core.domain.AjaxResult;
import com.easyink.common.core.page.PageDomain;
import com.easyink.common.core.page.TableDataInfo;
import com.easyink.wecom.domain.dto.moment.CreateMomentTaskDTO;
import com.easyink.wecom.domain.dto.moment.MomentUserCustomerDTO;
Expand All @@ -15,17 +18,21 @@
import com.easyink.wecom.service.moment.WeMomentTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* 类名: 朋友圈接口
*
* @author 佚名
* @date 2022/1/11 11:29
*/
@Slf4j
@RestController
@RequestMapping("/wecom/moment")
@Api(tags = "朋友圈")
Expand Down Expand Up @@ -75,8 +82,11 @@ public TableDataInfo<SearchMomentVO> listOfMomentTask(@Validated SearchMomentCon
@GetMapping("/listOfMomentPublishDetail")
@ApiOperation("查询朋友圈发布记录详情")
public TableDataInfo<MomentUserCustomerVO> listOfMomentPublishDetail(@Validated MomentUserCustomerDTO momentUserCustomerDTO) {
startPage();
return getDataTable(weMomentTaskService.listOfMomentPublishDetail(momentUserCustomerDTO));
PageDomain pageDomain = startPageManual();
TimeInterval timer = DateUtil.timer();
List<MomentUserCustomerVO> list = weMomentTaskService.listOfMomentPublishDetail(momentUserCustomerDTO, pageDomain);
log.info("查询朋友圈发布记录详情: {}毫秒", timer.interval());
return getDataTable(list);
}

@PreAuthorize("@ss.hasPermi('wecom:moments:detail')")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.easyink.common.utils.poi.ExcelUtil;
import com.easyink.wecom.domain.WeSensitiveAct;
import com.easyink.wecom.domain.WeSensitiveActHit;
import com.easyink.wecom.domain.query.sensitiveact.WeSensitiveActQuery;
import com.easyink.wecom.login.util.LoginTokenService;
import com.easyink.wecom.service.WeSensitiveActHitService;
import com.easyink.wecom.service.WeSensitiveActService;
Expand Down Expand Up @@ -118,11 +119,11 @@ public AjaxResult remove(@PathVariable("ids") String ids) {
// @PreAuthorize("@ss.hasPermi('wecom:sensitiveacthit:list')")
@GetMapping("/hit/list")
@ApiOperation("敏感词命中查询")
public TableDataInfo hitList() {
public TableDataInfo hitList(WeSensitiveActQuery actQuery) {
startPage();
RootEntity rootEntity = new RootEntity();
rootEntity.getParams().put("corpId", LoginTokenService.getLoginUser().getCorpId());
List<WeSensitiveActHit> list = weSensitiveActHitService.selectWeSensitiveActHitList(rootEntity);
List<WeSensitiveActHit> list = weSensitiveActHitService.selectWeSensitiveActHitList(rootEntity, actQuery);
return getDataTable(list);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.easyink.common.core.controller.BaseController;
import com.easyink.common.core.domain.AjaxResult;
import com.easyink.common.core.page.TableDataInfo;
import com.easyink.common.utils.PageInfoUtil;
import com.easyink.wecom.domain.WeWordsGroupEntity;
import com.easyink.wecom.domain.WeWordsLastUseEntity;
import com.easyink.wecom.domain.dto.WeWordsDTO;
Expand All @@ -16,7 +17,6 @@
import com.easyink.wecom.login.util.LoginTokenService;
import com.easyink.wecom.service.WeWordsGroupService;
import com.easyink.wecom.service.WeWordsLastUseService;
import com.github.pagehelper.PageHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
Expand Down Expand Up @@ -87,7 +87,7 @@ public TableDataInfo<WeWordsVO> listOfWords(@Validated @RequestBody WeWordsQuery
WeWordsGroupEntity weWordsGroupEntity = weWordsGroupService.get(weWordsQueryDTO.getId());
weWordsQueryDTO.setSort(weWordsGroupEntity.getSort());
}
PageHelper.startPage(weWordsQueryDTO.getPageNum(), weWordsQueryDTO.getPageSize());
PageInfoUtil.setPage(weWordsQueryDTO.getPageNum(), weWordsQueryDTO.getPageSize());
}
return getDataTable(weWordsGroupService.listOfWords(weWordsQueryDTO));
}
Expand Down
1 change: 1 addition & 0 deletions easyink-admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ ruoyi:
- /wecom/transferData/**
- /actuator/**
- /open_api/**
- /transfer/**


# 开发环境配置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public class RuoYiConfig {
*/
private boolean enableExceptionDetailResp;

/**
* 压测标识
*/
private boolean pressure;

/**
* 是否内部应用服务器
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,9 @@ public static Long[] getInitMenuList(){
* 如示例所示,员工id被``包围,通过``来定位员工id
*/
public static final String CUSTOMER_PUSH_MESSAGE_NOT_EXIST_USER_MARK = "`";

/**
* 查询SOP任务作用范围超时时间 5s
*/
public static final Long CENTER_SOP_SCOPE_SEARCH_EXPIRE_TIME = 5000L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.easyink.common.core.domain.AjaxResult;
import com.easyink.common.core.page.PageDomain;
import com.easyink.common.core.page.PageDomainAdvice;
import com.easyink.common.core.page.TableDataInfo;
import com.easyink.common.core.page.TableSupport;
import com.easyink.common.enums.ResultTip;
Expand Down Expand Up @@ -53,6 +54,16 @@ protected void startPage() {
}
}

/**
* 手动分页方法
* 用于处理执行逻辑中存在其他sql操作,在需要执行分页的时候才进行分页处理,调用{@link PageDataAdvice#page()}
*
* @return PageDataAdvice
*/
protected PageDomain startPageManual() {
return new PageDomainAdvice<>();
}

/**
* 响应请求分页数据
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

Expand Down Expand Up @@ -40,4 +42,11 @@ public class ChatInfoVO extends ChatBodyVO {
private Object toListInfo;
private Object roomInfo;

/**
* 校验参数非法
* @return
*/
public boolean invalid() {
return StringUtils.isAnyBlank(this.from, this.msgid, this.msgtype, this.action) || CollectionUtils.isEmpty(this.tolist);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
public class SphFeedVO {

@ApiModelProperty("视频号消息类型。2 图片、4 视频、9 直播。")
private Integer feedType;
private Integer feed_type;

@ApiModelProperty("视频号账号名称")
private String sphName;
private String sph_name;

@ApiModelProperty("视频号消息描述")
private String feedDesc;
private String feed_desc;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.easyink.common.core.page;

import com.easyink.common.utils.ServletUtils;
import com.easyink.common.utils.StringUtils;

/**
* 分页数据
*
* @author admin
*/
public class PageDomain {
public class PageDomain implements PageInvoke {
/**
* 当前记录起始索引
*/
Expand All @@ -28,6 +29,20 @@ public class PageDomain {
*/
private String isAsc = "asc";


public PageDomain() {
//lastId存在,则采用游标分页方式
if (StringUtils.isNotBlank(ServletUtils.getParameter(TableSupport.LAST_ID))) {
//默认从第一页开始
this.pageNum = Integer.valueOf("1");
} else {
this.pageNum = ServletUtils.getParameterToInt(TableSupport.PAGE_NUM);
}
this.pageSize = ServletUtils.getParameterToInt(TableSupport.PAGE_SIZE);
this.orderByColumn = ServletUtils.getParameter(TableSupport.ORDER_BY_COLUMN);
this.isAsc = ServletUtils.getParameter(TableSupport.IS_ASC);
}

public String getOrderBy() {
if (StringUtils.isEmpty(orderByColumn)) {
return "";
Expand Down Expand Up @@ -66,4 +81,14 @@ public String getIsAsc() {
public void setIsAsc(String isAsc) {
this.isAsc = isAsc;
}

@Override
public void page() {

}

@Override
public void clear() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.easyink.common.core.page;

import com.github.pagehelper.PageHelper;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* 自动邀群repository
*
* @author tigger
* 2023/4/3 17:29
**/
@EqualsAndHashCode(callSuper = true)
@Data
public class PageDomainAdvice<T> extends PageDomain implements PageInvoke {


public PageDomainAdvice() {
super();
}

@Override
public void page() {
PageHelper.startPage(this.getPageNum(), this.getPageSize());
}

@Override
public void clear() {
PageHelper.clearPage();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.easyink.common.core.page;

/**
* 分页执行函数
*
* @author tigger
* 2023/4/3 17:29
**/
public interface PageInvoke {

/**
* 分页方法
*/
void page();

/**
* 清除分页
*/
void clear();
}
Loading

0 comments on commit 5f375d6

Please sign in to comment.