diff --git a/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java index efb710fd..6a61be97 100644 --- a/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java @@ -12,6 +12,8 @@ import com.spring.common.utils.PageUtils; import com.spring.ifs.api.IfsServer; import com.spring.ifs.bean.BomServiceBean; import com.spring.ifs.bean.RecipeServiceBean; +import com.spring.ifs.bean.InventoryServiceBean; +import com.spring.ifs.data.CopyBomStructureData; import com.spring.modules.base.utils.DataUtils; import com.spring.modules.base.utils.HttpClientUtil; import com.spring.modules.base.utils.ResponseData; @@ -48,6 +50,8 @@ public class RecipeManagementServiceImpl extends ServiceImpl().eq("site", data.getPreviousVersion().getSite()).eq("part_no", data.getPreviousVersion().getPartNo())); + boolean isFromPartFormal = fromPartInfo != null && "Y".equals(fromPartInfo.getStatus()); + boolean isToPartFormal = "Y".equals(partInformationEntity.getStatus()); + boolean callIfsCopy = isFromPartFormal && isToPartFormal; + + if (callIfsCopy) { + data.setOfficialFlag("Y"); + } // 1、创建recipeHeader RecipeHeaderEntity header = recipeManagementMapper.queryRecipeHeader(data.getPreviousVersion()); data.setNoteText(header.getNoteText()); @@ -1030,8 +1044,13 @@ public class RecipeManagementServiceImpl extends ServiceImpl copyResult = recipeServiceBean.copyRecipeStructure(srv, copyData); + if (!"200".equals(copyResult.get("resultCode"))) { + throw new RuntimeException("IFS Recipe复制异常:" + copyResult.get("resultMsg")); + } + } catch (Exception e) { + throw new RuntimeException("IFS Recipe复制异常:" + e.getMessage()); + } + } + } + return data; }