|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.gaotao.common.exception.XJException; |
|
|
|
import com.gaotao.common.utils.ErrorLogUtils; |
|
|
|
import com.gaotao.common.utils.HttpUtils; |
|
|
|
import com.gaotao.common.utils.IfsErrorMessageUtils; |
|
|
|
import com.gaotao.modules.scrap.entity.*; |
|
|
|
@ -319,6 +320,7 @@ public class ScrapServiceImpl extends AbstractController implements ScrapService |
|
|
|
* 调用IFS的ScrapInventoryPart接口(单个汇总项) |
|
|
|
*/ |
|
|
|
private void callIfsScrapInventoryPartSingle(String site, ScrapSummaryInfo summaryInfo, String scrapReason) { |
|
|
|
String jsonBody = ""; |
|
|
|
try { |
|
|
|
// 构建IFS接口参数 |
|
|
|
Map<String, Object> params = Map.ofEntries( |
|
|
|
@ -338,7 +340,7 @@ public class ScrapServiceImpl extends AbstractController implements ScrapService |
|
|
|
Map.entry("ifsScrapNote", "WMS批量报废") |
|
|
|
); |
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
log.info("IFS请求接口名称:{},请求参数: {}","ScrapInventoryPart", jsonBody); |
|
|
|
String ifsResponse = HttpUtils.doPost(ifsUrl + "ScrapInventoryPart", jsonBody, null); |
|
|
|
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)) { |
|
|
|
@ -356,6 +358,14 @@ public class ScrapServiceImpl extends AbstractController implements ScrapService |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("调用IFS报废接口失败 - 物料: {}, 批次: {}, 库位: {}, 错误: {}", |
|
|
|
summaryInfo.getPartNo(), summaryInfo.getBatchNo(), summaryInfo.getLocationId(), e.getMessage(), e); |
|
|
|
ErrorLogUtils.logInterface(site, |
|
|
|
"IFS接口", |
|
|
|
"物料报废", |
|
|
|
"IFS", |
|
|
|
"ScrapInventoryPart", |
|
|
|
summaryInfo.getPartNo()+";"+summaryInfo.getBatchNo()+";"+ |
|
|
|
summaryInfo.getTotalQty()+";"+(summaryInfo.getWdr() != null ? summaryInfo.getWdr() : "*"), |
|
|
|
jsonBody, e.getMessage(),e.getMessage()); |
|
|
|
throw new XJException(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|