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

update

parent 30479a31
......@@ -69,9 +69,9 @@ public class IBAHelper implements Serializable, RemoteAccess {
* @throws WTException
*/
public static Hashtable getAllIBAValues(WTObject obj) throws WTException, InvocationTargetException, RemoteException {
if (!RemoteMethodServer.ServerFlag) {
return (Hashtable) RemoteMethodServer.getDefault().invoke("getAllIBAValues", IBAHelper.class.getName(), null, new Class[]{WTObject.class}, new Object[]{obj});
}
// if (!RemoteMethodServer.ServerFlag) {
// return (Hashtable) RemoteMethodServer.getDefault().invoke("getAllIBAValues", IBAHelper.class.getName(), null, new Class[]{WTObject.class}, new Object[]{obj});
// }
Hashtable hashtable = new Hashtable();
if (obj == null) {
return hashtable;
......@@ -630,12 +630,12 @@ public class IBAHelper implements Serializable, RemoteAccess {
}
public static DefaultAttributeContainer getContainer(IBAHolder ibaholder) throws WTException, RemoteException, InvocationTargetException {
System.out.println("getContainer=============="+RemoteMethodServer.ServerFlag);
if (!RemoteMethodServer.ServerFlag) {
System.out.println("getContainer==============1");
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=============="+RemoteMethodServer.ServerFlag);
// if (!RemoteMethodServer.ServerFlag) {
// System.out.println("getContainer==============1");
// return (DefaultAttributeContainer) RemoteMethodServer.getDefault().invoke("getContainer", IBAHelper.class.getName(), null, new Class[]{IBAHolder.class}, new Object[]{ibaholder});
// }
// System.out.println("getContainer==============2");
ibaholder = IBAValueHelper.service.refreshAttributeContainerWithoutConstraints(ibaholder);
DefaultAttributeContainer defaultattributecontainer = (DefaultAttributeContainer) ibaholder.getAttributeContainer();
return defaultattributecontainer;
......
......@@ -50,12 +50,13 @@ public class PartUtil implements RemoteAccess {
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;
Hashtable<WTPart,Hashtable> parttable = new Hashtable<WTPart, Hashtable>();
try {
number = number.toUpperCase();
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});
} else {
boolean enforce = SessionServerHelper.manager.setAccessEnforced(accessControlled);
......@@ -78,6 +79,11 @@ public class PartUtil implements RemoteAccess {
if (queryResult.hasMoreElements()) {
part = (WTPart) queryResult.nextElement();
}
if(part!=null){
Hashtable hashtable = IBAHelper.getAllIBAValues(part);
parttable.put(part,hashtable);
}
} finally {
SessionServerHelper.manager.setAccessEnforced(enforce);
}
......@@ -87,7 +93,7 @@ public class PartUtil implements RemoteAccess {
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return part;
return parttable;
}
......@@ -322,9 +328,9 @@ public class PartUtil implements RemoteAccess {
}
public static void main(String[] args) throws WTException, InvocationTargetException, RemoteException {
WTPart part = getPartByNumberAndView(args[0], args[1], false);
Hashtable hashtable = IBAHelper.getAllIBAValues(part);
System.out.println("hashtable====>" + hashtable);
Hashtable table = getPartByNumberAndView(args[0], args[1], false);
//Hashtable hashtable = IBAHelper.getAllIBAValues(part);
System.out.println("hashtable====>" + table);
}
/**
......
......@@ -21,10 +21,7 @@ import wt.vc.wip.WorkInProgressHelper;
import java.lang.reflect.InvocationTargetException;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
import java.util.*;
@Service
public class PartService {
......@@ -33,13 +30,27 @@ public class PartService {
System.out.println("-----getPartByNumber----");
boolean accessControlled = false;
DxPart dxPart = new DxPart();
WTPart wtPart = PartUtil.getPartByNumberAndView(number, view, accessControlled);
Hashtable hashtable = PartUtil.getPartByNumberAndView(number, view, accessControlled);
System.out.println("-----getPartByNumber----a");
Hashtable hashtable = IBAHelper.getAllIBAValues(wtPart);
System.out.println("-----getPartByNumber----b");
Hashtable ibatable = new Hashtable();
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) {
WTUser creat = ((WTUser) wtPart.getCreator().getObject());
dxPart.setCreator(String.format("%s(%s)", creat.getFullName(), creat.getName()));
String name = wtPart.getCreatorName();
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());
dxPart.setModifier(String.format("%s(%s)", modify.getFullName(), modify.getName()));
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