 package com.connor.erp.BomImport;
 
 import com.connor.erp.BomAddTransferToERP.BomAddTransferDialog;
 import com.connor.erp.BomChgTransferToERP.BomChgTransferDialog;
import com.connor.erp.BomChgTransferToERP.DBUtils;
import com.connor.erp.toolkit.AimType;
 import com.connor.erp.toolkit.FileType;
 import com.connor.erp.toolkit.IsContinueDialog;
 import com.connor.erp.toolkit.UtilApi;
 import com.teamcenter.rac.aif.AbstractAIFCommand;
 import com.teamcenter.rac.aif.AbstractAIFOperation;
 import com.teamcenter.rac.aif.AbstractAIFUIApplication;
 import com.teamcenter.rac.aif.kernel.AIFComponentContext;
 import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
 import com.teamcenter.rac.kernel.TCComponent;
 import com.teamcenter.rac.kernel.TCComponentBOMLine;
 import com.teamcenter.rac.kernel.TCComponentForm;
 import com.teamcenter.rac.kernel.TCComponentItemRevision;
 import com.teamcenter.rac.kernel.TCComponentMEProcess;
 import com.teamcenter.rac.kernel.TCComponentMEProcessRevision;
 import com.teamcenter.rac.kernel.TCComponentSignoff;
 import com.teamcenter.rac.kernel.TCComponentTask;
 import com.teamcenter.rac.kernel.TCComponentUser;
 import com.teamcenter.rac.kernel.TCException;
 import com.teamcenter.rac.kernel.TCPreferenceService;
 import com.teamcenter.rac.kernel.TCSession;
 import com.teamcenter.rac.kernel.TCUserService;
 import com.teamcenter.rac.pse.operations.UnpackOperation;
 import com.teamcenter.rac.util.MessageBox;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 import javax.swing.SwingUtilities;
 
 public class BomTransferCommand extends AbstractAIFCommand {
   private static final String NHL_BOMTRANSFERTYPE = "NHL_BomTrasferType";
   
   private static final String NHL_BOMIMPERP_PRIVILEGES = "NHL_BOMimpERP_Privileges";
   
   private static final String NHL_BOMIMPERP_MENUAUTH = "NHL_BOMimpERP_MenuAuth";
   
   public TCSession session;
   
   public AbstractAIFUIApplication application;
   
/*   62 */   public List<TCComponentItemRevision> NoBomItemRevisions = new ArrayList<TCComponentItemRevision>();
   
/*   63 */   public List<TCComponentItemRevision> ItemRevisions = new ArrayList<TCComponentItemRevision>();
   
/*   64 */   public Map<String, Map<String, List<String>>> id_to_list_map = new HashMap<String, Map<String, List<String>>>();
   
/*   65 */   public Vector<Vector<Object>> data = new Vector<Vector<Object>>();
   
   private boolean isPrivilege = false;
   
   private TCPreferenceService ps;
   
   TCComponentUser currentUser;
   
   int targetNum;
   
/*   75 */   List<String> listItemTypes = new ArrayList<String>();
   
/*   77 */   List<String> listProcessTypes = new ArrayList<String>();
   
   private StringBuffer resultInfo;
   
   private StringBuffer detailInfo;
   
/*   82 */   private Map<TCComponentItemRevision, TCComponentMEProcessRevision> itemToMeprocessMap = new HashMap<TCComponentItemRevision, TCComponentMEProcessRevision>();
   
   private InterfaceAIFComponent[] targets;
   
   public BomTransferCommand(TCSession pSession, AbstractAIFUIApplication app) {
/*   86 */     this.session = pSession;
/*   87 */     this.application = app;
   }
   
   private void addItemRevision(TCComponentMEProcessRevision meprocessRev, TCComponentItemRevision itemRev) {
/*  102 */     if (this.ItemRevisions.contains(itemRev) || this.NoBomItemRevisions.contains(itemRev))
       return; 
     try {
/*  106 */       if ((itemRev.getRelatedComponents("ps_children")).length > 0 || "NHL8_PartsProRevision".equals(meprocessRev.getType()) ) {
/*  107 */         this.ItemRevisions.add(itemRev);
       } else {
/*  109 */         this.NoBomItemRevisions.add(itemRev);
       } 
/*  111 */     } catch (TCException tcEx) {
/*  112 */       tcEx.printStackTrace();
     } 
   }
   
   public void checkTarget(AimType aimType) {
/*  117 */     this.targets = this.application.getTargetComponents();
/*  118 */     if (this.targets == null || this.targets.length == 0) {
/*  119 */       MessageBox.post(this.application.getDesktop().getShell(), " 请选择一个对象", "警告", 4);
       return;
     } 
/*  122 */     this.ps = this.session.getPreferenceService();
/*  123 */     String[] NHL8_BomTrasferType = this.ps.getStringArray(4, "NHL_BomTrasferType");
/*  125 */     this.listProcessTypes.add("NHL8_AssemblyProRevision");
/*  126 */     this.listProcessTypes.add("NHL8_PartsProRevision");
this.listProcessTypes.add("NHL8_DivergeProRevision");
/*  127 */     if (NHL8_BomTrasferType == null || NHL8_BomTrasferType.length == 0) {
/*  128 */       MessageBox.post("首选项NHL_BomTrasferType尚未配置，请联系系统管理员！", "提示", 4);
     } else {
/*  130 */       int typesLen = NHL8_BomTrasferType.length;
/*  131 */       for (int n = 0; n < typesLen; n++)
/*  132 */         this.listItemTypes.add(NHL8_BomTrasferType[n]); 
     } 
/*  136 */     String[] userNames = this.ps.getStringArray(4, "NHL_BOMimpERP_Privileges");
/*  137 */     this.currentUser = this.session.getUser();
/*  138 */     String userID = "";
     try {
/*  140 */       userID = this.currentUser.getProperty("user_id");
/*  141 */     } catch (TCException e1) {
/*  142 */       e1.printStackTrace();
     } 
/*  144 */     if (userNames != null && userNames.length > 0) {
/*  145 */       int nameLen = userNames.length;
/*  146 */       for (int i = 0; i < nameLen; i++) {
/*  147 */         if (userNames[i].trim().equals(userID)) {
/*  148 */           this.isPrivilege = true;  //首选项配的权限
           break;
         } 
       } 
     } else {
/*  153 */       MessageBox.post(this.application.getDesktop().getShell(), "请配置首选项NHL_BOMimpERP_Privileges！！", "警告", 4);
       return;
     } 
/*  156 */     this.targetNum = this.targets.length;
/*  157 */     TCComponent targetComponent = (TCComponent)this.targets[0];
/*  158 */     String targetType = "";
/*  159 */     if (targetComponent instanceof TCComponentBOMLine) {  //bomline对象获取item版本的类型 
/*  160 */       if (!this.isPrivilege) {
/*  161 */         MessageBox.post(this.application.getDesktop().getShell(), "您是普通用户权限不够，请联系管理员！", "警告", 4);
         return;
       } 
       try {
/*  165 */         targetType = ((TCComponentBOMLine)targetComponent).getItemRevision().getType();
/*  166 */       } catch (TCException e) {
/*  167 */         e.printStackTrace();
       } 
     } else {
/*  170 */       targetType = targetComponent.getType(); 
     } 
/*  173 */     if (targetComponent instanceof TCComponentTask) {  //选择的类型要是流程中的 或者是工艺的
/*  174 */       if (this.isPrivilege) {
					String errMsgCheck="";
/*  175 */         StringBuffer resultInfo = new StringBuffer("");
/*  176 */         StringBuffer detailInfo = new StringBuffer("");
/*  177 */         for (int i = 0; i < this.targetNum; i++) {
/*  178 */           if (this.targets[i] instanceof TCComponentTask) {
						
/*  179 */             TCComponentTask task = (TCComponentTask)this.targets[i];
						try {
/*  181 */               TCComponent[] attachmentComponents = task.getRelatedComponents("root_target_attachments");
/*  182 */               int attachmentsLen = attachmentComponents.length;
/*  183 */               for (int j = 0; j < attachmentsLen; j++) {
/*  184 */                 String type = attachmentComponents[j].getType();
/*  185 */                 if (this.listProcessTypes.contains(type)) {
/*  186 */                   TCComponentMEProcessRevision meprocessRev = (TCComponentMEProcessRevision)attachmentComponents[j];
/*  187 */                   TCComponent[] metargets = meprocessRev.getRelatedComponents("IMAN_METarget");
/*  188 */                   int metargetsLen = metargets.length;
/*  189 */                   if (metargetsLen > 0) {
	
							
/*  190 */                     TCComponentItemRevision itemRev = (TCComponentItemRevision)metargets[0];

								if(meprocessRev.getType().equals("NHL8_AssemblyProRevision")){
									if(itemRev.getType().equals("NHL8_PartsRevision") ||itemRev.getType().equals("NHL8_ProductRevision") ) {
										TCComponent masterRev = meprocessRev.getRelatedComponent("IMAN_master_form_rev");
										boolean isfpass = masterRev.getLogicalProperty("nhl8_isfPass");
										if(!isfpass) {
											TCComponent relatedComponent = itemRev.getRelatedComponent("IMAN_master_form_rev");
											String itemId =  meprocessRev.getStringProperty("item_id");
											 Object obj[] = new Object[1];
											 obj[0] = 1;
											 TCUserService service = session.getUserService();
								   			 service.call("openByPass", obj);
								   			 relatedComponent.setLogicalProperty("nhl8_BOMimpSucc", true);
								   			 service.call("closeByPass", obj);
								   			 errMsgCheck=errMsgCheck+itemId+"的设计BOM和工艺BOM不一致\n";
//											MessageBox.post("设计BOM和工艺BOM不一致，无法执行BOM导入ERP操作，请在ERP中手"
//													+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点。","提示",2);
//											return;
										}
									}
								}
								
/*  191 */                     this.itemToMeprocessMap.put(itemRev, meprocessRev);
/*  192 */                     String comType = itemRev.getType();
/*  193 */                     if (!this.listItemTypes.contains(comType))
/*  194 */                       detailInfo.append(itemRev + "类型不在首选项中存在<br>"); 
/*  196 */                     addItemRevision(meprocessRev, itemRev);
                   } 
                 } 
               } 
/*  200 */             } catch (TCException e) {
/*  201 */               e.printStackTrace();
/*  202 */             } catch (Exception e) {
/*  203 */               e.printStackTrace();
             } 
           } else {
/*  206 */             MessageBox.post(this.application.getDesktop().getShell(), "请确认选中的是任务对象！！", "警告", 4);
             return;
           } 
         } 
					if(!errMsgCheck.equals("")) {
						errMsgCheck=errMsgCheck+"无法执行BOM导入ERP操作，请在ERP中手"
								+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点";
						MessageBox.post(errMsgCheck,"提示",2);
						return;
					}
/*  210 */         if (!detailInfo.toString().equals("")) {
/*  211 */           resultInfo.append("所选或提取制造目标的业务对象类型在首选项中不存在<br>");
/*  212 */           loadDataForPrivilege(aimType, resultInfo, detailInfo);
         } else {
/*  214 */           loadDataForPrivilege(aimType, new StringBuffer(""), new StringBuffer(""));
         } 
/*  217 */       } else if (aimType.toString().equals("add")) {
/*  218 */         if (!UtilApi.getTaskBomAddResult(this.application, this.session, FileType.bom, "BOM传递新增结果", this, "task", aimType))
           return; 
/*  221 */       } else if (aimType.toString().equals("chg") && 
/*  222 */         !UtilApi.getTaskBomChgResult(this.application, this.session, FileType.bom, "BOM传递变更结果", this, "task", aimType)) {
         return;
       } 
/*  227 */     } else if (this.listItemTypes.contains(targetType) || this.listProcessTypes.contains(targetType)) {
/*  228 */       if (this.isPrivilege) {
/*  229 */         StringBuffer resultInfo = new StringBuffer("");
/*  230 */         StringBuffer detailInfo = new StringBuffer("");
/*  231 */         boolean notFind = false;
/*  232 */         boolean findMore = false;
/*  233 */         for (int i = 0; i < this.targetNum; i++) {
/*  234 */           String type = "";
/*  235 */           TCComponentItemRevision revision = null;
/*  236 */           TCComponentMEProcessRevision meprocessRev = null;
/*  237 */           if (this.targets[i] instanceof TCComponentBOMLine) {
             try {
/*  239 */               revision = ((TCComponentBOMLine)this.targets[i]).getItemRevision();
/*  240 */               if (revision instanceof TCComponentMEProcessRevision)
/*  241 */                 meprocessRev = (TCComponentMEProcessRevision)this.targets[i]; 
/*  243 */               type = revision.getType();
/*  244 */             } catch (TCException e) {
/*  245 */               e.printStackTrace();
             } 
           } else {
/*  248 */             revision = (TCComponentItemRevision)this.targets[i];

//						String revisionType	=revision.getType();
//
//						if(revisionType.equals("NHL8_PartsRevision")||revisionType.equals("NHL8_ProductRevision")
//								||revisionType.equals("NHL8_FixtureRevision")) {
//							TCComponent masterComponent;
//							try {
//								masterComponent = revision.getRelatedComponent("IMAN_master_form_rev");
//								boolean isfpass = masterComponent.getLogicalProperty("nhl8_isfPass");
//								if(!isfpass) {
//									MessageBox.post("设计BOM和工艺BOM不一致，无法执行BOM导入ERP操作，请在ERP中手"
//											+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点。","提示",2);
//									return;
//								}
//							} catch (TCException e) {
//								// TODO Auto-generated catch block
//								e.printStackTrace();
//							}
//						}

/*  249 */             if (revision instanceof TCComponentMEProcessRevision)
/*  250 */               meprocessRev = (TCComponentMEProcessRevision)this.targets[i]; 
/*  252 */             type = revision.getType();
           } 
/*  254 */           if (this.listItemTypes.contains(type)) {
/*  255 */             AIFComponentContext[] referenceComponents = null;
             try {
/*  257 */               referenceComponents = revision.whereReferenced();
/*  258 */             } catch (TCException e) {
/*  259 */               e.printStackTrace();
             } 
/*  261 */             TCComponentMEProcessRevision meprocess_rev = null;
/*  262 */             int referenceNum = referenceComponents.length;
/*  263 */             int meprocessNum = 0;
/*  264 */             for (int k = 0; k < referenceNum; k++) {
/*  265 */               String comtype = referenceComponents[k].getComponent().getType();
/*  266 */               if (this.listProcessTypes.contains(comtype)) {
                 try {
/*  268 */                   TCComponentMEProcess meprocessItem = (TCComponentMEProcess)((TCComponentMEProcessRevision)referenceComponents[k].getComponent()).getItem();
/*  269 */                   TCComponentItemRevision[] releaseRevisions = meprocessItem.getReleasedItemRevisions();
/*  270 */                   int releaseRevisionNum = releaseRevisions.length;
/*  271 */                   if (releaseRevisionNum > 0) {
/*  272 */                     meprocess_rev = (TCComponentMEProcessRevision)releaseRevisions[0];
                   } else {
/*  274 */                     meprocess_rev = (TCComponentMEProcessRevision)meprocessItem.getLatestItemRevision();
                   } 
/*  276 */                 } catch (TCException e) {
/*  277 */                   e.printStackTrace();
                 } 
/*  279 */                 meprocessNum++;
               } 
             } 
						
/*  282 */             System.out.println("265 meprocess_rev===" + meprocess_rev);

						
/*  283 */             if (meprocess_rev != null) {
	
						
						if(meprocessRev.getType().equals("NHL8_AssemblyProRevision")){
							if(revision.getType().equals("NHL8_PartsRevision") ||revision.getType().equals("NHL8_ProductRevision") ) {
								TCComponent masterRev;
								try {
									masterRev = meprocess_rev.getRelatedComponent("IMAN_master_form_rev");
									boolean isfpass = masterRev.getLogicalProperty("nhl8_isfPass");
									
									
									if(!isfpass) {
										TCComponent relatedComponent = revision.getRelatedComponent("IMAN_master_form_rev");
										 Object obj[] = new Object[1];
										 obj[0] = 1;
										 TCUserService service = session.getUserService();
							   			 service.call("openByPass", obj);
							   			 relatedComponent.setLogicalProperty("nhl8_BOMimpSucc", true);
							   			 service.call("closeByPass", obj);
										MessageBox.post("设计BOM和工艺BOM不一致，无法执行BOM导入ERP操作，请在ERP中手"
												+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点。","提示",2);
										return;
									}
								} catch (TCException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
							}
						}
						
/*  284 */               if (meprocessNum > 1) {
/*  285 */                 findMore = true;
/*  286 */                 detailInfo.append(revision + "找到多个关联的工艺版本对象<br>");
               } 
/*  288 */               this.itemToMeprocessMap.put(revision, meprocess_rev);
/*  289 */               addItemRevision(meprocess_rev, revision);
             } else {
/*  291 */               notFind = true;
/*  292 */               addItemRevision(meprocess_rev, revision);
/*  293 */               detailInfo.append(revision + "没有找到关联的工艺对象<br>");
             } 
/*  295 */           } else if (this.listProcessTypes.contains(type)) {
/*  296 */             TCComponent[] metargets = null;
             try {
/*  298 */               metargets = meprocessRev.getRelatedComponents("IMAN_METarget");
						
/*  299 */             } catch (TCException e) {
/*  300 */               e.printStackTrace();
             } 
/*  302 */             int metargetsLen = metargets.length;
/*  303 */             if (metargetsLen == 0) {
/*  304 */               MessageBox.post(meprocessRev + "制造目标关系没有关联任何零组件!", "提示", 4);
               return;
             } 
/*  307 */             TCComponentItemRevision itemRev = (TCComponentItemRevision)metargets[0];
if(meprocessRev.getType().equals("NHL8_AssemblyProRevision")){
	if(itemRev.getType().equals("NHL8_PartsRevision") ||itemRev.getType().equals("NHL8_ProductRevision") ) {
		TCComponent masterRev;
		try {
			masterRev = meprocessRev.getRelatedComponent("IMAN_master_form_rev");
			boolean isfpass = masterRev.getLogicalProperty("nhl8_isfPass");
			
			
			if(!isfpass) {
				TCComponent relatedComponent = itemRev.getRelatedComponent("IMAN_master_form_rev");
				 Object obj[] = new Object[1];
				 obj[0] = 1;
				 TCUserService service = session.getUserService();
	   			 service.call("openByPass", obj);
	   			 relatedComponent.setLogicalProperty("nhl8_BOMimpSucc", true);
	   			 service.call("closeByPass", obj);
				MessageBox.post("设计BOM和工艺BOM不一致，无法执行BOM导入ERP操作，请在ERP中手"
						+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点。","提示",2);
				return;
			}
		} catch (TCException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
						
/*  308 */             this.itemToMeprocessMap.put(itemRev, meprocessRev);
/*  309 */             String comType = itemRev.getType();
/*  310 */             if (this.listItemTypes.contains(comType)) {
/*  311 */               addItemRevision(meprocessRev, itemRev);
             } else {
/*  313 */               MessageBox.post(meprocessRev + "制造目标关系关联零组件类型没有在首选项中配置!", "提示", 4);
               return;
             } 
           } else {
/*  318 */             MessageBox.post(this.application.getDesktop().getShell(), "请选中首选项中配置的Item版本对象！！", "警告", 4);
             return;
           } 
         } 
/*  322 */         if (notFind)
/*  323 */           resultInfo.append("有部分零组件对象没有关联的工艺对象<br>"); 
/*  325 */         if (findMore)
/*  326 */           resultInfo.append("有部分零组件对象找到多个关联的工艺版本对象<br>"); 
/*  328 */         if (!detailInfo.toString().equals("")) {
/*  329 */           loadDataForPrivilege(aimType, resultInfo, detailInfo);
         } else {
/*  331 */           loadDataForPrivilege(aimType, new StringBuffer(""), new StringBuffer(""));
         } 
/*  334 */       } else if (aimType.toString().equals("add")) {
/*  335 */         if (!UtilApi.getTaskBomAddResult(this.application, this.session, FileType.bom, "BOM传递新增结果", this, "bom", aimType)) {
						return; 
					}
						
/*  338 */       } else if (aimType.toString().equals("chg") && 
/*  339 */         !UtilApi.getTaskBomChgResult(this.application, this.session, FileType.bom, "BOM传递变更结果", this, "bom", aimType)) {
						return;
       } 
     } else {
/*  345 */       MessageBox.post(this.application.getDesktop().getShell(), "请您选择流程中的任务或工艺版本对象！！！", "警告", 4);
       return;
     } 
   }
//   gettarget
   
   public void postDialogForTask(AimType aimType) {
/*  351 */     List<String> listProcessAndTaskNames = new ArrayList<String>();
/*  352 */     String[] processAndTaskNames = this.ps.getStringArray(4, "NHL_BOMimpERP_MenuAuth");
/*  353 */     if (processAndTaskNames == null || processAndTaskNames.length == 0) {
/*  354 */       MessageBox.post("首选项NHL_BOMimpERP_MenuAuth尚未配置，请联系系统管理员！", "提示", 4);
       return;
     } 
/*  357 */     int nameLen = processAndTaskNames.length;
/*  358 */     for (int j = 0; j < nameLen; j++)
/*  359 */       listProcessAndTaskNames.add(processAndTaskNames[j].trim().replace("：", ":")); 
/*  362 */     for (int i = 0; i < this.targetNum; i++) {
/*  363 */       if (this.targets[i] instanceof TCComponentTask) {
/*  364 */         TCComponentTask task = (TCComponentTask)this.targets[i];
/*  365 */         String taskType = task.getType();
/*  366 */         String processAndTaskName = "";
/*  367 */         boolean isTaskPerformer = false;
					String errMsgCheck="";
         try {
/*  369 */           if (taskType.equals("EPMPerformSignoffTask")) {
/*  370 */             processAndTaskName = task.getRoot().getProcessDefinition().getName() + ":" + task.getParent().getName();
/*  371 */             TCComponentSignoff[] signoffs = task.getPredecessors()[0].getValidSignoffs();
/*  372 */             int signoffNum = signoffs.length;
/*  373 */             for (int k = 0; k < signoffNum; k++) {
/*  374 */               if (signoffs[k].getGroupMember().getUser().equals(this.currentUser)) {
/*  375 */                 isTaskPerformer = true;
                 break;
               } 
             } 
           } 
/*  380 */           if (listProcessAndTaskNames.contains(processAndTaskName) && isTaskPerformer) {
/*  381 */             TCComponent[] attachmentComponents = task.getRelatedComponents("root_target_attachments");
/*  382 */             int attachmentsLen = attachmentComponents.length;
/*  383 */             for (int k = 0; k < attachmentsLen; k++) {
/*  384 */               String type = attachmentComponents[k].getType();

					
/*  385 */               if (this.listProcessTypes.contains(type)) {
/*  386 */                 TCComponentMEProcessRevision meprocessRev = (TCComponentMEProcessRevision)attachmentComponents[k];
/*  387 */                 TCComponent[] metargets = meprocessRev.getRelatedComponents("IMAN_METarget");
/*  388 */                 int metargetsLen = metargets.length;
/*  389 */                 if (metargetsLen == 0) {
/*  390 */                   MessageBox.post(meprocessRev + "制造目标关系没有关联任何零组件!", "提示", 4);
                   return;
                 } 
/*  393 */                 TCComponentItemRevision itemRev = (TCComponentItemRevision)metargets[0];


						if(meprocessRev.getType().equals("NHL8_AssemblyProRevision")){
							if(itemRev.getType().equals("NHL8_PartsRevision") ||itemRev.getType().equals("NHL8_ProductRevision") ) {
								TCComponent masterRev;
								try {
									masterRev = meprocessRev.getRelatedComponent("IMAN_master_form_rev");
									boolean isfpass = masterRev.getLogicalProperty("nhl8_isfPass");
									String itemId = meprocessRev.getStringProperty("item_id");
									
									if(!isfpass) {
										TCComponent relatedComponent = itemRev.getRelatedComponent("IMAN_master_form_rev");
										 Object obj[] = new Object[1];
										 obj[0] = 1;
										 TCUserService service = session.getUserService();
							   			 service.call("openByPass", obj);
							   			 relatedComponent.setLogicalProperty("nhl8_BOMimpSucc", true);
							   			 service.call("closeByPass", obj);
						//				MessageBox.post("设计BOM和工艺BOM不一致，无法执行BOM导入ERP操作，请在ERP中手"
						//						+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点。","提示",2);
						//				return;
							   			errMsgCheck=errMsgCheck+itemId+"的设计BOM和工艺BOM不一致\n";
									}
								} catch (TCException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
								
							}
						}
							
/*  394 */                 this.itemToMeprocessMap.put(itemRev, meprocessRev);
/*  395 */                 String comType = itemRev.getType();
/*  396 */                 if (this.listItemTypes.contains(comType)) {
/*  397 */                   addItemRevision(meprocessRev, itemRev);
                 } else {
/*  399 */                   MessageBox.post(meprocessRev + "制造目标关系关联零组件类型没有在首选项中配置!", "提示", 4);
                   return;
                 } 
               } 
             } 
           } else {
/*  406 */             MessageBox.post(this.application.getDesktop().getShell(), "请选中有权限的任务对象！！", "警告", 4);
             return;
           } 
/*  409 */         } catch (TCException e) {
/*  410 */           e.printStackTrace();
/*  411 */         } catch (Exception e) {
/*  412 */           e.printStackTrace();
         } 
         if(!errMsgCheck.equals("")) {
				errMsgCheck=errMsgCheck+"无法执行BOM导入ERP操作，请在ERP中手"
						+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点";
				MessageBox.post(errMsgCheck,"提示",2);
				return;
			}
       } else {
/*  415 */         MessageBox.post(this.application.getDesktop().getShell(), "请确认选中的是任务对象！！", "警告", 4);
         return;
       } 
     } 
/*  419 */     loadData(aimType);
   }
   
   public void postDialogForBom(AimType aimType) {
/*  423 */     List<String> listProcessAndTaskNames = new ArrayList<String>();
/*  424 */     String[] processAndTaskNames = this.ps.getStringArray(4, "NHL_BOMimpERP_MenuAuth");
/*  425 */     if (processAndTaskNames == null || processAndTaskNames.length == 0) {
/*  426 */       MessageBox.post("首选项NHL_BOMimpERP_MenuAuth尚未配置，请联系系统管理员！", "提示", 4);
     } else {
/*  428 */       int nameLen = processAndTaskNames.length;
/*  429 */       for (int j = 0; j < nameLen; j++)
/*  430 */         listProcessAndTaskNames.add(processAndTaskNames[j].trim().replace("：", ":")); 
     } 
/*  433 */     for (int i = 0; i < this.targetNum; i++) {
/*  434 */       String type = this.targets[i].getType();


/*  435 */       if (this.listProcessTypes.contains(type)) {
/*  436 */         TCComponentMEProcessRevision meprocessRev = (TCComponentMEProcessRevision)this.targets[i];
/*  437 */         TCComponent[] metargets = null;
         try {
/*  439 */           metargets = meprocessRev.getRelatedComponents("IMAN_METarget");
/*  440 */         } catch (TCException e) {
/*  441 */           e.printStackTrace();
         } 
/*  443 */         int metargetsLen = metargets.length;
/*  444 */         if (metargetsLen == 0) {
/*  445 */           MessageBox.post(meprocessRev + "制造目标关系没有关联任何零组件!", "提示", 4);
           return;
         } 
/*  448 */         TCComponentItemRevision itemRev = (TCComponentItemRevision)metargets[0];
					if(meprocessRev.getType().equals("NHL8_AssemblyProRevision")){
						if(itemRev.getType().equals("NHL8_PartsRevision") ||itemRev.getType().equals("NHL8_ProductRevision") ) {
							TCComponent masterRev;
							try {
								masterRev = meprocessRev.getRelatedComponent("IMAN_master_form_rev");
								boolean isfpass = masterRev.getLogicalProperty("nhl8_isfPass");
								
								
								if(!isfpass) {
									TCComponent relatedComponent = itemRev.getRelatedComponent("IMAN_master_form_rev");
									 Object obj[] = new Object[1];
									 obj[0] = 1;
									 TCUserService service = session.getUserService();
						   			 service.call("openByPass", obj);
						   			 relatedComponent.setLogicalProperty("nhl8_BOMimpSucc", true);
						   			 service.call("closeByPass", obj);
									MessageBox.post("设计BOM和工艺BOM不一致，无法执行BOM导入ERP操作，请在ERP中手"
											+ "动录入工艺BOM。BOM录入成功后，可直接完成该任务节点。","提示",2);
									return;
								}
							} catch (TCException e) {
								// TODO Auto-generated catch block
								e.printStackTrace();
							}
							
						}
					}
					
         try {
/*  450 */           if ((itemRev.getReferenceListProperty("release_status_list")).length == 0) {
/*  451 */             MessageBox.post(itemRev + " 对象未发布", "警告", 4);
             return;
           } 
/*  454 */         } catch (TCException e) {
/*  455 */           e.printStackTrace();
         } 
/*  457 */         if (!revRefRightProcess(meprocessRev, listProcessAndTaskNames))
           return; 
/*  460 */         this.itemToMeprocessMap.put(itemRev, meprocessRev);
/*  461 */         String comType = itemRev.getType();
/*  462 */         if (this.listItemTypes.contains(comType)) {
/*  463 */           addItemRevision(meprocessRev, itemRev);
         } else {
/*  465 */           MessageBox.post(meprocessRev + "制造目标关系关联零组件类型没有在首选项中配置!", "提示", 4);
           return;
         } 
       } else {
/*  470 */         MessageBox.post(this.application.getDesktop().getShell(), "请您选择流程中的任务或工艺版本对象！！", "警告", 4);
         return;
       } 
     } 
/*  474 */     loadData(aimType);
   }
   
   private boolean revRefRightProcess(TCComponentMEProcessRevision meprocessRev, List<String> listProcessAndTaskNames) {
     try {
/*  479 */       TCComponent[] processStageList = meprocessRev.getReferenceListProperty("fnd0StartedWorkflowTasks");
/*  480 */       int listSize = processStageList.length;
/*  481 */       TCComponentTask referenceTask = null;
/*  482 */       if (listSize > 0) {
/*  483 */         String rootTaskName = processStageList[0].getProperty("object_name");
/*  484 */         for (int j = 1; j < listSize; j++) {
/*  485 */           if (listProcessAndTaskNames.contains(rootTaskName + ":" + processStageList[j].getProperty("object_name"))) {
/*  486 */             referenceTask = (TCComponentTask)processStageList[j];
             break;
           } 
         } 
/*  490 */         if (referenceTask != null) {
/*  491 */           TCComponentTask[] subTasks = referenceTask.getSubtasks();
/*  492 */           int subTaskNum = subTasks.length;
/*  493 */           boolean isTaskPerformer = false;
/*  494 */           for (int i = 0; i < subTaskNum; i++) {
/*  495 */             TCComponentTask subTask = subTasks[i];
/*  496 */             String taskType = subTask.getType();
/*  497 */             if (taskType.equals("EPMPerformSignoffTask")) {
/*  498 */               TCComponentSignoff[] signoffs = subTask.getPredecessors()[0].getValidSignoffs();
/*  499 */               int signoffNum = signoffs.length;
/*  500 */               for (int k = 0; k < signoffNum; k++) {
/*  501 */                 if (signoffs[k].getGroupMember().getUser().equals(this.currentUser)) {
/*  502 */                   isTaskPerformer = true;
                   break;
                 } 
               } 
               break;
             } 
           } 
/*  509 */           if (!isTaskPerformer) {
/*  510 */             MessageBox.post(this.application.getDesktop().getShell(), "请确定对工艺版本对象的操作权限！！", "警告", 4);
/*  511 */             return false;
           } 
         } else {
/*  514 */           MessageBox.post(this.application.getDesktop().getShell(), "请选中在正确流程节点中的工艺版本对象！！", "警告", 4);
/*  515 */           return false;
         } 
       } else {
/*  518 */         MessageBox.post(this.application.getDesktop().getShell(), "请选中在流程中的工艺版本对象！！", "警告", 4);
/*  519 */         return false;
       } 
/*  522 */     } catch (TCException e) {
/*  523 */       e.printStackTrace();
     } 
/*  525 */     return true;
   }
   
   public void loadDataForPrivilege(AimType aimType, StringBuffer resultInfo, StringBuffer detailInfo) {
/*  537 */     this.resultInfo = resultInfo;
/*  538 */     this.detailInfo = detailInfo;
/*  539 */     if (this.NoBomItemRevisions.size() > 0) {
/*  540 */       StringBuilder sb = new StringBuilder();
/*  541 */       for (TCComponentItemRevision itemRev : this.NoBomItemRevisions)
/*  542 */         sb.append(itemRev + "没有子BOM<br>"); 
/*  544 */       SwingUtilities.invokeLater((Runnable)new IsContinueDialog(this, "loadDataForPrivilege1", aimType, "有 " + this.NoBomItemRevisions.size() + " 个零组件没有子BOM对象", sb.toString()));
     } else {
/*  546 */       loadDataForPrivilege1(aimType);
     } 
   }
   
   public void loadDataForPrivilege1(AimType aimType) {
/*  553 */     if (this.NoBomItemRevisions.size() > 0) {
/*  554 */       Object[] obj = new Object[1];
/*  555 */       obj[0] = Integer.valueOf(11);
/*  556 */       TCUserService service = this.session.getUserService();
///*  557 */       for (TCComponentItemRevision itemRev : this.NoBomItemRevisions) {
//         try {
///*  559 */           service.call("openByPass", obj);
///*  560 */           TCComponentForm form = (TCComponentForm)itemRev.getRelatedComponent("IMAN_master_form_rev");
///*  561 */           form.setLogicalProperty("nhl8_BOMimpSucc", true);
///*  562 */           form.save();
///*  563 */           service.call("closeByPass", obj);
///*  564 */         } catch (TCException e) {
///*  565 */           e.printStackTrace();
//         } 
//       } 
     } 
/*  569 */     int revNum = this.ItemRevisions.size();
/*  570 */     if (revNum == 0) {
/*  571 */       MessageBox.post("有子BOM的零组件的数量为0", "提示", 4);
       return;
     } 
/*  574 */     int selectRevNoReleaseNum = 0;
/*  575 */     int materialNoReleaseNum = 0;
/*  576 */     int childRevNoReleaseNum = 0;
/*  577 */     for (int i = 0; i < revNum; i++) {
       try {
/*  579 */         TCComponentItemRevision ItemRev = this.ItemRevisions.get(i);
/*  580 */         Map<String, List<String>> item_map = new HashMap<String, List<String>>();
/*  581 */         TCComponent[] rev_release = ItemRev.getReferenceListProperty("release_status_list");
/*  582 */         if (rev_release.length == 0) {
/*  583 */           selectRevNoReleaseNum++;
/*  584 */           this.detailInfo.append(ItemRev + " 对象未发布<br>");
         } 
/*  587 */         List<String> bl_child_list = new ArrayList<String>();
/*  588 */         List<String> bl_quantity_list = new ArrayList<String>();
/*  589 */         List<String> nhl8_step_num_list = new ArrayList<String>();
/*  590 */         List<Vector> dataList = new ArrayList<Vector>();
/*  592 */         TCComponentMEProcessRevision parts_rev = null;
/*  593 */         TCComponentMEProcessRevision meprocess_rev = this.itemToMeprocessMap.get(ItemRev);
					System.out.println("999 === meprocess_rev type name"+meprocess_rev.getType()+meprocess_rev);
/*  595 */         if (meprocess_rev != null && meprocess_rev.getType().equals("NHL8_PartsProRevision")) {
						parts_rev = meprocess_rev; 
					}
/*  596 */           
/*  598 */         if (parts_rev != null) {
/*  599 */           TCComponent[] NHL8_MateriaRlation = parts_rev.getRelatedComponents("NHL8_MateriaRlation");
/*  601 */           if (NHL8_MateriaRlation == null || NHL8_MateriaRlation.length == 0) {
/*  602 */             MessageBox.post(this.application.getDesktop().getShell(), parts_rev + "没有关联的原材料", "警告", 4);
             return;
           } 
/*  606 */           TCComponentItemRevision materialCom = (TCComponentItemRevision)NHL8_MateriaRlation[0];
/*  607 */           if ((materialCom.getReferenceListProperty("release_status_list")).length == 0) {
/*  608 */             materialNoReleaseNum++;
/*  609 */             this.detailInfo.append(materialCom + " 对象未发布<br>");
           } 
/*  611 */           String[] revProNames = { "object_string", "item_id" };
/*  612 */           String[] revProValues = ItemRev.getProperties(revProNames);
/*  613 */           String parent_obj_str = revProValues[0];
/*  614 */           String parent_item_id = revProValues[1];
/*  615 */           TCComponentForm partRevform = (TCComponentForm)parts_rev.getRelatedComponent("IMAN_master_form_rev");
/*  616 */           double nhl8_GWeight = partRevform.getDoubleProperty("nhl8_GWeight");
/*  617 */           String gweight_str = "";
/*  619 */           if (NHL8_MateriaRlation[0].getType().equals("NHL8_RawMaterialRevision")) {
             try {
/*  621 */               double quantityNum = UtilApi.div(nhl8_GWeight, 1000.0D);
/*  622 */               gweight_str = UtilApi.subZeroAndDot(String.valueOf(quantityNum));
/*  623 */             } catch (NumberFormatException numberFormatException) {
/*  624 */               MessageBox.post(partRevform + "的毛重不能为空，请修改后再提交！", "错误", 1);
               return;
             } 
           } else {
/*  628 */             gweight_str = UtilApi.subZeroAndDot(String.valueOf(nhl8_GWeight));
           } 
/*  630 */           String[] comProValues = materialCom.getProperties(revProNames);
/*  631 */           String bl_child_line_name = comProValues[0];
/*  632 */           String bl_child_line_id = comProValues[1];
/*  633 */           bl_child_list.add(bl_child_line_id);
/*  634 */           bl_quantity_list.add(gweight_str);
/*  635 */           nhl8_step_num_list.add("10_");
/*  637 */           Vector<Object> vec = new Vector();
/*  638 */           vec.add(Integer.valueOf(2));
/*  639 */           vec.add(parent_obj_str);
/*  640 */           vec.add(bl_child_line_name);
/*  641 */           vec.add("10_");
/*  642 */           vec.add(gweight_str);
/*  644 */           dataList.add(vec);
/*  645 */           item_map.put("item_name", bl_child_list);
/*  646 */           item_map.put("item_quantity", bl_quantity_list);
/*  647 */           item_map.put("operation_seq_num", nhl8_step_num_list);
/*  648 */           this.id_to_list_map.put(parent_item_id, item_map);
/*  651 */           for (int m = 0; m < dataList.size(); m++) {
/*  652 */             Vector<Object> vector = dataList.get(m);
/*  653 */             this.data.add(vector);
           } 
         } else {
/*  657 */           TCComponentBOMLine topbomline = UtilApi.getNewBOMLine(this.session, ItemRev, null);
/*  658 */           String bl_line_name = topbomline.getProperty("bl_line_name");
/*  659 */           String bl_line_id = topbomline.getProperty("bl_item_item_id");
/*  660 */           AIFComponentContext[] childrenContexts = topbomline.getChildren();
/*  661 */           int childCount = childrenContexts.length;
/*  662 */           boolean isNeedUnPack = false;
/*  663 */           List<String> idList1 = new ArrayList<String>();
/*  664 */           Map<String, Double> idToQuantityMap1 = new HashMap<String, Double>();
/*  665 */           for (int j = 0; j < childCount; j++) {
					try {
/*  667 */               TCComponentBOMLine childbomline = (TCComponentBOMLine)childrenContexts[j].getComponent();
/*  668 */               String bl_child_line_name = childbomline.getProperty("bl_line_name");
/*  669 */               String bl_chlid_line_id = childbomline.getProperty("bl_item_item_id");
/*  670 */               String bl_quantity = childbomline.getProperty("bl_quantity");
/*  671 */               if (!bl_quantity.equals("")) {
/*  672 */                 bl_quantity = UtilApi.subZeroAndDot(bl_quantity);
			               } else {
			/*  674 */           bl_quantity = "1";
			               } 
/*  677 */               String nhl8_step_num =  childbomline.getProperty("NHL8_step_num"); // 10_xxxx
/*  678 */               if (nhl8_step_num.equals("")) {
/*  679 */                 MessageBox.post(this.application.getDesktop().getShell(), "设计BOM不能导入ERP,请重新选择！！！", "警告", 4);
		                 return;
		               } 
/*  682 */               if (nhl8_step_num.contains("已打包的注释")) {
/*  683 */                 isNeedUnPack = true;
/*  685 */               } else if (nhl8_step_num.contains(",")) {
/*  686 */                 String[] arrStr = nhl8_step_num.split(",");
/*  687 */                 int arrLen = arrStr.length;
/*  688 */                 for (int k = 0; k < arrLen; k++) {
/*  689 */                   String[] str = arrStr[k].split("×");
							if(arrStr[k].contains("x")) {
								str = arrStr[k].split("x");
							}
/*  690 */                   nhl8_step_num = str[0];
/*  691 */                   bl_quantity = str[1];
							if(childbomline.getProperty("bl_occ_type").equals("MEDisassemble")|| childbomline.getProperty("bl_occ_type").equals("拆卸")) {
								if(!bl_quantity.startsWith("-")) {
									bl_quantity="-"+bl_quantity;
									System.out.println("MEDisassemble"+bl_quantity);
								}
							}
/*  692 */                   String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/*  693 */                   System.out.println("666 id_and_stepNum==" + id_and_stepNum);
/*  694 */                   if (!idList1.contains(id_and_stepNum))
/*  695 */                     idList1.add(id_and_stepNum); 
/*  697 */                   if (idToQuantityMap1.get(id_and_stepNum) == null) {
/*  698 */                     idToQuantityMap1.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
		                   } else {
		/*  700 */              idToQuantityMap1.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap1.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
		                   } 
		                 } 
		               } else {
/*  704 */                 if (nhl8_step_num.contains("×")) {
								nhl8_step_num = nhl8_step_num.split("×")[0]; 
							}else if (nhl8_step_num.contains("x")) {
								nhl8_step_num = nhl8_step_num.split("x")[0]; 
							}
/*  705 */                  if(childbomline.getProperty("bl_occ_type").equals("MEDisassemble")|| childbomline.getProperty("bl_occ_type").equals("拆卸")) {
							if(!bl_quantity.startsWith("-")) {
								bl_quantity="-"+bl_quantity;
								System.out.println("MEDisassemble"+bl_quantity);
							}
						}
/*  707 */                 String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/*  708 */                 System.out.println("680 id_and_stepNum==" + id_and_stepNum);
/*  709 */                 if (!idList1.contains(id_and_stepNum))
/*  710 */                   idList1.add(id_and_stepNum); 
/*  712 */                 if (idToQuantityMap1.get(id_and_stepNum) == null) {
/*  713 */                   idToQuantityMap1.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
		                 } else {
		/*  715 */                   idToQuantityMap1.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap1.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
		                 } 
		               } 
/*  719 */             } catch (Exception e) {
/*  720 */               e.printStackTrace();
		             } 
		           } 
/*  725 */           if (isNeedUnPack) {
/*  726 */             bl_child_list.clear();
/*  727 */             bl_quantity_list.clear();
/*  728 */             nhl8_step_num_list.clear();
/*  729 */             dataList.clear();
/*  731 */             if (isNeedUnPack) {
/*  732 */               childrenContexts = unpack(topbomline, childCount);
/*  733 */               childCount = childrenContexts.length;
             } 
/*  736 */             List<String> idList = new ArrayList<String>();
/*  737 */             Map<String, Double> idToQuantityMap = new HashMap<String, Double>();
/*  738 */             for (int k = 0; k < childCount; k++) {
               try {
/*  740 */                 TCComponentBOMLine childbomline = (TCComponentBOMLine)childrenContexts[k].getComponent();
/*  741 */                 String bl_child_line_name = childbomline.getProperty("bl_line_name");
/*  742 */                 String bl_chlid_line_id = childbomline.getProperty("bl_item_item_id");
/*  743 */                 String bl_quantity = childbomline.getProperty("bl_quantity");
/*  744 */                 if (!bl_quantity.equals("")) {
/*  745 */                   bl_quantity = UtilApi.subZeroAndDot(bl_quantity);
		                 } else {
		/*  747 */                   bl_quantity = "1";
		                 } 
/*  749 */                 String nhl8_step_num = childbomline.getProperty("NHL8_step_num");
/*  750 */                 if (nhl8_step_num.equals("")) {
/*  751 */                   MessageBox.post(this.application.getDesktop().getShell(), "设计BOM不能导入ERP,请重新选择！！！", "警告", 4);
                   return;
                 } 
/*  754 */                 if (nhl8_step_num.contains(",")) {
/*  755 */                   String[] arrStr = nhl8_step_num.split(",");
/*  756 */                   int arrLen = arrStr.length;
/*  757 */                   for (int i1 = 0; i1 < arrLen; i1++) {
/*  758 */                     String[] str = arrStr[i1].split("×");
								if(arrStr[i1].contains("x")) {
									str = arrStr[i1].split("x");
								}
/*  759 */                     nhl8_step_num = str[0];
/*  760 */                     bl_quantity = str[1];
								if(childbomline.getProperty("bl_occ_type").equals("MEDisassemble")|| childbomline.getProperty("bl_occ_type").equals("拆卸")) {
									if(!bl_quantity.startsWith("-")) {
										bl_quantity="-"+bl_quantity;
										System.out.println("MEDisassemble"+bl_quantity);
									}
								}
/*  761 */                     String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/*  762 */                     if (!idList.contains(id_and_stepNum))
/*  763 */                       idList.add(id_and_stepNum); 
/*  765 */                     if (idToQuantityMap.get(id_and_stepNum) == null) {
/*  766 */                       idToQuantityMap.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
                     } else {
/*  768 */                       idToQuantityMap.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
                     } 
                   } 
                 } else {
/*  772 */                   if (nhl8_step_num.contains("×")) {
								nhl8_step_num = nhl8_step_num.split("×")[0]; 
							}else if (nhl8_step_num.contains("x")) {
								nhl8_step_num = nhl8_step_num.split("x")[0]; 
							}
/*  773 */                     
/*  775 */                   String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/*  776 */                   if (!idList.contains(id_and_stepNum))
/*  777 */                     idList.add(id_and_stepNum); 
/*  779 */                   if (idToQuantityMap.get(id_and_stepNum) == null) {
/*  780 */                     idToQuantityMap.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
                   } else {
/*  782 */                     idToQuantityMap.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
                   } 
                 } 
/*  786 */               } catch (Exception e) {
/*  787 */                 e.printStackTrace();
               } 
             } 
/*  790 */             int listSize = idList.size();
/*  791 */             for (int n = 0; n < listSize; n++) {
/*  792 */               String[] arrStr = ((String)idList.get(n)).split("&");
/*  793 */               String bl_chlid_line_id = arrStr[0];
/*  794 */               String bl_child_line_name = arrStr[1].split("\\(视图")[0];
/*  795 */               String nhl8_step_num = arrStr[2];
/*  796 */               String bl_quantity = ((Double)idToQuantityMap.get(idList.get(n))).toString();
/*  797 */               bl_quantity = bl_quantity.replaceAll("\\.0+$", "");
/*  798 */               bl_child_list.add(bl_chlid_line_id);
/*  799 */               bl_quantity_list.add(bl_quantity);
/*  800 */               nhl8_step_num_list.add(nhl8_step_num);
/*  802 */               Vector<Object> vec = new Vector();
/*  803 */               vec.add(Integer.valueOf(2));
/*  804 */               vec.add(bl_line_name);
/*  805 */               vec.add(bl_child_line_name);
/*  806 */               vec.add(nhl8_step_num);
/*  807 */               vec.add(bl_quantity);
/*  809 */               dataList.add(vec);
             } 
/*  812 */             item_map.put("item_name", bl_child_list);
/*  813 */             item_map.put("item_quantity", bl_quantity_list);
/*  814 */             item_map.put("operation_seq_num", nhl8_step_num_list);
/*  815 */             idToQuantityMap.clear();
           } else {
/*  817 */             int listSize = idList1.size();
/*  818 */             for (int k = 0; k < listSize; k++) {
/*  819 */               System.out.println("788 idList1.get(m)==" + (String)idList1.get(k));
/*  820 */               String[] arrStr = ((String)idList1.get(k)).split("&");
/*  821 */               String bl_chlid_line_id = arrStr[0];
/*  822 */               String bl_child_line_name = arrStr[1].split("\\(视图")[0];
/*  823 */               String nhl8_step_num = arrStr[2];
/*  824 */               String bl_quantity = ((Double)idToQuantityMap1.get(idList1.get(k))).toString();
/*  825 */               bl_quantity = bl_quantity.replaceAll("\\.0+$", "");
/*  826 */               bl_child_list.add(bl_chlid_line_id);
/*  827 */               bl_quantity_list.add(bl_quantity);
/*  828 */               nhl8_step_num_list.add(nhl8_step_num);
/*  830 */               Vector<Object> vec = new Vector();
/*  831 */               vec.add(Integer.valueOf(2));
/*  832 */               vec.add(bl_line_name);
/*  833 */               vec.add(bl_child_line_name);
/*  834 */               vec.add(nhl8_step_num);
/*  835 */               vec.add(bl_quantity);
/*  837 */               dataList.add(vec);
             } 
/*  839 */             item_map.put("item_name", bl_child_list);
/*  840 */             item_map.put("item_quantity", bl_quantity_list);
/*  841 */             item_map.put("operation_seq_num", nhl8_step_num_list);
/*  842 */             idToQuantityMap1.clear();
           } 
/*  844 */           this.id_to_list_map.put(bl_line_id, item_map);
/*  847 */           for (int m = 0; m < dataList.size(); m++) {
/*  848 */             Vector<Object> vector = dataList.get(m);
/*  849 */             this.data.add(vector);
           } 
         } 
/*  854 */       } catch (TCException e) {
/*  855 */         e.printStackTrace();
       } 
     } 
/*  858 */     if (selectRevNoReleaseNum > 0)
/*  859 */       this.resultInfo.append("所选对象中存在未发布的；<br>"); 
/*  861 */     if (materialNoReleaseNum > 0)
/*  862 */       this.resultInfo.append("所选对象中存在关联的零件工艺对应的原材料未发布；<br>"); 
/*  864 */     if (childRevNoReleaseNum > 0)
/*  865 */       this.resultInfo.append("所选对象中存在子BOM未发布的"); 
/*  867 */     if (!this.resultInfo.toString().equals("")) {
/*  868 */       SwingUtilities.invokeLater((Runnable)new IsContinueDialog(this, aimType, this.resultInfo.toString(), this.detailInfo.toString()));
     } else {
/*  870 */       postDialog(aimType);
     } 
   }
   
   public void postDialog(AimType aimType) {
/*  876 */     if (aimType.toString().equals("add")) {
/*  877 */       SwingUtilities.invokeLater((Runnable)new BomAddTransferDialog(this.session, this.application, this.ItemRevisions, this.id_to_list_map, this.data));
/*  878 */     } else if (aimType.toString().equals("chg")) {
/*  879 */       Object[] obj = new Object[1];
/*  880 */       obj[0] = Integer.valueOf(11);
/*  881 */       TCUserService service = this.session.getUserService();
/*  882 */       for (int i = 0; i < this.ItemRevisions.size(); i++) {
         try {
/*  884 */           service.call("openByPass", obj);
/*  885 */           TCComponentForm form = (TCComponentForm)((TCComponentItemRevision)this.ItemRevisions.get(i)).getRelatedComponent("IMAN_master_form_rev");
/*  886 */           form.setLogicalProperty("nhl8_BOMimpSucc", false);
/*  887 */           form.save();
/*  888 */           service.call("closeByPass", obj);
/*  889 */         } catch (TCException e) {
/*  890 */           e.printStackTrace();
         } 
       } 
/*  893 */       SwingUtilities.invokeLater((Runnable)new BomChgTransferDialog(this.session, this.application, this.ItemRevisions, this.id_to_list_map, this.data));
     } 
   }
   
   public void postDialog2(AimType aimType) {
/*  898 */     if (aimType.toString().equals("add")) {
/*  899 */       SwingUtilities.invokeLater((Runnable)new BomAddTransferDialog(this.session, this.application, this.ItemRevisions, this.id_to_list_map, this.data));
/*  900 */     } else if (aimType.toString().equals("chg")) {
/*  901 */       Object[] obj = new Object[1];
/*  902 */       obj[0] = Integer.valueOf(11);
/*  903 */       TCUserService service = this.session.getUserService();
/*  904 */       for (int i = 0; i < this.ItemRevisions.size(); i++) {
         try {
/*  906 */           service.call("openByPass", obj);
/*  907 */           TCComponentForm form = (TCComponentForm)((TCComponentItemRevision)this.ItemRevisions.get(i)).getRelatedComponent("IMAN_master_form_rev");
/*  908 */           form.setLogicalProperty("nhl8_BOMimpSucc", false);
/*  909 */           form.save();
/*  910 */           service.call("closeByPass", obj);
/*  911 */         } catch (TCException e) {
/*  912 */           e.printStackTrace();
         } 
       } 
/*  915 */       SwingUtilities.invokeLater((Runnable)new BomChgTransferDialog(this.session, this.application, this.ItemRevisions, this.id_to_list_map, this.data));
     } 
   }
   
   public void loadData(AimType aimType) {
/*  921 */     if (this.NoBomItemRevisions.size() > 0) {
/*  922 */       StringBuilder sb = new StringBuilder();
/*  923 */       for (TCComponentItemRevision itemRev : this.NoBomItemRevisions)
/*  924 */         sb.append(itemRev + "没有子BOM<br>"); 
/*  926 */       SwingUtilities.invokeLater((Runnable)new IsContinueDialog(this, "loadData1", aimType, "有 " + this.NoBomItemRevisions.size() + " 个零组件没有子BOM对象", sb.toString()));
     } else {
/*  928 */       loadData1(aimType);
     } 
   }
   
   public void loadData1(AimType aimType) {
/*  937 */     if (this.NoBomItemRevisions.size() > 0) {
/*  938 */       Object[] obj = new Object[1];
/*  939 */       obj[0] = Integer.valueOf(11);
/*  940 */       TCUserService service = this.session.getUserService();
///*  941 */       for (TCComponentItemRevision itemRev : this.NoBomItemRevisions) {
//         try {
///*  943 */           service.call("openByPass", obj);
///*  944 */           TCComponentForm form = (TCComponentForm)itemRev.getRelatedComponent("IMAN_master_form_rev");
///*  945 */           form.setLogicalProperty("nhl8_BOMimpSucc", true);
///*  946 */           form.save();
///*  947 */           service.call("closeByPass", obj);
///*  948 */         } catch (TCException e) {
///*  949 */           e.printStackTrace();
//         } 
//       } 
     } 
/*  953 */     int revNum = this.ItemRevisions.size();
/*  954 */     if (revNum == 0) {
/*  955 */       MessageBox.post("有子BOM的零组件的数量为0", "提示", 4);
       return;
     } 
/*  958 */     for (int i = 0; i < revNum; i++) {
       try {
/*  960 */         List<Vector> dataList = new ArrayList<Vector>();
/*  961 */         TCComponentItemRevision ItemRev = this.ItemRevisions.get(i);
/*  962 */         Map<String, List<String>> item_map = new HashMap<String, List<String>>();
/*  963 */         TCComponent[] rev_release = ItemRev.getReferenceListProperty("release_status_list");
/*  964 */         if (rev_release.length == 0) {
/*  965 */           MessageBox.post(ItemRev + " 对象未发布", "警告", 4);
           return;
         } 
/*  969 */         List<String> bl_child_list = new ArrayList<String>();
/*  970 */         List<String> bl_quantity_list = new ArrayList<String>();
/*  971 */         List<String> nhl8_step_num_list = new ArrayList<String>();
/*  973 */         TCComponentMEProcessRevision parts_rev = null;
/*  974 */         TCComponentMEProcessRevision meprocess_rev = this.itemToMeprocessMap.get(ItemRev);
/*  975 */         if (meprocess_rev.getType().equals("NHL8_PartsProRevision"))
/*  976 */           parts_rev = meprocess_rev; 
/*  978 */         if (parts_rev != null) {
/*  979 */           TCComponent[] NHL8_MateriaRlation = parts_rev.getRelatedComponents("NHL8_MateriaRlation");
/*  981 */           if (NHL8_MateriaRlation == null || NHL8_MateriaRlation.length == 0) {
/*  982 */             MessageBox.post(this.application.getDesktop().getShell(), parts_rev + "没有关联的原材料", "警告", 4);
             return;
           } 
/*  985 */           TCComponentItemRevision materialCom = (TCComponentItemRevision)NHL8_MateriaRlation[0];
/*  986 */           if ((materialCom.getReferenceListProperty("release_status_list")).length == 0) {
/*  987 */             MessageBox.post(this.application.getDesktop().getShell(), materialCom + " 对象未发布", "警告", 4);
             return;
           } 
/*  990 */           String[] revProNames = { "object_string", "item_id" };
/*  991 */           String[] revProValues = ItemRev.getProperties(revProNames);
/*  992 */           String parent_obj_str = revProValues[0];
/*  993 */           String parent_item_id = revProValues[1];
/*  994 */           TCComponentForm partRevform = (TCComponentForm)parts_rev.getRelatedComponent("IMAN_master_form_rev");
/*  995 */           double nhl8_GWeight = partRevform.getDoubleProperty("nhl8_GWeight");
/*  996 */           String gweight_str = "";
/*  998 */           if (NHL8_MateriaRlation[0].getType().equals("NHL8_RawMaterialRevision")) {
             try {
/* 1000 */               double quantityNum = UtilApi.div(nhl8_GWeight, 1000.0D);
/* 1001 */               gweight_str = UtilApi.subZeroAndDot(String.valueOf(quantityNum));
/* 1002 */             } catch (NumberFormatException numberFormatException) {
/* 1003 */               MessageBox.post(partRevform + "的毛重不能为空，请修改后再提交！", "错误", 1);
               return;
             } 
           } else {
/* 1007 */             gweight_str = UtilApi.subZeroAndDot(String.valueOf(nhl8_GWeight));
           } 
/* 1010 */           String[] comProValues = materialCom.getProperties(revProNames);
/* 1011 */           String bl_child_line_name = comProValues[0];
/* 1012 */           String bl_child_line_id = comProValues[1];
/* 1013 */           bl_child_list.add(bl_child_line_id);
/* 1014 */           bl_quantity_list.add(gweight_str);
/* 1015 */           nhl8_step_num_list.add("10_");
/* 1017 */           Vector<Object> vec = new Vector();
/* 1018 */           vec.add(Integer.valueOf(2));
/* 1019 */           vec.add(parent_obj_str);
/* 1020 */           vec.add(bl_child_line_name);
/* 1021 */           vec.add("10_");
/* 1022 */           vec.add(gweight_str);
/* 1024 */           dataList.add(vec);
/* 1025 */           item_map.put("item_name", bl_child_list);
/* 1026 */           item_map.put("item_quantity", bl_quantity_list);
/* 1027 */           item_map.put("operation_seq_num", nhl8_step_num_list);
/* 1028 */           this.id_to_list_map.put(parent_item_id, item_map);
/* 1030 */           for (int m = 0; m < dataList.size(); m++) {
/* 1031 */             Vector<Object> vector = dataList.get(m);
/* 1032 */             this.data.add(vector);
           } 
         } else {
/* 1036 */           TCComponentBOMLine topbomline = UtilApi.getNewBOMLine(this.session, ItemRev, null);
/* 1037 */           String bl_line_name = topbomline.getProperty("bl_line_name");
/* 1038 */           String bl_line_id = topbomline.getProperty("bl_item_item_id");
/* 1039 */           AIFComponentContext[] childrenContexts = topbomline.getChildren();
/* 1040 */           int childCount = childrenContexts.length;
/* 1041 */           boolean isNeedUnPack = false;
/* 1042 */           List<String> idList1 = new ArrayList<String>();
/* 1043 */           Map<String, Double> idToQuantityMap1 = new HashMap<String, Double>();
/* 1044 */           for (int j = 0; j < childCount; j++) {
             try {
/* 1046 */               TCComponentBOMLine childbomline = (TCComponentBOMLine)childrenContexts[j].getComponent();
/* 1047 */               String bl_child_line_name = childbomline.getProperty("bl_line_name");
/* 1048 */               String bl_chlid_line_id = childbomline.getProperty("bl_item_item_id");
/* 1049 */               String bl_quantity = childbomline.getProperty("bl_quantity");
/* 1050 */               if (!bl_quantity.equals("")) {
/* 1051 */                 bl_quantity = UtilApi.subZeroAndDot(bl_quantity);
               } else {
/* 1053 */                 bl_quantity = "1";
               } 
/* 1055 */               String nhl8_step_num = childbomline.getProperty("NHL8_step_num");
/* 1056 */               if (nhl8_step_num.equals("")) {
/* 1057 */                 MessageBox.post(this.application.getDesktop().getShell(), "设计BOM不能导入ERP,请重新选择！！！", "警告", 4);
                 return;
               } 
/* 1060 */               if (nhl8_step_num.contains("已打包的注释")) {
/* 1061 */                 isNeedUnPack = true;
/* 1063 */               } else if (nhl8_step_num.contains(",")) {
/* 1064 */                 String[] arrStr = nhl8_step_num.split(",");
/* 1065 */                 int arrLen = arrStr.length;
/* 1066 */                 for (int k = 0; k < arrLen; k++) {
/* 1067 */                   String[] str = arrStr[k].split("×");
								if(arrStr[k].contains("x")) {
									str = arrStr[k].split("x");
								}
/* 1068 */                   nhl8_step_num = str[0];
/* 1069 */                   bl_quantity = str[1];
/* 1070 */                   String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/* 1071 */                   if (!idList1.contains(id_and_stepNum))
/* 1072 */                     idList1.add(id_and_stepNum); 
							if(childbomline.getProperty("bl_occ_type").equals("MEDisassemble") || childbomline.getProperty("bl_occ_type").equals("拆卸")) {
								if(!bl_quantity.startsWith("-")) {
									bl_quantity="-"+bl_quantity;
									System.out.println("MEDisassemble"+bl_quantity);
								}
							}
/* 1074 */                   if (idToQuantityMap1.get(id_and_stepNum) == null) {
/* 1075 */                     idToQuantityMap1.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
                   } else {
/* 1077 */                     idToQuantityMap1.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap1.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
                   } 
                 } 
               } else {
/* 1081 */                 if (nhl8_step_num.contains("×"))
/* 1082 */                   nhl8_step_num = nhl8_step_num.split("×")[0]; 
							if(nhl8_step_num.contains("x")) {
								nhl8_step_num = nhl8_step_num.split("x")[0];
							}
/* 1084 */                 String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/* 1085 */                 if (!idList1.contains(id_and_stepNum))
/* 1086 */                   idList1.add(id_and_stepNum); 
							if(childbomline.getProperty("bl_occ_type").equals("MEDisassemble")|| childbomline.getProperty("bl_occ_type").equals("拆卸")) {
								if(!bl_quantity.startsWith("-")) {
									bl_quantity="-"+bl_quantity;
									System.out.println("MEDisassemble"+bl_quantity);
								}
							}
/* 1088 */                 if (idToQuantityMap1.get(id_and_stepNum) == null) {
/* 1089 */                   idToQuantityMap1.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
                 } else {
/* 1091 */                   idToQuantityMap1.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap1.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
                 } 
               } 
/* 1109 */             } catch (Exception e) {
/* 1110 */               e.printStackTrace();
             } 
           } 
/* 1114 */           if (isNeedUnPack) {
/* 1115 */             bl_child_list.clear();
/* 1116 */             bl_quantity_list.clear();
/* 1117 */             nhl8_step_num_list.clear();
/* 1118 */             dataList.clear();
/* 1120 */             if (isNeedUnPack) {
/* 1121 */               System.out.println("childCount=" + childCount);
/* 1122 */               childrenContexts = unpack(topbomline, childCount);
/* 1123 */               childCount = childrenContexts.length;
/* 1124 */               System.out.println("childCount=" + childCount);
             } 
/* 1127 */             List<String> idList = new ArrayList<String>();
/* 1128 */             Map<String, Double> idToQuantityMap = new HashMap<String, Double>();
/* 1129 */             for (int k = 0; k < childCount; k++) {
               try {
/* 1131 */                 TCComponentBOMLine childbomline = (TCComponentBOMLine)childrenContexts[k].getComponent();
/* 1132 */                 String bl_child_line_name = childbomline.getProperty("bl_line_name");
/* 1133 */                 String bl_chlid_line_id = childbomline.getProperty("bl_item_item_id");
/* 1134 */                 String bl_quantity = childbomline.getProperty("bl_quantity");
/* 1135 */                 if (!bl_quantity.equals("")) {
/* 1136 */                   bl_quantity = UtilApi.subZeroAndDot(bl_quantity);
                 } else {
/* 1138 */                   bl_quantity = "1";
                 } 
/* 1140 */                 String nhl8_step_num = childbomline.getProperty("NHL8_step_num");
/* 1141 */                 if (nhl8_step_num.equals("")) {
/* 1142 */                   MessageBox.post(this.application.getDesktop().getShell(), "设计BOM不能导入ERP,请重新选择！！！", "警告", 4);
                   return;
                 } 
/* 1145 */                 if (nhl8_step_num.contains(",")) {
/* 1146 */                   String[] arrStr = nhl8_step_num.split(",");
/* 1147 */                   int arrLen = arrStr.length;
/* 1148 */                   for (int i1 = 0; i1 < arrLen; i1++) {
/* 1149 */                     String[] str = arrStr[i1].split("×");
								if(arrStr[i1].contains("x")) {
									str = arrStr[i1].split("x");
								}
/* 1150 */                     nhl8_step_num = str[0];
/* 1151 */                     bl_quantity = str[1];
/* 1152 */                     String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/* 1153 */                     if (!idList.contains(id_and_stepNum))
/* 1154 */                       idList.add(id_and_stepNum); 

							if(childbomline.getProperty("bl_occ_type").equals("MEDisassemble")|| childbomline.getProperty("bl_occ_type").equals("拆卸")) {
								if(!bl_quantity.startsWith("-")) {
									bl_quantity="-"+bl_quantity;
								}
							}
/* 1156 */                     if (idToQuantityMap.get(id_and_stepNum) == null) {
/* 1157 */                       idToQuantityMap.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
                     } else {
/* 1159 */                       idToQuantityMap.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
                     } 
                   } 
                 } else {
/* 1163 */                   if (nhl8_step_num.contains("×"))
/* 1164 */                     nhl8_step_num = nhl8_step_num.split("×")[0]; 
							if(nhl8_step_num.contains("x")) {
								nhl8_step_num = nhl8_step_num.split("x")[0];
							}
/* 1166 */                   String id_and_stepNum = bl_chlid_line_id + "&" + bl_child_line_name + "&" + nhl8_step_num;
/* 1167 */                   if (!idList.contains(id_and_stepNum))
/* 1168 */                     idList.add(id_and_stepNum); 

							if(childbomline.getProperty("bl_occ_type").equals("MEDisassemble")|| childbomline.getProperty("bl_occ_type").equals("拆卸")) {
								if(!bl_quantity.startsWith("-")) {
									bl_quantity="-"+bl_quantity;
									System.out.println("MEDisassemble"+bl_quantity);
								}
							}
/* 1170 */                   if (idToQuantityMap.get(id_and_stepNum) == null) {
/* 1171 */                     idToQuantityMap.put(id_and_stepNum, Double.valueOf(Double.parseDouble(bl_quantity)));
                   } else {
/* 1173 */                     idToQuantityMap.put(id_and_stepNum, Double.valueOf(((Double)idToQuantityMap.get(id_and_stepNum)).doubleValue() + Double.parseDouble(bl_quantity)));
                   } 
                 } 
/* 1177 */               } catch (Exception e) {
/* 1178 */                 e.printStackTrace();
               } 
             } 
/* 1181 */             int listSize = idList.size();
/* 1182 */             for (int n = 0; n < listSize; n++) {
/* 1183 */               String[] arrStr = ((String)idList.get(n)).split("&");
/* 1184 */               String bl_chlid_line_id = arrStr[0];
/* 1185 */               String bl_child_line_name = arrStr[1];
/* 1186 */               String nhl8_step_num = arrStr[2];
/* 1187 */               String bl_quantity = ((Double)idToQuantityMap.get(idList.get(n))).toString();
/* 1188 */               bl_quantity = bl_quantity.replaceAll("\\.0+$", "");
/* 1190 */               bl_child_list.add(bl_chlid_line_id);
/* 1191 */               bl_quantity_list.add(bl_quantity);
/* 1192 */               nhl8_step_num_list.add(nhl8_step_num);
/* 1194 */               Vector<Object> vec = new Vector();
/* 1195 */               vec.add(Integer.valueOf(2));
/* 1196 */               vec.add(bl_line_name);
/* 1197 */               vec.add(bl_child_line_name);
/* 1198 */               vec.add(nhl8_step_num);
/* 1199 */               vec.add(bl_quantity);
/* 1200 */               dataList.add(vec);
             } 
/* 1203 */             item_map.put("item_name", bl_child_list);
/* 1204 */             item_map.put("item_quantity", bl_quantity_list);
/* 1205 */             item_map.put("operation_seq_num", nhl8_step_num_list);
/* 1206 */             idToQuantityMap.clear();
           } else {
/* 1208 */             int listSize = idList1.size();
/* 1209 */             for (int k = 0; k < listSize; k++) {
/* 1210 */               String[] arrStr = ((String)idList1.get(k)).split("&");
/* 1211 */               String bl_chlid_line_id = arrStr[0];
/* 1212 */               String bl_child_line_name = arrStr[1];
/* 1213 */               String nhl8_step_num = arrStr[2];
/* 1214 */               String bl_quantity = ((Double)idToQuantityMap1.get(idList1.get(k))).toString();
/* 1215 */               bl_quantity = bl_quantity.replaceAll("\\.0+$", "");
/* 1217 */               bl_child_list.add(bl_chlid_line_id);
/* 1218 */               bl_quantity_list.add(bl_quantity);
/* 1219 */               nhl8_step_num_list.add(nhl8_step_num);
/* 1221 */               Vector<Object> vec = new Vector();
/* 1222 */               vec.add(Integer.valueOf(2));
/* 1223 */               vec.add(bl_line_name);
/* 1224 */               vec.add(bl_child_line_name);
/* 1225 */               vec.add(nhl8_step_num);
/* 1226 */               vec.add(bl_quantity);
/* 1227 */               dataList.add(vec);
             } 
/* 1231 */             item_map.put("item_name", bl_child_list);
/* 1232 */             item_map.put("item_quantity", bl_quantity_list);
/* 1233 */             item_map.put("operation_seq_num", nhl8_step_num_list);
/* 1234 */             idToQuantityMap1.clear();
           } 
/* 1237 */           this.id_to_list_map.put(bl_line_id, item_map);
/* 1240 */           for (int m = 0; m < dataList.size(); m++) {
/* 1241 */             Vector<Object> vector = dataList.get(m);
/* 1242 */             this.data.add(vector);
           } 
         } 
/* 1246 */       } catch (TCException e) {
/* 1247 */         e.printStackTrace();
       } 
     } 
/* 1250 */     postDialog2(aimType);
   }
   
   public AIFComponentContext[] unpack(TCComponentBOMLine topbomline, int childCount) {
/* 1254 */     UnpackOperation unpackoperation = new UnpackOperation(topbomline);
/* 1255 */     this.session.queueOperation((AbstractAIFOperation)unpackoperation);
/* 1256 */     AIFComponentContext[] childrenContexts = null;
/* 1257 */     int childCount2 = 0;
     try {
/* 1259 */       topbomline.refresh();
/* 1260 */       childrenContexts = topbomline.getChildren();
/* 1261 */       childCount2 = childrenContexts.length;
/* 1262 */     } catch (TCException e) {
/* 1263 */       e.printStackTrace();
     } 
/* 1265 */     int unpackCount = 1;
/* 1266 */     while (childCount2 == childCount) {
/* 1267 */       System.out.println("第" + unpackCount + "次解包失败...");
/* 1268 */       this.session.queueOperation((AbstractAIFOperation)unpackoperation);
       try {
/* 1270 */         topbomline.refresh();
/* 1271 */         childrenContexts = topbomline.getChildren();
/* 1272 */         childCount2 = childrenContexts.length;
/* 1273 */       } catch (TCException e) {
/* 1274 */         e.printStackTrace();
       } 
/* 1276 */       unpackCount++;
     } 
/* 1278 */     return childrenContexts;
   }
   
   public static void main(String[] args) {
/* 1282 */     System.out.println("2.0000".replaceAll("\\.0+$", ""));
   }
 }
