装箱集成和工装需求

main
李建辉 11 months ago
parent be67b3d060
commit 92113227ea

@ -13,6 +13,7 @@
<command name="框架BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapKjSendCommand"/> <command name="框架BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapKjSendCommand"/>
<command name="项目BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhCommand"/> <command name="项目BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhCommand"/>
<command name="拆卸一览表下发" id="com.connor.chint.yunpi.command.ZxjcCommand"/> <command name="拆卸一览表下发" id="com.connor.chint.yunpi.command.ZxjcCommand"/>
<command name="拆卸一览表默认数据管理" id="com.connor.chint.yunpi.command.QueryZxjcHandler"/>
<command name="部件BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhBjCommand"/> <command name="部件BOM传递SAP" id="com.connor.chint.yunpi.command.BomSapWhBjCommand"/>
<command name="物料编码批量申请-全部图纸" id="com.chint.plm.applyMatnr.ApplyMatnrCommand#all"/> <command name="物料编码批量申请-全部图纸" id="com.chint.plm.applyMatnr.ApplyMatnrCommand#all"/>
<!--正泰定制下 中压开关--> <!--正泰定制下 中压开关-->
@ -59,6 +60,7 @@
<handler commandId="com.connor.chint.yunpi.command.EbomToPCommand" 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.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.ZxjcCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.QueryZxjcHandler" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.BomSapWhBjCommand" 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.chint.plm.createKjBom.CreateKjBomCommand" class="com.connor.chint.yunpi.KHandler"/>
<handler commandId="com.connor.chint.yunpi.command.DbomToECommand" class="com.connor.chint.yunpi.KHandler"/> <handler commandId="com.connor.chint.yunpi.command.DbomToECommand" class="com.connor.chint.yunpi.KHandler"/>
@ -492,6 +494,29 @@
</visibleWhen> </visibleWhen>
</command> </command>
<command commandId = "com.connor.chint.yunpi.command.QueryZxjcHandler" id = "com.connor.chint.yunpi.command.QueryZxjcHandler">
<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.QueryZxjcHandler">
</equals>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
<command commandId = "com.connor.chint.yunpi.command.BomDcSapCommand" id = "com.connor.chint.yunpi.command.BomDcSapCommand"> <command commandId = "com.connor.chint.yunpi.command.BomDcSapCommand" id = "com.connor.chint.yunpi.command.BomDcSapCommand">
<visibleWhen> <visibleWhen>
<and> <and>

