MerchantMissionService.java
5.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
package cn.com.glsx.stoassistant.service;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.stoassistant.annotation.LogSupport;
import cn.com.glsx.stoassistant.convert.ConvertRequest;
import cn.com.glsx.stoassistant.model.request.mission.ActivityMissionInfoRequest;
import cn.com.glsx.stoassistant.model.request.mission.MerchantUserFollowInfoRpcRequest;
import cn.com.glsx.stoassistant.model.request.mission.PlatformMerchantStaffMissionRequest;
import cn.com.glsx.stoassistant.model.request.mission.StaffMissionListRequest;
import cn.com.glsx.stoassistant.model.response.mission.PlatformMerchantMissionInfoResponse;
import cn.com.glsx.stoassistant.model.response.mission.PlatformMerchantStaffMissionDetailResponse;
import cn.com.glsx.stoassistant.model.response.mission.StaffMissionDateResponse;
import cn.com.glsx.stoassistant.remote.PlatformMerchantMissionRemote;
import cn.com.glsx.stoassistant.remote.PlatformMerchantStaffMissionRemote;
import cn.com.glsx.stoassistant.request.activity.ActivityMissionInfoRopRequest;
import cn.com.glsx.stoassistant.request.mission.StaffMissionListRopRequest;
import cn.com.glsx.stoassistant.request.mission.StaffMissionRopRequest;
import cn.com.glsx.stoassistant.request.userInfo.MerchantUserFollowInfoRopRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @BelongsProject: 20221031
* @BelongsPackage: cn.com.glsx.stoassistant.service
* @Author: 11
* @CreateTime: 2022-10-18 09:52
* @Description: TODO
* @Version: 1.0
*/
@Service
public class MerchantMissionService {
@Autowired
private PlatformMerchantMissionRemote platformMerchantMissionRemote;
@Autowired
private PlatformMerchantStaffMissionRemote platformMerchantStaffMissionRemote;
@LogSupport(module = "任务模块",method = "查询任务详情")
public PlatformMerchantStaffMissionDetailResponse getMissionById(StaffMissionRopRequest staffMissionRopRequest){
PlatformMerchantStaffMissionRequest param = ConvertRequest.convertRequest(staffMissionRopRequest, new PlatformMerchantStaffMissionRequest());
param.setUuid(staffMissionRopRequest.getUuid());
RpcResponse<PlatformMerchantStaffMissionDetailResponse> rpcResponse = platformMerchantMissionRemote.getMissionById(param);
if (rpcResponse.isSuccess()) {
return rpcResponse.getResult();
}
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getException().getMessage());
}
@LogSupport(module = "任务模块",method = "查询员工任务列表")
public List<StaffMissionDateResponse> findStaffMissionList(StaffMissionListRopRequest staffMissionRopRequest){
StaffMissionListRequest param = ConvertRequest.convertRequest(staffMissionRopRequest, new StaffMissionListRequest());
param.setUuid(staffMissionRopRequest.getUuid());
RpcResponse<List<StaffMissionDateResponse>> staffMissionList = platformMerchantStaffMissionRemote.findStaffMissionList(param);
if (staffMissionList.isSuccess()) {
return staffMissionList.getResult();
}
throw new RpcServiceException(staffMissionList.getException().getErrId(), staffMissionList.getException().getMessage());
}
@LogSupport(module = "任务模块",method = "查询任务详情")
public PlatformMerchantStaffMissionDetailResponse getMissionByIdAndNoSession(StaffMissionRopRequest staffMissionRopRequest){
PlatformMerchantStaffMissionRequest param = ConvertRequest.convertRequest(staffMissionRopRequest, new PlatformMerchantStaffMissionRequest());
RpcResponse<PlatformMerchantStaffMissionDetailResponse> rpcResponse = platformMerchantMissionRemote.getMissionByIdAndNoSession(param);
if (rpcResponse.isSuccess()) {
return rpcResponse.getResult();
}
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getException().getMessage());
}
@LogSupport(module = "任务模块",method = "保存线索跟进")
public void saveMerchantUserFollowInfo(MerchantUserFollowInfoRopRequest request) {
MerchantUserFollowInfoRpcRequest rpcRequest = ConvertRequest.convertRequest(request, new MerchantUserFollowInfoRpcRequest());
RpcResponse<Boolean> rpcResponse = platformMerchantMissionRemote.saveMerchantUserFollowInfo(rpcRequest);
if (rpcResponse.isFailed()) {
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getException().getMessage());
}
}
public PlatformMerchantMissionInfoResponse findMissionByActiviyId(ActivityMissionInfoRopRequest activityIdRequest) {
ActivityMissionInfoRequest rpcRequest = ConvertRequest.convertRequest(activityIdRequest, new ActivityMissionInfoRequest());
RpcResponse<PlatformMerchantMissionInfoResponse> rpcResponse = platformMerchantMissionRemote.findMissionByActiviyId(rpcRequest);
if (rpcResponse.isFailed()) {
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getException().getMessage());
}
return rpcResponse.getResult();
}
}