zj
2026-01-14 3a1977e8cc0c5fffbc6490f220f30116af6cce86
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
package com.nq.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nq.common.ServerResponse;
import com.nq.pojo.*;
import com.nq.service.IUserPositionService;
import com.nq.service.UserPositionCheckDzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.servlet.http.HttpServletRequest;
 
/**
 * @program: dabaogp
 * @description: 大宗交易审核
 * @create: 2024-07-02 14:33
 **/
@Controller
@RequestMapping({"/api/dzCheck/"})
public class UserPositionCheckDzController {
 
    @Autowired
    UserPositionCheckDzService service;
 
    @Autowired
    IUserPositionService userPositionService;
 
    //大宗交易审核列表
    @RequestMapping({"getList.do"})
    @ResponseBody
    public ServerResponse getList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                  @RequestParam(value = "pageSize", defaultValue = "15") int pageSize,
                                  @RequestParam(value = "type", required = false) Integer type,
                                  @RequestParam(value = "stockCode", required = false)String stockCode,
                                  @RequestParam(value = "agentId", required = false) String agentId) {
        Page<UserPositionCheckDz> page = Page.of(pageNum, pageSize);
        LambdaQueryWrapper<UserPositionCheckDz> queryWrapper = new LambdaQueryWrapper<UserPositionCheckDz>();
 
        // 判断type是否为空,不为空则加入查询条件
        if (type != null) {
            queryWrapper.eq(UserPositionCheckDz::getCheckType, type);
        }
 
        if (agentId != null) {
            queryWrapper.eq(UserPositionCheckDz::getAgentId, agentId);
        }
 
        // 判断stockCode是否为空,不为空则加入查询条件
        if (stockCode != null) {
            queryWrapper.eq(UserPositionCheckDz::getStockCode, stockCode);
        }
        queryWrapper.orderByDesc(UserPositionCheckDz::getBuyOrderTime);
        Page<UserPositionCheckDz> pageList = service.page(page, queryWrapper);
        return ServerResponse.createBySuccess(pageList);
    }
 
    //大宗审核
    @RequestMapping({"check.do"})
    @ResponseBody
    public ServerResponse check(@RequestParam(value = "id") Integer id,
                                @RequestParam(value = "checkType") Integer checkType,
                                @RequestParam(value = "orderNum", required = false) Integer orderNum, HttpServletRequest request) {
        if(checkType != 2 && (id == null || checkType == null || orderNum == null)){
            return ServerResponse.createByErrorMsg("参数不能为空", request);
        }
        return userPositionService.checkDz(id, checkType, orderNum ,request);
    }
}