Browse Source

2024-12-02

copy part
master
fengyuan_yang 1 year ago
parent
commit
5b668b9f3b
  1. 4
      src/main/java/com/spring/modules/part/entity/APIEntity/PartIfsInventory.java
  2. 37
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

4
src/main/java/com/spring/modules/part/entity/APIEntity/PartIfsInventory.java

@ -125,4 +125,8 @@ public class PartIfsInventory extends PartIfsCatalog {
* 生命周期阶段
*/
private String lifecycleStage;
/**
* 模板编码
*/
private String engAttribute;
}

37
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -178,6 +178,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
partIfsInventory.setInvoiceConsideration(data.getInvoiceConsideration() == null ? "" : data.getInvoiceConsideration()); // 供应商发票事项
partIfsInventory.setZeroCostFlag(data.getZeroCostFlag() == null ? "" : data.getZeroCostFlag()); // 零成本
partIfsInventory.setPartCostGroupId(data.getPartCostGroupId() == null ? "" : data.getPartCostGroupId()); // 零件成本组
partIfsInventory.setEngAttribute(data.getCodeNo().isEmpty() ? "" : data.getCodeNo()); // 模板编码
return partIfsInventory;
}
@ -809,12 +810,13 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
if (!"200".equals(deleteInventoryPartPropertyResponse.getCode())) {
throw new RuntimeException("IFS库存件属性删除异常:" + deleteInventoryPartPropertyResponse.getMsg());
}
String addInventoryPartPropertyURL = apiUrl + "/part/ifs/syncInventoryPartCharacteristics";
ResponseData addInventoryPartPropertyResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartPropertyURL, ifsProperty);
if (!"200".equals(addInventoryPartPropertyResponse.getCode())) {
throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.getMsg());
if (!ifsProperty.isEmpty()) {
String addInventoryPartPropertyURL = apiUrl + "/part/ifs/syncInventoryPartCharacteristics";
ResponseData addInventoryPartPropertyResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartPropertyURL, ifsProperty);
if (!"200".equals(addInventoryPartPropertyResponse.getCode())) {
throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.getMsg());
}
}
}
}
}
@ -1014,12 +1016,13 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
if (!"200".equals(deleteInventoryPartPropertyResponse.getCode())) {
throw new RuntimeException("IFS库存件属性删除异常:" + deleteInventoryPartPropertyResponse.getMsg());
}
String addInventoryPartPropertyURL = apiUrl + "/part/ifs/syncInventoryPartCharacteristics";
ResponseData addInventoryPartPropertyResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartPropertyURL, ifsProperty);
if (!"200".equals(addInventoryPartPropertyResponse.getCode())) {
throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.getMsg());
if (!ifsProperty.isEmpty()) {
String addInventoryPartPropertyURL = apiUrl + "/part/ifs/syncInventoryPartCharacteristics";
ResponseData addInventoryPartPropertyResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartPropertyURL, ifsProperty);
if (!"200".equals(addInventoryPartPropertyResponse.getCode())) {
throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.getMsg());
}
}
}
}
}
@ -2933,13 +2936,13 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
}
// 1.6 同步库存件的模板和属性
if (partIfsInventoryModel.getEngAttribute() != null && !partIfsInventoryModel.getEngAttribute().isEmpty()) {
String addInventoryPartModelURL = apiUrl + "/part/ifs/modifyInventoryPartCharacteristicTemplate";
ResponseData addInventoryPartModelResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartModelURL, partIfsInventoryModel);
if (!"200".equals(addInventoryPartModelResponse.getCode())) {
throw new RuntimeException("IFS库存件模板新增异常:" + addInventoryPartModelResponse.getMsg());
}
}
// if (partIfsInventoryModel.getEngAttribute() != null && !partIfsInventoryModel.getEngAttribute().isEmpty()) {
// String addInventoryPartModelURL = apiUrl + "/part/ifs/modifyInventoryPartCharacteristicTemplate";
// ResponseData addInventoryPartModelResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartModelURL, partIfsInventoryModel);
// if (!"200".equals(addInventoryPartModelResponse.getCode())) {
// throw new RuntimeException("IFS库存件模板新增异常:" + addInventoryPartModelResponse.getMsg());
// }
// }
if (!propertyList.isEmpty()) {
String addInventoryPartPropertyURL = apiUrl + "/part/ifs/syncInventoryPartCharacteristics";
ResponseData addInventoryPartPropertyResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartPropertyURL, propertyList);

Loading…
Cancel
Save