MerchantStaffController.java
4.95 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
package cn.com.glsx.busassistant.controller;
import cn.com.glsx.busassistant.request.serviceCenter.CreateMerchantStaffRopRequest;
import cn.com.glsx.busassistant.request.serviceCenter.SearchStaffPageRopRequest;
import cn.com.glsx.busassistant.request.serviceCenter.UpdateStaffRopRequest;
import cn.com.glsx.busassistant.request.staff.StaffAuditPageRopRequest;
import cn.com.glsx.busassistant.request.staff.StaffResponse;
import cn.com.glsx.busassistant.request.staff.TechnicianPageRequest;
import cn.com.glsx.busassistant.response.ServiceStaffRopResponse;
import cn.com.glsx.busassistant.service.BusinessStaffService;
import cn.com.glsx.busassistant.util.Pagination;
import cn.com.glsx.dj.smartcarlife.response.staff.StaffAuditResponse;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
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;
@Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("个人中心-员工管理")
public class MerchantStaffController {
@Autowired
private BusinessStaffService staffService;
@ServiceMethod(method = "scrm.api.busassistant.staff.createStaff", needInSession = NeedInSessionType.YES)
@ApiOperation("服务中心-创建员工")
public RopResponse<Boolean> createStaff(CreateMerchantStaffRopRequest ropRequest) {
try {
return staffService.createStaff(ropRequest);
} catch (RpcServiceException e) {
log.info("=======OpenController__invoke__serviceCenterCreateStaff__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "scrm.api.busassistant.staff.updateStaff", needInSession = NeedInSessionType.YES)
@ApiOperation("服务中心-更新员工")
public RopResponse<Boolean> updateStaff(UpdateStaffRopRequest ropRequest) {
try {
return staffService.updateStaff(ropRequest);
} catch (RpcServiceException e) {
log.info("=======OpenController__invoke__serviceCenterupdateStaff__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "scrm.api.busassistant.staff.searchStaffPage", needInSession = NeedInSessionType.YES)
@ApiOperation("服务中心-查询员工分页")
public RopResponse<Pagination<ServiceStaffRopResponse>> searchStaffPage(SearchStaffPageRopRequest ropRequest) {
try {
return RopResponse.success(staffService.searchStaffPage(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OpenController__invoke__serviceCenterSearchStaffPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询员工分页列表
*
* @param staffPageRequest 入参
* @return
*/
@ServiceMethod(method = "scrm.api.busassistant.staff.findStaffByPage", needInSession = NeedInSessionType.NO)
@ApiOperation("查询员工分页列表")
public RopResponse<Pagination<StaffResponse>> getMerchantStaffPage(TechnicianPageRequest staffPageRequest) {
try {
Pagination<StaffResponse> list = staffService.getMerchantStaffPage(staffPageRequest);
return RopResponse.success(list);
} catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__findStaffByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 新增/更新/删除员工-提交审核
*/
@ServiceMethod(method = "scrm.api.busassistant.staff.audit.add", needInSession = NeedInSessionType.NO)
@ApiOperation("新增/更新/删除员工-提交审核")
public RopResponse<Boolean> addStaffAudit(CreateMerchantStaffRopRequest ropRequest) {
try {
return RopResponse.success(staffService.addStaffAudit(ropRequest));
} catch (RpcServiceException e) {
log.error("提交审核失败 ",e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "scrm.api.busassistant.staff.audit.page", needInSession = NeedInSessionType.NO)
@ApiOperation("员工审核列表")
public RopResponse<RpcPagination<StaffAuditResponse>> addStaffAudit(StaffAuditPageRopRequest ropRequest) {
try {
return RopResponse.success(staffService.staffAuditPage(ropRequest));
} catch (RpcServiceException e) {
log.error("查询员工审核列表失败 ",e);
return RopResponse.error("查询员工审核列表失败");
}
}
}