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") Integer orderNum, HttpServletRequest request) {
|
if(checkType != 2 && (id == null || checkType == null || orderNum == null)){
|
return ServerResponse.createByErrorMsg("参数不能为空", request);
|
}
|
return userPositionService.checkDz(id, checkType, orderNum ,request);
|
}
|
}
|