|
|
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -148,7 +149,7 @@ public class BomSendSapController {
|
|
|
|
|
return soapXML;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TCComponentItemRevision getPRevision(TCComponentItemRevision rev2) throws TCException {
|
|
|
|
|
public TCComponentItemRevision getPRevision(TCComponentItemRevision rev2) throws Exception {
|
|
|
|
|
|
|
|
|
|
String zt2_MaterialNo = rev2.getStringProperty("zt2_MaterialNo");
|
|
|
|
|
if (rev2.getType().equals("Part Revision")) {
|
|
|
|
@ -162,7 +163,12 @@ public class BomSendSapController {
|
|
|
|
|
for (TCComponent matnr : matnrs) {
|
|
|
|
|
String[] properties = matnr.getProperties(new String[] { "zt2_ifpbom", "zt2_MaterialNo" });
|
|
|
|
|
if (properties[1].equals(zt2_MaterialNo) && properties[0].equals("P")) {
|
|
|
|
|
return (TCComponentItemRevision) matnr;
|
|
|
|
|
TCComponentItemRevision[] revs = ((TCComponentItemRevision) matnr).getItem().getReleasedItemRevisions();
|
|
|
|
|
System.out.println("getPRevision:" + matnr + " ==> " + Arrays.toString(revs));
|
|
|
|
|
if(revs.length > 0)//lidy20240415
|
|
|
|
|
return revs[0];
|
|
|
|
|
// else
|
|
|
|
|
// return (TCComponentItemRevision) matnr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -172,7 +178,7 @@ public class BomSendSapController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getUserName(TCSession session) throws TCException {
|
|
|
|
|
public String getUserName(TCSession session) throws Exception {
|
|
|
|
|
TCComponentUser user = session.getUser();
|
|
|
|
|
session.getUserName();
|
|
|
|
|
return user.getTCProperty("user_name").getDisplayValue();
|
|
|
|
|