dev-discount
袁野 3 years ago
parent 0fcf02d6f5
commit 2c782eb935
  1. 14
      hai-bweb/src/main/java/com/bweb/controller/CommonController.java
  2. 42
      hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.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);
}
}
}

@ -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();

Loading…
Cancel
Save