zyy
2025-10-30 081a25368d4ebf71f69a9e82cbdeb5108e350d4a
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
package com.yami.trading.admin.controller.dz;
 
import com.yami.trading.bean.dz.StockDz;
import com.yami.trading.common.constants.Constants;
import com.yami.trading.common.domain.Result;
import com.yami.trading.service.dz.StockDzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@RestController
@CrossOrigin
@Api(tags = "后台美股暗池订单")
@RequestMapping("stockDarkPools")
@Slf4j
public class AdminStockDarkPoolsController {
 
    @Resource
    StockDzService stockDzService;
 
    /**
     * @Description: 获取大宗列表
     * @Param:
     * @return:
     */
    @ApiOperation("获取大宗列表")
    @PostMapping({"getDzListByAdmin.do"})
    public Result getDzListByAdmin(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                   @RequestParam(value = "pageSize", defaultValue = "5") int pageSize,
                                   @RequestParam(value = "keywords", required = false)String keywords) {
        return stockDzService.getDzListByAdmin(pageNum, pageSize, keywords, Constants.US_DARK);
    }
 
    /**
     * @Description: 新增大宗
     * @Param:
     * @return:
     */
    @ApiOperation("新增大宗")
    @PostMapping({"addByAdmin.do"})
    public Result addByAdmin(@RequestParam(value = "stockCode") String stockCode,
                                     @RequestParam(value = "stockNum") String stockNum,
                                     @RequestParam(value = "password", required = false) String password,
                                     @RequestParam(value = "startTime") String startTime,
                                     @RequestParam(value = "endTime") String endTime,
                                     @RequestParam(value = "discount", required = false) String discount,
                                     @RequestParam(value = "period") Integer period,
                                     @RequestParam(value = "nowPrice") String nowPrice,
                                     @RequestParam(value = "switchType", defaultValue = "0") Integer switchType) {
        return stockDzService.addByAdmin(stockCode, stockNum, password, startTime, endTime, discount, period,nowPrice,switchType, Constants.US_DARK);
    }
 
    /**
     * 删除大宗
     */
    @ApiOperation("删除大宗")
    @PostMapping({"deleteByAdmin.do"})
    public Result deleteByAdmin(@RequestParam(value = "id") String id) {
        return stockDzService.deleteByAdmin(id);
    }
 
    /**
     * 修改大宗
     */
    @ApiOperation("修改大宗")
    @PostMapping({"updateByAdmin.do"})
    public Result updateByAdmin(StockDz model) {
        return stockDzService.updByAdmin(model);
    }
 
 
    @ApiOperation("大宗交易审核列表")
    @PostMapping({"getDzCheckList.do"})
    @ResponseBody
    public Result getDzCheckList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                  @RequestParam(value = "pageSize", defaultValue = "15") int pageSize,
                                  @RequestParam(value = "state", required = false) String state,
                                  @RequestParam(value = "stockCode", required = false)String stockCode) {
        return stockDzService.getDzCheckList(pageNum, pageSize, state, stockCode, Constants.US_DARK);
    }
 
    @ApiOperation("大宗审核")
    @PostMapping({"dzCheck.do"})
    @ResponseBody
    public Result check(@RequestParam(value = "id") String id,
                                @RequestParam(value = "checkType") Integer checkType,
                                @RequestParam(value = "orderNum", required = false) Double orderNum) {
        if(checkType != 2 && (id == null || checkType == null || orderNum == null)){
            return Result.failed("参数不能为空");
        }
        return stockDzService.dzCheck(id, checkType, orderNum);
    }
 
}