|
|
@@ -1,6 +1,7 @@
|
|
|
package org.jeecg.modules.hlgcompany.controller;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -11,13 +12,19 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.PermissionData;
|
|
|
+import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.common.util.StringUtils;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
+import org.jeecg.common.utils.CryptTool;
|
|
|
+import org.jeecg.common.utils.HttpsContants;
|
|
|
+import org.jeecg.common.utils.OauthApi;
|
|
|
+import org.jeecg.common.utils.OauthTokenUtils;
|
|
|
import org.jeecg.modules.hlgaccount.service.IHlgAccountDetailService;
|
|
|
import org.jeecg.modules.hlgcompany.entity.HlgCompany;
|
|
|
import org.jeecg.modules.hlgcompany.entity.HlgCompanySubcontractor;
|
|
|
@@ -131,6 +138,45 @@ public class HlgCompanyController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 回显企业支付类型
|
|
|
+ *
|
|
|
+ * @param companyId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/getPaymentType")
|
|
|
+ public Result<Object> getPaymentType(@RequestParam(name="companyId",required=true) String companyId) {
|
|
|
+ Result<Object> result = new Result<Object>();
|
|
|
+ HlgCompany hlgCompany = hlgCompanyService.getById(companyId);
|
|
|
+ //同步慧盈
|
|
|
+ String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
+ String requestUrl = OauthApi.getPaymentType;
|
|
|
+ Map<String, Object> parameters = new HashMap<>();
|
|
|
+ parameters.put("companyCode", hlgCompany.getCompanyCode());
|
|
|
+ log.info("param============{}", JSONObject.toJSONString(parameters));
|
|
|
+ //数据加密
|
|
|
+ String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
|
|
|
+ JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
|
|
|
+ log.info("企业-获取企业支付类型===={}", jsonObject);
|
|
|
+ if (jsonObject != null) {
|
|
|
+ if (jsonObject.getBoolean("success")) {
|
|
|
+ log.info("企业-获取企业支付类型成功===={}", jsonObject);
|
|
|
+ JSONObject jsonObject1 = jsonObject.getJSONObject("result");
|
|
|
+ String paymentType = jsonObject1.getString("paymentType");
|
|
|
+ return Result.ok(paymentType);
|
|
|
+ } else {
|
|
|
+ //抛出异常
|
|
|
+ throw new JeecgBootException("获取企业支付类型失败");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("获取企业支付类型失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 编辑平台支付
|
|
|
* @param hlgCompany
|