| | |
| | | model.setAddTime(new Date()); |
| | | model.setOrderNo(KeyUtils.getUniqueKey()); |
| | | model.setType(model.getType()); |
| | | model.setDiscountPrice(stockSubscribe.getPrice().multiply(stockSubscribe.getDiscount()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | |
| | | ret = userStockSubscribeMapper.insert(model); |
| | |
| | | // if (userStockSubscribe.getApplyNums() < model.getApplyNumber()) { |
| | | // return ServerResponse.createByErrorMsg("中签数量超过申购数量"); |
| | | // } |
| | | model.setBond(userStockSubscribe.getBuyPrice().multiply(BigDecimal.valueOf(model.getApplyNumber()))); |
| | | if(null != userStockSubscribe.getDiscountPrice() && userStockSubscribe.getDiscountPrice().compareTo(BigDecimal.ZERO) > 0) { |
| | | model.setBond(userStockSubscribe.getDiscountPrice().multiply(BigDecimal.valueOf(model.getApplyNumber()))); |
| | | }else { |
| | | model.setBond(userStockSubscribe.getBuyPrice().multiply(BigDecimal.valueOf(model.getApplyNumber()))); |
| | | } |
| | | |
| | | ret = userStockSubscribeMapper.update1(model); |
| | | } else if (model.getStatus() == 2) { |
| | | ret = userStockSubscribeMapper.update1(model); |