ReceptionCustomerFileController.java
2.77 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
package cn.com.glsx.dj.script.controller;
import cn.com.glsx.dj.mindworkplate.dto.ReceptionCustomerFileDetailDTO;
import cn.com.glsx.dj.mindworkplate.dto.ReceptionCustomerFileUpdateRequestDTO;
import cn.com.glsx.dj.mindworkplate.remote.ReceptionCustomerFileRemote;
import cn.com.glsx.dj.script.request.customer.ReceptionCustomerFileIdRequest;
import cn.com.glsx.dj.script.request.customer.ReceptionCustomerFileUpdateRequest;
import cn.com.glsx.dj.script.utils.CommonUtil;
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
@Api("客户档案管理")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class ReceptionCustomerFileController {
@Autowired
private ReceptionCustomerFileRemote receptionCustomerFileRemote;
@ApiOperation("查询客户档案详情")
@ServiceMethod(method = "dj.api.script.customer.file.detail", needInSession = NeedInSessionType.NO)
public RopResponse<ReceptionCustomerFileDetailDTO> findDetailByReceptionId(ReceptionCustomerFileIdRequest request) {
try {
return CommonUtil.convertRopResponse(receptionCustomerFileRemote.findDetailByReceptionId(request.getReceptionId()));
} catch (RpcServiceException e) {
log.error("=====查询客户档案详情 rpcServiceException:{}", e.getMessage(), e);
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====查询客户档案详情 exception:{}", e.getMessage(), e);
return RopResponse.error("查询客户档案详情失败");
}
}
@ApiOperation("更新客户档案")
@ServiceMethod(method = "dj.api.script.customer.file.update", needInSession = NeedInSessionType.NO)
public RopResponse<Boolean> updateCustomerFile(ReceptionCustomerFileUpdateRequest request) {
ReceptionCustomerFileUpdateRequestDTO dto = CommonUtil.convertRequest(ReceptionCustomerFileUpdateRequestDTO.class);
try {
return CommonUtil.convertRopResponse(receptionCustomerFileRemote.updateCustomerFile(dto));
} catch (RpcServiceException e) {
log.error("=====更新客户档案 rpcServiceException:{}", e.getMessage(), e);
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====更新客户档案 exception:{}", e.getMessage(), e);
return RopResponse.error("更新客户档案失败");
}
}
}