| | |
| | | @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, Constants.indices_dark, 0); |
| | | return stockDzService.addByAdmin(stockCode, null, stockNum, password, startTime, endTime, discount, period,nowPrice,switchType, Constants.indices_dark, 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("新增大宗") |
| | | @PostMapping({"addByAdmin.do"}) |
| | | public Result addByAdmin(@RequestParam(value = "stockCode") String stockCode, |
| | | @RequestParam(value = "stockName", required = false) String stockName, |
| | | @RequestParam(value = "stockNum", required = false) String stockNum, |
| | | @RequestParam(value = "password", required = false) String password, |
| | | @RequestParam(value = "startTime") String startTime, |
| | |
| | | @RequestParam(value = "nowPrice") String nowPrice, |
| | | @RequestParam(value = "switchType", defaultValue = "0") Integer switchType, |
| | | @RequestParam(value = "dayRate", defaultValue = "0") double dayRate) { |
| | | return stockDzService.addByAdmin(stockCode, stockNum, password, startTime, endTime, discount, period,nowPrice,switchType, Constants.indices, dayRate); |
| | | return stockDzService.addByAdmin(stockCode, stockName, stockNum, password, startTime, endTime, discount, period,nowPrice,switchType, Constants.indices, dayRate); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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, Constants.US_DARK, 0); |
| | | return stockDzService.addByAdmin(stockCode, null, stockNum, password, startTime, endTime, discount, period,nowPrice,switchType, Constants.US_DARK, 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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, Constants.US_STOCKS, 0); |
| | | return stockDzService.addByAdmin(stockCode, null, stockNum, password, startTime, endTime, discount, period,nowPrice,switchType, Constants.US_STOCKS, 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | Result getDzList(int pageNum, int pageSize, String orderBy, String keyWords, String stockType); |
| | | |
| | | Result addByAdmin(String stockCode, String stockNum, String password, String startTime, String endTime, String discount,Integer period,String nowPrice,Integer switchType, String stockType, double dayRate); |
| | | Result addByAdmin(String stockCode, String stockName, String stockNum, String password, String startTime, String endTime, String discount,Integer period,String nowPrice,Integer switchType, String stockType, double dayRate); |
| | | |
| | | Result getDzListByAdmin(int pageNum, int pageSize, String keywords, String stockType); |
| | | |
| | |
| | | if (!list.isEmpty() && list.get(0) != null) { |
| | | stockDzDto.setCurrentPrice(list.get(0).getClose()); |
| | | } |
| | | if (stockDzDto.getDayRate() != 0) { |
| | | double dayRate = BigDecimal.valueOf(stockDzDto.getDayRate()).multiply(BigDecimal.valueOf(100)).doubleValue(); |
| | | stockDzDto.setDayRate(dayRate); |
| | | } |
| | | }); |
| | | return Result.succeed(page); |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result addByAdmin(String stockCode, String stockNum, String password, String startTime, String endTime, String discount,Integer period,String nowPrice,Integer switchType, String stockType, double dayRate) { |
| | | public Result addByAdmin(String stockCode, String stockName, String stockNum, String password, String startTime, String endTime, String discount,Integer period,String nowPrice,Integer switchType, String stockType, double dayRate) { |
| | | if (stockCode == null || stockCode.isEmpty() || startTime == null || startTime.isEmpty() ||endTime == null || endTime.isEmpty() || nowPrice == null){ |
| | | return Result.failed("参数不能为空"); |
| | | } |
| | | if (stockType.equalsIgnoreCase(Item.indices) && dayRate == 0) { |
| | | return Result.failed("请输入日收益率"); |
| | | if (stockType.equalsIgnoreCase(Item.indices)) { |
| | | if (dayRate == 0) { |
| | | return Result.failed("请输入日收益率"); |
| | | } |
| | | if (stockName == null || stockName.isEmpty()){ |
| | | return Result.failed("请输入股票名称"); |
| | | } |
| | | } |
| | | |
| | | //该类型是否已添加 |
| | |
| | | |
| | | StockDz stockDz = new StockDz(); |
| | | if (stockType.equalsIgnoreCase(Item.indices)) { |
| | | stockDz.setStockName(stockCode); |
| | | stockDz.setStockName(stockName); |
| | | stockDz.setStockCode(stockCode); |
| | | stockDz.setStockSpell(stockCode); |
| | | } else { |
| | |
| | | model.setStockSpell(item.getSymbolData()); |
| | | } |
| | | } else { |
| | | model.setStockCode(model.getStockCode()); |
| | | model.setStockSpell(model.getStockCode()); |
| | | model.setStockName(model.getStockCode()); |
| | | } |
| | | model.setStockType(stockDz.getStockType()); |
| | | |