From 2c782eb935ac0b853b706a8d5e6184858ab0de4a Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Sat, 2 Apr 2022 10:01:19 +0800 Subject: [PATCH] 1 --- .../com/bweb/controller/CommonController.java | 14 +++++++ .../controller/HighOpenApiController.java | 42 +++++++++---------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/CommonController.java b/hai-bweb/src/main/java/com/bweb/controller/CommonController.java index d254c492..d3a77ac7 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/CommonController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/CommonController.java @@ -3,6 +3,7 @@ package com.bweb.controller; import com.alibaba.fastjson.JSONObject; import com.hai.common.utils.DateUtil; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.TuanYouConfig; import com.hai.entity.SecConfig; import com.hai.model.*; import com.hai.service.CommonService; @@ -279,5 +280,18 @@ public class CommonController { return data; } + @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询团油余额") + public ResponseData queryCompanyAccountInfo2JD() { + try { + + return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD().getJSONArray("result")); + } catch (Exception e) { + log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java index 36165384..6f884edc 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java @@ -95,18 +95,18 @@ public class HighOpenApiController { public ResponseData getGuizhouSinopecList(HttpServletRequest request) { try { - String ip = ""; - // 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for - if (request.getHeader("x-forwarded-for") == null) { - ip = request.getRemoteAddr(); - } else { - ip = request.getHeader("x-forwarded-for"); - } - - if (!secConfigService.isConfig("IP_WHITE" , ip)) { - log.error("getGuizhouSinopec error!", "非法ip地址,请联系管理人员!"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!"); - } +// String ip = ""; +// // 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for +// if (request.getHeader("x-forwarded-for") == null) { +// ip = request.getRemoteAddr(); +// } else { +// ip = request.getHeader("x-forwarded-for"); +// } +// +// if (!secConfigService.isConfig("IP_WHITE" , ip)) { +// log.error("getGuizhouSinopec error!", "非法ip地址,请联系管理人员!"); +// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!"); +// } // 获取token String token = huiLianTongConfig.getToken(); @@ -140,10 +140,10 @@ public class HighOpenApiController { ip = request.getHeader("x-forwarded-for"); } - if (!secConfigService.isConfig("IP_WHITE" , ip)) { - log.error("getGuizhouSinopec error!", "非法ip地址,请联系管理人员!"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!"); - } +// if (!secConfigService.isConfig("IP_WHITE" , ip)) { +// log.error("getGuizhouSinopec error!", "非法ip地址,请联系管理人员!"); +// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!"); +// } // 获取token String token = huiLianTongConfig.getToken(); @@ -175,11 +175,11 @@ public class HighOpenApiController { } else { ip = request.getHeader("x-forwarded-for"); } - - if (!secConfigService.isConfig("IP_WHITE" , ip)) { - log.error("couJointDist error!", "非法ip地址,请联系管理人员!"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!"); - } +// +// if (!secConfigService.isConfig("IP_WHITE" , ip)) { +// log.error("couJointDist error!", "非法ip地址,请联系管理人员!"); +// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "非法ip地址,请联系管理人员!"); +// } // 获取token String token = huiLianTongConfig.getToken();