liurunyu
6 天以前 f1c648e7ac1b4c437e7f0c9a69130cb443ca46fd
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
package com.dy.pipIrrTerminal.general;
 
import com.dy.common.aop.SsoAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrTerminal.general.qo.QoSummary;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Map;
import java.util.Objects;
 
/**
 * @author ZhuBaoMin
 * @date 2025-06-25 11:25
 * @LastEditTime 2025-06-25 11:25
 * @Description
 */
 
@Slf4j
@RestController
@RequestMapping(path="general")
@RequiredArgsConstructor
public class GeneralCtrl {
    private final GeneralSv generalSv;
 
    /**
     * 充值机用获取交易统计记录
     * @param vo
     * @param bindingResult
     * @return
     */
    @GetMapping(path = "getSummaries")
    @SsoAop()
    public BaseResponse<Map> getSummaries(@Valid QoSummary vo, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        try {
            Map res = generalSv.getSummaries(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询交易汇总记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}