Merge pull request 'ljh' (#8) from ljh into main

Reviewed-on: http://yunpi.tpddns.cn:3000/ZT_CODE/chint_wuhan/pulls/8
pull/10/head
李建辉 1 year ago
commit 3ae5fa9272

@ -12,6 +12,7 @@
<command name="创建框架BOM" id="com.chint.plm.createKjBom.CreateKjBomCommand"/>
<command name="框架BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapKjSendCommand"/>
<command name="项目BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhCommand"/>
<command name="拆卸一览表下发" id="com.connor.chint.yunpi.command.ZxjcCommand"/>
<command name="部件BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhBjCommand"/>
<command name="物料编码批量申请-全部图纸" id="com.chint.plm.applyMatnr.ApplyMatnrCommand#all"/>
<!--正泰定制下 中压开关-->
@ -57,6 +58,7 @@
<handler commandId="com.chint.plm.applyMatnr.ApplyMatnrCommand#user" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.EbomToPCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.BomSapWhCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.ZxjcCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.BomSapWhBjCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.chint.plm.createKjBom.CreateKjBomCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.DbomToECommand" class="com.connor.chint.yunpi.KHandler"/>
@ -461,6 +463,29 @@
</visibleWhen>
</command>
<command commandId = "com.connor.chint.yunpi.command.ZxjcCommand" id = "com.connor.chint.yunpi.command.ZxjcCommand">
<visibleWhen>
<and>
<or>
<reference definitionId="com.teamcenter.rac.ui.inMainPerspective"/>
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
</or>
<with
variable="rac_command_suppression">
<not>
<iterate
operator="or">
<equals
value="com.connor.chint.yunpi.command.ZxjcCommand">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
<command commandId = "com.connor.chint.yunpi.command.BomDcSapCommand" id = "com.connor.chint.yunpi.command.BomDcSapCommand">
<visibleWhen>
<and>

@ -348,7 +348,13 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
my = new MyProgressBarCompent("自制件编码申请", "正在读取BOM......");
System.out.println("===============开始获取可申请物料 自制件和普通图纸===============");
long time33 = System.nanoTime();
long time1 = System.nanoTime();
Map<String, ExpandPSData[]> listBOM = BomToSapUtil.getBomLineTreeNodeSOA(bomline);
System.out.println("listBOM.size=================="+listBOM.size());
long time2 = System.nanoTime();
System.out.println("===============soa获取bomline用时(ms) " + ((time2 - time1) / 1000000L)+"===============");
gbBuff.setLength(0);
xqErrBuff.setLength(0);
readBom(listBOM, bomline, error);
@ -1082,7 +1088,10 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
System.out.println(rev);
if (isNeedApply(rev)) {
// boolean flag = true;
String item_id = rev.getProperty("item_id");
//String item_id = rev.getProperty("item_id");
//一次性获取三个属性
String[] revProperties = rev.getProperties(new String[] {"item_id","zt2_Specifications","zt2_DrawingNo"});
String item_id = revProperties[0];
if (item_id.length() >= 3) {
String stuf = item_id.substring(0, 3);
if (stuf.equalsIgnoreCase("2ZD") || stuf.equalsIgnoreCase("4ZD") || stuf.equalsIgnoreCase("1ZD")) {
@ -1093,7 +1102,8 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
// 无通用件规格
TCComponent[] comps = rev.getReferenceListProperty("representation_for");
System.out.println(comps.length);
String spec = rev.getProperty("zt2_Specifications"); // ·Ç±ØÌî
//String spec = rev.getProperty("zt2_Specifications"); // 非必填
String spec = revProperties[1];
if (comps.length == 0) {
if (general_maps.containsKey(rev)) {
if (!general_maps.get(rev).contains(spec)) {
@ -1105,26 +1115,38 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
general_maps.put(rev, specs);
}
}else if(stuf.equalsIgnoreCase("2ZD")){
partRevs.add(comps[0]);
boolean needApply = true;
for(TCComponent comp:comps) {
String specs = comp.getProperty("zt2_Specifications"); // ·Ç±ØÌî
if(specs.equals(spec)) {
needApply = false;
break;
//20240426 增加查询的代码
Map<String, String> field = new HashMap<String, String>();
String value = "* " + spec;
System.out.println("查询值:" + value+"item_id==>"+item_id);
field.put("描述", value);
field.put("关联的图号", item_id);
TCComponentContextList contxt = KUtil.query(session, "chint_query_material_test", field);
//"*"+item_id+"*"+zt2_TYJSpec+"*"
if(contxt == null || contxt.getListCount() == 0) {
partRevs.add(comps[0]);
boolean needApply = true;
for(TCComponent comp:comps) {
String specs = comp.getProperty("zt2_Specifications"); // 非必填
if(specs.equals(spec)) {
needApply = false;
break;
}
}
}
if(needApply) {
if (general_maps.containsKey(rev)) {
if (!general_maps.get(rev).contains(spec)) {
general_maps.get(rev).add(spec);
if(needApply) {
if (general_maps.containsKey(rev)) {
if (!general_maps.get(rev).contains(spec)) {
general_maps.get(rev).add(spec);
}
} else {
List<String> specs = new ArrayList<String>();
specs.add(spec);
general_maps.put(rev, specs);
}
} else {
List<String> specs = new ArrayList<String>();
specs.add(spec);
general_maps.put(rev, specs);
}
}
}
} else {
// 有通用件规格
@ -1146,7 +1168,8 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
System.out.println("contxt:" + contxt.getListCount());
if (contxt == null || contxt.getListCount() == 0) {
String bpNo = item_id;
String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo");
//String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo");
String zt2_DrawingNo = revProperties[2];
if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD")) {
if (!item_id.equals(zt2_DrawingNo))
bpNo = zt2_DrawingNo;
@ -1174,7 +1197,11 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
boolean flag2 = true;
for (int i = 0, len = contxt.getListCount(); i < len; i++) {
TCComponent component = (TCComponent) contxt.get(i).getComponent();
String property = component.getProperty("object_desc");
//一次性获取两个属性
String[] tcProperties = component.getProperties(new String[] {"object_desc","zt2_MaterialNo"});
String property = tcProperties[0];
//String property = component.getProperty("object_desc");
String[] split = property.split(" ");
if(!zt2_TYJSpec.equals(split[split.length-1])) {
if(split.length-2>=0) {
@ -1187,14 +1214,15 @@ public class ApplyMatnrOp extends AbstractAIFOperation {
}
ResultSet rs;
String zt2_MaterialNo;
String zt2_MaterialNo = "";
Object[] objs = new Object[1];
String featureList;
String temp;
String[] vals;
if (!flag2)
break;
zt2_MaterialNo = component.getProperty("zt2_MaterialNo");
//zt2_MaterialNo = component.getProperty("zt2_MaterialNo");
zt2_MaterialNo = tcProperties[1];
if(zt2_MaterialNo.equals("")||zt2_MaterialNo.isEmpty()) {
flag2 = false;
continue;

@ -549,6 +549,7 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation {
List<TCComponent> partRevs = new ArrayList<>();
String zt2_Source = "";
String type = itemRevision.getType();
if(!type.equals("ZT2_XNZJB")) {
getRevs(bomline, error,partRevs);
zt2_Source = itemRevision.getProperty("zt2_Source");
@ -1083,7 +1084,9 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation {
System.out.println(rev);
if (isNeedApply(rev)) {
boolean flag = true;
String item_id = rev.getProperty("item_id");
//String item_id = rev.getProperty("item_id");
String[] revProperties = rev.getProperties(new String[] {"item_id","zt2_Specifications","zt2_DrawingNo"});
String item_id = revProperties[0];
if (item_id.length() >= 3) {
String stuf = item_id.substring(0, 3);
if (stuf.equalsIgnoreCase("2ZD") || stuf.equalsIgnoreCase("4ZD") || stuf.equalsIgnoreCase("1ZD")) {
@ -1102,7 +1105,8 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation {
// ÎÞͨÓüþ¹æ¸ñ
TCComponent[] comps = rev.getReferenceListProperty("representation_for");
System.out.println(comps.length);
String spec = rev.getProperty("zt2_Specifications"); // ·Ç±ØÌî
//String spec = rev.getProperty("zt2_Specifications"); // ·Ç±ØÌî
String spec = revProperties[1];
if (comps.length == 0) {
if (general_maps.containsKey(rev)) {
if (!general_maps.get(rev).contains(spec)) {
@ -1156,7 +1160,8 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation {
if (contxt == null || contxt.getListCount() == 0) {
Map<String, String> field2 = new HashMap<String, String>();
String bpNo = item_id;
String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo");
//String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo");
String zt2_DrawingNo = revProperties[2];
if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD")) {
if (!item_id.equals(zt2_DrawingNo))
bpNo = zt2_DrawingNo;
@ -1187,7 +1192,9 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation {
boolean flag2 = true;
for (int i = 0, len = contxt.getListCount(); i < len; i++) {
TCComponent component = (TCComponent) contxt.get(i).getComponent();
String property = component.getProperty("object_desc");
//String property = component.getProperty("object_desc");
String[] tcProperties = component.getProperties(new String[] {"object_desc","zt2_MaterialNo"});
String property = tcProperties[0];
String[] split = property.split(" ");
if(!zt2_TYJSpec.equals(split[split.length-1])) {
if(split.length-2>=0) {
@ -1207,7 +1214,8 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation {
String[] vals;
if (!flag2)
break;
zt2_MaterialNo = contxt.get(i).getComponent().getProperty("zt2_MaterialNo");
//zt2_MaterialNo = component.getProperty("zt2_MaterialNo");
zt2_MaterialNo = tcProperties[1];
if(zt2_MaterialNo.equals("")||zt2_MaterialNo.isEmpty()) {
flag2 = false;
continue;

@ -4,6 +4,7 @@ import java.util.Map;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentItem;
import com.teamcenter.rac.kernel.TCComponentItemType;
import com.teamcenter.rac.kernel.TCProperty;
import com.teamcenter.rac.kernel.TCSession;
public class RemarkUtil {
@ -40,7 +41,12 @@ public class RemarkUtil {
try {
String[] idss = new String[] {"A","B","C","D","E"};
String remark = bomline.getProperty("ZT2_Remark");
//String remark = bomline.getProperty("ZT2_Remark");
//一次性获取两个属性
String[] tcProperties = bomline.getProperties(new String[] {"ZT2_Remark","bl_quantity"});
String remark = tcProperties[0];
String bl_quantity = tcProperties[1];
String markMsg = "";
for (int i = 0; i < len; i++) {
if (remark.contains(idss[i])) {
@ -49,7 +55,7 @@ public class RemarkUtil {
}
String c_pId = bomline.getItemRevision().getProperty("item_id");
int xqlen = markMsg.length();
String bl_quantity = bomline.getProperty("bl_quantity");
//String bl_quantity = bomline.getProperty("bl_quantity");
if(bl_quantity.isEmpty()) {
xqErrBuff.append("图纸:").append(pId).append("下子件").append(c_pId)
.append("无法整除,请检查.").append("\n");

@ -33,95 +33,101 @@ public class AssignProcess extends KCommand {
public TCComponentItemRevision getPRevision(TCComponentItemRevision rev2) throws Exception {
String zt2_MaterialNo = rev2.getStringProperty("zt2_MaterialNo");
if(rev2.getType().equals("Part Revision")) {
if (rev2.getType().equals("Part Revision")) {
String zt2_ifpbom = rev2.getProperty("zt2_ifpbom");
if(zt2_ifpbom.equals("P")) {
if (zt2_ifpbom.equals("P")) {
return rev2;
}else {
} else {
TCComponent designRev = rev2.getRelatedComponent("TC_Is_Represented_By");
if(designRev!=null) {
if (designRev != null) {
TCComponent[] matnrs = designRev.getRelatedComponents("representation_for");
for(TCComponent matnr:matnrs) {
String[] properties = matnr.getProperties(new String[]{"zt2_ifpbom","zt2_MaterialNo"});
if(properties[1].equals(zt2_MaterialNo) && properties[0].equals("P")) {
return (TCComponentItemRevision)matnr;
for (TCComponent matnr : matnrs) {
String[] properties = matnr.getProperties(new String[] { "zt2_ifpbom", "zt2_MaterialNo" });
if (properties[1].equals(zt2_MaterialNo) && properties[0].equals("P")) {
return (TCComponentItemRevision) matnr;
}
}
}
}
}else if(rev2.getType().equals("ZT2_Design3DRevision")) {
} else if (rev2.getType().equals("ZT2_Design3DRevision")) {
TCComponent[] matnrs = rev2.getRelatedComponents("representation_for");
for(TCComponent matnr:matnrs) {
String[] properties = matnr.getProperties(new String[]{"zt2_ifpbom","zt2_MaterialNo"});
if(properties[0].equals("P")) {
return (TCComponentItemRevision)matnr;
for (TCComponent matnr : matnrs) {
String[] properties = matnr.getProperties(new String[] { "zt2_ifpbom", "zt2_MaterialNo" });
if (properties[0].equals("P")) {
return (TCComponentItemRevision) matnr;
}
}
return (TCComponentItemRevision)matnrs[0];
return (TCComponentItemRevision) matnrs[0];
}
return rev2;
}
private TCComponentItemRevision getTopZzItem(TCComponentItemRevision rev) {
// Auto-generated method stub
// Auto-generated method stub
// item = null;
try {
TCComponent[] whereUsed = rev.whereUsed((short)0);
if(whereUsed.length==0) {
TCComponent[] whereUsed = rev.whereUsed((short) 0);
if (whereUsed.length == 0) {
// String property = rev.getProperty("item_id");
return rev;
}else {
} else {
List<TCComponentItemRevision> revPs = new ArrayList<TCComponentItemRevision>();
for(int i=0;i<whereUsed.length;i++) {
TCComponentItemRevision revP = (TCComponentItemRevision)whereUsed[i];
if(revP.getType().contains("Part")) {
for (int i = 0; i < whereUsed.length; i++) {
TCComponentItemRevision revP = (TCComponentItemRevision) whereUsed[i];
if (revP.getType().contains("Part")) {
revPs.add(revP);
}
}
for(TCComponentItemRevision revP:revPs) {
if(revPs.size()>1) {
for (TCComponentItemRevision revP : revPs) {
if (revPs.size() > 1) {
// TCComponentItemRevision revP = (TCComponentItemRevision)whereUsed[i];
String property = revP.getProperty("zt2_ifpbom");
if(property==null||!property.equals("P")) {
if (property == null || !property.equals("P")) {
continue;
}
}
TCComponentItemRevision item = getTopZzItem(revP);
if(item!=null) {
if (item != null) {
return item;
}
}
}
} catch (Exception e) {
// Auto-generated catch block
// Auto-generated catch block
e.printStackTrace();
}
return null;
}
public AssignProcess(AbstractAIFApplication app, String commandId, String actionInfo) {
super(app, commandId, actionInfo);
long time20 = System.nanoTime();
InterfaceAIFComponent targetComponent = app.getTargetComponent();
try {
TCSession session = (TCSession)app.getSession();
TCSession session = (TCSession) app.getSession();
String groupID = SAPUtil.getGroupID(session);
if(!groupID.equals("M060")) {
if (!groupID.equals("M060")) {
MessageBox.post("请登录正确组", "", MessageBox.ERROR);
return;
}
if(targetComponent instanceof TCComponentBOMLine) {
rev = ((TCComponentBOMLine)targetComponent).getItemRevision();
}else if(targetComponent instanceof TCComponentItemRevision) {
if (targetComponent instanceof TCComponentBOMLine) {
rev = ((TCComponentBOMLine) targetComponent).getItemRevision();
} else if (targetComponent instanceof TCComponentItemRevision) {
TCComponentItemRevision rev = (TCComponentItemRevision) targetComponent;
this.rev = rev;
}else {
} else {
MessageBox.post("请选择BOM行或者版本对象", "", MessageBox.ERROR);
return;
}
new Thread() {
@Override
public void run() {
if(!rev.getType().equals("Part Revision")) {
if (!rev.getType().equals("Part Revision")) {
MessageBox.post("请选择PBOM对象", "", MessageBox.ERROR);
return;
}
@ -129,94 +135,133 @@ public class AssignProcess extends KCommand {
try {
TCPreferenceService service = session.getPreferenceService();
// TCComponentItemRevision pRevision = getPRevision(rev);
long time5 = System.nanoTime();
TCComponentItemRevision topZzItem = getTopZzItem(rev);
long time6 = System.nanoTime();
System.out.println(
"getTopZzItem========================================= " + (time6 - time5) / 1000000L);
long time7 = System.nanoTime();
String name = rev.getProperty("object_name");
String property = topZzItem.getProperty("zt2_ifpbom");
if(!property.equals("P") && topZzItem.getStringProperty("object_desc").contains("1ZDB300000P")) {
if (!property.equals("P")
&& topZzItem.getStringProperty("object_desc").contains("1ZDB300000P")) {
MessageBox.post("请选择PBOM对象", "", MessageBox.ERROR);
return;
}
boolean isback = false;
String[] rules = service.getStringValues("CHINT_PROCESS_RULE");
for(String rule : rules) {
for (String rule : rules) {
String[] split = rule.split(":");
if(!split[0].equals(groupID))
if (!split[0].equals(groupID))
continue;
String[] backs = split[1].split(";");
for(String back : backs) {
for (String back : backs) {
System.out.println(name + "==" + back + ">>" + name.contains(back));
if(name.contains(back)) {
if (name.contains(back)) {
isback = true;
break;
}
}
if(isback)
if (isback)
break;
}
TCComponentItemRevision desginRev = (TCComponentItemRevision) topZzItem.getRelatedComponent("TC_Is_Represented_By");
System.out.println("topZzItem=="+topZzItem.toString()+">>"+isback);
if(isback) {
TCComponentItemRevision desginRev = (TCComponentItemRevision) topZzItem
.getRelatedComponent("TC_Is_Represented_By");
System.out.println("topZzItem==" + topZzItem.toString() + ">>" + isback);
if (isback) {
AIFComponentContext[] folders = topZzItem.getItem()
.whereReferencedByTypeRelation(new String[] { "ZT2_ProjectFolder" }, null);//new String[] { "contents" }
if(folders.length == 0) {
.whereReferencedByTypeRelation(new String[] { "ZT2_ProjectFolder" }, null);// new
// String[]
// {
// "contents"
// }
if (folders.length == 0) {
MessageBox.post("未找到产成品文件夹,请检查.", "提示", MessageBox.WARNING);
return;
}
AIFComponentContext[] ccps = folders[0].getComponent().getChildren();
System.out.println(folders[0].getComponent() + "==>" + ccps.length);
for(AIFComponentContext aifcc : ccps) {
for (AIFComponentContext aifcc : ccps) {
TCComponentItem item = (TCComponentItem) aifcc.getComponent();
desginRev = (TCComponentItemRevision) item.getLatestItemRevision().getRelatedComponent("TC_Is_Represented_By");
desginRev = (TCComponentItemRevision) item.getLatestItemRevision()
.getRelatedComponent("TC_Is_Represented_By");
System.out.println(item + "==>" + desginRev);
if(desginRev != null)
if (desginRev != null)
break;
}
}
if(desginRev == null) {
long time8 = System.nanoTime();
System.out.println(
"检查逻辑========================================= " + (time8 - time7) / 1000000L);
if (desginRev == null) {
MessageBox.post("存在顶层P物料没有关联图纸,请检查.", "提示", MessageBox.WARNING);
return;
}
Map<String, String> classificationAttributes = desginRev.getItem().getClassificationAttributes();
long time3 = System.nanoTime();
Map<String, String> classificationAttributes = desginRev.getItem()
.getClassificationAttributes();
System.out.println(classificationAttributes.toString());
for(String key:classificationAttributes.keySet()) {
if(key.equals("产品型号")) {
for (String key : classificationAttributes.keySet()) {
if (key.equals("产品型号")) {
String cphx = classificationAttributes.get(key);
String sql = "SELECT \"ProductZu\" FROM \"CHINT_WORKHOUR_WhProductXH\" where \"ProductXH\" = '"+cphx+"'";
String sql = "SELECT \"ProductZu\" FROM \"CHINT_WORKHOUR_WhProductXH\" where \"ProductXH\" = '"
+ cphx + "'";
String[] prefs = service.getStringValues("database_tc");
SqlUtil.getTCDataConnection(prefs);
ResultSet read2 = SqlUtil.read(sql);
if(!read2.next()) {
if (!read2.next()) {
String searchSql = "SELECT distinct \"ProductZu\" FROM \"CHINT_WORKHOUR_WhProductXH\" where \"COMPANYCODE\" = 'M060'";
ResultSet read = SqlUtil.read(searchSql);
List<String> productZuList = new ArrayList<String>();
while(read.next()){
while (read.next()) {
productZuList.add(read.getString(1));
}
System.out.println(productZuList.toString());
String[] array = productZuList.toArray(new String[] {});
Object showInputDialog = JOptionPane.showInputDialog(null,"当前产品型号未维护,请选择对应产品族.","提示",JOptionPane.QUESTION_MESSAGE,null,array,array[0]);
if(showInputDialog==null) {
Object showInputDialog = JOptionPane.showInputDialog(null, "当前产品型号未维护,请选择对应产品族.",
"提示", JOptionPane.QUESTION_MESSAGE, null, array, array[0]);
if (showInputDialog == null) {
return;
}else {
} else {
System.out.println("showInputDialog:" + showInputDialog.toString());
String insertSql = "INSERT INTO \"CHINT_WORKHOUR_WhProductXH\" "
+ "(\"ProductXH\",\"ProductZu\",\"COMPANYCODE\") "
+ "VALUES (?,?,?)";
SqlUtil.write(insertSql, new Object[] {cphx,showInputDialog.toString(),"M060"});
+ "(\"ProductXH\",\"ProductZu\",\"COMPANYCODE\") " + "VALUES (?,?,?)";
SqlUtil.write(insertSql,
new Object[] { cphx, showInputDialog.toString(), "M060" });
}
}
break;
}
}
long time4 = System.nanoTime();
System.out.println(
"sql========================================== " + (time4 - time3) / 1000000L);
comp = new MyProgressBarCompent("", "正在进行一键指派工艺路线......");
TCUserService userService = (TCUserService) session.getUserService();
Object call = userService.call("CloneTempProcess", new Object[] {rev.getUid()});
long time1 = System.nanoTime();
Object call = userService.call("CloneTempProcess", new Object[] { rev.getUid() });
long time2 = System.nanoTime();
System.out.println(
"调用call========================================== " + (time2 - time1) / 1000000L);
String string = call.toString();
comp.setVisible(false);
System.out.println(string);
if(!string.equals("succ")) {
if (!string.equals("succ")) {
// if(string.contains("在数据库表中无对应典型产品族值")) {
// String[] split = string.split("当前变压器产品型号:");
// String[] split2 = split[1].split(",在数据库表中无对应典型产品族值");
@ -235,23 +280,28 @@ public class AssignProcess extends KCommand {
// System.out.println(productZuList.toString());
// }
new SAPMessageUtilFram("", "一键指派工艺路线存在异常,请检查:\n" + string);
}else {
MessageBox.post("一键指派工艺路线完成。","提示",MessageBox.INFORMATION);
} else {
MessageBox.post("一键指派工艺路线完成。", "提示", MessageBox.INFORMATION);
}
} catch (Exception e1) {
// Auto-generated catch block
// Auto-generated catch block
e1.printStackTrace();
}finally {
} finally {
SqlUtil.freeAll();
}
if(comp!=null) {
if (comp != null) {
comp.setVisible(false);
}
}
}.start();
}catch(Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
long time21 = System.nanoTime();
System.out.println(
"总时长========================================== " + (time21 - time20) / 1000000L);
}
}

@ -208,6 +208,29 @@ public class PartBean extends SAPPushBOMBean {
getUserName(), getZDATE() };
}
public Object[] getRowDataZxjc() throws Exception {
String name = part.getStringProperty("object_name");
TCComponent[] facts = part.getRelatedComponents(REL_PART_FACTNO);
int len = facts == null ? 0 : facts.length;
System.out.println("获取出厂编号:" + part);
String factNo = "";
for (int i = 0; i < len; i++) {
String type = facts[i].getType();
System.out.println(">> 找到子对象:" + facts[i] + "|" + type);
factoryNos = facts;
if (TYPE_FACTNO.equals(type)) {
factNo = facts[i].getStringProperty("item_id");
this.factoryNo = (TCComponentItem) facts[i];
break;
}
}
String zt2_site = part.getStringProperty("zt2_Site");
String zt2_tankNo = part.getStringProperty("zt2_TankNo");
// return new Object[] {true,index,zt2_site,zt2_tankNo,name,this,factNo};
return new Object[] { true, index, zt2_site, zt2_tankNo, name, this, factNo,"",""};
}
public Object[] getZYKGRowData() throws Exception {
String name = part.getStringProperty("object_name");
String zt2_site = part.getStringProperty("zt2_Site");

Loading…
Cancel
Save