| | |
| | | |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | UserAssetsMapper userAssetsMapper; |
| | | |
| | | /** |
| | | * 用户新股申购 |
| | | * @param model |
| | |
| | | if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){ |
| | | return ServerResponse.createByErrorMsg("请先缴清待补资金", request); |
| | | } |
| | | if(new Date().before(stockSubscribe.getSubscribeTime()) && new Date().after(stockSubscribe.getSubscribeTime()) ){ |
| | | return ServerResponse.createByErrorMsg("不在认缴或配售时间之内",request); |
| | | Date currentDate = new Date(); |
| | | if(currentDate.before(stockSubscribe.getSubscriptionTime())){ |
| | | return ServerResponse.createByErrorMsg("未开售",request); |
| | | } |
| | | |
| | | if(currentDate.after(stockSubscribe.getSubscribeTime())){ |
| | | return ServerResponse.createByErrorMsg("已结束",request); |
| | | } |
| | | // //重复申购限制 |
| | | // UserStockSubscribe userStockSubscribe = userStockSubscribeMapper.selectOne(new QueryWrapper<UserStockSubscribe>().eq( |
| | | // "new_code", model.getNewCode()).eq("user_id", user.getId()).eq("type",model.getType())); |
| | |
| | | model.setUserId(user.getId()); |
| | | model.setAgentId(user.getAgentId()); |
| | | model.setAgentName(user.getAgentName()); |
| | | StockSubscribe stockSubscribe = stockSubscribeMapper.selectOne(new QueryWrapper<>(new StockSubscribe()) |
| | | .eq("newlist_id", model.getNewStockId())); |
| | | StockSubscribe stockSubscribe = stockSubscribeMapper.selectOne(new LambdaQueryWrapper<>(StockSubscribe.class).eq(StockSubscribe::getCode,model.getNewCode())); |
| | | if (stockSubscribe == null) { |
| | | return ServerResponse.createByErrorMsg("Failed. Ipo information does not exist"); |
| | | } |