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 2b0036f6..3f9c50c1 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(); diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java index 8f99b16a..3cb1fb81 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java @@ -51,6 +51,7 @@ import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; +import java.util.function.IntFunction; @Controller @RequestMapping(value = "/outRechargeOrder") @@ -134,6 +135,7 @@ public class OutRechargeOrderController { @RequestParam(name = "payStatus", required = false) Integer payStatus, @RequestParam(name = "rechargeStatus", required = false) String rechargeStatus, @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "companyId", required = false) Long companyId, @RequestParam(name = "operatorType", required = false) String operatorType, @RequestParam(name = "laborUnionCard", required = false) String laborUnionCard, @RequestParam(name = "rechargeContent", required = false) String rechargeContent, @@ -154,7 +156,16 @@ public class OutRechargeOrderController { Map map = new HashMap<>(); - map.put("companyId", userInfoModel.getBsCompany().getId()); + if (companyId != null) { + map.put("companyId", companyId); + } else if (userInfoModel.getSecRole().getRoleType() != 1){ + if (userInfoModel.getSecRole().getRoleType() == 7) { + map.put("companyId", 23); + } else { + map.put("companyId", userInfoModel.getBsCompany().getId()); + } + } + map.put("rechargeStatus", rechargeStatus); map.put("payStatus", payStatus); map.put("orderNo", orderNo); @@ -189,6 +200,7 @@ public class OutRechargeOrderController { public ResponseData exportOrderList( @RequestParam(name = "payStatus", required = false) Integer payStatus, @RequestParam(name = "rechargeStatus", required = false) String rechargeStatus, + @RequestParam(name = "companyId", required = false) Long companyId, @RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "operatorType", required = false) String operatorType, @RequestParam(name = "laborUnionCard", required = false) String laborUnionCard, @@ -209,7 +221,11 @@ public class OutRechargeOrderController { Map map = new HashMap<>(); - map.put("companyId", userInfoModel.getBsCompany().getId()); + if (companyId != null) { + map.put("companyId", companyId); + } else if (userInfoModel.getSecRole().getRoleType() != 1){ + map.put("companyId", userInfoModel.getBsCompany().getId()); + } map.put("rechargeStatus", rechargeStatus); map.put("payStatus", payStatus); map.put("orderNo", orderNo); diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java index cbd3f4de..a2e5329b 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java @@ -134,7 +134,7 @@ public interface OutRechargeOrderMapperExt { @Select(value = { "" }) @Results({ diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 01d060e7..3daf7fd6 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -35,8 +35,8 @@ unionPayChannelid=D01X00000801226 unionPayMerid=83169055983W000 unionPayTermid=XS000103 unionPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0 -unionPayNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notify -unionPayTelNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notifyTel +unionPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notify +unionPayTelNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notifyTel unionStagingPayUrl=https://mtest.eycard.cn/ unionStagingPayOrgId=ORG000000000001