Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
		
						commit
						5b0bc594d5
					
				| 
						 | 
				
			
			@ -16,7 +16,10 @@ import shkd.sys.sys.utils.AesUtils;
 | 
			
		|||
 | 
			
		||||
import javax.servlet.http.*;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.io.UnsupportedEncodingException;
 | 
			
		||||
import java.nio.charset.StandardCharsets;
 | 
			
		||||
import java.security.PrivateKey;
 | 
			
		||||
import java.util.Base64;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +45,10 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
 | 
			
		|||
        String ip;
 | 
			
		||||
        String client;
 | 
			
		||||
        String secret;
 | 
			
		||||
        if (httpServletRequest.getRequestURI().contains("isNew")) {
 | 
			
		||||
 | 
			
		||||
        String queryUrl = httpServletRequest.getQueryString();
 | 
			
		||||
 | 
			
		||||
        if (queryUrl.contains("isNew")) {
 | 
			
		||||
            ip = EOSS_IP2;
 | 
			
		||||
            client = CLIENT_ID2;
 | 
			
		||||
            secret = CLIENT_SECRET2;
 | 
			
		||||
| 
						 | 
				
			
			@ -51,29 +57,39 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
 | 
			
		|||
            client = CLIENT_ID;
 | 
			
		||||
            secret = CLIENT_SECRET;
 | 
			
		||||
        }
 | 
			
		||||
        //认证中心的登录地址
 | 
			
		||||
        logger.info(String.format("eoss_ip:%s,client_id:%s,client_secret:%s,重定向地址:%s", ip, client, secret, s));
 | 
			
		||||
        try {
 | 
			
		||||
        if(queryUrl.contains("code")){
 | 
			
		||||
//            httpServletResponse.sendRedirect(ssourl);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        }else{
 | 
			
		||||
            queryUrl = Base64.getEncoder().encodeToString(queryUrl.getBytes(StandardCharsets.UTF_8));
 | 
			
		||||
//            String skIp = httpServletRequest.getRemoteAddr();
 | 
			
		||||
            String skUrl = httpServletRequest.getRequestURL().toString();
 | 
			
		||||
            skUrl = skUrl.substring(0, skUrl.indexOf("ierp"));
 | 
			
		||||
            String redirect = skUrl+"ierp/index.html?param="+queryUrl;
 | 
			
		||||
            //认证中心的登录地址
 | 
			
		||||
            logger.info(String.format("eoss_ip:%s,client_id:%s,client_secret:%s,重定向地址:%s", ip, client, secret, s));
 | 
			
		||||
            String ssourl = ip + "/service/SGE-project-sctz-master/pc/dist/login.html";
 | 
			
		||||
            if (httpServletRequest.getRequestURI().contains("/auth/logout.do")) {
 | 
			
		||||
                String userName = UserServiceHelper.getCurrentUser("name").getString("name");
 | 
			
		||||
                DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
 | 
			
		||||
                String userKey = "user_sessionId_" + userName; // 构造一个唯一的键
 | 
			
		||||
                String sessionId = cache.get(userKey);
 | 
			
		||||
                if (sessionId != null) {
 | 
			
		||||
                    AuthService.logout(ip, sessionId);
 | 
			
		||||
 | 
			
		||||
            try {
 | 
			
		||||
                if (httpServletRequest.getRequestURI().contains("/auth/logout.do")) {
 | 
			
		||||
                    String userName = UserServiceHelper.getCurrentUser("name").getString("name");
 | 
			
		||||
                    DistributeSessionlessCache cache = CacheFactory.getCommonCacheFactory().getDistributeSessionlessCache("customRegion");
 | 
			
		||||
                    String userKey = "user_sessionId_" + userName; // 构造一个唯一的键
 | 
			
		||||
                    String sessionId = cache.get(userKey);
 | 
			
		||||
                    if (sessionId != null) {
 | 
			
		||||
                        AuthService.logout(ip, sessionId);
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    //重定向的统一认证的地址 获取授权码
 | 
			
		||||
                    ssourl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&sessionKeep=false&authType=0&redirect_uri=%s",
 | 
			
		||||
                            ip, client, redirect);
 | 
			
		||||
                    logger.info(String.format("重定向地址→sendRedirect:%s", ssourl));
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                /*
 | 
			
		||||
                 *重定向的统一认证的地址 获取授权码
 | 
			
		||||
                 */
 | 
			
		||||
                ssourl = String.format("%s/sso2/authCenter/authorize?client_id=%s&response_type=code&authType=0&redirect_uri=%s",
 | 
			
		||||
                        ip, client, s);
 | 
			
		||||
                logger.info(String.format("重定向地址→sendRedirect:%s", ssourl));
 | 
			
		||||
                httpServletResponse.sendRedirect(ssourl);
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                throw new RuntimeException(e);
 | 
			
		||||
            }
 | 
			
		||||
            httpServletResponse.sendRedirect(ssourl);
 | 
			
		||||
        } catch (IOException e) {
 | 
			
		||||
            throw new RuntimeException(e);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -86,7 +102,7 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
 | 
			
		|||
        String ip;
 | 
			
		||||
        String client;
 | 
			
		||||
        String secret;
 | 
			
		||||
        if (httpServletRequest.getRequestURI().contains("isNew")) {
 | 
			
		||||
        if (httpServletRequest.getQueryString().contains("isNew")) {
 | 
			
		||||
            ip = EOSS_IP2;
 | 
			
		||||
            client = CLIENT_ID2;
 | 
			
		||||
            secret = CLIENT_SECRET2;
 | 
			
		||||
| 
						 | 
				
			
			@ -95,22 +111,37 @@ public class SSOPluginLogin implements ThirdSSOAuthHandler {
 | 
			
		|||
            client = CLIENT_ID;
 | 
			
		||||
            secret = CLIENT_SECRET;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //返回的认证结果
 | 
			
		||||
        UserAuthResult result = new UserAuthResult();
 | 
			
		||||
        //获取返回的授权码
 | 
			
		||||
        String code = httpServletRequest.getParameter("code");
 | 
			
		||||
        //获取返回的 sessionId
 | 
			
		||||
        String sessionId = httpServletRequest.getParameter("sessionId");
 | 
			
		||||
        String userName = httpServletRequest.getParameter("userName");
 | 
			
		||||
        if (userName != null) {
 | 
			
		||||
            userName = userName.replace(" ", "+"); // 将空格替换为 + 号
 | 
			
		||||
        String param = httpServletRequest.getParameter("param");
 | 
			
		||||
        if(param!=null){
 | 
			
		||||
            byte[] decodedBytes = Base64.getDecoder().decode(param);
 | 
			
		||||
            String paramString = new String(decodedBytes, StandardCharsets.UTF_8);
 | 
			
		||||
            try {
 | 
			
		||||
                httpServletResponse.sendRedirect(httpServletRequest.getRequestURI()+"?"+paramString+"&code="+code);
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                throw new RuntimeException(e);
 | 
			
		||||
            }
 | 
			
		||||
            result.setSucess(false);
 | 
			
		||||
            return result;
 | 
			
		||||
        }
 | 
			
		||||
        logger.info("获取待办链接中参数userName:" + userName);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//        //获取返回的 sessionId
 | 
			
		||||
//        String sessionId = httpServletRequest.getParameter("sessionId");
 | 
			
		||||
//        String userName = httpServletRequest.getParameter("userName");
 | 
			
		||||
//        if (userName != null) {
 | 
			
		||||
//            userName = userName.replace(" ", "+"); // 将空格替换为 + 号
 | 
			
		||||
//        }
 | 
			
		||||
//        logger.info("获取待办链接中参数userName:" + userName);
 | 
			
		||||
 | 
			
		||||
//        RSAUtils.
 | 
			
		||||
        logger.info(String.format("getTrdSSOAuth→授权码code:%s", code));
 | 
			
		||||
        result.setUserType(UserProperType.UserName);
 | 
			
		||||
        if (StringUtils.isEmpty(code) && StringUtils.isEmpty(userName)) {
 | 
			
		||||
        if (StringUtils.isEmpty(code)) {
 | 
			
		||||
            logger.error("getTrdSSOAuth→授权码code为空");
 | 
			
		||||
            result.setSucess(false);
 | 
			
		||||
            return result;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,9 +50,20 @@ public class BondSeletRatingPlugin extends AbstractBasePlugIn {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    private void showRatingSelectForm(String actionId) {
 | 
			
		||||
        DynamicObject ratingAgency = (DynamicObject)this.getModel().getValue("ratingagency");
 | 
			
		||||
        DynamicObject ratingAgency;
 | 
			
		||||
        //shkd_ratingscale:主体评级 shkd_debtratingscale:债券评级
 | 
			
		||||
        if("shkd_ratingscale".equals(actionId)){
 | 
			
		||||
            ratingAgency = (DynamicObject)this.getModel().getValue("ratingagency");
 | 
			
		||||
        }else{
 | 
			
		||||
            ratingAgency = (DynamicObject)this.getModel().getValue("shkd_bondratingagency");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (EmptyUtil.isEmpty(ratingAgency)) {
 | 
			
		||||
            this.getView().showTipNotification(ResManager.loadKDString("请先选择评级机构。", "BondCreditRatingEdit_0", "tmc-cfm-formplugin", new Object[0]));
 | 
			
		||||
            if("shkd_ratingscale".equals(actionId)){
 | 
			
		||||
                this.getView().showTipNotification(ResManager.loadKDString("请先选择主体评级机构。", "BondCreditRatingEdit_0", "tmc-cfm-formplugin", new Object[0]));
 | 
			
		||||
            }else{
 | 
			
		||||
                this.getView().showTipNotification(ResManager.loadKDString("请先选择债项评级机构。", "BondCreditRatingEdit_0", "tmc-cfm-formplugin", new Object[0]));
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            ListShowParameter showParameter = ShowFormHelper.createShowListForm("tbd_ratingscale", Boolean.FALSE);
 | 
			
		||||
            showParameter.setCustomParam("ismergerows", Boolean.FALSE);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,6 +45,9 @@ public class LoancontractF7Plugin extends AbstractBillPlugIn implements Plugin,
 | 
			
		|||
        //监听评级机构F7数据选择
 | 
			
		||||
        BasedataEdit ratingagency = view.getControl("ratingagency");
 | 
			
		||||
        ratingagency.addBeforeF7SelectListener(this);
 | 
			
		||||
        //监听债券评级机构F7数据选择
 | 
			
		||||
        BasedataEdit bondratingagency = view.getControl("shkd_bondratingagency");
 | 
			
		||||
        bondratingagency.addBeforeF7SelectListener(this);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -158,6 +161,36 @@ public class LoancontractF7Plugin extends AbstractBillPlugIn implements Plugin,
 | 
			
		|||
            DynamicObjectCollection winningbidderentry = intermediaryselect.getDynamicObjectCollection("winningbidderentry");
 | 
			
		||||
            ArrayList<String> dataFilterArr = new ArrayList<>();
 | 
			
		||||
            winningbidderentry.forEach((temp)->{
 | 
			
		||||
                if("主体评级".equals( temp.getString("shkd_pglx1") ))
 | 
			
		||||
                dataFilterArr.add(temp.getString("e_midorgname.number"));
 | 
			
		||||
            });
 | 
			
		||||
            //将set转换成数组
 | 
			
		||||
            QFilter accountQFilter = new QFilter("number", QCP.in, dataFilterArr);
 | 
			
		||||
            dataFilter.add(accountQFilter);
 | 
			
		||||
        }
 | 
			
		||||
        if("shkd_bondratingagency".equals(name)){
 | 
			
		||||
            //注册额度
 | 
			
		||||
            //债券发行:occupybondlimit   债券发行计划:shkd_occupybondlimit
 | 
			
		||||
            try {
 | 
			
		||||
                shkd_bondlimit= (DynamicObject)this.getModel().getValue("occupybondlimit");
 | 
			
		||||
            }catch(Exception e){
 | 
			
		||||
                shkd_bondlimit= (DynamicObject)this.getModel().getValue("shkd_occupybondlimit");
 | 
			
		||||
            }
 | 
			
		||||
            if(shkd_bondlimit == null){
 | 
			
		||||
                evt.setCancel(true);
 | 
			
		||||
                this.getView().showTipNotification("请先选择占用注册额度。");
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            Long occupybondlimitId = (Long) shkd_bondlimit.getPkValue();
 | 
			
		||||
            //找到注册额度中的招标遴选ID
 | 
			
		||||
            DynamicObject intermediaryselectID = BusinessDataServiceHelper.loadSingle(occupybondlimitId,"bdim_bond_limit", "shkd_intermediaryselect");
 | 
			
		||||
            QFilter qFilter = new QFilter("billno", QCP.equals, intermediaryselectID.getString("shkd_intermediaryselect"));
 | 
			
		||||
            DynamicObject intermediaryselect = BusinessDataServiceHelper.loadSingle("bdim_intermediaryselect",qFilter.toArray());
 | 
			
		||||
            //招标遴选 中标单位分录
 | 
			
		||||
            DynamicObjectCollection winningbidderentry = intermediaryselect.getDynamicObjectCollection("winningbidderentry");
 | 
			
		||||
            ArrayList<String> dataFilterArr = new ArrayList<>();
 | 
			
		||||
            winningbidderentry.forEach((temp)->{
 | 
			
		||||
                if("债项评级".equals( temp.getString("shkd_pglx1") ))
 | 
			
		||||
                dataFilterArr.add(temp.getString("e_midorgname.number"));
 | 
			
		||||
            });
 | 
			
		||||
            //将set转换成数组
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue