| | |
| | | @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.indices_dark); |
| | | return stockDzService.getDzCheckList(pageNum, pageSize, state, stockCode, Constants.indices_dark, null); |
| | | } |
| | | |
| | | @ApiOperation("大宗审核") |
| | |
| | | if(checkType != 2 && (id == null || checkType == null || orderNum == null)){ |
| | | return Result.failed("参数不能为空"); |
| | | } |
| | | return stockDzService.dzCheck(id, checkType, orderNum); |
| | | return stockDzService.dzCheck(id, checkType, orderNum, 0); |
| | | } |
| | | |
| | | } |
| | |
| | | @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.indices); |
| | | return stockDzService.getDzCheckList(pageNum, pageSize, state, stockCode, Constants.indices, null); |
| | | } |
| | | |
| | | @ApiOperation("大宗审核") |
| | |
| | | if(checkType != 2 && (id == null || checkType == null || orderNum == null)){ |
| | | return Result.failed("参数不能为空"); |
| | | } |
| | | return stockDzService.dzCheck(id, checkType, orderNum); |
| | | return stockDzService.dzCheck(id, checkType, orderNum, 0); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yami.trading.admin.controller.dz; |
| | | |
| | | import com.yami.trading.admin.facade.PermissionFacade; |
| | | import com.yami.trading.bean.dz.StockDz; |
| | | import com.yami.trading.common.constants.Constants; |
| | | import com.yami.trading.common.domain.Result; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | StockDzService stockDzService; |
| | | |
| | | @Autowired |
| | | private PermissionFacade permissionFacade; |
| | | |
| | | |
| | | /** |
| | | * @Description: 获取大宗列表 |
| | |
| | | @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); |
| | | return stockDzService.getDzCheckList(pageNum, pageSize, state, stockCode, Constants.US_DARK, permissionFacade.getOwnerUserIds()); |
| | | } |
| | | |
| | | @ApiOperation("大宗审核") |
| | |
| | | @ResponseBody |
| | | public Result check(@RequestParam(value = "id") String id, |
| | | @RequestParam(value = "checkType") Integer checkType, |
| | | @RequestParam(value = "orderNum", required = false) Double orderNum) { |
| | | @RequestParam(value = "orderNum", required = false) Double orderNum, |
| | | @RequestParam(value = "price", required = false, defaultValue = "0") double price) { |
| | | if(checkType != 2 && (id == null || checkType == null || orderNum == null)){ |
| | | return Result.failed("参数不能为空"); |
| | | } |
| | | return stockDzService.dzCheck(id, checkType, orderNum); |
| | | return stockDzService.dzCheck(id, checkType, orderNum, price); |
| | | } |
| | | |
| | | } |
| | |
| | | @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); |
| | | return stockDzService.getDzCheckList(pageNum, pageSize, state, stockCode, Constants.US_STOCKS, null); |
| | | } |
| | | |
| | | @ApiOperation("大宗审核") |
| | |
| | | if(checkType != 2 && (id == null || checkType == null || orderNum == null)){ |
| | | return Result.failed("参数不能为空"); |
| | | } |
| | | return stockDzService.dzCheck(id, checkType, orderNum); |
| | | return stockDzService.dzCheck(id, checkType, orderNum, 0); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("浮动盈亏比例") |
| | | private double profitLossPercentage; |
| | | |
| | | @ApiModelProperty("推荐人") |
| | | private String recomUserName; |
| | | |
| | | } |
| | |
| | | import com.yami.trading.bean.dz.dto.StockDzDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface StockDzMapper extends BaseMapper<StockDz> { |
| | | |
| | |
| | | Page getDzCheckList(Page page, |
| | | @Param("state") String state, |
| | | @Param("stockCode") String stockCode, |
| | | @Param("stockType") String stockType); |
| | | @Param("stockType") String stockType, |
| | | @Param("checkedList") List<String> checkedList); |
| | | |
| | | } |
| | |
| | | import com.yami.trading.common.domain.Result; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | public interface StockDzService extends IService<StockDz> { |
| | | |
| | |
| | | |
| | | Result getDzOrderList(int pageNum, int pageSize, String state, String userId, String stockType); |
| | | |
| | | Result getDzCheckList(int pageNum, int pageSize, String state, String stockCode, String stockType); |
| | | Result getDzCheckList(int pageNum, int pageSize, String state, String stockCode, String stockType, List<String> checkedList); |
| | | |
| | | Result buyDz(String dzId, String password, double num, String partyId); |
| | | |
| | | Result dzCheck(String id, Integer checkType, Double num); |
| | | Result dzCheck(String id, Integer checkType, Double num, double price); |
| | | |
| | | public void intoPosition(ExchangeApplyOrderDz orderDz, String stockType); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result getDzCheckList(int pageNum, int pageSize, String state, String stockCode, String stockType) { |
| | | public Result getDzCheckList(int pageNum, int pageSize, String state, String stockCode, String stockType, List<String> checkedList) { |
| | | try { |
| | | Page page = new Page(pageNum, pageSize); |
| | | stockDzMapper.getDzCheckList(page ,state, stockCode, stockType); |
| | | |
| | | stockDzMapper.getDzCheckList(page ,state, stockCode, stockType, checkedList); |
| | | return Result.succeed(page); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public Result dzCheck(String id, Integer checkType, Double orderNum) { |
| | | public Result dzCheck(String id, Integer checkType, Double orderNum, double price) { |
| | | try { |
| | | ExchangeApplyOrderDz order = exchangeApplyOrderDzMapper.selectById(id); |
| | | if (order == null) { |
| | |
| | | } |
| | | |
| | | BigDecimal nowPrice = stockDz.getNowPrice(); |
| | | if (price > 0) { |
| | | nowPrice = BigDecimal.valueOf(price); |
| | | order.setPrice(price); |
| | | } |
| | | if (nowPrice.compareTo(new BigDecimal("0")) == 0) { |
| | | throw new YamiShopBindException("股票价格0,请重试"); |
| | | } |
| | |
| | | order.setVolume(buyAmt.doubleValue()); |
| | | order.setFee(orderFree.doubleValue()); |
| | | order.setState(ExchangeApplyOrderDz.STATE_POSITION); |
| | | order.setCreateTime(new Date()); |
| | | exchangeApplyOrderDzMapper.updateById(order); |
| | | walletService.update(wallet.getUserId(), Arith.sub(0, orderAmt.doubleValue())); |
| | | |
| | |
| | | |
| | | <select id="getDzCheckList" resultType="com.yami.trading.bean.dz.dto.ExchangeApplyOrderDzDto" parameterType="map"> |
| | | SELECT |
| | | t.*,u.user_name,u.user_code,s.stock_name |
| | | t.*,u.user_name,u.user_code,s.stock_name,r.user_name AS 'recomUserName' |
| | | FROM t_exchange_apply_order_dz t |
| | | LEFT JOIN tz_user u ON t.party_id = u.user_id |
| | | LEFT JOIN t_stock_dz s ON s.uuid = t.dz_id |
| | | LEFT JOIN tz_user r ON u.user_recom = r.user_id |
| | | WHERE 1=1 |
| | | <if test="state != null and state != ''"> |
| | | AND t.state = #{state} |
| | |
| | | <if test="stockType != null and stockType != '' "> |
| | | AND s.stock_type = #{stockType} |
| | | </if> |
| | | <if test="checkedList!=null"> |
| | | and u.user_id in |
| | | <foreach collection="checkedList" separator="," index="index" open="(" close=")" item="r"> |
| | | #{r} |
| | | </foreach> |
| | | |
| | | </if> |
| | | |
| | | ORDER BY t.create_time DESC |
| | | </select> |
| | | |