ERPCommonController.java
1.63 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
package cn.fw.valhalla.controller.erp;
import cn.fw.common.web.annotation.ControllerMethod;
import cn.fw.common.web.auth.LoginAuthBean;
import cn.fw.common.web.auth.annotation.CurrentUser;
import cn.fw.data.base.domain.common.Message;
import cn.fw.security.auth.client.annotation.Authorization;
import cn.fw.security.auth.client.annotation.IgnoreUserToken;
import cn.fw.security.auth.client.enums.AuthType;
import cn.fw.valhalla.sdk.param.CustomerQueryReq;
import cn.fw.valhalla.service.bus.cust.CustomerBizService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import static cn.fw.common.web.util.ResultBuilder.success;
/**
* @author : kurisu
* @className : CustomerController
* @description : 档案控制器
* @date: 2020-08-12 15:30
*/
@Slf4j
@Validated
@RestController
@Authorization(AuthType.ERP)
@RequiredArgsConstructor
@RequestMapping("/erp/customer")
public class ERPCommonController {
private final CustomerBizService customerBizService;
@GetMapping("/condition/count")
@IgnoreUserToken
@ControllerMethod("查询满足条件的档案数量")
public Message<Number> conditionCustomerCount(@CurrentUser LoginAuthBean currentUser, @Valid CustomerQueryReq customerQueryReq) {
customerQueryReq.setGroupId(currentUser.getGroupId());
return success(customerBizService.queryCustomCount(customerQueryReq));
}
}