CommonController.java
6.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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());
}
}
}