Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
1766756cef
|
|
@ -79,7 +79,8 @@ public class AuthService {
|
|||
logger.info(String.format("getUserInfo→返回结果:%s",jsonObject));
|
||||
JSONObject obj = jsonObject.getJSONObject("data");
|
||||
if (obj!=null){
|
||||
return obj.getString("loginName");
|
||||
// return obj.getString("loginName");
|
||||
return obj.getString("phone");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,10 @@ import kd.bos.login.thirdauth.UserProperType;
|
|||
import kd.bos.servicehelper.user.UserServiceHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.http.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
|
||||
|
|
@ -38,6 +40,9 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
|||
public void callTrdSSOLogin(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, String s) {
|
||||
logger.info(String.format("callTrdSSOLogin→httpServletRequest:%s", httpServletRequest));
|
||||
|
||||
logger.info("CLIENT_ID:{}\nCLIENT_SECRET:{}\nEOSS_IP:{}\nCLIENT_ID2:{}\nCLIENT_SECRET2:{}\nEOSS_IP2:{}\nskIP:{}",
|
||||
CLIENT_ID, CLIENT_SECRET, EOSS_IP, CLIENT_ID2, CLIENT_SECRET2, EOSS_IP2, skIP);
|
||||
|
||||
String ip;
|
||||
String client;
|
||||
String secret;
|
||||
|
|
@ -46,8 +51,8 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
|||
if (queryUrlOld != null && queryUrlOld.contains("code") && queryUrlOld.contains("sessionId")) {
|
||||
String replace = queryUrlOld.replace("sessionId", "eossSessionId");
|
||||
try {
|
||||
httpServletResponse.sendRedirect(httpServletRequest.getRequestURI() + "?" + replace);
|
||||
logger.info(String.format("callTrdSSOLogin→sendRedirect:%s", httpServletRequest.getRequestURI() + "?" + replace));
|
||||
httpServletResponse.sendRedirect(httpServletRequest.getRequestURI() + "?" + replace);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
@ -74,7 +79,7 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
|||
try {
|
||||
//退出系统
|
||||
if (httpServletRequest.getRequestURI().contains("/auth/logout.do")) {
|
||||
String userName = UserServiceHelper.getCurrentUser("name").getString("name");
|
||||
String userName = UserServiceHelper.getCurrentUser("phone").getString("phone");
|
||||
DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
|
||||
String userKey = "user_sessionId_" + userName; // 构造存储sessionId的键
|
||||
String sessionId = cache.get(userKey);
|
||||
|
|
@ -82,7 +87,7 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
|||
if (sessionId != null) {
|
||||
AuthService.logout(ip, sessionId);
|
||||
}
|
||||
if (StringUtils.equals("true",isNew)){
|
||||
if (StringUtils.equals("true", isNew)) {
|
||||
ip = EOSS_IP2;
|
||||
}
|
||||
//退出系统跳转到eoss登录页
|
||||
|
|
@ -90,10 +95,10 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
|||
} else {
|
||||
//重定向到eoss统一认证的地址 获取授权码code
|
||||
ssoUrl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&sessionKeep=true&authType=0&redirect_uri=%s",
|
||||
ip, client, redirect);
|
||||
ip, client, URLEncoder.encode(redirect, "UTF-8"));
|
||||
}
|
||||
httpServletResponse.sendRedirect(ssoUrl);
|
||||
logger.info(String.format("callTrdSSOLogin→sendRedirect:%s", ssoUrl));
|
||||
httpServletResponse.sendRedirect(ssoUrl);
|
||||
} catch (IOException e) {
|
||||
logger.info(String.format("callTrdSSOLogin→sendRedirect异常:%s", e));
|
||||
throw new RuntimeException(e);
|
||||
|
|
@ -142,16 +147,16 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
|||
//如果直接携带了code与session,并且未通过加密成param,需要去除session参数,并将其key替换为eossSessionId即可
|
||||
if (StringUtils.isNotEmpty(code) && StringUtils.isNotEmpty(sessionId) && StringUtils.isEmpty(param)) {
|
||||
String replace = queryUrlOld.replace("sessionId", "eossSessionId");
|
||||
httpServletResponse.sendRedirect(requestURI + "?" + replace);
|
||||
logger.info(String.format("getTrdSSOAuth→sendRedirect:%s", replace));
|
||||
httpServletResponse.sendRedirect(requestURI + "?" + replace);
|
||||
}
|
||||
//携带了code,并且加密成param,解密param,并重定向进入司库
|
||||
else if (StringUtils.isNotEmpty(param)) {
|
||||
//解码
|
||||
byte[] decodedBytes = Base64.getDecoder().decode(param);
|
||||
String queryUrlNew = new String(decodedBytes, StandardCharsets.UTF_8);
|
||||
httpServletResponse.sendRedirect(requestURI + "?" + queryUrlNew + "&code=" + code + "&eossSessionId=" + sessionId);
|
||||
logger.info(String.format("getTrdSSOAuth→sendRedirect:%s", requestURI + "?" + queryUrlNew + "&code=" + code + "&eossSessionId=" + sessionId));
|
||||
httpServletResponse.sendRedirect(requestURI + "?" + queryUrlNew + "&code=" + code + "&eossSessionId=" + sessionId);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.info(String.format("getTrdSSOAuth→sendRedirect异常:%s", e));
|
||||
|
|
@ -166,12 +171,12 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
|
|||
String user = AuthService.getUserInfo(access_token, ip, client, secret);
|
||||
logger.info(String.format("getTrdSSOAuth→getUserInfo返回数据:%s", user));
|
||||
String userKey = "user_sessionId_" + user;
|
||||
if(httpServletRequest.getParameter("eossSessionId")!=null){
|
||||
if (httpServletRequest.getParameter("eossSessionId") != null) {
|
||||
//存储sessionId用于退出系统
|
||||
cache.put(userKey, httpServletRequest.getParameter("eossSessionId"));
|
||||
}
|
||||
//当前返回类型手机,用户名,email,工号
|
||||
result.setUserType(UserProperType.UserName);
|
||||
result.setUserType(UserProperType.Mobile);
|
||||
result.setUser(user);
|
||||
result.setSucess(true);
|
||||
logger.info("SSO用户登录成功,进入苍穹系统");
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ public class GuaranteeContractPatchPlugin extends AbstractReportListDataPluginEx
|
|||
" a.fbillno AS guaranteedOriBillno,\n" +
|
||||
" a.fisexceedstock AS shkd_fisexceedstock,\n" +
|
||||
" a.fk_shkd_sfwslqy AS shkd_sfwslqy,\n" +
|
||||
" b.fguaranteequotaid AS shkd_guaranteequotaid\n" +
|
||||
" b.fguaranteequotaid AS shkd_guaranteequotaid,\n" +
|
||||
" b.fgratio AS shkd_gratio\n" +
|
||||
"FROM \n" +
|
||||
" t_gm_guarcontract AS a\n" +
|
||||
" LEFT JOIN t_gm_guaranteed_entry AS b \n" +
|
||||
|
|
@ -137,13 +138,14 @@ public class GuaranteeContractPatchPlugin extends AbstractReportListDataPluginEx
|
|||
entry.set("shkd_gdebtbalance", debtBalance);
|
||||
}
|
||||
}
|
||||
//补充债券余额
|
||||
Object shkdGdebtamount = entry.get("shkd_gdebtamount");
|
||||
Object shkdGdebtbalance = entry.get("shkd_gdebtbalance");
|
||||
BigDecimal debtAmountTemp = shkdGdebtamount != null ? new BigDecimal(shkdGdebtamount.toString()) : BigDecimal.ZERO;
|
||||
BigDecimal debtBalanceTemp = shkdGdebtbalance != null ? new BigDecimal(shkdGdebtbalance.toString()) : BigDecimal.ZERO;
|
||||
BigDecimal difference = debtAmountTemp.subtract(debtBalanceTemp);
|
||||
entry.set("shkd_gdebalanceamount", difference);
|
||||
//补充债券余额 责任金额 - 担保责任金额 = 责任余额
|
||||
//FIXME:逻辑修改:改为 责任余额 = 担保责任金额 / 担保比例 ;并且逻辑时机挪到最终dataset组成完成之后
|
||||
// Object shkdGdebtamount = entry.get("shkd_gdebtamount");//责任金额
|
||||
// Object shkdGdebtbalance = entry.get("shkd_gdebtbalance");//担保责任金额
|
||||
// BigDecimal debtAmountTemp = shkdGdebtamount != null ? new BigDecimal(shkdGdebtamount.toString()) : BigDecimal.ZERO;
|
||||
// BigDecimal debtBalanceTemp = shkdGdebtbalance != null ? new BigDecimal(shkdGdebtbalance.toString()) : BigDecimal.ZERO;
|
||||
// BigDecimal difference = debtAmountTemp.subtract(debtBalanceTemp);
|
||||
// entry.set("shkd_gdebalanceamount", difference);
|
||||
|
||||
entry.set("shkd_gcomment", gcBIll.get("gcomment"));
|
||||
entry.set("shkd_gstatus", gcBIll.getBigDecimal("gratio").compareTo(BigDecimal.ZERO) == 0 ? "C" : (BigDecimal.ZERO.compareTo(debtBalance) != 0 ? "A" : "B"));
|
||||
|
|
@ -166,11 +168,18 @@ public class GuaranteeContractPatchPlugin extends AbstractReportListDataPluginEx
|
|||
|
||||
}
|
||||
|
||||
//3、根据参数进行过滤和排序
|
||||
//3、补充债券余额
|
||||
try {
|
||||
finish = finish.addField("(shkd_gdebtbalance*100)/shkd_gratio", "shkd_gdebalanceamount");
|
||||
} catch (Exception e) {
|
||||
finish = finish.addField("0", "shkd_gdebalanceamount");
|
||||
}
|
||||
|
||||
//4、根据参数进行过滤和排序
|
||||
reportQueryParam = event.getReportQueryParam();
|
||||
DataSet newFinish = refreshDataSet(reportQueryParam, finish, "gm_guaranteecontract");
|
||||
|
||||
//4、注入整合后的table数据
|
||||
//5、注入整合后的table数据
|
||||
event.setDataSet(newFinish);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue