| | |
| | | package com.yami.trading.admin.controller.dz; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | @RestController |
| | | @CrossOrigin |
| | |
| | | * @return: |
| | | */ |
| | | @ApiOperation("获取大宗列表") |
| | | @RequestMapping({"getDzListByAdmin.do"}) |
| | | public Result getDzListByAdmin(String keywords) { |
| | | return stockDzService.getDzListByAdmin(keywords); |
| | | @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_STOCKS); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return: |
| | | */ |
| | | @ApiOperation("新增大宗") |
| | | @RequestMapping({"addByAdmin.do"}) |
| | | @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 = "period", required = false) 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); |
| | | return stockDzService.addByAdmin(stockCode, stockNum, password, startTime, endTime, discount, period,nowPrice,switchType, Constants.US_STOCKS, 0); |
| | | } |
| | | |
| | | /** |
| | | * 删除大宗 |
| | | */ |
| | | @ApiOperation("删除大宗") |
| | | @RequestMapping({"deleteByAdmin.do"}) |
| | | @PostMapping({"deleteByAdmin.do"}) |
| | | public Result deleteByAdmin(@RequestParam(value = "id") String id) { |
| | | return stockDzService.deleteByAdmin(id); |
| | | } |
| | |
| | | * 修改大宗 |
| | | */ |
| | | @ApiOperation("修改大宗") |
| | | @RequestMapping({"updateByAdmin.do"}) |
| | | @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_STOCKS, null); |
| | | } |
| | | |
| | | @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, 0); |
| | | } |
| | | |
| | | } |