Browse Source

IFS接口添加mapper.configure

master
shenzhouyu 3 months ago
parent
commit
32eb985a34
  1. 35
      src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java

35
src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java

@ -2,6 +2,7 @@ package com.gaotao.modules.api.service.impl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.gaotao.common.exception.XJException;
import com.gaotao.common.utils.IfsErrorMessageUtils;
@ -78,6 +79,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"InventoryPart",jsonBody,null);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<InventoryPartVo> inventoryPartVos = mapper.readValue(ifsResponse, new TypeReference<List<InventoryPartVo>>() {
});
@ -103,6 +105,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrder",jsonBody,null);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<ShopOrderVo> shopOrders = mapper.readValue(ifsResponse, new TypeReference<List<ShopOrderVo>>() {
});
return shopOrders;
@ -127,6 +130,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrderMaterial",jsonBody,null);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<ShopOrderMaterialVo> shopOrderMaterialVos = mapper.readValue(ifsResponse, new TypeReference<List<ShopOrderMaterialVo>>() {
});
@ -153,6 +157,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"IssueForShopOrder",jsonBody,null);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<IssueForShopOrderVo> issueForShopOrderVos = mapper.readValue(ifsResponse, new TypeReference<List<IssueForShopOrderVo>>() {
});
@ -257,7 +262,9 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "MaterialRequisition", jsonBody, null);
List<MaterialRequisitionVo> mrList = objectMapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionVo>>() {});
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<MaterialRequisitionVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionVo>>() {});
return mrList;
} catch (Exception e) {
e.printStackTrace();
@ -278,7 +285,9 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "MaterialRequisitionMaterialLine", jsonBody, null);
List<MaterialRequisitionMaterialLineVo> mrList = objectMapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionMaterialLineVo>>() {});
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<MaterialRequisitionMaterialLineVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionMaterialLineVo>>() {});
return mrList;
} catch (Exception e) {
e.printStackTrace();
@ -436,7 +445,9 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "IssueForMaterialRequisition", jsonBody, null);
List<IssueForMaterialRequisitionVo> mrList = objectMapper.readValue(ifsResponse, new TypeReference<List<IssueForMaterialRequisitionVo>>() {});
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<IssueForMaterialRequisitionVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<IssueForMaterialRequisitionVo>>() {});
return mrList;
} catch (Exception e) {
e.printStackTrace();
@ -498,7 +509,9 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrder", jsonBody, null);
List<PurchaseOrderVo> orderVos = objectMapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderVo>>() {});
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<PurchaseOrderVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderVo>>() {});
return orderVos;
} catch (Exception e) {
e.printStackTrace();
@ -519,7 +532,9 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrderLine", jsonBody, null);
List<PurchaseOrderLineVo> orderVos = objectMapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderLineVo>>() {});
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<PurchaseOrderLineVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderLineVo>>() {});
return orderVos;
} catch (Exception e) {
e.printStackTrace();
@ -540,7 +555,9 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "POLineSupplierMaterial", jsonBody, null);
List<POLineSupplierMaterialVo> orderVos = objectMapper.readValue(ifsResponse, new TypeReference<List<POLineSupplierMaterialVo>>() {});
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<POLineSupplierMaterialVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<POLineSupplierMaterialVo>>() {});
return orderVos;
} catch (Exception e) {
e.printStackTrace();
@ -642,7 +659,9 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "IssueForPurchaseOrder", jsonBody, null);
List<IssueForPurchaseOrderVo> orderVos = objectMapper.readValue(ifsResponse, new TypeReference<List<IssueForPurchaseOrderVo>>() {});
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<IssueForPurchaseOrderVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<IssueForPurchaseOrderVo>>() {});
return orderVos;
} catch (Exception e) {
e.printStackTrace();
@ -766,6 +785,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "InventoryPartInStock", jsonBody, null);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<InventoryPartInStockVo> inventoryPartInStockVos = mapper.readValue(ifsResponse, new TypeReference<List<InventoryPartInStockVo>>() {
});
@ -789,6 +809,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "AnInventoryPartInStock", jsonBody, null);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
List<AnInventoryPartInStockVo> inventoryPartInStockVos = mapper.readValue(ifsResponse, new TypeReference<List<AnInventoryPartInStockVo>>() {
});

Loading…
Cancel
Save