main
熊朝柱 2 weeks ago
parent 09c16ddb3d
commit 5ac81a162a

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="accountSettings">
<option name="activeRegion" value="us-east-1" />
<option name="recentlyUsedRegions">
<list>
<option value="us-east-1" />
</list>
</option>
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/cn.com.origin.autocode/src/cn/com/origin/autocode/AutoCodePerspective.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/cn.com.origin.autocode/src/cn/com/origin/autocode/handlers/AutoCodeNewItemHandler.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/cn.com.origin.autocode/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java" charset="GBK" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxBlameSettings">
<option name="version" value="2" />
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ASMSmaliIdeaPluginConfiguration">
<asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/autocode.iml" filepath="$PROJECT_DIR$/.idea/autocode.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>autocode</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

@ -14,6 +14,7 @@ import cn.com.origin.autocodemanager.common.TCPreferenceUitl;
import com.teamcenter.rac.aif.AIFDesktop;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
public class AutoCodeNewItemHandler extends AbstractHandler {
private String origin_newItemDialogType = "origin_newItemDialogType";
@ -25,8 +26,6 @@ public class AutoCodeNewItemHandler extends AbstractHandler {
new Thread() {
public void run() {
ORNewItemCommand command = new ORNewItemCommand(AIFDesktop.getActiveDesktop().getFrame(), AIFUtility.getCurrentApplication());
// ExcelTemplate Item
// ORNewItemCommand command = new ORNewItemCommand(AIFDesktop.getActiveDesktop().getFrame(), AIFUtility.getCurrentApplication(),"DMTemplate");
try {
command.executeModal();
} catch (Exception e) {
@ -36,6 +35,7 @@ public class AutoCodeNewItemHandler extends AbstractHandler {
}.start();
} else {
new NewCodeItemDialog(AIFDesktop.getActiveDesktop().getShell()).open();
}
return null;
}

@ -103,7 +103,10 @@ import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.PlatformHelper;
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
import com.teamcenter.services.rac.core.DataManagementService;
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn;
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput;
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateOut;
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateResponse;
import com.teamcenter.soa.client.model.LovValue;
import cn.com.origin.autocode.jfom.util.ClassProperty;
@ -3037,6 +3040,7 @@ public class NewCodeItemDialog extends Dialog {
createitemsresponse = datamanagementservice.createItems(aitemproperties, tccomponent1, s1);
if (createitemsresponse.serviceData.sizeOfPartialErrors() == 0) {
newComp = createitemsresponse.output[0].item;
System.out.println("1:"+newComp.toString());
if (newComp != null) {
try {
TCComponentItemRevision rev = ((TCComponentItem) newComp).getLatestItemRevision();
@ -3181,7 +3185,8 @@ public class NewCodeItemDialog extends Dialog {
CNCompontent iComp, CNCompontent imComp, CNCompontent rComp, CNCompontent rmComp) {
try {
com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput itemInput = new com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput();
//com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput itemInput = new com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput();
CreateInput itemInput = new CreateInput();
itemInput.boName = itemType;
System.out.println("Item Type =>>>>" + itemType);
Map<String, Object> itemStringMap = new HashMap();
@ -3248,14 +3253,23 @@ public class NewCodeItemDialog extends Dialog {
itemInput.compoundCreateInput = compMap;
DataManagementService datamanagementservice = DataManagementService.getService(session);
com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn createin = new com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn();
CreateIn createin = new CreateIn();
createin.clientId = "Test";
createin.data = itemInput;
System.out.println("11111111111111");
com.teamcenter.services.rac.core._2008_06.DataManagement.CreateResponse createresponse = datamanagementservice
.createObjects(
new com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn[] { createin });
com.teamcenter.services.rac.core._2008_06.DataManagement.CreateResponse createresponse;
createresponse = datamanagementservice.createObjects(new CreateIn[] { createin });
if (createresponse.serviceData.sizeOfPartialErrors() > 0) {
System.out.println("create item failed");
for (int i = 0; i < createresponse.serviceData.sizeOfPartialErrors(); i++) {
String[] messages = createresponse.serviceData.getPartialError(0).getMessages();
for(int j=0;j<messages.length;j++) {
System.out.println(createresponse.serviceData.getPartialError(0).getErrorValues()[j].getMessage());
}
System.out.println(createresponse.serviceData.getPartialError(0).getMessages());
System.out.println(createresponse.serviceData.getPartialError(0).getErrorValues()[0].getMessage());
}
}
SoaUtil.handlePartialErrors(createresponse.serviceData, null, null, true);
com.teamcenter.services.rac.core._2008_06.DataManagement.CreateOut acreateout[] = createresponse.output;
if (acreateout != null && acreateout.length > 0) {
@ -3268,6 +3282,7 @@ public class NewCodeItemDialog extends Dialog {
if (atccomponent != null && atccomponent.length > 0) {
arraylist.addAll(Arrays.asList(atccomponent));
newComp = atccomponent[0];
System.out.println("2:"+newComp.toString()+i);
}
}
}
@ -3428,6 +3443,7 @@ public class NewCodeItemDialog extends Dialog {
System.out.println("选中对象:" + targetObject + " 类型:" + type);
}
TCComponentItem newItem = (TCComponentItem) newComp;
System.out.println("3:"+newItem.toString());
for (int i = 0; i < generalPropLabelList.size(); i++) {
String text = generalPropLabelList.get(i).getText();
@ -3515,7 +3531,7 @@ public class NewCodeItemDialog extends Dialog {
}
if (targetObject instanceof TCComponentFolder) {
System.out.println("5"+newComp.toString());
if (newComp != null) {
TCComponentFolder folder = (TCComponentFolder) targetObject;
if (isHaveWritePrivilige(folder)) {
@ -3528,7 +3544,7 @@ public class NewCodeItemDialog extends Dialog {
}
} else if (type.equals("Hxc8tuzhiRevision") || type.equals("Hxc8bctuzhiRevision")
|| type.equals("Hxc8dmtuzhiRevision") || type.equals("Hxc8mjtuzhiRevision")) {
System.out.println("6"+newComp.toString());
if (newComp != null) {
openByPass(session);
targetObject.add("representation_for", ((TCComponentItem) newComp).getLatestItemRevision());// 关系
@ -3546,7 +3562,7 @@ public class NewCodeItemDialog extends Dialog {
}
} else if (targetObject instanceof TCComponentPseudoFolder) {
System.out.println("4"+newComp.toString());
if (newComp != null) {
if (TCPreferenceUitl.isTrueTCPreferenceValue(session, origin_isNotSaveNewItemToPseudoFolder)) {
session.getUser().getNewStuffFolder().add("contents", newComp);
@ -3562,7 +3578,7 @@ public class NewCodeItemDialog extends Dialog {
}
}
} else {
System.out.println("5"+newComp.toString());
if (newComp != null) {
session.getUser().getNewStuffFolder().add("contents", newComp);
session.getUser().getNewStuffFolder().refresh();
@ -4484,12 +4500,7 @@ public class NewCodeItemDialog extends Dialog {
}
}
TCComponentItem oldItem = tccomponentitemtype.find(getJYNewID(newID));
if (oldItem != null) {
MessageBox.post("IDΪ¡¾" + getJYNewID(newID) + "¡¿µÄÎïÁÏÒѾ­´æÔÚ!", "INFO", MessageBox.WARNING);
new GetCodeNumber().delete_recycleID(counterID);
return;
}
long time11 = System.nanoTime();
if (!TCPreferenceUitl.isSelectExsitToTCPreferenceValues(session, origin_idNeddExamineAndApproveTypes,
@ -4501,19 +4512,40 @@ public class NewCodeItemDialog extends Dialog {
itemID = new GetCodeNumber().getCodeNumber("LS", 10, 0, 99999999, 1, "");
} while (tccomponentitemtype.find(itemID) != null);
TCComponentItem oldItem = tccomponentitemtype.find(itemID);
if (oldItem != null) {
MessageBox.post("ID为【" + itemID + "】的物料已经存在!", "INFO", MessageBox.WARNING);
new GetCodeNumber().delete_recycleID(counterID);
return;
}else {
createNewItem(itemID, revText.getText(), "JK8LSMaterial", nameText.getText(), "");
}
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
TCComponentItem oldItem = tccomponentitemtype.find(getJYNewID(newID));
if (oldItem != null) {
MessageBox.post("ID为【" + getJYNewID(newID) + "】的物料已经存在!", "INFO", MessageBox.WARNING);
new GetCodeNumber().delete_recycleID(counterID);
return;
}else {
createNewItem(getJYNewID(newID), revText.getText(), realItemType, nameText.getText(), "");
}
}
} else {
TCComponentItem oldItem = tccomponentitemtype.find(tccomponentitemtype.getNewID());
if (oldItem != null) {
MessageBox.post("ID为【" + tccomponentitemtype.getNewID() + "】的物料已经存在!", "INFO", MessageBox.WARNING);
new GetCodeNumber().delete_recycleID(counterID);
return;
}else {
createNewItem(tccomponentitemtype.getNewID(), revText.getText(), realItemType, nameText.getText(), "");
}
}
long time12 = System.nanoTime();
System.out.println("创建item用时(ms) " + (time12 - time11) / 1000000);
@ -4900,7 +4932,9 @@ public class NewCodeItemDialog extends Dialog {
try {
TCComponentItemRevision rev = ((TCComponentItem) newComp).getLatestItemRevision();
rev.refresh();
//获取首选项配置的分类配置prefArr[{洗护分类库/洗护自制件:规格,材质,尺寸,颜色},{},{}]
String[] prefArr = getPrefStrArray("jd2_custom_display_name");
//获取分类路径
String classAddress = getClassificationAddress(rev.getClassificationClass());
System.out.println("classAddress=====>" + classAddress);
for (String pref : prefArr) {
@ -4928,7 +4962,6 @@ public class NewCodeItemDialog extends Dialog {
}
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
JOptionPane.showMessageDialog(null, "首选项jd2_custom_display_name配置有误请检查\r\n" + e.getMessage(), "提示",
JOptionPane.WARNING_MESSAGE);

@ -1,2 +1,2 @@
/icons/
/cn/
/icons/

Loading…
Cancel
Save