| | |
| | | |
| | | |
| | | public static <T> ServerResponse<T> createBySuccessMsg(String msg,HttpServletRequest request) { |
| | | return new ServerResponse(ResponseCode.SUCCESS.getCode(), new GoogleTranslateUtil().translate(msg,request.getHeader(LANG))); |
| | | return new ServerResponse(ResponseCode.SUCCESS.getCode(),msg); |
| | | } |
| | | |
| | | public static <T> ServerResponse<T> createBySuccess(T data) { |
| | |
| | | |
| | | |
| | | public static <T> ServerResponse<T> createBySuccess(String data,HttpServletRequest request) { |
| | | return new ServerResponse(ResponseCode.SUCCESS.getCode(), new GoogleTranslateUtil().translate(data,request.getHeader(LANG))); |
| | | return new ServerResponse(ResponseCode.SUCCESS.getCode(), data); |
| | | } |
| | | |
| | | public static <T> ServerResponse<T> createBySuccess(String msg, T data) { |
| | |
| | | return new ServerResponse(ResponseCode.ERROR.getCode(), errormsg); |
| | | } |
| | | public static <T> ServerResponse<T> createByErrorMsg(String errormsg, HttpServletRequest request) { |
| | | return new ServerResponse(ResponseCode.ERROR.getCode(), new GoogleTranslateUtil().translate(errormsg,request.getHeader(LANG))); |
| | | return new ServerResponse(ResponseCode.ERROR.getCode(), errormsg); |
| | | } |
| | | |
| | | |
| | |
| | | //查询企业公告信息 |
| | | @RequestMapping({"list.do"}) |
| | | @ResponseBody |
| | | public ServerResponse list(@RequestParam(value = "artTitle", required = false) String artTitle, @RequestParam(value = "artType", required = false) String artType, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "12") int pageSize,HttpServletRequest request) { |
| | | public ServerResponse list(@RequestParam(value = "artTitle", required = false) String artTitle, |
| | | @RequestParam(value = "artType", required = false) String artType, |
| | | @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, |
| | | @RequestParam(value = "pageSize", defaultValue = "12") int pageSize, |
| | | HttpServletRequest request) { |
| | | return this.iSiteArticleService.list(artTitle, artType, pageNum, pageSize,request); |
| | | } |
| | | |
| | |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.RechargeAddressMapper; |
| | | import com.nq.pojo.RechargeAddress; |
| | | import com.nq.service.IUserRechargeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @Autowired |
| | | private RechargeAddressMapper mapper; |
| | | |
| | | @Autowired |
| | | IUserRechargeService iUserRechargeService; |
| | | |
| | | @RequestMapping(value = {"select.do"}) |
| | | @ResponseBody |
| | | public ServerResponse select(@RequestParam("currency") String currency) { |
| | | return ServerResponse.createBySuccess(mapper.selectList(new LambdaQueryWrapper<RechargeAddress>().eq(RechargeAddress::getCurrency,currency))); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = {"createUSDTOrder.do"}) |
| | | @ResponseBody |
| | | public ServerResponse createUSDTOrder(@RequestParam("userId") Integer userId, |
| | | @RequestParam("amt") Integer amt, |
| | | @RequestParam("img") String img, |
| | | HttpServletRequest request) { |
| | | return ServerResponse.createBySuccess(iUserRechargeService.createUSDTOrder(userId,amt,img,request)); |
| | | } |
| | | } |
| | |
| | | private String img; |
| | | private String channelName; |
| | | private String assetsType; |
| | | private Integer rechargeType; |
| | | |
| | | |
| | | |
| | |
| | | BigDecimal CountTotalRechargeAmountByTime(Integer paramInteger); |
| | | |
| | | List<UserRecharge> exportByAdmin( Integer agentId, Integer userId, String realName, Integer state, String beginTime, String endTime, HttpServletRequest request); |
| | | |
| | | public ServerResponse createUSDTOrder(Integer userId,Integer amt,String currency,HttpServletRequest request); |
| | | } |
| | |
| | | GoogleTranslateUtil googleTranslateUtil = new GoogleTranslateUtil(); |
| | | try { |
| | | siteArticle.setArtTitle(googleTranslateUtil.translate(siteArticle.getArtTitle(), request.getHeader("lang"))); |
| | | siteArticle.setArtCnt(googleTranslateUtil.translate(siteArticle.getArtCnt(), request.getHeader("lang"))); |
| | | } catch (Exception e) { |
| | | log.error("翻译失败"); |
| | | } |
| | |
| | | if (user == null) { |
| | | return ServerResponse.createByErrorMsg("用户不存在"); |
| | | } |
| | | SitePay payChnnel = sitePayMapper.selectById(userRecharge.getPayId()); |
| | | userAssetsServices.availablebalanceChange(payChnnel.getAssetsType(),user.getId(), EUserAssets.TOP_UP,userRecharge.getPayAmt(),"",""); |
| | | // SitePay payChnnel = sitePayMapper.selectById(userRecharge.getPayId()); |
| | | userAssetsServices.availablebalanceChange(EStockType.JP.getCode(),user.getId(), EUserAssets.TOP_UP,userRecharge.getPayAmt(),"",""); |
| | | } |
| | | userRecharge.setOrderStatus(Integer.valueOf((state.intValue() == 1) ? 1 : 2)); |
| | | userRecharge.setPayTime(new Date()); |
| | |
| | | return ServerResponse.createByErrorMsg("生成订单失败,请重试"); |
| | | } |
| | | |
| | | @Override |
| | | public ServerResponse createUSDTOrder(Integer userId, Integer amt,String currency, HttpServletRequest request) { |
| | | if (userId == null || amt == null) { |
| | | return ServerResponse.createByErrorMsg("参数不能为空"); |
| | | } |
| | | |
| | | User user = this.userMapper.selectById(userId); |
| | | if (user == null) { |
| | | return ServerResponse.createByErrorMsg("找不到用户"); |
| | | } |
| | | |
| | | UserRecharge userRecharge = new UserRecharge(); |
| | | userRecharge.setUserId(user.getId()); |
| | | userRecharge.setNickName(user.getRealName()); |
| | | userRecharge.setAgentId(user.getAgentId()); |
| | | |
| | | String ordersn = KeyUtils.getRechargeOrderSn(); |
| | | userRecharge.setOrderSn(ordersn); |
| | | |
| | | userRecharge.setPayChannel("1"); |
| | | userRecharge.setPayAmt(new BigDecimal(amt.intValue())); |
| | | userRecharge.setAddTime(new Date()); |
| | | userRecharge.setPayTime(new Date()); |
| | | userRecharge.setOrderStatus(Integer.valueOf(0)); |
| | | userRecharge.setPayId(1); |
| | | userRecharge.setRechargeType(1); |
| | | userRecharge.setImg(currency); |
| | | int insertCount = this.userRechargeMapper.insert(userRecharge); |
| | | if (insertCount > 0) { |
| | | return ServerResponse.createBySuccessMsg("提交成功",request); |
| | | } |
| | | return ServerResponse.createByErrorMsg("提交失败,请重试",request); |
| | | } |
| | | |
| | | |
| | | public ServerResponse del(Integer cId) { |
| | | if (cId == null) { |
| | |
| | | |
| | | @Override |
| | | public void onMessage(String s) { |
| | | StockRealTimeBean stockDetailBean = new Gson().fromJson(s, StockRealTimeBean.class); |
| | | RedisKeyUtil.setCacheRealTimeStock(eStockType,stockDetailBean); |
| | | send(s); |
| | | } |
| | | |
| | |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://127.0.0.1:3306/rb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://127.0.0.1:3306/stock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | # url: jdbc:mysql://127.0.0.1:3306/cgstock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |