|
|
|
@ -134,7 +134,7 @@ public class RecipeManagementServiceImpl extends ServiceImpl<RecipeManagementMap |
|
|
|
if (dataUrl) { |
|
|
|
// 判断是否为正式的recipeHeader |
|
|
|
if ("Y".equals(recipeHeader.getOfficialFlag())) { |
|
|
|
// 同步ifs |
|
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
|
RecipeIfsHeader recipeIfsHeader = new RecipeIfsHeader(); |
|
|
|
recipeIfsHeader.setContract(data.getSite()); |
|
|
|
recipeIfsHeader.setPartNo(data.getPartNo()); |
|
|
|
@ -143,10 +143,9 @@ public class RecipeManagementServiceImpl extends ServiceImpl<RecipeManagementMap |
|
|
|
recipeIfsHeader.setEffPhaseInDate(DateUtils.format(data.getEffPhaseInDate())); |
|
|
|
recipeIfsHeader.setEffPhaseOutDate(DateUtils.format(data.getEffPhaseOutDate())); |
|
|
|
recipeIfsHeader.setNoteText(data.getNoteText()); |
|
|
|
String updateRecipeHeaderURL = apiUrl + "/recipe/ifs/modifyRecipeHeaderToIfs"; |
|
|
|
ResponseData updateRecipeHeaderResponse = HttpClientUtil.doPostByRawWithPLM(updateRecipeHeaderURL, recipeIfsHeader); |
|
|
|
if (!"200".equals(updateRecipeHeaderResponse.getCode())) { |
|
|
|
throw new RuntimeException("ifs RecipeHeader修改异常:" + updateRecipeHeaderResponse.getMsg()); |
|
|
|
Map<String, String> updateRecipeHeaderResponse = recipeServiceBean.modifyRecipeHeader(srv, recipeIfsHeader); |
|
|
|
if (!"200".equals(updateRecipeHeaderResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("ifs RecipeHeader修改异常:" + updateRecipeHeaderResponse.get("resultMsg")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -166,12 +165,11 @@ public class RecipeManagementServiceImpl extends ServiceImpl<RecipeManagementMap |
|
|
|
public void recipeManagementEdit(RecipeAllFieldEntity data) { |
|
|
|
// 修改主表 |
|
|
|
recipeManagementMapper.updateRecipeHeader(data); |
|
|
|
|
|
|
|
if (dataUrl) { |
|
|
|
RecipeHeaderEntity recipeHeader = recipeManagementMapper.selectOne(new QueryWrapper<RecipeHeaderEntity>().eq("site", data.getSite()).eq("part_no", data.getPartNo()).eq("eng_chg_level", data.getEngChgLevel()).eq("bom_type", data.getBomType())); |
|
|
|
// 判断是否为正式的recipeHeader |
|
|
|
if ("Y".equals(recipeHeader.getOfficialFlag())) { |
|
|
|
// 同步ifs |
|
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
|
RecipeIfsHeader recipeIfsHeader = new RecipeIfsHeader(); |
|
|
|
recipeIfsHeader.setContract(data.getSite()); |
|
|
|
recipeIfsHeader.setPartNo(data.getPartNo()); |
|
|
|
@ -180,10 +178,9 @@ public class RecipeManagementServiceImpl extends ServiceImpl<RecipeManagementMap |
|
|
|
recipeIfsHeader.setEffPhaseInDate(DateUtils.format(data.getEffPhaseInDate())); |
|
|
|
recipeIfsHeader.setEffPhaseOutDate(data.getEffPhaseOutDate() == null ? "" : DateUtils.format(data.getEffPhaseOutDate())); |
|
|
|
recipeIfsHeader.setNoteText(data.getNoteText()); |
|
|
|
String updateRecipeHeaderURL = apiUrl + "/recipe/ifs/modifyRecipeHeaderToIfs"; |
|
|
|
ResponseData updateRecipeHeaderResponse = HttpClientUtil.doPostByRawWithPLM(updateRecipeHeaderURL, recipeIfsHeader); |
|
|
|
if (!"200".equals(updateRecipeHeaderResponse.getCode())) { |
|
|
|
throw new RuntimeException("ifs RecipeHeader修改异常:" + updateRecipeHeaderResponse.getMsg()); |
|
|
|
Map<String, String> updateRecipeHeaderResponse = recipeServiceBean.modifyRecipeHeader(srv, recipeIfsHeader); |
|
|
|
if (!"200".equals(updateRecipeHeaderResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("ifs RecipeHeader修改异常:" + updateRecipeHeaderResponse.get("resultMsg")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -580,7 +577,7 @@ public class RecipeManagementServiceImpl extends ServiceImpl<RecipeManagementMap |
|
|
|
if (dataUrl) { |
|
|
|
// 判断是否为正式替代 |
|
|
|
if ("Y".equals(checkList.get(0).getOfficialFlag())) { |
|
|
|
// 同步ifs |
|
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
|
RecipeIfsAlternative recipeIfsDetail = new RecipeIfsAlternative(); |
|
|
|
recipeIfsDetail.setContract(checkList.get(0).getSite()); |
|
|
|
recipeIfsDetail.setPartNo(checkList.get(0).getPartNo()); |
|
|
|
@ -589,16 +586,14 @@ public class RecipeManagementServiceImpl extends ServiceImpl<RecipeManagementMap |
|
|
|
recipeIfsDetail.setAlternativeNo(checkList.get(0).getAlternativeNo()); |
|
|
|
recipeIfsDetail.setAlternativeDesc(checkList.get(0).getAlternativeDescription()); |
|
|
|
if ("Buildable".equals(data.getStatus())) { // 状态修改为buildable |
|
|
|
String buildRecipeDetailURL = apiUrl + "/recipe/ifs/buildRecipeAlternativeToIfs"; |
|
|
|
ResponseData buildRecipeDetailResponse = HttpClientUtil.doPostByRawWithPLM(buildRecipeDetailURL, recipeIfsDetail); |
|
|
|
if (!"200".equals(buildRecipeDetailResponse.getCode())) { |
|
|
|
throw new RuntimeException("ifs RecipeAlternative Build异常:" + buildRecipeDetailResponse.getMsg()); |
|
|
|
Map<String, String> buildRecipeDetailResponse = recipeServiceBean.buildRecipeAlternative(srv, recipeIfsDetail); |
|
|
|
if (!"200".equals(buildRecipeDetailResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("ifs RecipeAlternative Build异常:" + buildRecipeDetailResponse.get("resultMsg")); |
|
|
|
} |
|
|
|
} else if ("Obsolete".equals(data.getStatus())) { // 状态修改为Obsolete |
|
|
|
String retireRecipeDetailURL = apiUrl + "/recipe/ifs/retireRecipeAlternativeToIfs"; |
|
|
|
ResponseData retireRecipeDetailResponse = HttpClientUtil.doPostByRawWithPLM(retireRecipeDetailURL, recipeIfsDetail); |
|
|
|
if (!"200".equals(retireRecipeDetailResponse.getCode())) { |
|
|
|
throw new RuntimeException("ifs RecipeAlternative Retire异常:" + retireRecipeDetailResponse.getMsg()); |
|
|
|
Map<String, String> retireRecipeDetailResponse = recipeServiceBean.retireRecipeAlternative(srv, recipeIfsDetail); |
|
|
|
if (!"200".equals(retireRecipeDetailResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("ifs RecipeAlternative Retire异常:" + retireRecipeDetailResponse.get("resultMsg")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|