Commit 185d822f by 叶立庆

svn迁移到git

0 parents
Showing 314 changed files with 4884 additions and 0 deletions
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rop</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.entmicro</groupId>
<artifactId>rop-scrm-entmicro</artifactId>
<version>3.24.0-SNAPSHOT</version>
<name>rop-scrm-entmicro</name>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.entmicro</groupId>
<artifactId>rpc-scrm-entmicro-api</artifactId>
<version>3.24.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-scrm-system-api</artifactId>
<version>3.19.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-spring-boot-starter</artifactId>
<version>6.5.2</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.outbound</groupId>
<artifactId>rpc-scrm-outbound-api</artifactId>
<version>3.19.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--支付平台 -->
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-platform-payment-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- 二维码 -->
<dependency>
<groupId>qrcode</groupId>
<artifactId>qrcode</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-proxy-api</artifactId>
<version>3.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.worktool</groupId>
<artifactId>rpc-scrm-worktool-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.entmicro;
import org.oreframework.boot.main.AbsOreBootStarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
/**
* @Title: Main.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@SpringBootApplication
@ServletComponentScan
@EnableAspectJAutoProxy
public class Main extends AbsOreBootStarter {
@Override
public void run(String[] args)
{
SpringApplication.run(Main.class, args);
}
public static void main(String[] args)
{
Main main = new Main();
main.run(args);
}
}
package cn.com.glsx.entmicro.config;
import cn.com.glsx.entmicro.remote.*;
import cn.com.glsx.outbound.remote.OutBoundRemote;
import cn.com.glsx.platform.payment.remote.PaymentAppRemote;
import cn.com.glsx.platform.payment.remote.PaymentTradeRemote;
import cn.com.glsx.platform.payment.remote.PaymentUploadFileRemote;
import cn.com.glsx.scrm.proxy.remote.merchant.MerchantRemote;
import cn.com.glsx.worktool.remote.GroupRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
private static final int dubboRetries = 0;
@Bean
public ScrmDataCubeJoinRestCloudRemote ScrmDataCubeJoinRestCloudRemote() {
return factory.builder(ScrmDataCubeJoinRestCloudRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public CustomerReportRemote customerReportRemote() {
return factory.builder(CustomerReportRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public CustomerRemote customerRemote() {
return factory.builder(CustomerRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
//.url("192.168.2.85:22884")
@Bean
public CustomerBaseRemote customerBaseRemote() {
return factory.builder(CustomerBaseRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public EntmicroDepartmentRemote getEntmicroDepartmentRemote() {
return factory.builder(EntmicroDepartmentRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public EntmicroFollowerStaffRemote getEntmicroFollowerStaffRemote() {
return factory.builder(EntmicroFollowerStaffRemote.class)/*.url("dubbo://localhost:22889")*/.check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public EntmicroFollowerTypeRemote getEntmicroFollowerTypeRemote() {
return factory.builder(EntmicroFollowerTypeRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public EntmicroStaffRemote getEntmicroStaffRemote() {
return factory.builder(EntmicroStaffRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public EntmicroLoginRemote EntmicroLoginRemote() {
return factory.builder(EntmicroLoginRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public SyncRemote getSyncRemote() {
return factory.builder(SyncRemote.class).check(false).timeout(300000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public ScrmMagicCubeCustomerImportRemote scrmMagicCubeCustomerImportRemote() {
return factory.builder(ScrmMagicCubeCustomerImportRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracChannelCodeBillRemote DracChannelCodeBillRemote() {
return factory.builder(DracChannelCodeBillRemote.class).check(false).timeout(120000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracChannelCodeRemote DracChannelCodeRemote() {
return factory.builder(DracChannelCodeRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public TagRemote getTagRemote() {
return factory.builder(TagRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracImServiceRemote dracImServiceRemote() {
return factory.builder(DracImServiceRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracImMessageTemplateRemote dracImMessageTemplateRemote() {
return factory.builder(DracImMessageTemplateRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracImConfigServiceRemote dracImConfigServiceRemote() {
return factory.builder(DracImConfigServiceRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracScrmWorkRemote dracScrmWorkRemote() {
return factory.builder(DracScrmWorkRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public GroupOneTemplateRemote groupOneTemplateRemote(){
return factory.builder(GroupOneTemplateRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public GroupOneRemote groupOneRemote() {
return factory.builder(GroupOneRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DataCustomerRemote getDataCustomerRemote() {
return factory.builder(DataCustomerRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracScrmStatisticServiceRemote dracScrmStatisticServiceRemote() {
return factory.builder(DracScrmStatisticServiceRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public MassRemote getMassRemote() {
return factory.builder(MassRemote.class)/*.url("dubbo://localhost:22889")*/.check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public OperationRemote getOperationRemote() {
return factory.builder(OperationRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public CommonRemote getCommonRemote() {
return factory.builder(CommonRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracRescueConfigRemote getDracRescueConfigRemote() {
return factory.builder(DracRescueConfigRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public OutboundCallRemote getOutboundCallRemote() {
return factory.builder(OutboundCallRemote.class)/*.url("dubbo://localhost:22889")*/.check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public OutBoundRemote getOutBoundRemote() {
return factory.builder(OutBoundRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public BatchMomentRemote getBatchMomentRemote() {
return factory.builder(BatchMomentRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public BatchMessagingRemote getBatchMessagingRemote() {
return factory.builder(BatchMessagingRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public WechatCloudControlLoginRemote getWechatCloudControlLoginRemote() {
return factory.builder(WechatCloudControlLoginRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public BusinessCardRemote getBusinessCardRemote() {
return factory.builder(BusinessCardRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public MiniProgramShortUrlRemote getMiniProgramShortUrlRemote() {
return factory.builder(MiniProgramShortUrlRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public PaymentAppRemote getPaymentAppRemote() {
return factory.builder(PaymentAppRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public PaymentUploadFileRemote getPaymentUploadFileRemote() {
return factory.builder(PaymentUploadFileRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public PaymentTradeRemote getPaymentTradeRemote() {
return factory.builder(PaymentTradeRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public DracMessageInfoRemote getDracMessageInfoRemote() {
return factory.builder(DracMessageInfoRemote.class).check(false).timeout(120000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public SystemSubscribeRemote getSystemSubscribeRemote() {
return factory.builder(SystemSubscribeRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public GroupRemote getGroupRemote() {
return factory.builder(GroupRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public CollisionInfoRemote getCollisionInfoRemote() {
return factory.builder(CollisionInfoRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
@Bean
public PropertyRoomRemote getPropertyRoomRemote() {
return factory.builder(PropertyRoomRemote.class).check(false).timeout(30000).version("1.0.0").retries(dubboRetries).build();
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.entmicro.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Title: SystemProperty.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Configuration
@ConfigurationProperties("system")
public class SystemProperty {
// 对应配置项:system.name
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package cn.com.glsx.entmicro.config;
import cn.com.glsx.entmicro.request.DefaultRequest;
import cn.com.glsx.entmicro.utils.IpUtils;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.scrm.system.dto.LoginUserDTO;
import com.rop.AbstractRopRequest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.oreframework.boot.autoconfigure.rop.util.RopThreadLocal;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
/**
* @author zhouhaibao
* @version 1.0
* @description: 用户信息统一处理
* @date 2021/7/30 10:00
*/
@Slf4j
@Aspect
@Component
public class UserAspect {
public void logPointCut() {
}
@Before("execution(* cn.com.glsx.entmicro.service..*(..))")
public void webpre(JoinPoint joinPoint) {
// 处理用户信息
try {
setUser(joinPoint);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 保存用户信息
*
* @param joinPoint
*/
public void setUser(JoinPoint joinPoint) throws Exception {
Object[] args = joinPoint.getArgs();
if (args != null && args.length != 0) {
Object object = args[0];
try {
if (object instanceof DefaultRequest) {
AbstractRopRequest accessToken = (AbstractRopRequest) object;
LoginUserDTO user = getUser();
HttpServletRequest httpServletRequest = (HttpServletRequest) accessToken.getRopRequestContext().getRawRequestObject();
String ip = IpUtils.getIpAddr(httpServletRequest);
log.info("当前登录的ip{}", ip);
log.info("商户号{}", user.getMerchantId());
log.info("createdBy{}", user.getId());
log.info("用户id{}", user.getUuid());
log.info("用户类型{}", user.getUserType());
Class userCla = (Class) object.getClass();
Class superclass = userCla.getSuperclass();
Field field = superclass.getDeclaredField("createdBy");
Field field1 = superclass.getDeclaredField("createdAccount");
Field field5 = superclass.getDeclaredField("ip");
Field field7 = superclass.getDeclaredField("merchantId");
Field field6 = superclass.getDeclaredField("datalist");
Field field8 = superclass.getDeclaredField("entmicroId");
Field field9 = superclass.getDeclaredField("uuid");
Field field10 = superclass.getDeclaredField("userType");
field.setAccessible(true);
field.set(object, user.getId());
field1.setAccessible(true);
field1.set(object, user.getAccountName());
field5.setAccessible(true);
field5.set(object, ip);
field6.setAccessible(true);
field6.set(object, user.getPermissionMerchantIds());
field7.setAccessible(true);
field7.set(object, user.getMerchantId());
field8.setAccessible(true);
field8.set(object, user.getEntmicroId());
field9.setAccessible(true);
field9.set(object, user.getUuid());
field10.setAccessible(true);
field10.set(object, user.getUserType());
}
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR);
}
}
}
/**
* 获取用户信息
*
* @return
*/
public LoginUserDTO getUser() {
LoginUserDTO loginUser = RopThreadLocal.getLoginUser(LoginUserDTO.class);
if (loginUser == null) {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR);
}
return loginUser;
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.code.*;
import cn.com.glsx.entmicro.response.code.DetailChannelCodeBillResponse;
import cn.com.glsx.entmicro.response.code.GetSubCodeChannelCodeBillResponse;
import cn.com.glsx.entmicro.response.code.ListChannelCodeBillListResponse;
import cn.com.glsx.entmicro.service.ChannelCodeBillService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author Lichongyuan
* @Description: 海报活码
* @date 2021/11/14 10:28
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("海报活码服务")
@Slf4j
public class ChannelCodeBillController {
@Autowired
private ChannelCodeBillService channelCodeBillService;
/**
* 保存海报活码
*
* @param saveChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.saveChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("保存海报活码")
public RopResponse<Boolean> saveChannelCodeBill(SaveChannelCodeBillRequest saveChannelCodeBillRequest) {
try {
channelCodeBillService.saveChannelCodeBill(saveChannelCodeBillRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__saveChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除海报活码
*
* @param deleteChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.deleteChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("删除海报活码")
public RopResponse<Boolean> deleteChannelCodeBill(DeleteChannelCodeBillRequest deleteChannelCodeBillRequest) {
try {
channelCodeBillService.deleteChannelCodeBill(deleteChannelCodeBillRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__deleteChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 当前活码的海报活码列表
*
* @param listChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getSubCodeChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("当前活码的海报活码列表")
public RopResponse<GetSubCodeChannelCodeBillResponse> getSubCodeChannelCodeBill(ListChannelCodeBillRequest listChannelCodeBillRequest) {
try {
GetSubCodeChannelCodeBillResponse subCodeChannelCodeBill = channelCodeBillService.getSubCodeChannelCodeBill(listChannelCodeBillRequest);
return RopResponse.success(subCodeChannelCodeBill);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getSubCodeChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 编辑海报活码
* @param updateChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.updateChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("编辑海报活码")
public RopResponse<Boolean> updateChannelCodeBill(UpdateChannelCodeBillRequest updateChannelCodeBillRequest) {
try {
channelCodeBillService.updateChannelCodeBill(updateChannelCodeBillRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__updateChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* id获取海报活码详情
*
* @param detailChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("id获取海报活码详情")
public RopResponse<DetailChannelCodeBillResponse> getChannelCodeBill(DetailChannelCodeBillRequest detailChannelCodeBillRequest) {
try {
DetailChannelCodeBillResponse responses = channelCodeBillService.getChannelCodeBill(detailChannelCodeBillRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取所有海报列表
*
* @param listChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("获取所有海报列表")
public RopResponse<Pagination<ListChannelCodeBillListResponse>> listChannelCodeBill(ListChannelCodeBillByPageRequest listChannelCodeBillRequest) {
try {
Pagination<ListChannelCodeBillListResponse> listChannelCodeBillListResponses = channelCodeBillService.listChannelCodeBill(listChannelCodeBillRequest);
return RopResponse.success(listChannelCodeBillListResponses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.code.*;
import cn.com.glsx.entmicro.response.code.*;
import cn.com.glsx.entmicro.service.ChannelCodeService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author Lichongyuan
* @Description: 渠道活码
* @date 2021/11/14 10:27
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("渠道活码服务")
@Slf4j
public class ChannelCodeController {
@Autowired
private ChannelCodeService channelCodeService;
/**
* 新增渠道活码
*
* @param saveChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.saveChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("新增渠道活码")
public RopResponse<Boolean> saveChannelCode(SaveChannelCodeRequest saveChannelCodeRequest) {
try {
channelCodeService.saveChannelCode(saveChannelCodeRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__saveChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 编辑渠道活码
*
* @param updateChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.updateChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("编辑渠道活码")
public RopResponse<Boolean> updateChannelCode(UpdateChannelCodeRequest updateChannelCodeRequest) {
try {
channelCodeService.updateChannelCode(updateChannelCodeRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__updateChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除渠道活码
*
* @param deleteChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.deleteChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("删除渠道活码")
public RopResponse<Boolean> deleteChannelCode(DeleteChannelCodeRequest deleteChannelCodeRequest) {
try {
channelCodeService.deleteChannelCode(deleteChannelCodeRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__deleteChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 渠道活码分页列表
*
* @param searchChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listChannelCodeByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("渠道活码分页列表")
public RopResponse<Pagination<ListChannelCodeByPageResponse>> listChannelCodeByPage(SearchChannelCodeRequest searchChannelCodeRequest) {
try {
Pagination<ListChannelCodeByPageResponse> codeByPage = channelCodeService.listChannelCodeByPage(searchChannelCodeRequest);
return RopResponse.success(codeByPage);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listChannelCodeByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取活码详情
*
* @param detailChanelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.detailChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("获取活码详情")
public RopResponse<DetailChannelCodeResponse> detailChannelCode(DetailChanelCodeRequest detailChanelCodeRequest) {
try {
DetailChannelCodeResponse detailChannelCodeResponse = channelCodeService.detailChannelCode(detailChanelCodeRequest);
return RopResponse.success(detailChannelCodeResponse);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__detailChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 当前活码员工列表
*
* @param getChannelCodeStaffListRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getChannelCodeStaffList", needInSession = NeedInSessionType.YES)
@ApiOperation("当前活码员工列表")
public RopResponse<Pagination<GetChannelCodeStaffListResponse>> getChannelCodeStaffList(GetChannelCodeStaffListRequest getChannelCodeStaffListRequest) {
try {
Pagination<GetChannelCodeStaffListResponse> channelStaffList = channelCodeService.getChannelStaffList(getChannelCodeStaffListRequest);
return RopResponse.success(channelStaffList);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getChannelCodeStaffList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 渠道活码列表 企微端
*
* @param searchEntmicroChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listEntmicroChannelCodeList", needInSession = NeedInSessionType.YES)
@ApiOperation("渠道活码列表 企微端")
public RopResponse<List<ListEntmicroChannelCodeRopResponse>> listEntmicroChannelCodeList(SearchEntmicroChannelCodeRequest searchEntmicroChannelCodeRequest) {
try {
List<ListEntmicroChannelCodeRopResponse> responses = channelCodeService.listEntmicroChannelCodeList(searchEntmicroChannelCodeRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listEntmicroChannelCodeList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 无忧服务渠道活码分页列表
*
* @param searchChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getFreeChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("无忧服务渠道活码分页列表")
public RopResponse<Pagination<ListChannelCodeByPageResponse>> getFreeChannelCode(SearchChannelCodeRequest searchChannelCodeRequest) {
try {
Pagination<ListChannelCodeByPageResponse> codeByPage = channelCodeService.getFreeChannelCode(searchChannelCodeRequest);
return RopResponse.success(codeByPage);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getFreeChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 渠道我的活码列表 企微端
*
* @param searchEntmicroChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listStaffEntmicroChannelCodeList", needInSession = NeedInSessionType.YES)
@ApiOperation("渠道我的活码列表 企微端")
public RopResponse<List<ListEntmicroChannelCodeRopResponse>> listStaffEntmicroChannelCodeList(SearchEntmicroChannelCodeRequest searchEntmicroChannelCodeRequest) {
try {
List<ListEntmicroChannelCodeRopResponse> responses = channelCodeService.listStaffEntmicroChannelCodeList(searchEntmicroChannelCodeRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listStaffEntmicroChannelCodeList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取当前门店已配置了活码的员工(仅服务商账号)
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getCodeStaffList", needInSession = NeedInSessionType.YES)
@ApiOperation("获取当前门店已配置了活码的员工(仅服务商账号)")
public RopResponse<List<DracChannelCodeStaffRopResponse>> getCodeStaffList(DracChannelCodeStaffRopRequest request) {
try {
List<DracChannelCodeStaffRopResponse> codeStaffList = channelCodeService.getCodeStaffList(request);
return RopResponse.success(codeStaffList);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getCodeStaffList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.common.*;
import cn.com.glsx.entmicro.request.entmicro.RelevanceRopEntmicroBaseRequest;
import cn.com.glsx.entmicro.response.common.DictDataResponse;
import cn.com.glsx.entmicro.response.common.MerchantBaseInfoRopResponse;
import cn.com.glsx.entmicro.response.common.MerchantTreeOpenResponse;
import cn.com.glsx.entmicro.service.CommonService;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author fengzhi
* @version 1.0
* @description: 客户群模块接口
* @date 2021/9/23 16:52
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("公共服务接口")
@Slf4j
public class CommonController {
@Autowired
private CommonService commonService;
/**
* 字典列表
*
* @param dictDataRequest 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.common.dictdata.list", needInSession = NeedInSessionType.NO)
@ApiOperation("字典列表")
public RopResponse<List<DictDataResponse>> findAllByDictType(DictDataRequest dictDataRequest) {
try {
return RopResponse.success(commonService.findAllByDictType(dictDataRequest.getDictType()));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 根据商户号查询商户树
*
* @param merchantTreeOpenRequest 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.common.findMerchantTreeByMerchantNo.list", needInSession = NeedInSessionType.YES)
@ApiOperation("根据商户号查询商户树")
public RopResponse<List<MerchantTreeOpenResponse>> findMerchantTreeByMerchantNo(MerchantTreeOpenRequest merchantTreeOpenRequest) {
try {
return RopResponse.success(commonService.findMerchantTreeByMerchantNo(merchantTreeOpenRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__findMerchantTreeByMerchantNo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 商户关联企微
*
* @param relevanceRopEntmicroBaseRequest 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.common.relevanceEntmicro.list", needInSession = NeedInSessionType.YES)
@ApiOperation("商户关联企微")
public RopResponse<Boolean> relevanceEntmicro(RelevanceRopEntmicroBaseRequest relevanceRopEntmicroBaseRequest) {
try {
return RopResponse.success(commonService.relevanceEntmicro(relevanceRopEntmicroBaseRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__relevanceEntmicro__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询账户的登录次数
*
* @param loginRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.common.findLoginCount", needInSession = NeedInSessionType.YES)
@ApiOperation("查询账户的登录次数")
public RopResponse<Boolean> findLoginCount(LoginRequest loginRequest) {
try {
return RopResponse.success(commonService.findLoginCount(loginRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__findLoginCount__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 根据商户号查询商户信息
*
* @param merchantTreeOpenRequest 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.common.findMerchantInfoByMerchantNo.list", needInSession = NeedInSessionType.YES)
@ApiOperation("根据商户号查询商户信息")
public RopResponse<MerchantBaseInfoRopResponse> findMerchantInfoByMerchantNo(MerchantTreeOpenRequest merchantTreeOpenRequest) {
try {
return RopResponse.success(commonService.findMerchantInfoByMerchantNo(merchantTreeOpenRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__findMerchantInfoByMerchantNo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 用户授权企微
*
* @param entmicroAuthorizeRequest 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.common.authorizeEntmicro.list", needInSession = NeedInSessionType.YES)
@ApiOperation("用户授权企微")
public RopResponse<Boolean> authorizeEntmicro(EntmicroAuthorizeRequest entmicroAuthorizeRequest) {
try {
return RopResponse.success(commonService.authorizeEntmicro(entmicroAuthorizeRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__authorizeEntmicro__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 导入excel匹配信息
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.common.input.excel", needInSession = NeedInSessionType.YES)
@ApiOperation("导入excel匹配手机号")
public RopResponse<Boolean> inputExcelInfo(InputExcelRopRequest request) {
try {
return RopResponse.success(commonService.inputExcelInfo(request));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__inputExcelInfo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.CustomerReportVO;
import cn.com.glsx.entmicro.model.response.GroupCustomerReportVO;
import cn.com.glsx.entmicro.request.customer.CustomerReportSearchRopRequest;
import cn.com.glsx.entmicro.service.CustomerReportService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import javax.annotation.Resource;
/**
* @Description
* @author chizw
* @create 2022/1/11 11:04
*/
@Slf4j
@Api("客户报告接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class CustomerReportController {
@Resource
private CustomerReportService customerReportService;
/**
* 集团客户报告获取数据接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.group.report")
@ApiOperation("集团客户报告获取数据接口")
public RopResponse<RpcResponse<GroupCustomerReportVO>> getGroupCustomerReport(CustomerReportSearchRopRequest request) {
try {
return RopResponse.success(customerReportService.getGroupCustomerReport(request));
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__getGroupCustomerReport__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 门店客户报告获取数据接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.merchant.report")
@ApiOperation("门店客户报告获取数据接口")
public RopResponse<RpcResponse<CustomerReportVO>> getMerchantCustomerReport(CustomerReportSearchRopRequest request) {
try {
return RopResponse.success(customerReportService.getMerchantCustomerReport(request));
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__getMerchantCustomerReport__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 脚本 - 手动统计指定商户所有日期客户报告
*
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.merchant.report.script")
@ApiOperation("手动统计指定商户所有日期客户报告")
public RopResponse<RpcResponse<Boolean>> handleStatisticsCustomerReportByAllDays(CustomerReportSearchRopRequest request) {
try {
RpcResponse<Boolean> flag = customerReportService.handleStatisticsCustomerReportByAllDays(request);
return RopResponse.success(flag);
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__handleStatisticsCustomerReportByAllDays__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 脚本 - 手动统计所有商户所有日期客户报告
*
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.all.report.script")
@ApiOperation("手动统计所有商户所有日期客户报告")
public RopResponse<RpcResponse<Boolean>> handleStatisticsCustomerReportByAllMerchant(CustomerReportSearchRopRequest request) {
try {
RpcResponse<Boolean> flag = customerReportService.handleStatisticsCustomerReportByAllMerchant(request);
return RopResponse.success(flag);
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__handleStatisticsCustomerReportByAllMerchant__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 脚本 - 手动推送特定日期的周报/月报
*
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.report.push")
@ApiOperation("手动推送特定日期的周报/月报")
public RopResponse<RpcResponse<Boolean>> handlePushWeeklyOrMonthlyReport(CustomerReportSearchRopRequest request) {
try {
RpcResponse<Boolean> flag = customerReportService.handlePushWeeklyOrMonthlyReport(request);
return RopResponse.success(flag);
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__handleStatisticsCustomerReportByAllMerchant__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.drainage.CustomerStatisticCodeTrendResponse;
import cn.com.glsx.entmicro.request.drainage.DracCodeSearchRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticCodeDefaultRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticCodeDetailPageRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticCodeDetailRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticRequest;
import cn.com.glsx.entmicro.response.qystatistic.*;
import cn.com.glsx.entmicro.service.drainage.DracScrmStatisticService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName DracScrmStatisticController.java
* @description: SCRM-客户统计数据接口
* @createTime 2021年11月15日 19:51:00
*/
@Slf4j
@Api("SCRM-客户统计数据接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class DracScrmStatisticController {
@Autowired(required = false)
private DracScrmStatisticService dracScrmStatisticService;
@ServiceMethod(method = "entmicro.api.drac.statistic.getCustomerStatisticCodeTrend")
@ApiOperation("引流企微 - 概览页")
public RopResponse<CustomerStatisticCodeTrendResponse> getCustomerStatisticCodeTrend(DracScrmStatisticRequest request) {
try {
CustomerStatisticCodeTrendResponse customerStatisticCodeTrendResponse=dracScrmStatisticService.getCustomerStatisticCodeTrend(request);
return RopResponse.success(customerStatisticCodeTrendResponse);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getCustomerStatisticCodeTrend__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.day.trend")
@ApiOperation("引流企微 - 每日新增趋势")
public RopResponse<List<DracStatisticCodeTrend>> getDracStatisticDayTrend(DracScrmStatisticRequest request) {
try {
List<DracStatisticCodeTrend> resultList = new ArrayList<>();
DracStatisticCodeTrend trend = new DracStatisticCodeTrend();
trend.setLineX("未加企微客户");
trend.setTrendItemList(initTrend(1));
DracStatisticCodeTrend trend2 = new DracStatisticCodeTrend();
trend2.setLineX("已加企微客户");
trend2.setTrendItemList(initTrend(5));
resultList.add(trend);
resultList.add(trend2);
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
private List<DracStatisticCodeTrendItem> initTrend(int step) {
List<DracStatisticCodeTrendItem> trendItemList = new ArrayList<>();
trendItemList.add(new DracStatisticCodeTrendItem("8-5", 100 + step));
trendItemList.add(new DracStatisticCodeTrendItem("8-6", 120 + step));
trendItemList.add(new DracStatisticCodeTrendItem("8-7", 140 + step));
trendItemList.add(new DracStatisticCodeTrendItem("8-8", 150 + step));
return trendItemList;
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.default")
@ApiOperation("引流企微 - 活码统计默认返回列表")
public RopResponse<List<DracStatisticCodeDefaultVo>> getDracStatisticCodeDefault(DracScrmStatisticCodeDefaultRequest request) {
try {
List<DracStatisticCodeDefaultVo> resultList = new ArrayList<>();
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.trend")
@ApiOperation("引流企微 - 活码统计统计数据趋势图")
public RopResponse<List<DracStatisticCodeTrend>> getDracStatisticCodeTrend(DracScrmStatisticCodeDefaultRequest request) {
try {
List<DracStatisticCodeTrend> dracStatisticCodeTrend = dracScrmStatisticService.getDracStatisticCodeTrend(request);
return RopResponse.success(dracStatisticCodeTrend);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.search")
@ApiOperation("引流企微 - 活码统计列表数据返回")
public RopResponse<Pagination<DracStatisticCodeSearchResponse>> getDracStatisticCodeSearch(DracCodeSearchRequest dracCodeSearchRequest) {
try {
Pagination<DracStatisticCodeSearchResponse> dracStatisticCodeDefault = dracScrmStatisticService.getDracStatisticCodeDefault(dracCodeSearchRequest);
return RopResponse.success(dracStatisticCodeDefault);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.detail.total")
@ApiOperation("引流企微 - 活码详情页统计数据总览")
public RopResponse<DracScrmStatisticCodeDetailTotalResponse> getDracStatisticCodeDetailTotal(DracScrmStatisticCodeDetailRequest request) {
try {
return RopResponse.success(new DracScrmStatisticCodeDetailTotalResponse(10, 999, 555));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.detail.list.time")
@ApiOperation("引流企微 - 活码详情页按时间查看")
public RopResponse<List<DracScrmStatisticCodeDetailTimeListResponse>> getDracStatisticCodeDetailListByTime(DracScrmStatisticCodeDetailRequest request) {
try {
List<DracScrmStatisticCodeDetailTimeListResponse> resultList=dracScrmStatisticService.getDracStatisticCodeDetailListByTime(request);
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.detail.list.staff")
@ApiOperation("引流企微 - 活码详情页按员工查看")
public RopResponse<Pagination<DracScrmStatisticCodeDetailStaffListResponse>> getDracStatisticCodeDetailListByStaff(DracScrmStatisticCodeDetailPageRequest request) {
try {
Pagination<DracScrmStatisticCodeDetailStaffListResponse> resultList=dracScrmStatisticService.getDracStatisticCodeDetailListByStaff(request);
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.DepartmentTreeResponse;
import cn.com.glsx.entmicro.model.response.EntmicroDepartmentResponse;
import cn.com.glsx.entmicro.request.department.DepartmentListRequest;
import cn.com.glsx.entmicro.request.department.DepartmentPageRequest;
import cn.com.glsx.entmicro.request.department.DepartmentTreeRequest;
import cn.com.glsx.entmicro.request.department.MerchantRequest;
import cn.com.glsx.entmicro.service.DepartmentService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author Lichongyuan
* @Description: 部门服务
* @date 2021/9/28 11:29
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("部门服务")
@Slf4j
public class EntmicroDepartmentController {
@Autowired
private DepartmentService departmentService;
/**
* 查询组织树
* @param departmentTreeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.department.listDepartmentTree", needInSession = NeedInSessionType.YES)
@ApiOperation("查询组织树")
public RopResponse<List<DepartmentTreeResponse>> listDepartmentTree(DepartmentTreeRequest departmentTreeRequest) {
try {
List<DepartmentTreeResponse> departmentTreeRopResponses = departmentService.listDepartmentTree(departmentTreeRequest);
return RopResponse.success(departmentTreeRopResponses);
} catch (RpcServiceException e) {
log.info("=======EntmicroDepartmentController__invoke__listDepartmentTree__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询组织树(无session)
* @param departmentTreeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.department.listDepartmentTreeNoSession", needInSession = NeedInSessionType.NO)
@ApiOperation("查询组织树(无session)")
public RopResponse<List<DepartmentTreeResponse>> listDepartmentTreeNoSession(DepartmentTreeRequest departmentTreeRequest) {
try {
List<DepartmentTreeResponse> departmentTreeRopResponses = departmentService.listDepartmentTree(departmentTreeRequest);
return RopResponse.success(departmentTreeRopResponses);
} catch (RpcServiceException e) {
log.info("=======EntmicroDepartmentController__invoke__listDepartmentTree__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 根据父部门id查询子部门集合
* @param departmentRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.department.listDepartment", needInSession = NeedInSessionType.YES)
@ApiOperation("根据父部门id查询子部门集合")
public RopResponse<List<EntmicroDepartmentResponse>> listDepartmentBySupId(DepartmentListRequest departmentRequest) {
try {
List<EntmicroDepartmentResponse> DepartmentResponses = departmentService.listDepartmentBySupId(departmentRequest);
return RopResponse.success(DepartmentResponses);
} catch (RpcServiceException e) {
log.info("=======EntmicroDepartmentController__invoke__listDepartment__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 分页查询部门列表
* @param departmentPageRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.department.findDepartmentListByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("分页查询部门列表")
public RopResponse<Pagination<EntmicroDepartmentResponse>> findDepartmentListByPage(DepartmentPageRequest departmentPageRequest){
try {
Pagination<EntmicroDepartmentResponse> DepartmentResponses = departmentService.findDepartmentListByPage(departmentPageRequest);
return RopResponse.success(DepartmentResponses);
} catch (RpcServiceException e) {
log.info("=======EntmicroDepartmentController__invoke__findDepartmentListByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询授权商户
* @param merchantRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.department.authorizeMerchant", needInSession = NeedInSessionType.NO)
@ApiOperation("查询授权商户")
public RopResponse<Integer> authorizeMerchant(MerchantRequest merchantRequest) {
try {
Integer departmentTreeRopResponses = departmentService.authorizeMerchant(merchantRequest);
return RopResponse.success(departmentTreeRopResponses);
} catch (RpcServiceException e) {
log.info("=======EntmicroDepartmentController__invoke__listDepartmentTree__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.response.entmicromerchant.EntmicroMerchantBaseInfo;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.alibaba.fastjson.JSON;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.env.Environment;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author yelq
* @Version 1.0
* @Description:
* @Date 2022/10/14 17:13
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("门店号选择服务")
@Slf4j
public class EntmicroMerchantController {
@Resource
private Environment environment;
/**
* 获取配置文件中配置的门店列表
* @return
*/
@ServiceMethod(method = "entmicro.api.merchant.listDepartmentTree.select.merchant", needInSession = NeedInSessionType.YES)
@ApiOperation("获取配置文件中配置的门店列表")
public RopResponse<List<EntmicroMerchantBaseInfo>> getMerchantList(AbstractRopRequest request){
List<EntmicroMerchantBaseInfo> response = new ArrayList<>();
String merchantObjs = environment.getProperty("merchant.staff.tree.select.merchantId");
try {
if (merchantObjs!=null){
List<EntmicroMerchantBaseInfo> baseInfos = JSON.parseArray(merchantObjs, EntmicroMerchantBaseInfo.class);
response.addAll(baseInfos);
}
} catch (Exception e) {
log.info("获取配置文件中配置的门店列表转换失败:{}",e);
return RopResponse.error("获取门店列表失败!请联系管理员检查配置。");
}
return RopResponse.success(response);
}
}
package cn.com.glsx.entmicro.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.FileCopyUtils;
import cn.com.glsx.entmicro.request.example.ExampleRequest;
import cn.com.glsx.entmicro.request.example.LoginRequest;
import cn.com.glsx.entmicro.request.example.ExampleComplexRequest;
import cn.com.glsx.entmicro.request.example.UploadFileRequest;
import cn.com.glsx.entmicro.response.LoginResponse;
import cn.com.glsx.entmicro.response.ExampleResponse;
import cn.com.glsx.entmicro.response.UploadFileResponse;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import com.rop.session.SimpleSession;
/**
* @Title: ExampleController.java
* @Description:
* @author Alvin
* @date 2019年9月2日 下午3:27:41
* @version V2.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("示例接口")
public class ExampleController
{
/**
* logger
*/
protected final Logger logger = LoggerFactory.getLogger(getClass());
/**
* 接口例子
*
* @param req ExampleRequest
* @return Object
* @throws Exception 异常
*/
@ServiceMethod(method = "entmicro.api.example", needInSession = NeedInSessionType.NO)
@ApiOperation("get接口示例")
public RopResponse<ExampleResponse> getExample(ExampleRequest req)
throws Exception
{
ExampleResponse response = new ExampleResponse();
response.setField1("Ni Hao");
response.setField2(req.getName());
return RopResponse.success(response);
}
/**
* 复杂参数示例
* @param request
* @return
* @author Alvin
*/
@ServiceMethod(method = "entmicro.api.example.complex", needInSession = NeedInSessionType.NO)
@ApiOperation("复杂参数示例")
public RopResponse<ExampleResponse> complexExample(ExampleComplexRequest request){
ExampleResponse response = new ExampleResponse();
response.setField1(request.getName());
response.setField2(request.toString());
return RopResponse.success(response);
}
/**
* 文件上传示例
* @param request
* @return
* @author Alvin
* @throws IOException
*/
@ServiceMethod(method = "entmicro.api.example.upload", needInSession = NeedInSessionType.NO)
@ApiOperation("文件上传示例")
public RopResponse<UploadFileResponse> upload(UploadFileRequest request) throws IOException{
ClassPathResource outFile = new ClassPathResource("/");
File file = new File(outFile.getFile().getParent() + "/test." + request.getFile().getFileType());
FileCopyUtils.copy(request.getFile().getContent(), file);
UploadFileResponse response = new UploadFileResponse();
response.setFilePath(file.getPath());
return RopResponse.success(response);
}
/**
* 会话示例
* @param request
* @return
* @throws Exception
* @author Alvin
*/
@ServiceMethod(method = "entmicro.api.example.insession", needInSession = NeedInSessionType.YES)
@ApiOperation("会话示例")
public RopResponse<ExampleResponse> getExampleInSession(ExampleRequest request) throws Exception{
return getExample(request);
}
/**
* 登录示例
* @param request
* @return
* @author Alvin
*/
@ServiceMethod(method = "entmicro.api.example.login", needInSession = NeedInSessionType.NO)
@ApiOperation("登录示例")
public RopResponse<LoginResponse> login(LoginRequest request){
// 创建会话
SimpleSession session = new SimpleSession();
session.setAttribute("userName", request.getUserName());
String sessionId = UUID.randomUUID().toString();
request.getRopRequestContext().addSession(sessionId, session);
LoginResponse response = new LoginResponse();
response.setSessionId(sessionId);
return RopResponse.success(response);
}
/**
* 登出示例
* @param request
* @return
* @author Alvin
*/
@ServiceMethod(method = "entmicro.api.example.logout", needInSession = NeedInSessionType.YES)
@ApiOperation("登出示例")
public RopResponse<Boolean> logout(AbstractRopRequest request){
// 删除会话
request.getRopRequestContext().removeSession();
return RopResponse.success(true);
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.GroupOneCustomerDetailResponse;
import cn.com.glsx.entmicro.model.response.GroupOneTemplateResponse;
import cn.com.glsx.entmicro.request.one.CustomerDetailPgeRequest;
import cn.com.glsx.entmicro.request.one.OneInsertRequest;
import cn.com.glsx.entmicro.request.one.OneSearchRequest;
import cn.com.glsx.entmicro.request.one.template.TemplateDetailRequest;
import cn.com.glsx.entmicro.response.one.OneDataResponse;
import cn.com.glsx.entmicro.service.GroupOneService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author think.wang
* @version 1.0
* @description: 一客一群数据接口
* @date 2021/11/1 16:52
*/
@Slf4j
@Api("一客一群数据接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class GroupOneController {
@Autowired
private GroupOneService groupOneService;
/**
* 根据id获取一客一群详情数据
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.group.one.detail")
@ApiOperation("根据id获取一客一群详情数据")
public RopResponse<OneDataResponse> getGroupOneDetail(OneSearchRequest request) {
try {
return RopResponse.success(groupOneService.getGroupOneDataRemote(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneController__invoke__getGroupOneDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群数据保存接口
*
* @param request 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.group.one.insert")
@ApiOperation("一客一群数据保存接口")
public RopResponse<Boolean> insert(OneInsertRequest request) {
try {
return RopResponse.success(groupOneService.insertRemote(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneController__invoke__insert__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 客户群 群名称获取
*
* @param request 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.group.template.timstamp.get")
@ApiOperation("客户群 群名称获取")
public RopResponse<String> getMassGroupName(TemplateDetailRequest request) {
try {
String groupTimeStamp = groupOneService.getTemplateGroupName(request);
return RopResponse.success(groupTimeStamp);
} catch (RpcServiceException e) {
log.info("=======MassController_getMassGroupDetailSenderCustomerCountFilter_invoke__insert__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 客户群 群模板下客户列表
*
* @param request 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.group.template.customer.page")
@ApiOperation("群模板下客户列表分页")
public RopResponse<Pagination<GroupOneCustomerDetailResponse>> pageGroupOneCustomerPage(CustomerDetailPgeRequest request) {
try {
Pagination<GroupOneCustomerDetailResponse> pagination = groupOneService.pageGroupOneCustomerPage(request);
return RopResponse.success(pagination);
} catch (RpcServiceException e) {
log.info("=======MassController_pageGroupOneCustomerPage_invoke__insert__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.one.template.*;
import cn.com.glsx.entmicro.response.one.template.TemplateResponse;
import cn.com.glsx.entmicro.service.GroupOneTemplateService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author think.wang
* @version 1.0
* @description: 一客一群模块接口
* @date 2021/11/1 16:52
*/
@Slf4j
@Api("一客一群模板接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class GroupOneTemplateController {
@Autowired
private GroupOneTemplateService groupOneTemplateService;
/**
* 一客一群模板 分页数据接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.page")
@ApiOperation("一客一群模板分页数据接口")
public RopResponse<Pagination<TemplateResponse>> getGroupOneTemplatePage(TemplateSearchRequest request) {
try {
return RopResponse.success(groupOneTemplateService.getGroupOneTemplatePage(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群模板 列表数据接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.list")
@ApiOperation("一客一群模板列表数据接口")
public RopResponse<List<TemplateResponse>> getGroupOneTemplateList(TemplateListRequest request) {
try {
return RopResponse.success(groupOneTemplateService.getGroupOneTemplateList(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOneTemplateList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 根据id获取一客一群详情数据
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.detail")
@ApiOperation("根据id获取一客一群详情数据")
public RopResponse<TemplateResponse> getGroupOneDetail(TemplateDetailRequest request) {
try {
return RopResponse.success(groupOneTemplateService.getGroupOneDetail(request.getId()));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOneDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群 群模板数据保存接口
*
* @param request 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.insert")
@ApiOperation("一客一群数据保存接口")
public RopResponse<Boolean> insert(TemplateInsertRequest request) {
try {
return RopResponse.success(groupOneTemplateService.insertRemote(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__insert__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群数据更新接口
*
* @param request 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.update")
@ApiOperation("一客一群数据更新接口")
public RopResponse<Boolean> update(TemplateUpdateRequest request) {
try {
return RopResponse.success(groupOneTemplateService.updateRemote(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__update__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群数据 更新状态
*
* @param request 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.status")
@ApiOperation("一客一群数据更新接口")
public RopResponse<Boolean> updateStatus(TemplateUpdateStatusRequest request) {
try {
return RopResponse.success(groupOneTemplateService.updateStatusRemote(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__updateStatus__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群模板 企微端列表数据接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.list.qyclient")
@ApiOperation("一客一群模板列表数据接口")
public RopResponse<List<TemplateResponse>> getGroupOneTemplateListForQy(TemplateListForCustomerRequest request) {
try {
return RopResponse.success(groupOneTemplateService.getGroupOneTemplateListForCustomer(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOneTemplateList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群模板 群模板名称验证
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.name.valid")
@ApiOperation("一客一群模板 群模板名称验证")
public RopResponse<Boolean> getGroupOneTemplateByName(TemplateNameValidRequest request) {
if (request==null || StringUtils.isEmpty(request.getTemplateName())) {
return RopResponse.error(DefaultErrorEnum.PARAMETER_NULL);
}
try {
return RopResponse.success(groupOneTemplateService.getGroupOneTemplateByName(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 一客一群模板 群模板名称验证(更新时使用)
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.one.template.name.update.valid")
@ApiOperation("一客一群模板 群模板名称验证")
public RopResponse<Boolean> validateTemplateNameForUpdate(TemplateNameValidRequest request) {
RpcAssert.assertNotNull(request,DefaultErrorEnum.PARAMETER_NULL,"param is must not null !");
RpcAssert.assertNotNull(request.getId(),DefaultErrorEnum.PARAMETER_NULL,"id is must not null !");
RpcAssert.assertNotNull(request.getTemplateName(),DefaultErrorEnum.PARAMETER_NULL,"templateName is must not null !");
try {
return RopResponse.success(groupOneTemplateService.validateTemplateNameForUpdate(request));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__validateTemplateNameForUpdate__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.imports.ModelDownloadRequest;
import cn.com.glsx.entmicro.request.shorturl.MiniProShortUrlConfigRopRequest;
import cn.com.glsx.entmicro.request.shorturl.MiniProShortUrlRopRequest;
import cn.com.glsx.entmicro.service.MiniProgramShortUrlService;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
/**
* @Description
* @author chizw
* @create 2022/10/12 17:32
* @version ver.1.0.0
*/
@Slf4j
@Api("小程序短链接口")
@ServiceMethodBean(version = "1.0.0")
public class MiniProgramShortUrlController {
@Resource
private MiniProgramShortUrlService miniProgramShortUrlService;
@ServiceMethod(method = "entmicro.api.shorturl.uuid.get", needInSession = NeedInSessionType.NO)
@ApiOperation("获取小程序短链配置uuid")
public RopResponse<String> getShortUrlConfigUuid(MiniProShortUrlConfigRopRequest request){
try {
return RopResponse.success(miniProgramShortUrlService.getShortUrlConfigUuid(request));
} catch (RpcServiceException e) {
log.info("=======MiniProgramShortUrlController__invoke__getShortUrlConfigUuid__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.shorturl.get", needInSession = NeedInSessionType.NO)
@ApiOperation("根据uuid获取小程序配置短链")
public RopResponse<String> getShortUrlConfigUuid(MiniProShortUrlRopRequest request){
try {
return RopResponse.success(miniProgramShortUrlService.getShortUrlByUuid(request));
} catch (RpcServiceException e) {
log.info("=======MiniProgramShortUrlController__invoke__getShortUrlConfigUuid__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.operation.*;
import cn.com.glsx.entmicro.response.operation.OperationCodeRopResponse;
import cn.com.glsx.entmicro.response.operation.OperationDetailRopResponse;
import cn.com.glsx.entmicro.response.operation.OperationPageRopResponse;
import cn.com.glsx.entmicro.service.operation.OperationService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @ClassName OperationController
* @Description 运营专家Controller
* @Author lichongyuan
* @Date 2022/5/9
*/
@Slf4j
@Api("运营专家配置接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class OperationController {
@Autowired
private OperationService operationService;
/**
* 运营专家分页接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.page", needInSession = NeedInSessionType.YES)
@ApiOperation("运营专家分页接口")
public RopResponse<Pagination<OperationPageRopResponse>> getPage(OperationSearchRopRequest request) {
try {
return RopResponse.success(operationService.getPage(request));
} catch (RpcServiceException e) {
log.info("=======OperationController_getMassPage_invoke__getPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 新增运营配置
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.save", needInSession = NeedInSessionType.YES)
@ApiOperation("新增运营配置")
public RopResponse<Boolean> save(OperationSaveRopRequest request) {
try {
operationService.save(request);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__save__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 修改运营配置(禁用)
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.update", needInSession = NeedInSessionType.YES)
@ApiOperation("修改运营配置(禁用)")
public RopResponse<Boolean> update(OperationSaveRopRequest request) {
try {
operationService.update(request);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__update__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除运营配置
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.delete", needInSession = NeedInSessionType.YES)
@ApiOperation("删除运营配置")
public RopResponse<Boolean> delete(OperationDeleteRopRequest request) {
try {
operationService.delete(request);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__delete__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 配置详情
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.detail", needInSession = NeedInSessionType.YES)
@ApiOperation("配置详情")
public RopResponse<OperationDetailRopResponse> getDetail(OperationDetailRopRequest request) {
try {
return RopResponse.success(operationService.getDetail(request));
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__delete__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 下单获取二维码
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.code", needInSession = NeedInSessionType.NO)
@ApiOperation("下单获取二维码")
public RopResponse<OperationCodeRopResponse> getQRCode(OperationDetailRopRequest request) {
try {
return RopResponse.success(operationService.getOperationCode(request));
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__delete__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.convert.ConvertRequest;
import cn.com.glsx.entmicro.dto.PropertyRoomDTO;
import cn.com.glsx.entmicro.model.request.DracChannelCodeBillRequest;
import cn.com.glsx.entmicro.remote.PropertyRoomRemote;
import cn.com.glsx.entmicro.request.one.OneSearchRequest;
import cn.com.glsx.entmicro.request.property.PropertyRoomListRequest;
import cn.com.glsx.entmicro.response.one.OneDataResponse;
import cn.com.glsx.entmicro.service.GroupOneService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @description: 物业楼栋房号管理
*/
@Slf4j
@Api("物业楼栋房号接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class PropertyRoomController {
@Autowired
private PropertyRoomRemote propertyRoomRemote;
/**
* 查询房号信息
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.property.room.page")
@ApiOperation("根据条件查询房号信息")
public RopResponse<RpcPagination<PropertyRoomDTO>> page(PropertyRoomListRequest request) {
try {
RpcPagination<PropertyRoomDTO> pagination = ConvertRequest.convertPage(request, new PropertyRoomDTO());
RpcResponse<RpcPagination<PropertyRoomDTO>> res = propertyRoomRemote.page(pagination);
if(!res.hasResult()){
return RopResponse.error(res.getMessage());
}
return RopResponse.success(res.getResult());
} catch (RpcServiceException e) {
log.info("=======PropertyRoomController__page__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.one.template.TemplateSearchRequest;
import cn.com.glsx.entmicro.request.qystatistic.QyWechatStatisticRequest;
import cn.com.glsx.entmicro.response.one.template.TemplateResponse;
import cn.com.glsx.entmicro.response.qystatistic.QyWechatStatisticResponse;
import cn.com.glsx.entmicro.response.qystatistic.QyWechatStatisticStaffWeekVo;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName QyWechatStatisticController.java
* @description: 企微端-客户统计数据接口
* @createTime 2021年11月15日 19:51:00
*/
@Slf4j
@Api("企微端-客户统计数据接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class QyWechatStatisticController {
@ServiceMethod(method = "entmicro.api.qywechat.customer.statistic.week")
@ApiOperation("企微端-周报接口")
public RopResponse<QyWechatStatisticResponse> getQywechatCustomerStatisticWeek(QyWechatStatisticRequest request) {
try {
QyWechatStatisticResponse qyWechatStatisticResponse = new QyWechatStatisticResponse();
qyWechatStatisticResponse.setMerchantId(1);
qyWechatStatisticResponse.setMerchantName("广联");
qyWechatStatisticResponse.setTotalCount(1000);
qyWechatStatisticResponse.setApplyCount(500);
qyWechatStatisticResponse.setApplyDegree(50.0);
qyWechatStatisticResponse.setWeekName("1108-1114");
qyWechatStatisticResponse.setNewlyQyCount(50);
qyWechatStatisticResponse.setNewlyQyDegree(40.0);
qyWechatStatisticResponse.setFlowQyCount(20);
qyWechatStatisticResponse.setFlowQyDegree(30.0);
qyWechatStatisticResponse.setChampionStaffName("张衡");
qyWechatStatisticResponse.setStaffWeekList(initStaffList());
return RopResponse.success(qyWechatStatisticResponse);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
private List<QyWechatStatisticStaffWeekVo> initStaffList() {
List<QyWechatStatisticStaffWeekVo> qyWechatStatisticStaffWeekVos = new ArrayList<>();
qyWechatStatisticStaffWeekVos.add(new QyWechatStatisticStaffWeekVo(1, "王五", 10));
qyWechatStatisticStaffWeekVos.add(new QyWechatStatisticStaffWeekVo(2, "张二", 20));
qyWechatStatisticStaffWeekVos.add(new QyWechatStatisticStaffWeekVo(3, "陆陆", 50));
qyWechatStatisticStaffWeekVos.add(new QyWechatStatisticStaffWeekVo(4, "其他", 10));
return qyWechatStatisticStaffWeekVos;
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.qystatistic.QyWechatDefaultRequest;
import cn.com.glsx.entmicro.request.qystatistic.QyWechatPutTaggingRequest;
import cn.com.glsx.entmicro.response.qystatistic.CustomerInfoVoResponse;
import cn.com.glsx.entmicro.response.qystatistic.TaggingGroupVo;
import cn.com.glsx.entmicro.service.drainage.QyWechatTaggingService;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
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.util.StringUtils;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName QyWechatTaggingController.java
* @description: 企微端-批量打标签的服务
* @createTime 2021年11月15日 19:51:00
*/
@Slf4j
@Api("企微端-批量打标签的服务")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class QyWechatTaggingController {
@Autowired
private QyWechatTaggingService qyWechatTaggingService;
@ServiceMethod(method = "entmicro.api.qywechat.tagging.customer.list")
@ApiOperation("企微端-员工下的客户列表")
public RopResponse<List<CustomerInfoVoResponse>> getQywechatTaggingCustomerList(QyWechatDefaultRequest request) {
try {
List<CustomerInfoVoResponse> customerInfoVoResponses = qyWechatTaggingService.getQywechatTaggingCustomerList(request);
return RopResponse.success(customerInfoVoResponses);
} catch (RpcServiceException e) {
log.info("=======QyWechatTaggingController__invoke__getQywechatTaggingCustomerList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.qywechat.tagging.info")
@ApiOperation("企微端-标签数据获取")
public RopResponse<List<TaggingGroupVo>> getQywechatTaggingInfoList(QyWechatDefaultRequest request) {
try {
List<TaggingGroupVo> customerInfoVoResponseList = qyWechatTaggingService.getTaggingMetaData(request);
return RopResponse.success(customerInfoVoResponseList);
} catch (RpcServiceException e) {
log.info("=======QyWechatTaggingController__invoke__getQywechatTaggingInfoList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.qywechat.tagging.put.customer")
@ApiOperation("企微端-客户打标签")
public RopResponse<Boolean> getQywechatPutCustomerTagging(QyWechatPutTaggingRequest request) {
if (request == null
|| StringUtils.isEmpty(request.getExternalUserIds())) {
return RopResponse.error(DefaultErrorEnum.PARAMETER_NULL);
}
try {
Boolean putResult = qyWechatTaggingService.putCustomerTagInfo(request);
return RopResponse.success(putResult);
} catch (RpcServiceException e) {
log.info("=======QyWechatTaggingController__invoke__getQywechatPutCustomerTagging__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.*;
import cn.com.glsx.entmicro.request.datacube.DataCubeBaseRopRequest;
import cn.com.glsx.entmicro.request.datacube.DataCubeFileUploadRopRequest;
import cn.com.glsx.entmicro.request.datacube.RestCloudCallbackRopRequest;
import cn.com.glsx.entmicro.request.imports.*;
import cn.com.glsx.entmicro.service.ScrmMagicCubeCustormerImportService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.alibaba.fastjson.JSON;
import com.rop.annotation.IgnoreSignType;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
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.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @Author yeliqing
* @Version 1.0
* @Description:
* @Date 2021/11/6 14:18
*/
@Slf4j
@Api("魔方导入模块接口")
@ServiceMethodBean(version = "1.0.0")
public class ScrmMagicCubeCustormerImportController {
@Autowired
private ScrmMagicCubeCustormerImportService scrmMagicCubeCustormerImportService;
@ServiceMethod(method = "entmicro.api.imports.download.model", needInSession = NeedInSessionType.YES)
@ApiOperation("下载魔板接口")
public RopResponse<String> exportModelDownload(ModelDownloadRequest modelDownloadRequest){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.exportModelDownload(modelDownloadRequest));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__exportModelDownload__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.imports.check", needInSession = NeedInSessionType.YES)
@ApiOperation("魔方导入数据校验接口")
public RopResponse<String> customerDataUploadCheck(MagicCubeImportRequest magicCubeImportRequest){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.customerDataUploadCheck(magicCubeImportRequest));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__customerDataUploadCheck__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.imports.upload", needInSession = NeedInSessionType.YES)
@ApiOperation("魔方导入接口")
public RopResponse<ScrmMagicCubeCustomerCountResponse> customerDataUpload(MagicCubeImportRequest magicCubeImportRequest){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.customerDataUpload(magicCubeImportRequest));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__customerDataUpload__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 魔方导入记录分页数据查询接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.imports.record.page", needInSession = NeedInSessionType.YES)
@ApiOperation("魔方导入记录分页数据接口")
public RopResponse<Pagination<ScrmMagicCubeCustomerCountResponse>> getImportRecordPage(MagicCubeImportRecordQueryRequest request) {
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.getImportRecordPage(request));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__getImportRecordPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.imports.record.key", needInSession = NeedInSessionType.YES)
@ApiOperation("根据id查询魔方导入记录接口")
public RopResponse<ScrmMagicCubeCustomerCountResponse> magicCubeImportRecordQueryById(MagicCubeImportRecordByIdRequest magicCubeImportRecordByIdRequest){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.magicCubeImportRecordQueryById(magicCubeImportRecordByIdRequest));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__magicCubeImportRecordQueryById__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.imports.count", needInSession = NeedInSessionType.YES)
@ApiOperation("魔方导入列表页面数据接口")
public RopResponse<MagicCubeIndexCountResponse> magicCubeImportDataCount(MagicCubeImportIndexRequest MagicCubeImportIndexRequest){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.magicCubeImportDataCount(MagicCubeImportIndexRequest));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__magicCubeImportDataCount__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/********************************************************** 数据魔方接口 ***************************************************************/
@ServiceMethod(method = "entmicro.api.datacube.upload", needInSession = NeedInSessionType.YES)
@ApiOperation("数据魔方文件上传接口")
public RopResponse<DataCubeUploadResult> uploadDataCubeFiles(DataCubeFileUploadRopRequest magicCubeImportRequest){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.uploadDataCubeFiles(magicCubeImportRequest));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__uploadDataCubeFiles__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.datacube.merchant.config", needInSession = NeedInSessionType.YES)
@ApiOperation("数据魔方查询商户配置")
public RopResponse<List<DataCubeMerchantConfigResponse>> queryDateCubeTemplate(DataCubeBaseRopRequest magicCubeImportRequest){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.queryDateCubeTemplate(magicCubeImportRequest));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__queryDateCubeTemplate__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.datacube.log.page", needInSession = NeedInSessionType.YES)
@ApiOperation("数据魔方分页查询上传日志列表")
public RopResponse<Pagination<DataCubeUploadLogResponse>> queryDataCubeUploadLogByPage(DataCubeBaseRopRequest request){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.queryDataCubeUploadLogByPage(request));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__queryDataCubeUploadLogByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.datacube.failed.data", needInSession = NeedInSessionType.YES)
@ApiOperation("数据魔方查询文件处理异常数据")
public RopResponse<String> findDataCubeFailedData(DataCubeBaseRopRequest request){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.findDataCubeFailedData(request));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__findDataCubeFailedData__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.datacube.notice.pc", needInSession = NeedInSessionType.YES)
@ApiOperation("数据魔方处理完成PC端通知")
public RopResponse<List<String>> noticeReminderToPC(DataCubeBaseRopRequest request){
try {
return RopResponse.success(scrmMagicCubeCustormerImportService.noticeReminderToPC(request));
} catch (RpcServiceException e) {
log.info("=======ScrmMagicCubeCustormerImportController__invoke__findDataCubeFailedData__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.datacube.Upload.complete", needInSession = NeedInSessionType.NO, ignoreSign = IgnoreSignType.YES)
@ApiOperation("RestCloud上传完成回调")
public RopResponse<String> uploadCompleteCallback(@RequestBody RestCloudCallbackRopRequest request){
log.info("RestCloud上传完成回调object:{}",request);
return RopResponse.success("调用成功");
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.synchronization.SyncCustomerBaseRequest;
import cn.com.glsx.entmicro.request.synchronization.SyncCustomerRequest;
import cn.com.glsx.entmicro.request.synchronization.SyncDepartmentRequest;
import cn.com.glsx.entmicro.request.synchronization.SyncStaffRequest;
import cn.com.glsx.entmicro.service.SycService;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author Lichongyuan
* @Description: 同步服务
* @date 2021/10/19 16:00
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("同步服务")
@Slf4j
public class SyncController {
@Autowired
private SycService sycService;
/**
* 同步部门
*
* @param syncDepartmentRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncDepartment", needInSession = NeedInSessionType.YES)
@ApiOperation("同步部门")
public RopResponse<Boolean> syncDepartment(SyncDepartmentRequest syncDepartmentRequest) {
try {
sycService.sycDepartment(syncDepartmentRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncDepartment__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步员工
*
* @param syncStaffRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.synStaff", needInSession = NeedInSessionType.YES)
@ApiOperation("同步员工")
public RopResponse<Boolean> synStaff(SyncStaffRequest syncStaffRequest) {
try {
sycService.sycStaff(syncStaffRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__synStaff__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户
*
* @param syncCustomerRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomer", needInSession = NeedInSessionType.YES)
@ApiOperation("同步客户")
public RopResponse<Boolean> syncCustomer(SyncCustomerRequest syncCustomerRequest) {
try {
sycService.sycCustomer(syncCustomerRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomer__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户群
*
* @param syncCustomerBaseRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomerBase", needInSession = NeedInSessionType.YES)
@ApiOperation("同步客户群")
public RopResponse<Boolean> syncCustomerBase(SyncCustomerBaseRequest syncCustomerBaseRequest) {
try {
sycService.sycCustomerBase(syncCustomerBaseRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerBase__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步标签
*
* @param syncCustomerBaseRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncTag", needInSession = NeedInSessionType.YES)
@ApiOperation("同步客户群")
public RopResponse<Boolean> syncTag(SyncCustomerBaseRequest syncCustomerBaseRequest) {
try {
sycService.syncTag(syncCustomerBaseRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerBase__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 维格表同步指定门店企微客户
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomer2Vika", needInSession = NeedInSessionType.YES)
@ApiOperation("维格表同步指定门店企微客户")
public RopResponse<Boolean> syncCustomer2Vika(SyncDepartmentRequest request) {
try {
return RopResponse.success(sycService.syncCustomer2Vika(request));
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomer2Vika__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户企微类型标签
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomerTypeTagHandle", needInSession = NeedInSessionType.NO)
@ApiOperation("同步客户企微类型标签")
public RopResponse<Boolean> syncCustomerTypeTagHandle(SyncCustomerRequest request) {
try {
return RopResponse.success(sycService.syncCustomerTypeTagHandle(request));
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerTypeTagHandle__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户备注数据到cdp
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomerRemarkToCdp", needInSession = NeedInSessionType.NO)
@ApiOperation("同步客户备注数据到cdp")
public RopResponse<Boolean> syncCustomerRemarkToCdp(SyncCustomerRequest request) {
try {
return RopResponse.success(sycService.syncCustomerRemarkToCdp(request));
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerRemarkToCdp__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.AddTagResponse;
import cn.com.glsx.entmicro.model.response.WorkWechatExternalContactTagGroupListResponse;
import cn.com.glsx.entmicro.request.tag.*;
import cn.com.glsx.entmicro.service.TagService;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author fengzhi
* @Description: 企微标签服务
* @date 2021/11/15 13:06
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("企微标签服务")
@Slf4j
public class TagController {
@Autowired
private TagService tagService;
@ServiceMethod(method = "entmicro.api.tag.getExternalContactTagGroupList")
@ApiOperation("获取企业标签库")
public RopResponse<WorkWechatExternalContactTagGroupListResponse> getExternalContactTagGroupList(GetExternalContactTagListReq req){
try {
return RopResponse.success(tagService.getExternalContactTagGroupList(req));
} catch (RpcServiceException e) {
log.info("=======TagController__invoke__getExternalContactTagGroupList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.tag.addExternalContact")
@ApiOperation("创建企业客户企业标签")
public RopResponse<AddTagResponse> addExternalContactTag(AddExternalContactTagReq req) {
try {
return RopResponse.success(tagService.addExternalContactTag(req));
} catch (RpcServiceException e) {
log.info("=======TagController__invoke__addExternalContactTag__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.tag.editExternalContact")
@ApiOperation("编辑企业客户企业标签")
public RopResponse<Boolean> editExternalContactTag(EditExternalContactTagReq req) {
try {
return RopResponse.success(tagService.editExternalContactTag(req));
} catch (RpcServiceException e) {
log.info("=======TagController__invoke__editExternalContactTag__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.tag.delExternalContact")
@ApiOperation("删除企业客户标签")
public RopResponse<Boolean> delExternalContactTag(DelWorkWechatExternalContactTagReq req){
try {
return RopResponse.success(tagService.delExternalContactTag(req));
} catch (RpcServiceException e) {
log.info("=======TagController__invoke__delExternalContactTag__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.tag.markExternalContact")
@ApiOperation("编辑客户企业标签")
public RopResponse<Boolean> markExternalContactTag(MarkWorkWechatExternalContactTagReq req){
try {
return RopResponse.success(tagService.markExternalContactTag(req));
} catch (RpcServiceException e) {
log.info("=======TagController__invoke__markExternalContactTag__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.tag.syncCustomerTagChangeRemind")
@ApiOperation("同步客户标签变更提醒")
public RopResponse<Boolean> syncCustomerTagChangeRemind(SyncCustomerTagRequest req){
try {
return RopResponse.success(tagService.syncCustomerTagChangeRemind(req));
} catch (RpcServiceException e) {
log.info("=======TagController__invoke__syncCustomerTagChangeRemind__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.tag.syncTag2Vika")
@ApiOperation("同步企微标签to维格表")
public RopResponse<Boolean> syncTag2Vika(SyncCustomerTagRequest req){
try {
return RopResponse.success(tagService.syncTag2Vika(req));
} catch (RpcServiceException e) {
log.info("=======TagController__invoke__syncTag2Vika__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.collision;
import cn.com.glsx.entmicro.request.collision.*;
import cn.com.glsx.entmicro.request.outbound.PhoneCheckRopRequest;
import cn.com.glsx.entmicro.response.collision.*;
import cn.com.glsx.entmicro.response.outbound.PhoneCheckRopResponse;
import cn.com.glsx.entmicro.service.collision.CollisionInfoService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 碰撞线索
*/
@Slf4j
@Api("碰撞线模块接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class CollisionInfoController {
@Autowired
private CollisionInfoService collisionInfoService;
@ServiceMethod(method = "entmicro.api.collision.customer.device.list.export")
@ApiOperation("设备管理-列表查询导出")
public RopResponse<String> exportCustomerDeviceList(CollisionSnInfoSearchRopRequest request) {
try {
return RopResponse.success(collisionInfoService.exportCustomerDeviceList(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__exportCustomerDeviceList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.customer.device.list")
@ApiOperation("设备管理-列表查询")
public RopResponse<Pagination<CollisionSnInfoRopResponse>> getCustomerDeviceList(CollisionSnInfoSearchRopRequest request) {
try {
return RopResponse.success(collisionInfoService.getCustomerDeviceList(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__getCustomerDeviceList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.customer.device.edit")
@ApiOperation("设备管理-编辑")
public RopResponse<Boolean> customerDeviceEdit(CollisionSnInfoEditRopRequest request) {
try {
return RopResponse.success(collisionInfoService.customerDeviceEdit(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__customerDeviceDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.customer.device.detail")
@ApiOperation("设备管理-查询详情")
public RopResponse<CollisionSnInfoRopResponse> getCustomerDeviceDetail(CollisionSnInfoSearchRopRequest request) {
try {
return RopResponse.success(collisionInfoService.getCustomerDeviceDetail(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__getCustomerDeviceDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.device.import")
@ApiOperation("设备管理-设备信息导入")
public RopResponse<CustomerDeviceImportRopResponse> customerDeviceImport(CustomerDeviceImportRopRequest request) {
try {
return RopResponse.success(collisionInfoService.customerDeviceImport(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__customerDeviceImport__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.info.listCollisionInfoByPage")
@ApiOperation("碰撞线索-分页查询")
public RopResponse<Pagination<CollisionInfoRopResponse>> listCollisionInfoByPage(CollisionInfoSearchRopRequest request) {
try {
return RopResponse.success(collisionInfoService.listCollisionInfoByPage(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__listCollisionInfoByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.info.exportCollisionInfo")
@ApiOperation("碰撞线索-列表导出")
public RopResponse<String> exportCollisionInfo(CollisionInfoSearchRopRequest request) {
try {
return RopResponse.success(collisionInfoService.exportCollisionInfo(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__exportCollisionInfo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.info.getDetail")
@ApiOperation("碰撞线索-查询详情")
public RopResponse<CollisionDetailInfoRopResponse> getCollisionDetail(CollisionInfoSearchRopRequest request) {
try {
return RopResponse.success(collisionInfoService.getCollisionDetail(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__getCollisionDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.info.follow")
@ApiOperation("碰撞线索-回访")
public RopResponse<FollowInfoRopResponse> followCollisionInfo(FollowInfoRopRequest request) {
try {
return RopResponse.success(collisionInfoService.followCollisionInfo(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__followCollisionInfo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.config.addOrUpdatePushConfig")
@ApiOperation("碰撞线索-推送配置添加/修改")
public RopResponse<CollisionPushConfigRopResponse> addOrUpdatePushConfig(CollisionPushConfigRopRequest request) {
try {
return RopResponse.success(collisionInfoService.addOrUpdatePushConfig(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__addOrUpdatePushConfig__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.collision.config.getDetail")
@ApiOperation("碰撞线索-查询推送配置详情")
public RopResponse<List<CollisionPushConfigRopResponse>> getPushConfigDetail(CollisionPushConfigRopRequest request) {
try {
return RopResponse.success(collisionInfoService.getPushConfigDetail(request));
} catch (RpcServiceException e) {
log.info("=======CollisionInfoController__invoke__getPushConfigDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.drainage;
import cn.com.glsx.entmicro.request.drainage.DracImConfigAddRequest;
import cn.com.glsx.entmicro.request.drainage.DracImConfigSearchRequest;
import cn.com.glsx.entmicro.request.drainage.DracImConfigUpdateRequest;
import cn.com.glsx.entmicro.response.drainage.DracImConfigRopResponse;
import cn.com.glsx.entmicro.service.drainage.DracImConfigService;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/11/15 20:10
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("引流配置服务")
@Slf4j
public class DracImConfigController {
@Autowired
private DracImConfigService dracImConfigService;
/**
* 新增配置
*
* @param dracImConfigAddRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracImConfig.addConfig",needInSession = NeedInSessionType.YES)
@ApiOperation("新增配置")
public RopResponse<Boolean> addConfig(DracImConfigAddRequest dracImConfigAddRequest) {
try {
return RopResponse.success(dracImConfigService.addConfig(dracImConfigAddRequest));
} catch (RpcServiceException e) {
log.info("=======DracImConfigController__invoke__addConfig__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 更新配置
*
* @param dracImConfigUpdateRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracImConfig.updateConfig",needInSession = NeedInSessionType.YES)
@ApiOperation("更新配置")
public RopResponse<Boolean> updateConfig(DracImConfigUpdateRequest dracImConfigUpdateRequest) {
try {
return RopResponse.success(dracImConfigService.updateConfig(dracImConfigUpdateRequest));
} catch (RpcServiceException e) {
log.info("=======DracImConfigController__invoke__updateConfig__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询配置
*
* @param dracImConfigSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracImConfig.findConfig",needInSession = NeedInSessionType.YES)
@ApiOperation("查询配置")
public RopResponse<DracImConfigRopResponse> findConfig(DracImConfigSearchRequest dracImConfigSearchRequest) {
try {
DracImConfigRopResponse dracImConfigRopResponse=null;
List<DracImConfigRopResponse> config = dracImConfigService.findConfig(dracImConfigSearchRequest);
if(CollectionUtils.isNotEmpty(config)){
dracImConfigRopResponse=config.get(0);
}
return RopResponse.success(dracImConfigRopResponse);
} catch (RpcServiceException e) {
log.info("=======DracImConfigController__invoke__updateConfig__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.drainage;
import cn.com.glsx.entmicro.model.request.DracImMessageConfigRequest;
import cn.com.glsx.entmicro.model.response.DracImInfoResponse;
import cn.com.glsx.entmicro.model.response.DracImMessageConResponse;
import cn.com.glsx.entmicro.model.response.ExportDracImResponse;
import cn.com.glsx.entmicro.model.response.drainage.MessageStaticResponse;
import cn.com.glsx.entmicro.model.response.drainage.MiniProgramImResponse;
import cn.com.glsx.entmicro.request.drainage.*;
import cn.com.glsx.entmicro.response.drainage.DracImCustomerCollectionRopResponse;
import cn.com.glsx.entmicro.response.drainage.DracImInfoRopResponse;
import cn.com.glsx.entmicro.service.drainage.DracImService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author zhouhaibao
* @version 1.0
* @description: 智能营销配置服务
* @date 2021/11/15 18:14
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("智能营销")
@Slf4j
public class DracImController {
@Autowired
private DracImService dracImService;
/**
* 智能营销列表
*
* @param dracImSearchRequest 智能营销入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findAllByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("智能营销列表")
public RopResponse<Pagination<DracImInfoRopResponse>> findAllByPage(DracImSearchRequest dracImSearchRequest) {
try {
return RopResponse.success(dracImService.findAllByPage(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询短信列表
*
* @param messageListRopRequest 智能营销入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findAllMessageByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("查询短信列表")
public RopResponse<Pagination<DracImCustomerCollectionRopResponse>> findAllMessageByPage(MessageListRopRequest messageListRopRequest) {
try {
return RopResponse.success(dracImService.findAllMessageByPage(messageListRopRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询智能营销详情
*
* @param dracImSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findById", needInSession = NeedInSessionType.YES)
@ApiOperation("查询智能营销详情")
public RopResponse<DracImInfoResponse> findById(DracImDetailRequest dracImSearchRequest) {
try {
return RopResponse.success(dracImService.findById(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询智能营销详情
*
* @param messageStaticRopRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findMessageStatic", needInSession = NeedInSessionType.YES)
@ApiOperation("查询智能营销详情")
public RopResponse<MessageStaticResponse> findMessageStatic(MessageStaticRopRequest messageStaticRopRequest) {
try {
return RopResponse.success(dracImService.findMessageStatic(messageStaticRopRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 新增智能营销
*
* @param dracImSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.exportAdd", needInSession = NeedInSessionType.YES)
@ApiOperation("新增智能营销")
public RopResponse<ExportDracImResponse> exportAdd(DracImAddRequest dracImSearchRequest) {
try {
DracImMessageConfigRequest dracImMessageConfigRequest = dracImSearchRequest.getDracImMessageConfigRequest();
if (dracImMessageConfigRequest != null) {
String content = dracImMessageConfigRequest.getContent();
if (!StringUtils.isEmpty(content) && content.contains("XXX门店")) {
return RopResponse.error("", "请修改短信中的门店签名,将XXX替换为实际的门店名称");
}
}
return RopResponse.success(dracImService.exportAdd(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 更新智能营销
*
* @param dracImSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.exportUpdate", needInSession = NeedInSessionType.YES)
@ApiOperation("更新智能营销")
public RopResponse<ExportDracImResponse> exportUpdate(DracImUpdateRequest dracImSearchRequest) {
try {
return RopResponse.success(dracImService.exportUpdate(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询渠道活码链接
*
* @param dracImMiniProgramRequest 入参
* @return
*/
@ServiceMethod(method = "dracIm.api.entmicro.findMiniProgramIm", needInSession = NeedInSessionType.YES)
@ApiOperation("查询渠道活码链接")
public RopResponse<MiniProgramImResponse> findMiniProgramIm(DracImMiniProgramRequest dracImMiniProgramRequest) {
try {
return RopResponse.success(dracImService.findMiniProgramIm(dracImMiniProgramRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__findMiniProgramIm__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 短信详情
*
* @param dracImMessageDetailRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.dracMessage.detail", needInSession = NeedInSessionType.YES)
@ApiOperation("智能营销短信详情")
public RopResponse<DracImMessageConResponse> dracMassageDetailById(DracImMessageDetailRequest dracImMessageDetailRequest) {
try {
return RopResponse.success(dracImService.dracMassageDetailById(dracImMessageDetailRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__dracMassageDetailById__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 智能营销-客户列表分页条件查询
*
* @param dracImCustomerPageSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.customer.search.page", needInSession = NeedInSessionType.YES)
@ApiOperation("智能营销-客户列表分页条件查询")
public RopResponse<Pagination<DracImCustomerCollectionRopResponse>> dracCustomerConditionPageSearch(DracImCustomerPageSearchRequest dracImCustomerPageSearchRequest) {
try {
return RopResponse.success(dracImService.dracCustomerConditionPageSearch(dracImCustomerPageSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__dracCustomerConditionPageSearch__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 动态生成短链
*
* @param dracImRopRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.dracMessage.generateURL", needInSession = NeedInSessionType.NO)
@ApiOperation("动态生成短链")
public RopResponse<String> generateURL(DracImRopRequest dracImRopRequest) {
try {
return RopResponse.success(dracImService.generateURL(dracImRopRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__generateURL__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取业务活动的code
*
* @param addEntmicroCommonRequest 入参
* @return
*/
@ServiceMethod(method = "dracIm.api.entmicro.findByActivityIdAndPhone", needInSession = NeedInSessionType.NO)
@ApiOperation("获取业务活动的code")
public RopResponse<MiniProgramImResponse> findByActivityIdAndPhone(AddEntmicroCommonRopRequest addEntmicroCommonRequest) {
try {
return RopResponse.success(dracImService.findByActivityIdAndPhone(addEntmicroCommonRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__findByActivityIdAndPhone__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.drainage;/**
* @author zhouhaibao
* @date 2021/11/15
*/
import cn.com.glsx.entmicro.request.drainage.DracImMessTemplateSearchRequest;
import cn.com.glsx.entmicro.request.drainage.DracImSearchRequest;
import cn.com.glsx.entmicro.response.drainage.DracImInfoRopResponse;
import cn.com.glsx.entmicro.response.drainage.DracImMessageTemplateRopResponse;
import cn.com.glsx.entmicro.service.drainage.DracImMessageTemplateService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/11/15 19:57
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("短信模板配置服务")
@Slf4j
public class DracImMessageTemplateController {
@Autowired
private DracImMessageTemplateService dracImMessageTemplateService;
/**
* 短信模板列表
*
* @param dracImMessTemplateSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracImMessage.findAllByCondition", needInSession = NeedInSessionType.YES)
@ApiOperation("智能营销列表")
public RopResponse<Pagination<DracImMessageTemplateRopResponse>> findAllByCondition(DracImMessTemplateSearchRequest dracImMessTemplateSearchRequest) {
try {
return RopResponse.success(dracImMessageTemplateService.findAllByCondition(dracImMessTemplateSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.drainage;
import cn.com.glsx.entmicro.request.drainage.DracScrmWorkSearchRequest;
import cn.com.glsx.entmicro.request.drainage.DracScrmWorkUpdateRequest;
import cn.com.glsx.entmicro.response.drainage.DracStaffScrmWorkCustRopReponse;
import cn.com.glsx.entmicro.service.drainage.DracScrmWorkService;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/11/16 19:22
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("引流任务模块")
@Slf4j
public class DracScrmWorkController {
@Autowired
private DracScrmWorkService dracScrmWorkService;
/**
* 查询任务
*
* @param dracScrmWorkSearchRequest 智能营销入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracScrmWork.findWorkDetail",needInSession = NeedInSessionType.YES)
@ApiOperation("查询任务")
public RopResponse<List<DracStaffScrmWorkCustRopReponse>> findWorkDetail(DracScrmWorkSearchRequest dracScrmWorkSearchRequest) {
try {
return RopResponse.success(dracScrmWorkService.findWorkDetail(dracScrmWorkSearchRequest));
} catch (RpcServiceException e) {
log.info("=======DracScrmWorkController__invoke__findWorkDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询任务
*
* @param dracScrmWorkSdearchRequest 智能营销入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracScrmWork.updateCustomerWork",needInSession = NeedInSessionType.YES)
@ApiOperation("查询任务")
public RopResponse<Boolean> updateCustomerWork(DracScrmWorkUpdateRequest dracScrmWorkSdearchRequest) {
try {
return RopResponse.success(dracScrmWorkService.updateCustomerWork(dracScrmWorkSdearchRequest));
} catch (RpcServiceException e) {
log.info("=======DracScrmWorkController__invoke__findWorkDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.message;
import cn.com.glsx.entmicro.model.response.ExportDracImResponse;
import cn.com.glsx.entmicro.model.response.message.DracMesCusrCollectionResponse;
import cn.com.glsx.entmicro.model.response.message.DracMessageInfoResponse;
import cn.com.glsx.entmicro.request.message.*;
import cn.com.glsx.entmicro.service.message.DracMessageInfoService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @BelongsProject: scrm_v2.11.0_20221010_1
* @BelongsPackage: cn.com.glsx.entmicro.controller.message
* @Author: zhouhb
* @CreateTime: 2022-11-23 16:59
* @Description: 营销短信服务
* @Version: 1.0
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("营销短信服务")
@Slf4j
public class DracMessageInfoController {
@Autowired
private DracMessageInfoService dracMessageInfoService;
/**
* 保存短信营销配置
*
* @param dracMessageCreateRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.message.createMessageInfo", needInSession = NeedInSessionType.YES)
@ApiOperation("保存短信营销配置")
public RopResponse<ExportDracImResponse> createMessageInfo(DracMessageCreateRequest dracMessageCreateRequest) {
try {
return RopResponse.success(dracMessageInfoService.createMessageInfo(dracMessageCreateRequest));
} catch (RpcServiceException e) {
log.info("=======DracMessageInfoController__invoke__createMessageInfo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询短信营销列表
*
* @param dracMessagePageListRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.message.findAllByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("查询短信营销列表")
public RopResponse<Pagination<DracMessageInfoResponse>> findAllByPage(DracMessagePageListRequest dracMessagePageListRequest) {
try {
return RopResponse.success(dracMessageInfoService.findAllByPage(dracMessagePageListRequest));
} catch (RpcServiceException e) {
log.info("=======DracMessageInfoController__invoke__findAllByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询短信营销客户列表
*
* @param dracMessagePageCusListRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.message.findAllCustomerByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("查询短信营销客户列表")
public RopResponse<Pagination<DracMesCusrCollectionResponse>> findAllCustomerByPage(DracMessagePageCusListRequest dracMessagePageCusListRequest) {
try {
return RopResponse.success(dracMessageInfoService.findAllCustomerByPage(dracMessagePageCusListRequest));
} catch (RpcServiceException e) {
log.info("=======DracMessageInfoController__invoke__findAllCustomerByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除营销
*
* @param dracMessageUpdateStatusRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.message.updateMessageInfoStatus", needInSession = NeedInSessionType.YES)
@ApiOperation("查询短信营销客户列表")
public RopResponse<Boolean> updateMessageInfoStatus(DracMessageUpdateStatusRequest dracMessageUpdateStatusRequest) {
try {
return RopResponse.success(dracMessageInfoService.updateMessageInfoStatus(dracMessageUpdateStatusRequest));
} catch (RpcServiceException e) {
log.info("=======DracMessageInfoController__invoke__updateMessageInfoStatus__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询短信营销
*
* @param dracMessageDetailRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.message.findDetailById", needInSession = NeedInSessionType.YES)
@ApiOperation("查询短信营销")
public RopResponse<DracMessageInfoResponse> findDetailById(DracMessageDetailRequest dracMessageDetailRequest) {
try {
return RopResponse.success(dracMessageInfoService.findDetailById(dracMessageDetailRequest));
} catch (RpcServiceException e) {
log.info("=======DracMessageInfoController__invoke__findDetailById__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.payment;
import cn.com.glsx.entmicro.request.payment.*;
import cn.com.glsx.entmicro.service.payment.PaymentService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.platform.payment.dto.response.CreatePaymentResponseDTO;
import cn.com.glsx.platform.payment.dto.response.CreateTradeResponseDTO;
import cn.com.glsx.platform.payment.dto.response.PaymentPageResponseDTO;
import cn.com.glsx.platform.payment.model.PaymentAppInfo;
import cn.com.glsx.scrm.proxy.model.merchant.MerchantRopResponse;
import com.rop.AbstractRopRequest;
import com.rop.annotation.IgnoreSignType;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.oreframework.boot.autoconfigure.rop.metadata.RopProperty;
import org.oreframework.boot.autoconfigure.rop.util.RopClientUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.util.HashMap;
import java.util.List;
/**
* @author fanfr
* @Description: 支付配置
* @date 2022/12/02 13:57
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("支付配置接口")
@Slf4j
public class PaymentController {
@Autowired
private PaymentService paymentService;
/**
* 上传证书文件
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.payment.uploadCert", needInSession = NeedInSessionType.YES, ignoreSign = IgnoreSignType.YES)
@ApiOperation("上传证书文件")
public RopResponse<String> uploadCert( UploadCertFileRequest request) {
try {
String url = paymentService.uploadCert(request);
return RopResponse.success(url);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__uploadCert__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.createPayment", needInSession = NeedInSessionType.YES, ignoreSign = IgnoreSignType.YES)
@ApiOperation("创建支付账号")
public RopResponse<HashMap<String, CreatePaymentResponseDTO>> createPayment(CreatePaymentRequest request) {
try {
HashMap<String, CreatePaymentResponseDTO> response = paymentService.createPayment(request);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__createPayment__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.pageListPayment", needInSession = NeedInSessionType.YES, ignoreSign = IgnoreSignType.YES)
@ApiOperation("支付账号列表分页查询")
public RopResponse<RpcPagination<PaymentPageResponseDTO>> pageListPayment(PaymentQueryRequest request) {
try {
RpcPagination<PaymentPageResponseDTO> response = paymentService.pageListPayment(request);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__createPayment__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.deleteById", needInSession = NeedInSessionType.YES, ignoreSign = IgnoreSignType.YES)
@ApiOperation("删除支付账号")
public RopResponse<Boolean> deleteById(PaymentQueryRequest request) {
try {
Boolean aBoolean = paymentService.deleteById(request);
return RopResponse.success(aBoolean);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__createPayment__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.createWeappQrcode", needInSession = NeedInSessionType.YES, ignoreSign = IgnoreSignType.YES)
@ApiOperation("生成小程序码")
public RopResponse<String> createWeappQrcode(WeappQrcodeRequest request) {
log.info("createWeappQrcode :{}", request);
try {
String url = paymentService.createWeappQrcode(request);
return RopResponse.success(url);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__createWeappQrcode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.getSceneById", needInSession = NeedInSessionType.NO, ignoreSign = IgnoreSignType.YES)
@ApiOperation("获取小程序码参数")
public RopResponse<String> getSceneById(SceneRequest request) {
log.info("getSceneById :{}", request);
try {
String scene = paymentService.getSceneById(request);
return RopResponse.success(scene);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__getSceneById__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.createBizQrCode", needInSession = NeedInSessionType.YES, ignoreSign = IgnoreSignType.YES)
@ApiOperation("生成公众号码")
public RopResponse<String> createBizQrCode(BizQrCodeReqeust request) {
log.info("createBizQrcode :{}", request);
String bizQrCode = paymentService.createBizQrCode(request);
if (StringUtils.isNotBlank(bizQrCode)) {
return RopResponse.success(bizQrCode);
}
return RopResponse.error(DefaultErrorEnum.SERVICE_ERROR);
}
@ServiceMethod(method = "entmicro.api.payment.createTrade", needInSession = NeedInSessionType.NO, ignoreSign = IgnoreSignType.YES)
@ApiOperation("创建交易订单")
public RopResponse<CreateTradeResponseDTO> createTrade(CreateTradeRequest request) {
try {
CreateTradeResponseDTO trade = paymentService.createTrade(request);
return RopResponse.success(trade);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__createTrade__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.listMerchant", needInSession = NeedInSessionType.YES, ignoreSign = IgnoreSignType.YES)
@ApiOperation("查询商户列表")
public RopResponse<List<MerchantRopResponse>> listMerchant(MerchantPageRequest request) {
try {
List<MerchantRopResponse> response = paymentService.listMerchant(request);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__listMerchant__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.payment.listAppInfo", needInSession = NeedInSessionType.NO, ignoreSign = IgnoreSignType.YES)
@ApiOperation("查询App列表")
public RopResponse<List<PaymentAppInfo>> listAppInfo(AbstractRopRequest request) {
try {
List<PaymentAppInfo> response = paymentService.listAppInfo();
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======PaymentController__invoke__listAppInfo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.wechatcloudcontrol;
import cn.com.glsx.entmicro.dto.activityreport.ScrmActivityReportLogDTO;
import cn.com.glsx.entmicro.model.response.wechatcloudcontrol.batchmessaging.BatchMessagingGroupResponse;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.ActivityReportLog.ActivityReportLogSearchRopRequest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.batchmessaging.*;
import cn.com.glsx.entmicro.response.wechatcloudcontrol.batchmessaging.BatchMessagingMerchantVO;
import cn.com.glsx.entmicro.response.wechatcloudcontrol.batchmessaging.BatchMessagingRecordVO;
import cn.com.glsx.entmicro.response.wechatcloudcontrol.batchmessaging.BatchMessagingRecordOfSendVO;
import cn.com.glsx.entmicro.service.wechatcloudcontrol.BatchMessagingService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.worktool.model.response.ScrmWorktoolGroupResponse;
import cn.com.glsx.worktool.remote.GroupRemote;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import java.util.List;
/**
* @author chizw
* @version ver.1.0.0
* @Description
* @create 2022/9/19 15:06
*/
@Slf4j
@Api("企微接入 - 企微群发")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class BatchMessagingController {
@Resource
private BatchMessagingService batchMessagingService;
@Autowired
private GroupRemote groupRemote;
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.nosession.batchmessaging.create", needInSession = NeedInSessionType.NO)
@ApiOperation("企微高级群发任务创建")
public RopResponse<Boolean> createBatchMessagingNoSessionTask(BatchMessagingCreateRopRequest request) {
try {
return RopResponse.success(batchMessagingService.createBatchMessagingTask(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_createBatchMessagingTask_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.create")
@ApiOperation("企微高级群发任务创建")
public RopResponse<Boolean> createBatchMessagingTask(BatchMessagingCreateRopRequest request) {
try {
return RopResponse.success(batchMessagingService.createBatchMessagingTask(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_createBatchMessagingTask_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.customercount")
@ApiOperation("企微高级群发查看预计群发人数")
public RopResponse<Integer> estimateCustomerCount(BatchMessagingCreateRopRequest request) {
try {
return RopResponse.success(batchMessagingService.getEstimateCustomerCount(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_estimateCustomerCount_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant")
@ApiOperation("企微高级群发创建门店列表")
public RopResponse<List<BatchMessagingMerchantVO>> queryBatchMessagingCreateMerchant(BatchMessagingMerchantRopRequest request) {
try {
return RopResponse.success(batchMessagingService.findBatchMessagingMerchantList(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_queryBatchMessagingCreateMerchant_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.record")
@ApiOperation("企微高级群发记录")
public RopResponse<Pagination<BatchMessagingRecordVO>> queryBatchMessagingRecord(BatchMessagingRecordRopRequest request) {
try {
return RopResponse.success(batchMessagingService.queryBatchMessaging(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_queryBatchMessagingRecord_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.record.send")
@ApiOperation("企微高级群发发送记录")
public RopResponse<Pagination<BatchMessagingRecordOfSendVO>> queryBatchMessagingRecordOfSend(BatchMessagingRecordOfSendRopRequest request) {
try {
return RopResponse.success(batchMessagingService.queryBatchMessagingOfSend(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_queryBatchMessagingRecordOfSend_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.group.list")
@ApiOperation("企微高级群聊列表")
public RopResponse<List<BatchMessagingGroupResponse>> getBatchMessagingGroupList(BatchMessagingUserRopRequest request) {
try {
return RopResponse.success(batchMessagingService.getBatchMessagingGroupList(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_getBatchMessagingGroupList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.group.list.nosession", needInSession = NeedInSessionType.NO)
@ApiOperation("企微高级群聊列表")
public RopResponse<List<BatchMessagingGroupResponse>> getBatchMessagingGroupListNoSeesion(BatchMessagingUserRopRequest request) {
try {
return RopResponse.success(batchMessagingService.getBatchMessagingGroupList(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_getBatchMessagingGroupList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmessaging.send.stop")
@ApiOperation("群发记录停止发送")
public RopResponse<Boolean> stopBatchMessagingSend(BatchMessagingRecordOfSendRopRequest request) {
try {
return RopResponse.success(batchMessagingService.stopBatchMessagingSend(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_stopBatchMessagingSend_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.activityreport.log.page")
@ApiOperation("查询喜报战报推送日志分页列表")
public RopResponse<Pagination<ScrmActivityReportLogDTO>> getActivityReportLogPage(ActivityReportLogSearchRopRequest request) {
try {
return RopResponse.success(batchMessagingService.getActivityReportLogPage(request));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_getActivityReportLogPage_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.activityreport.worktool.grouplist")
@ApiOperation("查询worktool群列表")
public RopResponse<RpcResponse<List<ScrmWorktoolGroupResponse>>> worktoolGroupList(WorkToolGroupListRopRequest workToolGroupListRopRequest) {
try {
return RopResponse.success(groupRemote.groupList(workToolGroupListRopRequest.getCloudId()));
} catch (RpcServiceException e) {
log.info("=======BatchMessagingController_getActivityReportLogPage_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.wechatcloudcontrol;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.batchmoment.BatchMomentCreateRopRequest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.batchmoment.BatchMomentQueryRopRequest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.batchmoment.BatchMomentStaffRecordQueryRopRequest;
import cn.com.glsx.entmicro.response.wechatcloudcontrol.batchmoment.BatchMomentRopResponse;
import cn.com.glsx.entmicro.response.wechatcloudcontrol.batchmoment.BatchMomentStaffRecordRopResponse;
import cn.com.glsx.entmicro.service.wechatcloudcontrol.BatchMomentService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Author yelq
* @Version 1.0
* @Description: 朋友圈群发
* @Date 2022/9/16 17:11
*/
@Slf4j
@Api("朋友圈群发任务")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class BatchMomentController {
@Autowired
private BatchMomentService batchMomentService;
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmoment.save")
@ApiOperation("朋友圈群发任务创建")
public RopResponse<Boolean> batchMomentSave(BatchMomentCreateRopRequest request) {
try {
return RopResponse.success(batchMomentService.batchMomentSave(request));
} catch (RpcServiceException e) {
log.info("=======BatchMomentController_batchMomentSave_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmoment.condition.page")
@ApiOperation("朋友圈群发任务多条件分页查询")
public RopResponse<Pagination<BatchMomentRopResponse>> batchMomentConditionPage(BatchMomentQueryRopRequest request) {
try {
return RopResponse.success(batchMomentService.batchMomentConditionPage(request));
} catch (RpcServiceException e) {
log.info("=======BatchMomentController_batchMomentConditionPage_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmoment.record.page")
@ApiOperation("发送记录分页查询")
public RopResponse<Pagination<BatchMomentStaffRecordRopResponse>> batchMomentStaffRecordPage(BatchMomentStaffRecordQueryRopRequest request) {
try {
return RopResponse.success(batchMomentService.batchMomentStaffRecordPage(request));
} catch (RpcServiceException e) {
log.info("=======BatchMomentController_batchMomentStaffRecordPage_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.batchmoment.send.stop")
@ApiOperation("朋友圈停止发送")
public RopResponse<Boolean> stopBatchMomentSend(BatchMomentStaffRecordQueryRopRequest request) {
try {
return RopResponse.success(batchMomentService.stopBatchMomentSend(request));
} catch (RpcServiceException e) {
log.info("=======BatchMomentController_stopBatchMomentSend_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.controller.wechatcloudcontrol;
import cn.com.glsx.entmicro.model.response.EntmicroStaffResponse;
import cn.com.glsx.entmicro.model.response.wechatcloudcontrol.customer.CustomerInfoResponse;
import cn.com.glsx.entmicro.model.response.wechatcloudcontrol.login.CloudControQccodeResponse;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.CustomerListRopResquest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.QcCodeRequest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.WechatDepositRopRequest;
import cn.com.glsx.entmicro.service.EntimicroStaffService;
import cn.com.glsx.entmicro.service.wechatcloudcontrol.CloudControlLoginService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @BelongsProject: scrm_v2.11.0_20221010_1
* @BelongsPackage: cn.com.glsx.entmicro.controller.wechatcloudcontrol
* @Author: 11
* @CreateTime: 2022-09-21 18:57
* @Description: TODO
* @Version: 1.0
*/
@Slf4j
@Api("企微托管管理")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class CloudControlLoginController {
@Autowired
private CloudControlLoginService cloudControlLoginService;
@Autowired
private EntimicroStaffService entimicroStaffService;
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.getLoginQcCode")
@ApiOperation("获取验证码")
public RopResponse<CloudControQccodeResponse> getLoginQcCode(AbstractRopRequest abstractRopRequest) {
try {
return RopResponse.success(cloudControlLoginService.getLoginQcCode());
} catch (RpcServiceException e) {
log.info("=======CloudControlLoginController_getLoginQcCode_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.getQcCodeDetail")
@ApiOperation("验证二维码是否失效")
public RopResponse<Boolean> getQcCodeDetail(QcCodeRequest qcCodeRequest) {
try {
return RopResponse.success(cloudControlLoginService.getQcCodeDetail(qcCodeRequest));
} catch (RpcServiceException e) {
log.info("=======CloudControlLoginController_getQcCodeDetail_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositList")
@ApiOperation("查询托管的员工")
public RopResponse<Pagination<EntmicroStaffResponse>> wechatDepositList(WechatDepositRopRequest wechatDepositRopRequest) {
try {
return RopResponse.success(entimicroStaffService.wechatDepositList(wechatDepositRopRequest));
} catch (RpcServiceException e) {
log.info("=======CloudControlLoginController_wechatDepositList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositNotAccessList")
@ApiOperation("查询非SCRM托管的员工")
public RopResponse<Pagination<EntmicroStaffResponse>> wechatDepositNotAccessList(WechatDepositRopRequest wechatDepositRopRequest) {
try {
return RopResponse.success(entimicroStaffService.wechatDepositNotAccessList(wechatDepositRopRequest));
} catch (RpcServiceException e) {
log.info("=======CloudControlLoginController_wechatDepositNotAccessList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.wechatcloudcontrol.cloudconlogin.getStaffFriends")
@ApiOperation("查询非SCRM托管的员工客户列表")
public RopResponse<Pagination<CustomerInfoResponse>> getStaffFriends(CustomerListRopResquest customerListRopResquest) {
try {
return RopResponse.success(cloudControlLoginService.getStaffFriends(customerListRopResquest));
} catch (RpcServiceException e) {
log.info("=======CloudControlLoginController_getStaffFriends_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}
package cn.com.glsx.entmicro.convert;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhouhaibao
* @version 1.0
* @description: 请求体转化
* @date 2021/7/9 11:38
*/
public class ConvertRequest {
/**
* 转化请求参数
*
* @param re 原入参
* @param newObj 转后后的参数
* @param <T> 泛型
* @return
*/
public static <T> T convertRequest(Object re, T newObj) {
BeanUtils.copyProperties(re, newObj);
return newObj;
}
/**
* 转化请求参数List
*
* @param list 原入参
* @param clazz 转后后的参数
* @param <T> 泛型
* @return
*/
public static <E, T> List<T> convertListRequest(List<E> list, Class<T> clazz) {
List<T> tList = new ArrayList<>();
list.forEach(index -> {
T target = BeanUtils.instantiateClass(clazz);
BeanUtils.copyProperties(index, target);
tList.add(target);
});
return tList;
}
/**
* 分页对象转化参数
*
* @param old 原入参
* @param t 转化后的参数
* @param <T> 泛型
* @return
*/
public static <T> RpcPagination<T> convertPage(Object old, T t) {
RpcPagination rpcPagination = new RpcPagination();
BeanUtils.copyProperties(old, rpcPagination);
BeanUtils.copyProperties(old, t);
rpcPagination.setCondition(t);
return rpcPagination;
}
}
package cn.com.glsx.entmicro.convert;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import lombok.Data;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.BeanUtils;
import java.util.List;
/**
* @author zhouhaibao
* @version 1.0
* @description: 返回体转化参数
* @date 2021/7/9 11:21
*/
@Data
public class ConvertResponse {
/**
* 转化集合
*
* @param input 原集合
* @param clazz 新集合类
* @param <T> 泛型
* @return
*/
public static <E, T> List<T> convertList(List<E> input, Class<T> clazz) {
List<T> output = Lists.newArrayList();
if (CollectionUtils.isNotEmpty(input)) {
for (E source : input) {
T target = BeanUtils.instantiateClass(clazz);
BeanUtils.copyProperties(source, target);
output.add(target);
}
}
return output;
}
/**
* 分页转换
*
* @param clazz 新集合类
* @param list 原集合
* @return 新分页参数
*/
public static <E, T> Pagination<T> convertPage(RpcPagination<E> list, Class<T> clazz) {
Pagination pagination = new Pagination();
pagination.setPageNum(list.getPageNum());
List<T> newList = convertList(list.getList(), clazz);
pagination.setData(newList);
pagination.setCount((int) list.getTotal());
pagination.setPageSize(list.getPageSize());
return pagination;
}
/**
* 转化类型
*
* @param object 原类
* @param clazz 新类
* @return
*/
public static <T> T convertObject(Object object, Class<T> clazz) {
T target = BeanUtils.instantiateClass(clazz);
BeanUtils.copyProperties(object, target);
return target;
}
}
package cn.com.glsx.entmicro.convert.mass;
import cn.com.glsx.entmicro.dto.mass.MassCustomerSenderItemDTO;
import cn.com.glsx.entmicro.dto.mass.MassGroupDetailSenderDTO;
import cn.com.glsx.entmicro.dto.mass.MassGroupDetailStatisticDTO;
import cn.com.glsx.entmicro.dto.mass.MassStaffSenderItemDTO;
import cn.com.glsx.entmicro.response.mass.MassCustomerSenderItemVo;
import cn.com.glsx.entmicro.response.mass.MassGroupDetailSenderVo;
import cn.com.glsx.entmicro.response.mass.MassGroupDetailStatisticVo;
import cn.com.glsx.entmicro.response.mass.MassStaffSenderItemVo;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName MassStaffDetailConvert.java
* @description: ${description}
* @createTime 2021年11月19日 17:21:00
*/
public class MassStaffDetailConvert {
public static List<MassStaffSenderItemVo> convertRpcMassStaffSendList(List<MassStaffSenderItemDTO> result) {
if (CollectionUtils.isEmpty(result)) {
return null;
}
List<MassStaffSenderItemVo> massStaffSenderItemVoList = new ArrayList<>();
for (MassStaffSenderItemDTO itemDTO:result) {
massStaffSenderItemVoList.add(convertRpcMassStaffSend(itemDTO));
}
return massStaffSenderItemVoList;
}
private static MassStaffSenderItemVo convertRpcMassStaffSend(MassStaffSenderItemDTO itemDTO) {
MassStaffSenderItemVo itemVo = new MassStaffSenderItemVo();
BeanUtils.copyProperties(itemDTO, itemVo);
return itemVo;
}
public static List<MassCustomerSenderItemVo> convertRpcMassCustomerSendList(List<MassCustomerSenderItemDTO> result) {
if (CollectionUtils.isEmpty(result)) {
return null;
}
List<MassCustomerSenderItemVo> massCustomerSenderItemVoList = new ArrayList<>();
for (MassCustomerSenderItemDTO itemDTO:result) {
massCustomerSenderItemVoList.add(convertRpcMassCustomerSend(itemDTO));
}
return massCustomerSenderItemVoList;
}
private static MassCustomerSenderItemVo convertRpcMassCustomerSend(MassCustomerSenderItemDTO itemDTO) {
MassCustomerSenderItemVo itemVo = new MassCustomerSenderItemVo();
BeanUtils.copyProperties(itemDTO, itemVo);
return itemVo;
}
public static MassGroupDetailStatisticVo convertRpcMassGroupDetailStatistic(MassGroupDetailStatisticDTO result) {
MassGroupDetailStatisticVo detailVo = new MassGroupDetailStatisticVo();
BeanUtils.copyProperties(result, detailVo);
return detailVo;
}
public static List<MassGroupDetailSenderVo> convertRpcMassGroupDetailStaffList(List<MassGroupDetailSenderDTO> resultList) {
if (CollectionUtils.isEmpty(resultList)) {
return null;
}
List<MassGroupDetailSenderVo> detailSenderVoList = new ArrayList<>();
for (MassGroupDetailSenderDTO itemDTO:resultList) {
detailSenderVoList.add(convertRpcMassGroupDetailStaff(itemDTO));
}
return detailSenderVoList;
}
private static MassGroupDetailSenderVo convertRpcMassGroupDetailStaff(MassGroupDetailSenderDTO itemDTO) {
MassGroupDetailSenderVo senderVo = new MassGroupDetailSenderVo();
BeanUtils.copyProperties(itemDTO, senderVo);
return senderVo;
}
}
package cn.com.glsx.entmicro.convert.outbound;
import cn.com.glsx.entmicro.enums.outbound.EndTypeReasonEnum;
import cn.com.glsx.entmicro.model.response.outbound.OutBoundTaskCustomerExportResponse;
import cn.com.glsx.entmicro.model.response.outbound.OutBoundTaskCustomerRpcResponse;
import cn.com.glsx.entmicro.response.outbound.OutBoundTaskCustomerRopResponse;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import org.apache.commons.lang.StringUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author yelq
* @Version 1.0
* @Description:
* @Date 2023/6/6 11:08
*/
public class CustomerConvert {
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm");
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
/**
* 分页转化
* @param page
* @return
*/
public static Pagination<OutBoundTaskCustomerRopResponse> toPage(RpcPagination<OutBoundTaskCustomerRpcResponse> page){
Pagination<OutBoundTaskCustomerRopResponse> pagination = new Pagination<>();
pagination.setPageNum(page.getPageNum());
pagination.setPageSize(page.getPageSize());
pagination.setData(toOutBoundTaskCustomerRopResponses(page.getList()));
pagination.setCount((int)page.getTotal());
pagination.setPageSize(page.getPageSize());
return pagination;
}
/**
* 列表转化
*
* @param list
* @return
*/
public static List<OutBoundTaskCustomerRopResponse> toOutBoundTaskCustomerRopResponses(List<OutBoundTaskCustomerRpcResponse> list) {
if (list == null) {
return null;
} else if (list.isEmpty()) {
return new ArrayList<>();
}
return list.stream().map(CustomerConvert::toOutBoundTaskCustomerRopResponse).collect(Collectors.toList());
}
/**
* 客户返回对象转化为导出对象
*
* @param source
* @return
*/
public static OutBoundTaskCustomerRopResponse toOutBoundTaskCustomerRopResponse(OutBoundTaskCustomerRpcResponse source) {
if (source == null) {
return null;
}
return OutBoundTaskCustomerRopResponse.builder()
.phone(source.getPhone())
.answer(source.getTalkingTimeLen() != null && source.getTalkingTimeLen() > 0 ? "已接听" : source.getTalkingTimeLen() == null ? null : ("未接听(" + EndTypeReasonEnum.getMsg(source.getEndTypeReason()) + ")"))
.startTime(createStartTime(source.getStartTime()))
.reCallTimes(source.getCallTimes() == null || source.getCallTimes() == 0 ? 0 : source.getCallTimes() - 1)
.talkingTimeLen(source.getTalkingTimeLen() == null ? "0s" : source.getTalkingTimeLen() + "s")
.talkingTimeLeng(source.getTalkingTimeLeng() == null ? "0分钟" : source.getTalkingTimeLeng() + "分钟")
.intent(StringUtils.isBlank(source.getIntent()) ? "否" : "是")
.carNumber(source.getCarNumber())
.lastInsuranceCompany(source.getLastInsuranceCompany())
.insuranceEndTime(changeDate(source.getInsuranceEndTime()))
.build();
}
private static String changeDate(Date insuranceEndTime) {
if (insuranceEndTime == null) {
return null;
}
try {
return sdf.format(insuranceEndTime);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 转换开始时间
*
* @param source
* @return
*/
private static String createStartTime(Long source) {
if (source == null) {
return null;
}
try {
return simpleDateFormat.format(new Date(source));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
package cn.com.glsx.entmicro.convert.template;
import cn.com.glsx.entmicro.model.request.DracChannelCodeRequest;
import cn.com.glsx.entmicro.model.request.DracChannelCodeWelcomeInfoRequest;
import cn.com.glsx.entmicro.request.code.SaveChannelCodeRequest;
import cn.com.glsx.entmicro.request.code.UpdateChannelCodeRequest;
import cn.com.glsx.entmicro.request.one.template.QyAttachmentVo;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @author Lichongyuan
* @Description: 活码入参转换
* @date 2021/11/22 10:41
*/
public class ChannelCodeRequestConvert {
public static DracChannelCodeRequest convertSave(SaveChannelCodeRequest saveChannelCodeRequest) {
if (null == saveChannelCodeRequest) {
return null;
}
DracChannelCodeRequest dracChannelCodeRequest = new DracChannelCodeRequest();
BeanUtils.copyProperties(saveChannelCodeRequest, dracChannelCodeRequest);
dracChannelCodeRequest.setWelcomeInfo(convertWelcomeList(saveChannelCodeRequest.getWelcomeInfo()));
return dracChannelCodeRequest;
}
public static DracChannelCodeRequest convertUpdate(UpdateChannelCodeRequest updateChannelCodeRequest) {
if (null == updateChannelCodeRequest) {
return null;
}
DracChannelCodeRequest dracChannelCodeRequest = new DracChannelCodeRequest();
BeanUtils.copyProperties(updateChannelCodeRequest, dracChannelCodeRequest);
dracChannelCodeRequest.setWelcomeInfo(convertWelcomeList(updateChannelCodeRequest.getWelcomeInfo()));
return dracChannelCodeRequest;
}
public static List<DracChannelCodeWelcomeInfoRequest> convertWelcomeList(List<QyAttachmentVo> qyAttachmentVos) {
if (null == qyAttachmentVos) {
return null;
}
List<DracChannelCodeWelcomeInfoRequest> codeWelcomeInfoRequests = new ArrayList<>();
qyAttachmentVos.forEach(index ->{
codeWelcomeInfoRequests.add(convertDracChannelCodeWelcomeInfoRequest(index));
});
return codeWelcomeInfoRequests;
}
public static DracChannelCodeWelcomeInfoRequest convertDracChannelCodeWelcomeInfoRequest(QyAttachmentVo qyAttachmentVo) {
DracChannelCodeWelcomeInfoRequest dracChannelCodeWelcomeInfoRequest = new DracChannelCodeWelcomeInfoRequest();
dracChannelCodeWelcomeInfoRequest.setAttContent(qyAttachmentVo.getAttContent());
dracChannelCodeWelcomeInfoRequest.setAttType(qyAttachmentVo.getAttType());
return dracChannelCodeWelcomeInfoRequest;
}
}
package cn.com.glsx.entmicro.convert.template;
import cn.com.glsx.entmicro.constants.DracConstant;
import cn.com.glsx.entmicro.model.request.GroupOneTemplateRequest;
import cn.com.glsx.entmicro.model.request.GroupTemplateAttachmentRequest;
import cn.com.glsx.entmicro.model.request.GroupTemplateUserRequest;
import cn.com.glsx.entmicro.request.one.template.QyAttachmentVo;
import cn.com.glsx.entmicro.request.one.template.QyUserVo;
import cn.com.glsx.entmicro.request.one.template.TemplateInsertRequest;
import cn.com.glsx.entmicro.request.one.template.TemplateUpdateRequest;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName GroupOneTemplateRequestConvert.java
* @description: ${description}
* @createTime 2021年11月12日 19:53:00
*/
public class GroupOneTemplateRequestConvert {
public static GroupOneTemplateRequest convertGroupTemplateInsert(TemplateInsertRequest request) {
GroupOneTemplateRequest groupOneTemplateRequest = new GroupOneTemplateRequest();
groupOneTemplateRequest.setOrgName(request.getOrgName());
groupOneTemplateRequest.setGroupName(request.getGroupName());
groupOneTemplateRequest.setGroupNameRule(request.getGroupNameRule());
groupOneTemplateRequest.setMerchantId(request.getMerchantId());
groupOneTemplateRequest.setCreatedBy(request.getCreatedBy());
groupOneTemplateRequest.setDelFlag(DracConstant.DelFlag.OK);
groupOneTemplateRequest.setStatus(DracConstant.TemplateStatus.OK);
// groupOneTemplateRequest.setAttachmentList(convertGroupTemplateAttachmentList(request.getAttachmentList()));
groupOneTemplateRequest.setUserList(convertGroupTemplateUserList(request.getUserList()));
return groupOneTemplateRequest;
}
private static List<GroupTemplateAttachmentRequest> convertGroupTemplateAttachmentList(List<QyAttachmentVo> attachmentVoList) {
if (CollectionUtils.isEmpty(attachmentVoList)) {
return null;
}
List<GroupTemplateAttachmentRequest> attList = new ArrayList<>();
for (QyAttachmentVo attVo : attachmentVoList) {
attList.add(convertGroupTemplateAttachment(attVo));
}
return attList;
}
private static GroupTemplateAttachmentRequest convertGroupTemplateAttachment(QyAttachmentVo attVo) {
GroupTemplateAttachmentRequest att = new GroupTemplateAttachmentRequest();
att.setAttType(attVo.getAttType());
att.setAttContent(attVo.getAttContent());
att.setDelFlag(DracConstant.DelFlag.OK);
return att;
}
private static List<GroupTemplateUserRequest> convertGroupTemplateUserList(List<QyUserVo> userVoList) {
if (CollectionUtils.isEmpty(userVoList)) {
return null;
}
List<GroupTemplateUserRequest> uList = new ArrayList<>();
for (QyUserVo userVo : userVoList) {
uList.add(convertGroupTemplateUser(userVo));
}
return uList;
}
private static GroupTemplateUserRequest convertGroupTemplateUser(QyUserVo userVo) {
GroupTemplateUserRequest userRequest = new GroupTemplateUserRequest();
userRequest.setStaffId(userVo.getStaffId());
userRequest.setMasterStatus(userVo.getMasterStatus());
userRequest.setFollow(userVo.getFollow());
return userRequest;
}
public static GroupOneTemplateRequest convertGroupTemplateUpdate(TemplateUpdateRequest request) {
GroupOneTemplateRequest groupOneTemplateRequest = new GroupOneTemplateRequest();
groupOneTemplateRequest.setId(request.getId());
groupOneTemplateRequest.setOrgName(request.getOrgName());
groupOneTemplateRequest.setGroupName(request.getGroupName());
groupOneTemplateRequest.setGroupNameRule(request.getGroupNameRule());
groupOneTemplateRequest.setMerchantId(request.getMerchantId());
groupOneTemplateRequest.setUpdatedBy(request.getMerchantId());
groupOneTemplateRequest.setDelFlag(DracConstant.DelFlag.OK);
groupOneTemplateRequest.setStatus(DracConstant.TemplateStatus.OK);
// groupOneTemplateRequest.setAttachmentList(convertGroupTemplateAttachmentList(request.getAttachmentList()));
groupOneTemplateRequest.setUserList(convertGroupTemplateUserList(request.getUserList()));
return groupOneTemplateRequest;
}
}
package cn.com.glsx.entmicro.convert.template;
import cn.com.glsx.entmicro.model.request.DracChannelCodeRequest;
import cn.com.glsx.entmicro.model.request.DracChannelCodeWelcomeInfoRequest;
import cn.com.glsx.entmicro.model.request.operation.OperationSaveRpcRequest;
import cn.com.glsx.entmicro.model.request.operation.OperationUpdateRpcRequest;
import cn.com.glsx.entmicro.request.code.SaveChannelCodeRequest;
import cn.com.glsx.entmicro.request.code.UpdateChannelCodeRequest;
import cn.com.glsx.entmicro.request.one.template.QyAttachmentVo;
import cn.com.glsx.entmicro.request.operation.OperationSaveRopRequest;
import cn.com.glsx.entmicro.request.operation.OperationUpdateRopRequest;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName OperationRequestConvert
* @Description
* @Author lichongyuan
* @Date 2022/5/16
*/
public class OperationRequestConvert {
public static OperationSaveRpcRequest convertSave(OperationSaveRopRequest saveChannelCodeRequest) {
if (null == saveChannelCodeRequest) {
return null;
}
OperationSaveRpcRequest dracChannelCodeRequest = new OperationSaveRpcRequest();
BeanUtils.copyProperties(saveChannelCodeRequest, dracChannelCodeRequest);
dracChannelCodeRequest.setWelcomeInfo(convertWelcomeList(saveChannelCodeRequest.getWelcomeInfo()));
return dracChannelCodeRequest;
}
public static OperationUpdateRpcRequest convertUpdate(OperationUpdateRopRequest updateChannelCodeRequest) {
if (null == updateChannelCodeRequest) {
return null;
}
OperationUpdateRpcRequest dracChannelCodeRequest = new OperationUpdateRpcRequest();
BeanUtils.copyProperties(updateChannelCodeRequest, dracChannelCodeRequest);
dracChannelCodeRequest.setWelcomeInfo(convertWelcomeList(updateChannelCodeRequest.getWelcomeInfo()));
return dracChannelCodeRequest;
}
public static List<DracChannelCodeWelcomeInfoRequest> convertWelcomeList(List<QyAttachmentVo> qyAttachmentVos) {
if (null == qyAttachmentVos) {
return null;
}
List<DracChannelCodeWelcomeInfoRequest> codeWelcomeInfoRequests = new ArrayList<>();
qyAttachmentVos.forEach(index ->{
codeWelcomeInfoRequests.add(convertDracChannelCodeWelcomeInfoRequest(index));
});
return codeWelcomeInfoRequests;
}
public static DracChannelCodeWelcomeInfoRequest convertDracChannelCodeWelcomeInfoRequest(QyAttachmentVo qyAttachmentVo) {
DracChannelCodeWelcomeInfoRequest dracChannelCodeWelcomeInfoRequest = new DracChannelCodeWelcomeInfoRequest();
dracChannelCodeWelcomeInfoRequest.setAttContent(qyAttachmentVo.getAttContent());
dracChannelCodeWelcomeInfoRequest.setAttType(qyAttachmentVo.getAttType());
return dracChannelCodeWelcomeInfoRequest;
}
}
package cn.com.glsx.entmicro.request.card;
import com.rop.AbstractRopRequest;
public class ActivityRecordEmptyRopRequest extends AbstractRopRequest {
}
package cn.com.glsx.entmicro.request.card;
import cn.com.glsx.entmicro.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ActivityRecordIdRopRequest extends DefaultRequest {
@ApiModelProperty(value = "活动记录id",required = true)
private Integer Id;
}
package cn.com.glsx.entmicro.request.card;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ActivityRecordOpenIdRopRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "openId",required = true)
private String openId;
}
package cn.com.glsx.entmicro.request.card;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
public class ActivityRecordPageRopRequest extends AbstractRopRequest {
@ApiModelProperty("活动名称")
private String activityName;
@ApiModelProperty("门店名称")
private String merchantName;
@NotNull
@ApiModelProperty(notes = "分页数", name = "pageSize", required = true)
private Integer pageSize;
@NotNull
@ApiModelProperty(notes = "当前页", name = "pageNum", required = true)
private Integer pageNum;
}
package cn.com.glsx.entmicro.request.card;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ActivityRecordPhoneRopRequest extends AbstractRopRequest {
@ApiModelProperty(value = "员工手机号",required = true)
private String phone;
}
package cn.com.glsx.entmicro.request.card;
import cn.com.glsx.entmicro.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ActivityRecordUpdateRopRequest extends DefaultRequest {
@ApiModelProperty(value = "活动记录id",required = true)
private Integer id;
@ApiModelProperty("活动介绍")
private String activityEvent;
@ApiModelProperty("视频第一帧截图")
private String videoImage;
@ApiModelProperty("图片url")
private List<String> imageUrlArr;
@ApiModelProperty("视频url")
private String videoUrl;
}
package cn.com.glsx.entmicro.request.card;
import cn.com.glsx.entmicro.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Description
* @author chizw
* @create 2022/10/13 16:39
* @version ver.1.0.0
*/
@Data
public class BusinessCardActivityApplyRopRequest extends DefaultRequest {
/**
* 智能名片商户号
*/
@ApiModelProperty(notes = "智能名片商户号")
private Integer merchant;
/**
* 智能名片id
*/
@ApiModelProperty(notes = "智能名片id")
private Integer cardId;
/**
* 门店名称
*/
@ApiModelProperty(notes = "门店名称")
private String merchantName;
/**
* 主要车型
*/
@ApiModelProperty(notes = "主要车型")
private String carModel;
/**
* 联系人
*/
@ApiModelProperty(notes = "联系人")
private String contactName;
/**
* 联系方式
*/
@ApiModelProperty(notes = "联系方式")
private String contactPhone;
/**
* 访客openId
*/
@ApiModelProperty(notes = "访客openId")
private String openId;
/**
* 访客unionId
*/
@ApiModelProperty(notes = "访客unionId")
private String unionId;
/**
* 业务场景
*/
@ApiModelProperty(notes = "业务场景")
private String businessScenario;
/**
* 产品项目
*/
@ApiModelProperty(notes = "产品项目")
private String productItems;
}
package cn.com.glsx.entmicro.request.card;
import cn.com.glsx.entmicro.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Description
* @author chizw
* @create 2022/10/17 14:28
* @version ver.1.0.0
*/
@Data
public class BusinessCardActivityPageRopRequest extends DefaultRequest {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "分页数", name = "pageSize", required = true)
private Integer pageSize;
@ApiModelProperty(notes = "当前页", name = "pageNum", required = true)
private Integer pageNum;
/**
* 开始申请时间
*/
@ApiModelProperty(notes = "开始申请时间")
private Date startApplyDate;
/**
* 结束申请时间
*/
@ApiModelProperty(notes = "结束申请时间")
private Date endApplyDate;
/**
* 渠道名称
*/
@ApiModelProperty(notes = "渠道名称")
private String cardName;
/**
* 名片来源
*/
@ApiModelProperty(notes = "名片来源")
private String staffName;
/**
* 跟进状态
*/
@ApiModelProperty(notes = "跟进状态")
private Integer followType;
@ApiModelProperty(notes = "智能名片id")
private Integer cardId;
@ApiModelProperty(notes = "员工手机号")
private String staffPhone;
@ApiModelProperty(notes = "所属商户号")
private Integer merchant;
}
package cn.com.glsx.entmicro.request.card;
import cn.com.glsx.entmicro.request.DefaultRequest;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class BusinessCardActivityRecordRopRequest extends DefaultRequest {
/**
* 商户号
*/
@ApiModelProperty(value = "商户号",required = true)
private Integer merchantNo;
@ApiModelProperty(value = "众筹活动id",required = true)
private Integer crowdFundActivityId;
/**
* 商户名称
*/
@ApiModelProperty(value = "商户名称",required = true)
private String merchantName;
/**
* 活动名称
*/
@ApiModelProperty(value = "活动名称",required = true)
private String activityName;
@ApiModelProperty(value = "主办方")
private String sponsorName;
/**
* 开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间",required = true)
private Date beginTime;
/**
* 结束时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间",required = true)
private Date endTime;
/**
* 活动地址
*/
@ApiModelProperty(value = "活动地址")
private String address;
/**
* 参与人数
*/
@ApiModelProperty(value = "参与人数",required = true)
private Integer participants;
/**
* 活动介绍
*/
@ApiModelProperty(value = "活动介绍",required = true)
private String activityEvent;
/**
* 活动图片地址
*/
@ApiModelProperty("活动图片地址")
private List<String> imageUrlArr;
/**
* 视频url
*/
@ApiModelProperty("视频url")
private String videoUrl;
@ApiModelProperty("视频第一帧图片")
private String videoImage;
@ApiModelProperty(value = "活动状态 0:未开始 1:进行中 2:已结束",required = true)
private Byte status;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!