Commit 2ad037a6 authored by 杜科's avatar 杜科

update

parent 30479a31
...@@ -69,9 +69,9 @@ public class IBAHelper implements Serializable, RemoteAccess { ...@@ -69,9 +69,9 @@ public class IBAHelper implements Serializable, RemoteAccess {
* @throws WTException * @throws WTException
*/ */
public static Hashtable getAllIBAValues(WTObject obj) throws WTException, InvocationTargetException, RemoteException { public static Hashtable getAllIBAValues(WTObject obj) throws WTException, InvocationTargetException, RemoteException {
if (!RemoteMethodServer.ServerFlag) { // if (!RemoteMethodServer.ServerFlag) {
return (Hashtable) RemoteMethodServer.getDefault().invoke("getAllIBAValues", IBAHelper.class.getName(), null, new Class[]{WTObject.class}, new Object[]{obj}); // return (Hashtable) RemoteMethodServer.getDefault().invoke("getAllIBAValues", IBAHelper.class.getName(), null, new Class[]{WTObject.class}, new Object[]{obj});
} // }
Hashtable hashtable = new Hashtable(); Hashtable hashtable = new Hashtable();
if (obj == null) { if (obj == null) {
return hashtable; return hashtable;
...@@ -630,12 +630,12 @@ public class IBAHelper implements Serializable, RemoteAccess { ...@@ -630,12 +630,12 @@ public class IBAHelper implements Serializable, RemoteAccess {
} }
public static DefaultAttributeContainer getContainer(IBAHolder ibaholder) throws WTException, RemoteException, InvocationTargetException { public static DefaultAttributeContainer getContainer(IBAHolder ibaholder) throws WTException, RemoteException, InvocationTargetException {
System.out.println("getContainer=============="+RemoteMethodServer.ServerFlag); // System.out.println("getContainer=============="+RemoteMethodServer.ServerFlag);
if (!RemoteMethodServer.ServerFlag) { // if (!RemoteMethodServer.ServerFlag) {
System.out.println("getContainer==============1"); // System.out.println("getContainer==============1");
return (DefaultAttributeContainer) RemoteMethodServer.getDefault().invoke("getContainer", IBAHelper.class.getName(), null, new Class[]{IBAHolder.class}, new Object[]{ibaholder}); // return (DefaultAttributeContainer) RemoteMethodServer.getDefault().invoke("getContainer", IBAHelper.class.getName(), null, new Class[]{IBAHolder.class}, new Object[]{ibaholder});
} // }
System.out.println("getContainer==============2"); // System.out.println("getContainer==============2");
ibaholder = IBAValueHelper.service.refreshAttributeContainerWithoutConstraints(ibaholder); ibaholder = IBAValueHelper.service.refreshAttributeContainerWithoutConstraints(ibaholder);
DefaultAttributeContainer defaultattributecontainer = (DefaultAttributeContainer) ibaholder.getAttributeContainer(); DefaultAttributeContainer defaultattributecontainer = (DefaultAttributeContainer) ibaholder.getAttributeContainer();
return defaultattributecontainer; return defaultattributecontainer;
......
...@@ -50,12 +50,13 @@ public class PartUtil implements RemoteAccess { ...@@ -50,12 +50,13 @@ public class PartUtil implements RemoteAccess {
public static String FOLDER = "FOLDER"; public static String FOLDER = "FOLDER";
public static WTPart getPartByNumberAndView(String number, String viewStr, boolean accessControlled) throws WTException { public static Hashtable<WTPart,Hashtable> getPartByNumberAndView(String number, String viewStr, boolean accessControlled) throws WTException {
WTPart part = null; WTPart part = null;
Hashtable<WTPart,Hashtable> parttable = new Hashtable<WTPart, Hashtable>();
try { try {
number = number.toUpperCase(); number = number.toUpperCase();
if (!RemoteMethodServer.ServerFlag) { if (!RemoteMethodServer.ServerFlag) {
return (WTPart) RemoteMethodServer.getDefault().invoke("getPartByNumberAndView", PartUtil.class.getName(), return (Hashtable) RemoteMethodServer.getDefault().invoke("getPartByNumberAndView", PartUtil.class.getName(),
null, new Class[]{String.class, String.class, boolean.class}, new Object[]{number, viewStr, accessControlled}); null, new Class[]{String.class, String.class, boolean.class}, new Object[]{number, viewStr, accessControlled});
} else { } else {
boolean enforce = SessionServerHelper.manager.setAccessEnforced(accessControlled); boolean enforce = SessionServerHelper.manager.setAccessEnforced(accessControlled);
...@@ -78,6 +79,11 @@ public class PartUtil implements RemoteAccess { ...@@ -78,6 +79,11 @@ public class PartUtil implements RemoteAccess {
if (queryResult.hasMoreElements()) { if (queryResult.hasMoreElements()) {
part = (WTPart) queryResult.nextElement(); part = (WTPart) queryResult.nextElement();
} }
if(part!=null){
Hashtable hashtable = IBAHelper.getAllIBAValues(part);
parttable.put(part,hashtable);
}
} finally { } finally {
SessionServerHelper.manager.setAccessEnforced(enforce); SessionServerHelper.manager.setAccessEnforced(enforce);
} }
...@@ -87,7 +93,7 @@ public class PartUtil implements RemoteAccess { ...@@ -87,7 +93,7 @@ public class PartUtil implements RemoteAccess {
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
e.printStackTrace(); e.printStackTrace();
} }
return part; return parttable;
} }
...@@ -322,9 +328,9 @@ public class PartUtil implements RemoteAccess { ...@@ -322,9 +328,9 @@ public class PartUtil implements RemoteAccess {
} }
public static void main(String[] args) throws WTException, InvocationTargetException, RemoteException { public static void main(String[] args) throws WTException, InvocationTargetException, RemoteException {
WTPart part = getPartByNumberAndView(args[0], args[1], false); Hashtable table = getPartByNumberAndView(args[0], args[1], false);
Hashtable hashtable = IBAHelper.getAllIBAValues(part); //Hashtable hashtable = IBAHelper.getAllIBAValues(part);
System.out.println("hashtable====>" + hashtable); System.out.println("hashtable====>" + table);
} }
/** /**
......
...@@ -21,10 +21,7 @@ import wt.vc.wip.WorkInProgressHelper; ...@@ -21,10 +21,7 @@ import wt.vc.wip.WorkInProgressHelper;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.ArrayList; import java.util.*;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
@Service @Service
public class PartService { public class PartService {
...@@ -33,13 +30,27 @@ public class PartService { ...@@ -33,13 +30,27 @@ public class PartService {
System.out.println("-----getPartByNumber----"); System.out.println("-----getPartByNumber----");
boolean accessControlled = false; boolean accessControlled = false;
DxPart dxPart = new DxPart(); DxPart dxPart = new DxPart();
WTPart wtPart = PartUtil.getPartByNumberAndView(number, view, accessControlled); Hashtable hashtable = PartUtil.getPartByNumberAndView(number, view, accessControlled);
System.out.println("-----getPartByNumber----a"); System.out.println("-----getPartByNumber----a");
Hashtable hashtable = IBAHelper.getAllIBAValues(wtPart); Hashtable ibatable = new Hashtable();
System.out.println("-----getPartByNumber----b"); WTPart wtPart =null;
if(hashtable!=null){
Iterator i = hashtable.keySet().iterator();
if (i.hasNext()){
wtPart = (WTPart) i.next();
ibatable = (Hashtable) hashtable.get(wtPart);
}
}
// Hashtable hashtable = IBAHelper.getAllIBAValues(wtPart);
System.out.println("-----wtPart----1"+wtPart);
System.out.println("-----getPartByNumber----b"+hashtable);
if (wtPart != null) { if (wtPart != null) {
WTUser creat = ((WTUser) wtPart.getCreator().getObject()); String name = wtPart.getCreatorName();
dxPart.setCreator(String.format("%s(%s)", creat.getFullName(), creat.getName())); String fullName = wtPart.getCreatorFullName();
System.out.println("-----name----"+name+"=======fullName===="+fullName);
// WTUser creat = ((WTUser) wtPart.getCreator().getObject());
dxPart.setCreator(String.format("%s(%s)", fullName, name));
WTUser modify = ((WTUser) wtPart.getModifier().getObject()); WTUser modify = ((WTUser) wtPart.getModifier().getObject());
dxPart.setModifier(String.format("%s(%s)", modify.getFullName(), modify.getName())); dxPart.setModifier(String.format("%s(%s)", modify.getFullName(), modify.getName()));
System.out.println("-----getPartByNumber----1"); System.out.println("-----getPartByNumber----1");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment