From f29ad099c6dc5c55d6cb94fb190d06743777ec6d Mon Sep 17 00:00:00 2001 From: dangsn <dangsn@chicecm.com> Date: 星期三, 05 六月 2024 10:56:48 +0800 Subject: [PATCH] 项目引用调整 --- Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/WebUtil.java | 66 ++++++++++++++++++-------------- 1 files changed, 37 insertions(+), 29 deletions(-) diff --git a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/WebUtil.java b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/WebUtil.java index 6b512d2..15dd76a 100644 --- a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/WebUtil.java +++ b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/WebUtil.java @@ -2,10 +2,15 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; -import com.vci.base.ui.exception.VCIException; -import com.vci.corba.common.VCIError; -import com.vci.corba.framework.data.UserEntityInfo; -import com.vci.rmip.framework.client.systemConfig.object.UserEntityObject; +import com.vci.client.bof.ClientBusinessObject; +import com.vci.client.bof.ClientLinkObject; +import com.vci.client.common.objects.UserEntityObject; +import com.vci.common.exception.VciException; +import com.vci.corba.common.PLException; +import com.vci.corba.common.data.UserEntityInfo; +import com.vci.corba.omd.data.AttributeValue; +import com.vci.corba.omd.data.BusinessObject; +import com.vci.corba.omd.data.LinkObject; import com.vci.starter.revision.bo.TreeWrapperOptions; import com.vci.starter.web.annotation.*; import com.vci.starter.web.constant.QueryOptionConstant; @@ -18,7 +23,6 @@ import com.vci.starter.web.util.*; import com.vci.starter.web.wrapper.VciQueryWrapperForDO; import com.vci.web.pageModel.*; -import com.vci.web.properties.WebProperties; import com.vci.web.service.impl.WebLoServiceImpl; import net.sf.jsqlparser.parser.CCJSqlParserUtil; import net.sf.jsqlparser.statement.select.PlainSelect; @@ -26,14 +30,8 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; -import plm.bs.bom.clientobject.ClientBusinessObject; -import plm.bs.bom.clientobject.ClientLinkObject; -import plm.bs.bom.common.AttributeValue; -import plm.bs.bom.common.BusinessObject; -import plm.bs.bom.common.LinkObject; import javax.servlet.http.HttpServletRequest; import java.beans.IntrospectionException; @@ -80,16 +78,16 @@ if (e == null) { return errContent; } - if (e instanceof VCIError ) { + if (e instanceof PLException ) { // String error_code = ((VCIError) e).error_code; // String[] error_message = ((VCIError) e).error_message; // return MessageUtils.get(error_code, error_message); return null; } else if(e instanceof VciBaseException || e.getClass().getSuperclass().equals(VciBaseException.class)){ return LangBaseUtil.getErrorMsg(e); - }else if (e instanceof VCIException){ - String error_code = ((VCIException) e).getException_code(); - Object[] error_message = ((VCIException) e).getException_objArray(); + }else if (e instanceof VciException){ + String error_code = ((VciException) e).getCode(); + Object[] error_message = ((VciException) e).getObjArray(); return MessageUtils.get(error_code, error_message); }else if (e.getCause() != null && !e.getCause().toString().equals("")) { @@ -241,7 +239,7 @@ public static UserEntityInfo getUserEntityInfo(String model){ SessionInfo si = WebUtil.getCurrentUserSessionInfo(); UserEntityInfo ueo = new UserEntityInfo(); - ueo.ip = si.getIp(); +// ueo.ip = si.getIp(); ueo.modules = model; ueo.userName = si.getUserId(); return ueo; @@ -255,7 +253,7 @@ public static UserEntityObject getUserEntityObject(String model) { UserEntityObject entityObject = new UserEntityObject(); SessionInfo si = WebUtil.getCurrentUserSessionInfo(); - entityObject.setIp(si.getIp()); +// entityObject.setIp(si.getIp()); entityObject.setModules(model); entityObject.setUserName(si.getUserId()); return entityObject; @@ -1320,7 +1318,7 @@ * @param obj 瀵硅薄 * @param fieldAttrMap 灞炴�ap */ - public static void copyValueToObjectFromLos(LinkObject lo ,Object obj,Map<String,String> fieldAttrMap){ + public static void copyValueToObjectFromLos(LinkObject lo , Object obj, Map<String,String> fieldAttrMap){ if(lo!=null && obj != null){ //鍏堟妸鎵�鏈夌殑瀛楁鏄犲皠鎵惧埌 if(fieldAttrMap == null){ @@ -1367,7 +1365,7 @@ setValueToField(key, cbo, value); } cbo.setAttributeValueWithNoCheck(key.toLowerCase(), value); - } catch (VCIError e) { + } catch (PLException e) { throw WebUtil.getVciBaseException(e); } } @@ -1394,7 +1392,7 @@ }else { clo.setAttributeValue(key.toLowerCase(), value); } - } catch (VCIError e) { + } catch (PLException e) { throw WebUtil.getVciBaseException(e); } } @@ -1437,7 +1435,7 @@ setValueToField(fieldName, cbo, value); } cbo.setAttributeValue(attrName.toLowerCase(), value); - } catch (VCIError e) { + } catch (PLException e) { throw WebUtil.getVciBaseException(e); } } @@ -1509,9 +1507,19 @@ * @param e 寮傚父瀵硅薄 * @return base寮傚父瀵硅薄 */ - public static VciBaseException getVciBaseException(VCIError e){ -// return new VciBaseException(e.error_code, e.error_message); - return null; +// public static VciBaseException getVciBaseException(PLException e){ +//// return new VciBaseException(e.error_code, e.error_message); +// return null; +// } + + /** + * 杞崲寮傚父 + * @param e 寮傚父瀵硅薄 + * @return base寮傚父瀵硅薄 + */ + public static VciBaseException getVciBaseException(PLException e){ + return new VciBaseException(e.code, new java.lang.String[]{e.getMessage()}); +// return null; } /** @@ -1519,15 +1527,15 @@ * @param e 寮傚父瀵硅薄 * @return base寮傚父瀵硅薄 */ - public static VciBaseException getVciBaseException(VCIException e){ + public static VciBaseException getVciBaseException(VciException e){ String[] errorMsgs = new String[0]; - if(e != null && e.getException_objArray() !=null ){ - errorMsgs = new String[e.getException_objArray().length]; + if(e != null && e.getObjArray() !=null ){ + errorMsgs = new String[e.getObjArray().length]; for(int i = 0 ; i < errorMsgs.length ; i ++){ - errorMsgs[i] = e.getException_objArray()[i].toString(); + errorMsgs[i] = e.getObjArray()[i].toString(); } } - return new VciBaseException(e == null ?"com.vci.web.base.unknowerror":e.getException_code(), errorMsgs); + return new VciBaseException(e == null ?"com.vci.web.base.unknowerror":e.getCode(), errorMsgs); } /** -- Gitblit v1.9.3