@ -9,6 +9,8 @@ import java.io.OutputStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -42,8 +44,10 @@ import com.connor.chint.sap2.util.BomUtilWh;
import com.connor.chint.sap2.util.KUtil; import com.connor.chint.sap2.util.KUtil;
import com.connor.chint.sap2.util.MyProgressBarCompent; import com.connor.chint.sap2.util.MyProgressBarCompent;
import com.connor.chint.sap2.util.SAPMessageUtil; import com.connor.chint.sap2.util.SAPMessageUtil;
import com.connor.chint.sap2.util.SAPUtil;
import com.connor.chint.sap2.util.SqlUtil; import com.connor.chint.sap2.util.SqlUtil;
import com.connor.chint.sap2.util.TXTUtil; import com.connor.chint.sap2.util.TXTUtil;
import com.connor.plm.CostListManagement.pojo.GzxqBean;
import com.squareup.okhttp.Credentials; import com.squareup.okhttp.Credentials;
import com.squareup.okhttp.MediaType; import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.OkHttpClient;
@ -78,9 +82,15 @@ import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData; import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData;
import cn.hutool.json.JSONArray; import cn.hutool.json.JSONArray;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
public class ZxjcController { public class ZxjcController {
// 存在相同的物料 如果用j做序号不对
private int count = 1;//物料个数
public static final String TYPE_REV_PART = "Part Revision"; public static final String TYPE_REV_PART = "Part Revision";
public TCComponent project; // 项目信息 public TCComponent project; // 项目信息
public String groupName; public String groupName;
@ -381,8 +391,7 @@ public class ZxjcController {
System.out.println("tzBoms.size=====================" + tzBomsList.size()); System.out.println("tzBoms.size=====================" + tzBomsList.size());
// 根据图纸获取物料 排除重复物料 // 根据图纸获取物料 排除重复物料
// 存在相同的物料 如果用j做序号不对
int count = 1;
// 获取流水号的首选项 // 获取流水号的首选项
String[] lsmPref = session.getPreferenceService().getStringValues("CHINT_MATERIAL_VIRTUAL_RULE"); String[] lsmPref = session.getPreferenceService().getStringValues("CHINT_MATERIAL_VIRTUAL_RULE");
@ -396,6 +405,19 @@ public class ZxjcController {
} }
} }
// 获取数据库物料的首选项
String[] sqlMaterialPref = session.getPreferenceService().getStringValues("CHINT_WMS_DEFAULT_MATERIAL_RULE");
String sqlMaterialStr = "";
for (int i = 0; i < sqlMaterialPref.length; i++) {
String[] split = lsmPref[i].split(":");
// 判断当前组织与首选项是否相同
if (split[0].equals(groupName)) {
sqlMaterialStr = split[1];
}
}
for (int i = 0; i < tzBomsList.size(); i++) { for (int i = 0; i < tzBomsList.size(); i++) {
TCComponentBOMLine tcComponentBOMLine = tzBomsList.get(i); TCComponentBOMLine tcComponentBOMLine = tzBomsList.get(i);
String tzType = tcComponentBOMLine.getStringProperty("fnd0bl_line_object_type"); String tzType = tcComponentBOMLine.getStringProperty("fnd0bl_line_object_type");
@ -954,20 +976,26 @@ public class ZxjcController {
String zt2_MaterialNo = ""; String zt2_MaterialNo = "";
String object_desc = wlRev.getStringProperty("object_desc"); String object_desc = wlRev.getStringProperty("object_desc");
System.out.println("object_desc================================================"+object_desc); System.out.println("object_desc================================================"+object_desc);
//String zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
//2、物料型号规格取物料描述第一个空格后的数据
String zt2_Specifications = ""; String zt2_Specifications = "";
//2、物料型号规格取物料描述第一个空格后的数据
//String object_desc = wlRev.getStringProperty("object_desc"); //String object_desc = wlRev.getStringProperty("object_desc");
// if(object_desc != null && !object_desc.isEmpty()) { if(object_desc != null && !object_desc.isEmpty()) {
// // 查找第一个空格的位置 // 查找第一个空格的位置
// int spaceIndex = object_desc.indexOf(' '); int spaceIndex = object_desc.indexOf(' ');
//
// // 检查是否找到了空格 // 检查是否找到了空格
// if (spaceIndex != -1) { if (spaceIndex != -1) {
// // 提取空格之后的字符串 // 提取空格之后的字符串
// zt2_Specifications = object_desc.substring(spaceIndex + 1); zt2_Specifications = object_desc.substring(spaceIndex + 1);
// } }
// } }
if(zt2_Specifications != null && zt2_Specifications.isEmpty()) {
zt2_Specifications = wlRev.getStringProperty("zt2_Specifications");
}
System.out.println("zt2_Specifications=================================================="+zt2_Specifications); System.out.println("zt2_Specifications=================================================="+zt2_Specifications);
zt2_MaterialNo = wlRev.getStringProperty("zt2_MaterialNo"); zt2_MaterialNo = wlRev.getStringProperty("zt2_MaterialNo");
// 是否查到流水码 // 是否查到流水码
@ -1226,6 +1254,9 @@ public class ZxjcController {
JSONArray ccpArray = new JSONArray(); JSONArray ccpArray = new JSONArray();
// 获取产成品revs // 获取产成品revs
List<List> ccp_revs = map.getValue(); List<List> ccp_revs = map.getValue();
//获取其中一个产成品名称
String ccpName = "";
for (int j = 0; j < ccp_revs.size(); j++) { for (int j = 0; j < ccp_revs.size(); j++) {
JSONObject ccp_temp_Json = new JSONObject(); JSONObject ccp_temp_Json = new JSONObject();
TCComponentItemRevision ccp_rev = (TCComponentItemRevision) ccp_revs.get(j).get(0); TCComponentItemRevision ccp_rev = (TCComponentItemRevision) ccp_revs.get(j).get(0);
@ -1236,6 +1267,7 @@ public class ZxjcController {
// 手动填写属性 // 手动填写属性
ccp_temp_Json.put("factoryno", ccp_revs.get(j).get(1)); ccp_temp_Json.put("factoryno", ccp_revs.get(j).get(1));
ccpArray.put(ccp_temp_Json); ccpArray.put(ccp_temp_Json);
ccpName = ccp_rev.getStringProperty("object_name");
} }
// 物料信息array // 物料信息array
@ -1254,6 +1286,40 @@ public class ZxjcController {
wlArray.put(wl_temp_Json); wlArray.put(wl_temp_Json);
} }
//首选项取到对应的产成品名称 是否匹配
boolean isDelivery = true;
if(sqlMaterialStr != null && !sqlMaterialStr.isEmpty()) {
String[] split = sqlMaterialStr.split(";");
for (int i = 0; i < split.length; i++) {
//产成品名称匹配首选项 ,匹配到就不传数据库里的物料
if(ccpName.contains(split[i])) {
isDelivery = false;
}
}
}
//去数据库查对应组织的物料
if(isDelivery) {
//连接数据库查询出对应组织物料
String sql = "SELECT * FROM CHINT_WMS_DEFAULT_MATERIAL_RULE WHERE FACTORY = '" + groupName + "'";
SqlUtil.SRMGetTCDataConnection(prefs);
System.out.println("查询语句:" + sql.toString());
ResultSet rs = SqlUtil.read(sql.toString());
while (rs.next()) {
JSONObject wl_temp_Json = new JSONObject();
wl_temp_Json.put("no", count+"");
wl_temp_Json.put("materialno", rs.getString("DRAWINGNO"));
wl_temp_Json.put("objectdesc", rs.getString("OBJECTNAME"));
wl_temp_Json.put("specifications", rs.getString("SPECIFICATIONS"));
wl_temp_Json.put("quantity", rs.getInt("QUANTITY"));
wl_temp_Json.put("unit", rs.getString("UNIT"));
wl_temp_Json.put("remark", rs.getString("REMARK"));
wlArray.put(wl_temp_Json);
count++;
}
}
top.put("projectname", project_object_name); top.put("projectname", project_object_name);
top.put("projectno", project_zt2_ProjectNo); top.put("projectno", project_zt2_ProjectNo);
top.put("wbsno", project_zt2_WBSNo); top.put("wbsno", project_zt2_WBSNo);
@ -1266,7 +1332,8 @@ public class ZxjcController {
// //
System.out.println("top========" + top.toString()); System.out.println("top========" + top.toString());
//组织完一次 count 清空
count = 1;
// 发送接口 // 发送接口
String[] url = session.getPreferenceService().getStringValues("CHINT_ZXJC_URL"); String[] url = session.getPreferenceService().getStringValues("CHINT_ZXJC_URL");
String strUrl = url[0]; String strUrl = url[0];

Loading…
Cancel
Save