Browse Source

2025-01-24

优化
master
fengyuan_yang 12 months ago
parent
commit
5756131855
  1. 2
      src/main/java/com/spring/modules/part/mapper/MasterPartInformationMapper.java
  2. 12
      src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java
  3. 6
      src/main/resources/mapper/part/MasterPartInformationMapper.xml
  4. 2
      src/main/resources/mapper/part/PartInformationMapper.xml

2
src/main/java/com/spring/modules/part/mapper/MasterPartInformationMapper.java

@ -31,4 +31,6 @@ public interface MasterPartInformationMapper extends BaseMapper<MasterPartInform
void updateWeightAndVolume(MasterPartInformationVo data);
void updatePartOfficialFlag(MasterPartInformationEntity inData);
void updateCodeNoByPartNo(@Param("partNo") String partNo, @Param("codeNo") String technicalClass);
}

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

@ -280,8 +280,13 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
// 判断是否为正式物料
if ("Y".equals(masterPartInformation.getOfficialFlag())) {
if (dataUrl) {
Server srv = getIfsServer(data.getUpdateBy());
SysUserEntity ifsUser = sysUserDao.selectOne(new QueryWrapper<SysUserEntity>().eq("username", data.getUpdateBy()));
if (ifsUser == null || !org.apache.commons.lang3.StringUtils.isNotBlank(ifsUser.getIfsUsername()) || !org.apache.commons.lang3.StringUtils.isNotBlank(ifsUser.getIfsPassword())) {
throw new RuntimeException("请维护IFS账号和密码!");
}
Server srv = ifsServer.getIfsServer(ifsUser.getIfsUsername(), ifsUser.getIfsPassword());
PartIfsCatalog partIfsCatalog = getPartIfsCatalog(data);
partIfsCatalog.setIfsUsername(ifsUser.getIfsUsername());
Map<String, String> updateResponse = masterServiceBean.modifyPartCatalog(srv, partIfsCatalog);
if (!"200".equals(updateResponse.get("resultCode"))) {
throw new RuntimeException("IFS 物料件编辑异常信息:" + updateResponse.get("resultMsg"));
@ -375,10 +380,15 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
valueData.setRecordType("MP");
arrayList.add(valueData);
}
// 物料模板
partInformationMapper.savePartSubPropertiesValueHeader(data);
// 物料属性
partInformationMapper.savePartSubPropertiesValues(arrayList);
// 如果同步过来的模板编码和plm不同以ifs为准
if (!masterPart.getCodeNo().equals(ifsItems.get(0).getTechnicalClass())) {
masterPartInformationMapper.updateCodeNoByPartNo(data.getPartNo(), ifsItems.get(0).getTechnicalClass());
}
} else {
if (checkValueHeaderData.isEmpty()) {
// 初次或修改物料模板则重新加载模板

6
src/main/resources/mapper/part/MasterPartInformationMapper.xml

@ -93,4 +93,10 @@
update_by = #{updateBy}
WHERE part_no = #{plmPartNo}
</update>
<update id="updateCodeNoByPartNo">
UPDATE part_catalog
SET code_no = #{codeNo}
WHERE part_no = #{partNo}
</update>
</mapper>

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

@ -2253,7 +2253,7 @@
insert into PartSubPropertiesValue
(site, PartNo, CodeNo, SubCodeSeqNo, ItemNo, PropertiesItemNo, TextValue, NumValue, RecordType) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.partNo}, #{item.codeNo}, #{item.subCodeSeqNo,jdbcType=FLOAT}, #{item.itemNo}, #{item.propertiesItemNo}, #{item.textValue}, #{item.numValue}, #{item.recordType})
(#{item.site}, #{item.partNo}, #{item.codeNo}, #{item.subCodeSeqNo, jdbcType=FLOAT}, #{item.itemNo, jdbcType=FLOAT}, #{item.propertiesItemNo}, #{item.textValue}, #{item.numValue, jdbcType=FLOAT}, #{item.recordType})
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save