|
|
@ -26,6 +26,7 @@ import com.teamcenter.services.strong.core.SessionService;
|
|
|
|
import com.teamcenter.services.strong.core._2007_12.Session;
|
|
|
|
import com.teamcenter.services.strong.core._2007_12.Session;
|
|
|
|
import com.teamcenter.services.strong.core._2018_11.ProjectLevelSecurity;
|
|
|
|
import com.teamcenter.services.strong.core._2018_11.ProjectLevelSecurity;
|
|
|
|
import com.teamcenter.services.strong.workflow.WorkflowService;
|
|
|
|
import com.teamcenter.services.strong.workflow.WorkflowService;
|
|
|
|
|
|
|
|
import com.teamcenter.soa.client.Connection;
|
|
|
|
import com.teamcenter.soa.client.model.*;
|
|
|
|
import com.teamcenter.soa.client.model.*;
|
|
|
|
import com.teamcenter.soa.client.model.Property;
|
|
|
|
import com.teamcenter.soa.client.model.Property;
|
|
|
|
import com.teamcenter.soa.client.model.strong.*;
|
|
|
|
import com.teamcenter.soa.client.model.strong.*;
|
|
|
@ -181,8 +182,7 @@ public class TcsoaService {
|
|
|
|
FileManagementService fmService =
|
|
|
|
FileManagementService fmService =
|
|
|
|
FileManagementService.getService(AppXSession.getConnection());
|
|
|
|
FileManagementService.getService(AppXSession.getConnection());
|
|
|
|
Date date = new Date();
|
|
|
|
Date date = new Date();
|
|
|
|
String filePath =
|
|
|
|
String filePath = System.getProperty("java.io.tmpdir") + dateFormat.format(date);
|
|
|
|
System.getProperty("java.io.tmpdir") + dateFormat.format(date);
|
|
|
|
|
|
|
|
File file = new File(filePath);
|
|
|
|
File file = new File(filePath);
|
|
|
|
if (!file.exists()) {
|
|
|
|
if (!file.exists()) {
|
|
|
|
file.mkdir();
|
|
|
|
file.mkdir();
|
|
|
@ -346,7 +346,13 @@ public class TcsoaService {
|
|
|
|
ItemRevision itemRevision = itemsResponse.output[0].itemRev;
|
|
|
|
ItemRevision itemRevision = itemsResponse.output[0].itemRev;
|
|
|
|
resultJSONObject.put("TaskPackageUID", itemRevision.get_items_tag().getUid());
|
|
|
|
resultJSONObject.put("TaskPackageUID", itemRevision.get_items_tag().getUid());
|
|
|
|
// 添加任务资料
|
|
|
|
// 添加任务资料
|
|
|
|
|
|
|
|
try {
|
|
|
|
putRWZL(user, itemRevision, fileList);
|
|
|
|
putRWZL(user, itemRevision, fileList);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
dataManagementService.deleteObjects(new ModelObject[] {itemsResponse.output[0].item});
|
|
|
|
|
|
|
|
Utils.setLog(logFileName, "oaCreateWorkFlow", "上传数据集失败:" + e.getMessage());
|
|
|
|
|
|
|
|
return JsonResult.error("上传数据集失败!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 设置版本表单
|
|
|
|
// 设置版本表单
|
|
|
|
dataManagementService.getProperties(
|
|
|
|
dataManagementService.getProperties(
|
|
|
@ -1501,19 +1507,33 @@ public class TcsoaService {
|
|
|
|
|
|
|
|
|
|
|
|
if (property.getPropertyDescription().getLovUid() != null
|
|
|
|
if (property.getPropertyDescription().getLovUid() != null
|
|
|
|
&& !property.getPropertyDescription().getLovUid().equals("")) {
|
|
|
|
&& !property.getPropertyDescription().getLovUid().equals("")) {
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct ns = new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct();
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct ns =
|
|
|
|
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct();
|
|
|
|
ns.locales = new String[] {"zh_CN"};
|
|
|
|
ns.locales = new String[] {"zh_CN"};
|
|
|
|
ns.name = itemNames[itemNames.length - 1];
|
|
|
|
ns.name = itemNames[itemNames.length - 1];
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo pi = new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo();
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo pi =
|
|
|
|
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo();
|
|
|
|
pi.object = itemTag;
|
|
|
|
pi.object = itemTag;
|
|
|
|
pi.propsToget = new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct[] { ns };
|
|
|
|
pi.propsToget =
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement.LocalizedPropertyValuesResponse lpvr = dmService.getLocalizedProperties2(new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo[] { pi });
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct[] {
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement.LocalizedPropertyValuesInfo2[] Output = lpvr.output;
|
|
|
|
ns
|
|
|
|
if(Output.length > 0 && Output[0].propertyValues.length > 0 && Output[0].propertyValues[0].values.length > 0)
|
|
|
|
};
|
|
|
|
{
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement
|
|
|
|
|
|
|
|
.LocalizedPropertyValuesResponse
|
|
|
|
|
|
|
|
lpvr =
|
|
|
|
|
|
|
|
dmService.getLocalizedProperties2(
|
|
|
|
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo
|
|
|
|
|
|
|
|
[] {pi});
|
|
|
|
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement.LocalizedPropertyValuesInfo2
|
|
|
|
|
|
|
|
[]
|
|
|
|
|
|
|
|
Output = lpvr.output;
|
|
|
|
|
|
|
|
if (Output.length > 0
|
|
|
|
|
|
|
|
&& Output[0].propertyValues.length > 0
|
|
|
|
|
|
|
|
&& Output[0].propertyValues[0].values.length > 0) {
|
|
|
|
return Output[0].propertyValues[0].values[0];
|
|
|
|
return Output[0].propertyValues[0].values[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// LovInfo lovInfo = property.getPropertyDescription().getLovReference().getLovInfo();
|
|
|
|
// LovInfo lovInfo =
|
|
|
|
|
|
|
|
// property.getPropertyDescription().getLovReference().getLovInfo();
|
|
|
|
// List<LovValue> lovValueList = lovInfo.getValues();
|
|
|
|
// List<LovValue> lovValueList = lovInfo.getValues();
|
|
|
|
// for (LovValue lovValue : lovValueList) {
|
|
|
|
// for (LovValue lovValue : lovValueList) {
|
|
|
|
// lovValue.getDisplayValue();
|
|
|
|
// lovValue.getDisplayValue();
|
|
|
@ -1552,23 +1572,38 @@ public class TcsoaService {
|
|
|
|
GetProperty(itemTag, itemNames[itemNames.length - 1], dmService);
|
|
|
|
GetProperty(itemTag, itemNames[itemNames.length - 1], dmService);
|
|
|
|
if (property.getPropertyDescription().getLovUid() != null
|
|
|
|
if (property.getPropertyDescription().getLovUid() != null
|
|
|
|
&& !property.getPropertyDescription().getLovUid().equals("")) {
|
|
|
|
&& !property.getPropertyDescription().getLovUid().equals("")) {
|
|
|
|
// LovInfo lovInfo = property.getPropertyDescription().getLovReference().getLovInfo();
|
|
|
|
// LovInfo lovInfo =
|
|
|
|
|
|
|
|
// property.getPropertyDescription().getLovReference().getLovInfo();
|
|
|
|
// List<LovValue> lovValueList = lovInfo.getValues();
|
|
|
|
// List<LovValue> lovValueList = lovInfo.getValues();
|
|
|
|
// for (LovValue lovValue : lovValueList) {
|
|
|
|
// for (LovValue lovValue : lovValueList) {
|
|
|
|
// lovValue.getDisplayValue();
|
|
|
|
// lovValue.getDisplayValue();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
//Teamcenter.Services.Strong.Core._2010_04.DataManagement.NameLocaleStruct ns = new Services.Strong.Core._2010_04.DataManagement.NameLocaleStruct();
|
|
|
|
// Teamcenter.Services.Strong.Core._2010_04.DataManagement.NameLocaleStruct ns = new
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct ns = new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct();
|
|
|
|
// Services.Strong.Core._2010_04.DataManagement.NameLocaleStruct();
|
|
|
|
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct ns =
|
|
|
|
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct();
|
|
|
|
ns.locales = new String[] {"zh_CN"};
|
|
|
|
ns.locales = new String[] {"zh_CN"};
|
|
|
|
ns.name = itemNames[itemNames.length - 1];
|
|
|
|
ns.name = itemNames[itemNames.length - 1];
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo pi = new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo();
|
|
|
|
com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo pi =
|
|
|
|
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo();
|
|
|
|
pi.object = itemTag;
|
|
|
|
pi.object = itemTag;
|
|
|
|
pi.propsToget = new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct[] { ns };
|
|
|
|
pi.propsToget =
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement.LocalizedPropertyValuesResponse lpvr = dmService.getLocalizedProperties2(new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo[] { pi });
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.NameLocaleStruct[] {
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement.LocalizedPropertyValuesInfo2[] Output = lpvr.output;
|
|
|
|
ns
|
|
|
|
if(Output.length > 0 && Output[0].propertyValues.length > 0 && Output[0].propertyValues[0].values.length > 0)
|
|
|
|
};
|
|
|
|
{
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement
|
|
|
|
|
|
|
|
.LocalizedPropertyValuesResponse
|
|
|
|
|
|
|
|
lpvr =
|
|
|
|
|
|
|
|
dmService.getLocalizedProperties2(
|
|
|
|
|
|
|
|
new com.teamcenter.services.strong.core._2010_04.DataManagement.PropertyInfo
|
|
|
|
|
|
|
|
[] {pi});
|
|
|
|
|
|
|
|
com.teamcenter.services.strong.core._2015_07.DataManagement.LocalizedPropertyValuesInfo2
|
|
|
|
|
|
|
|
[]
|
|
|
|
|
|
|
|
Output = lpvr.output;
|
|
|
|
|
|
|
|
if (Output.length > 0
|
|
|
|
|
|
|
|
&& Output[0].propertyValues.length > 0
|
|
|
|
|
|
|
|
&& Output[0].propertyValues[0].values.length > 0) {
|
|
|
|
return Output[0].propertyValues[0].values[0];
|
|
|
|
return Output[0].propertyValues[0].values[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|