8 files modified
1 files added
| | |
| | | if(null==img_idimg_2) return Result.failed("img_idimg_2 is null"); |
| | | |
| | | String img_idimg_3=request.getString("img_idimg_3"); |
| | | if(null==img_idimg_3) return Result.failed("img_idimg_3 is null"); |
| | | //if(null==img_idimg_3) return Result.failed("img_idimg_3 is null"); |
| | | System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"); |
| | | SimpleLoanOrder simpleLoanOrder=new SimpleLoanOrder(new BigDecimal(quota),symbol,id); |
| | | simpleLoanOrder.setRepayCycle(new Integer(repayCycle)); |
| | |
| | | String password = model.getPassword(); |
| | | String authCode = identifyingCodeTimeWindowService.getAuthCode(username); |
| | | if (!model.getVerifcode().equalsIgnoreCase(authCode)) { |
| | | throw new YamiShopBindException("无效验证码"); |
| | | throw new YamiShopBindException("验证码错误"); |
| | | } |
| | | |
| | | User user = userService.register(username, |
| | |
| | | @ResponseBody |
| | | public Result buyDz(@RequestParam("dzId") String dzId, |
| | | @RequestParam(value = "password", required = false) String password, |
| | | @RequestParam("num") double num) { |
| | | @RequestParam(name = "num", defaultValue = "1") double num) { |
| | | lock.lock(); |
| | | try { |
| | | if (orderCreated.get()) { |
| | |
| | | @ResponseBody |
| | | public Result buyDz(@RequestParam("dzId") String dzId, |
| | | @RequestParam(value = "password", required = false) String password, |
| | | @RequestParam("num") double num) { |
| | | @RequestParam(name = "num", defaultValue = "1") double num) { |
| | | lock.lock(); |
| | | try { |
| | | if (orderCreated.get()) { |
| New file |
| | |
| | | package com.yami.trading.bean.dz.dto; |
| | | |
| | | import com.yami.trading.bean.dz.StockDz; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StockDzDto extends StockDz { |
| | | |
| | | //现价 |
| | | private double currentPrice; |
| | | |
| | | } |
| | |
| | | public static Map<String, String> LANGUAGE = new HashMap<String, String>(); |
| | | |
| | | static { |
| | | LANGUAGE.put("en", "英文"); |
| | | LANGUAGE.put("zh-CN", "简体中文"); |
| | | LANGUAGE.put("CN", "繁体中文"); |
| | | LANGUAGE.put("Japanese", "日文"); |
| | | LANGUAGE.put("Korean", "韩文"); |
| | | LANGUAGE.put("ru", "俄文"); |
| | | LANGUAGE.put("pt", "葡萄牙语"); |
| | | LANGUAGE.put("es", "西班牙语"); |
| | | LANGUAGE.put("th", "泰语"); |
| | | LANGUAGE.put("fr", "法语"); |
| | | LANGUAGE.put("vi", "越南语"); |
| | | LANGUAGE.put("ar", "阿拉伯语"); |
| | | LANGUAGE.put("my", "缅甸语"); |
| | | LANGUAGE.put("de", "德语"); |
| | | LANGUAGE.put("en","英语"); |
| | | LANGUAGE.put("es","西班牙语"); |
| | | LANGUAGE.put("fr","法语"); |
| | | LANGUAGE.put("Italy","意大利语"); |
| | | LANGUAGE.put("Turkish","土耳其语"); |
| | | LANGUAGE.put("Romanian","罗马尼亚语"); |
| | | LANGUAGE.put("Greek","希腊语"); |
| | | LANGUAGE.put("Japanese","日语"); |
| | | LANGUAGE.put("Korean","韩语"); |
| | | LANGUAGE.put("pt","葡萄牙语"); |
| | | LANGUAGE.put("vi","越南语"); |
| | | LANGUAGE.put("CN","繁体中文"); |
| | | LANGUAGE.put("zh-CN","简体中文"); |
| | | LANGUAGE.put("gr","希腊语"); |
| | | LANGUAGE.put("th","泰语"); |
| | | LANGUAGE.put("ga","爱尔兰语"); |
| | | LANGUAGE.put("nl","荷兰语"); |
| | | LANGUAGE.put("sv","瑞典语"); |
| | | LANGUAGE.put("da","丹麦语"); |
| | | LANGUAGE.put("no","挪威语"); |
| | | LANGUAGE.put("fi","芬兰语"); |
| | | LANGUAGE.put("ro","罗马尼亚语"); |
| | | LANGUAGE.put("lb","卢森堡语"); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.trading.bean.dz.StockDz; |
| | | import com.yami.trading.bean.dz.dto.ExchangeApplyOrderDzDto; |
| | | import com.yami.trading.bean.dz.dto.StockDzDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | |
| | | public interface StockDzMapper extends BaseMapper<StockDz> { |
| | | |
| | | Page findStockTypeDz(Page page, |
| | | Page<StockDzDto> findStockTypeDz(Page page, |
| | | @Param("orderBy") String orderBy, |
| | | @Param("keyWords") String keyWords , |
| | | @Param("formatDate") String formatDate, |
| | |
| | | import com.yami.trading.bean.dz.ExchangeApplyOrderDz; |
| | | import com.yami.trading.bean.dz.StockDz; |
| | | import com.yami.trading.bean.dz.dto.ExchangeApplyOrderDzDto; |
| | | import com.yami.trading.bean.dz.dto.StockDzDto; |
| | | import com.yami.trading.bean.exchange.ExchangeApplyOrder; |
| | | import com.yami.trading.bean.item.domain.Item; |
| | | import com.yami.trading.bean.model.MoneyLog; |
| | |
| | | public Result getDzList(int pageNum, int pageSize, String orderBy, String keyWords, String stockType) { |
| | | try { |
| | | String formatDate = DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN); |
| | | Page page = new Page(pageNum, pageSize); |
| | | stockDzMapper.findStockTypeDz(page,orderBy,keyWords,formatDate, stockType); |
| | | Page<StockDzDto> page = new Page<>(pageNum, pageSize); |
| | | page = stockDzMapper.findStockTypeDz(page,orderBy,keyWords,formatDate, stockType); |
| | | page.getRecords().forEach(stockDzDto -> { |
| | | Realtime realtime = this.dataService.realtime(stockDzDto.getStockCode()).get(0); |
| | | if (realtime != null) { |
| | | stockDzDto.setCurrentPrice(realtime.getClose()); |
| | | } |
| | | }); |
| | | return Result.succeed(page); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | |
| | | throw new YamiShopBindException("股票价格0,请重试"); |
| | | } |
| | | if (stockDz.getStockNum() > num) { |
| | | throw new YamiShopBindException("最小购买数量" + stockDz.getStockNum()); |
| | | throw new YamiShopBindException("请购买最小数量"); |
| | | } |
| | | |
| | | Wallet wallet = this.walletService.saveWalletByPartyId(partyId); |
| | |
| | | Date resultTime = calendar.getTime(); |
| | | |
| | | if(now.getTime() < resultTime.getTime()){ |
| | | throw new YamiShopBindException("锁仓中"); |
| | | throw new YamiShopBindException("未到平仓时间"); |
| | | } |
| | | } |
| | | |
| | |
| | | <mapper namespace="com.yami.trading.dao.dz.StockDzMapper"> |
| | | |
| | | |
| | | <select id="findStockTypeDz" resultType="com.yami.trading.bean.dz.StockDz" parameterType="map"> |
| | | <select id="findStockTypeDz" resultType="com.yami.trading.bean.dz.dto.StockDzDto" parameterType="map"> |
| | | SELECT |
| | | * |
| | | FROM t_stock_dz |