Browse Source

2024-11-05

库存件和物料件接口优化
master
fengyuan_yang 1 year ago
parent
commit
efd4457e40
  1. 3
      src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java
  2. 5
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java
  3. 7
      src/main/resources/mapper/part/PartInformationMapper.xml

3
src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java

@ -498,6 +498,8 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
if (!"200".equals(addMasterPartModelResponse.getCode())) {
throw new RuntimeException("IFS物料件模板新增异常:" + addMasterPartModelResponse.getMsg());
}
if (!propertyList.isEmpty()) {
String addMasterPartPropertyURL = apiUrl + "/technical/class/modifyTechnicalClassAttributes";
ResponseData addMasterPartPropertyResponse = HttpClientUtil.doPostByRawWithPLM(addMasterPartPropertyURL, propertyList);
if (!"200".equals(addMasterPartPropertyResponse.getCode())) {
@ -507,5 +509,6 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
}
}
}
}
}

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

@ -1984,17 +1984,22 @@ 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 (!propertyList.isEmpty()) {
String addInventoryPartPropertyURL = apiUrl + "/part/ifs/syncInventoryPartCharacteristics";
ResponseData addInventoryPartPropertyResponse = HttpClientUtil.doPostByRawWithPLM(addInventoryPartPropertyURL, propertyList);
if (!"200".equals(addInventoryPartPropertyResponse.getCode())) {
throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.getMsg());
}
}
}

7
src/main/resources/mapper/part/PartInformationMapper.xml

@ -120,10 +120,10 @@
AND spec like #{query.spec}
</if>
<if test="query.startDate != null ">
AND required_completion_date >= #{query.startDate}
AND create_date >= #{query.startDate}
</if>
<if test="query.endDate != null ">
AND #{query.endDate} >= required_completion_date
AND #{query.endDate} >= create_date
</if>
</where>
</select>
@ -1802,7 +1802,8 @@
a.PropertiesItemNo as characteristicCode,
isnull(a.TextValue, '') as attrValueAlpha,
ISNULL(CONVERT(VARCHAR(20), a.NumValue, 1), '') as attrValueNumeric,
case when b.ValueType_DB = 'T' then 'Alpha' when b.ValueType_DB = 'N' then 'Numeric' else '' end as characteristicType
case when b.ValueType_DB = 'T' then 'Alpha' when b.ValueType_DB = 'N' then 'Numeric' else '' end as characteristicType,
'' as unitMeas
FROM PartSubPropertiesValue as a
left join plm_properties_item as b on a.site = b.site and a.PropertiesItemNo = b.ItemNo and a.RecordType = b.ItemType
where a.site = #{site} and a.RecordType = #{recordType} and a.PartNo = #{partNo} and a.CodeNo = #{codeNo}

Loading…
Cancel
Save