Browse Source

添加日志

master
shenzhouyu 1 month ago
parent
commit
d42437e911
  1. 333
      src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java

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

@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.gaotao.common.exception.XJException; import com.gaotao.common.exception.XJException;
import com.gaotao.common.utils.ErrorLogUtils;
import com.gaotao.common.utils.IfsErrorMessageUtils; import com.gaotao.common.utils.IfsErrorMessageUtils;
import com.gaotao.common.utils.HttpUtils; import com.gaotao.common.utils.HttpUtils;
import com.gaotao.modules.api.dao.IfsShipmentReserveLogMapper; import com.gaotao.modules.api.dao.IfsShipmentReserveLogMapper;
@ -96,6 +97,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<InventoryPartVo> getInventoryPart(String partNo, String site){ public List<InventoryPartVo> getInventoryPart(String partNo, String site){
String jsonBody="";
try{ try{
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -104,7 +106,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsPartNo", partNo "ifsPartNo", partNo
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","InventoryPart", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","InventoryPart", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"InventoryPart",jsonBody,null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"InventoryPart",jsonBody,null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -114,6 +116,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
return inventoryPartVos; return inventoryPartVos;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs库存",
"IFS",
"InventoryPart",
partNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("获取IFS物料列表失败"+e.getMessage() ); throw new XJException("获取IFS物料列表失败"+e.getMessage() );
} }
@ -121,6 +131,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<ShopOrderVo> getWorkOrderInfo(String workOrderNo, String site,String releaseNo,String sequenceNo){ public List<ShopOrderVo> getWorkOrderInfo(String workOrderNo, String site,String releaseNo,String sequenceNo){
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -131,7 +142,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsSequenceNo", sequenceNo "ifsSequenceNo", sequenceNo
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ShopOrder", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ShopOrder", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrder",jsonBody,null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrder",jsonBody,null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -140,6 +151,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
}); });
return shopOrders; return shopOrders;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs工单",
"IFS",
"ShopOrder",
workOrderNo+";"+releaseNo+";"+ sequenceNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -147,6 +166,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<ShopOrderVo> getShopOrderLine(String workOrderNo, String site){ public List<ShopOrderVo> getShopOrderLine(String workOrderNo, String site){
String jsonBody="";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -155,7 +175,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsOrderNo", workOrderNo "ifsOrderNo", workOrderNo
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderLine", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderLine", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrderLine",jsonBody,null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrderLine",jsonBody,null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -164,6 +184,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
}); });
return shopOrders; return shopOrders;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"模糊查询ifs工单",
"IFS",
"ShopOrderLine",
workOrderNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -171,6 +199,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<ShopOrderMaterialVo> getShopOrderMaterial(String workOrderNo, String site,String releaseNo,String sequenceNo){ public List<ShopOrderMaterialVo> getShopOrderMaterial(String workOrderNo, String site,String releaseNo,String sequenceNo){
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -181,7 +210,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsSequenceNo", sequenceNo "ifsSequenceNo", sequenceNo
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderMaterial", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderMaterial", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrderMaterial",jsonBody,null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"ShopOrderMaterial",jsonBody,null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -191,6 +220,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
return shopOrderMaterialVos; return shopOrderMaterialVos;
}catch (Exception e) { }catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs工单材料",
"IFS",
"ShopOrderMaterial",
workOrderNo+";"+releaseNo+";"+ sequenceNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -199,6 +236,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<IssueForShopOrderVo> getIssueForShopOrder(String workOrderNo, String site,String releaseNo,String sequenceNo){ public List<IssueForShopOrderVo> getIssueForShopOrder(String workOrderNo, String site,String releaseNo,String sequenceNo){
String jsonBody = "";
try{ try{
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -209,7 +247,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsSequenceNo", sequenceNo "ifsSequenceNo", sequenceNo
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","IssueForShopOrder", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","IssueForShopOrder", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"IssueForShopOrder",jsonBody,null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl+"IssueForShopOrder",jsonBody,null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -219,6 +257,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
return issueForShopOrderVos; return issueForShopOrderVos;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs工单发料记录",
"IFS",
"IssueForShopOrder",
workOrderNo+";"+releaseNo+";"+ sequenceNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -227,6 +273,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addShopOrderManualIssue(IssueShopOrderDto issueShopOrderDto){ public String addShopOrderManualIssue(IssueShopOrderDto issueShopOrderDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -246,7 +293,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsHandlingUnitID",0); params.put("ifsHandlingUnitID",0);
params.put("ifsTransQty",issueShopOrderDto.getIfsTransQty()); params.put("ifsTransQty",issueShopOrderDto.getIfsTransQty());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderManualIssue", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderManualIssue", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"ShopOrderManualIssue",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"ShopOrderManualIssue",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -258,6 +305,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(issueShopOrderDto.getIfsSiteID(),
"IFS接口",
"查询ifs工单发料预留",
"IFS",
"ShopOrderManualIssue",
issueShopOrderDto.getIfsOrderNo()+";"+issueShopOrderDto.getIfsReleaseNo()+";"+ issueShopOrderDto.getIfsSequenceNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -265,6 +320,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addShopOrderManualUnIssue(UnissueShopOrderDto unissueShopOrderDto) { public String addShopOrderManualUnIssue(UnissueShopOrderDto unissueShopOrderDto) {
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -288,7 +344,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsTransactionID",unissueShopOrderDto.getIfsTransactionID()); params.put("ifsTransactionID",unissueShopOrderDto.getIfsTransactionID());
params.put("ifsAccountingID",unissueShopOrderDto.getIfsAccountingID()); params.put("ifsAccountingID",unissueShopOrderDto.getIfsAccountingID());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderManualUnIssue", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ShopOrderManualUnIssue", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"ShopOrderManualUnIssue",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"ShopOrderManualUnIssue",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -300,6 +356,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(unissueShopOrderDto.getIfsSiteID(),
"IFS接口",
"查询ifs工单退料",
"IFS",
"ShopOrderManualUnIssue",
unissueShopOrderDto.getIfsOrderNo()+";"+unissueShopOrderDto.getIfsReleaseNo()+";"+ unissueShopOrderDto.getIfsSequenceNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -307,6 +371,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<MaterialRequisitionVo> getMaterialRequisition(String workOrderNo, String site) { public List<MaterialRequisitionVo> getMaterialRequisition(String workOrderNo, String site) {
String jsonBody = "";
try { try {
// 调用IFS接口获取MR列表 // 调用IFS接口获取MR列表
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
@ -317,7 +382,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisition", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisition", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "MaterialRequisition", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "MaterialRequisition", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -325,6 +390,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
List<MaterialRequisitionVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionVo>>() {}); List<MaterialRequisitionVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionVo>>() {});
return mrList; return mrList;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifsMR",
"IFS",
"MaterialRequisition",
workOrderNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -332,6 +405,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<MaterialRequisitionMaterialLineVo> getMaterialRequisitionMaterialLine(String workOrderNo, String site) { public List<MaterialRequisitionMaterialLineVo> getMaterialRequisitionMaterialLine(String workOrderNo, String site) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -341,7 +415,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionMaterialLine", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionMaterialLine", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "MaterialRequisitionMaterialLine", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "MaterialRequisitionMaterialLine", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -349,6 +423,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
List<MaterialRequisitionMaterialLineVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionMaterialLineVo>>() {}); List<MaterialRequisitionMaterialLineVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<MaterialRequisitionMaterialLineVo>>() {});
return mrList; return mrList;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifsMR材料",
"IFS",
"MaterialRequisitionMaterialLine",
workOrderNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -356,6 +438,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addMaterialRequisitionReserve(MaterialRequisitionIssueDto materialRequisitionIssueDto){ public String addMaterialRequisitionReserve(MaterialRequisitionIssueDto materialRequisitionIssueDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -375,7 +458,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsHandlingUntitID",materialRequisitionIssueDto.getIfsHandlingUntitID()); params.put("ifsHandlingUntitID",materialRequisitionIssueDto.getIfsHandlingUntitID());
params.put("ifsQuantity",materialRequisitionIssueDto.getIfsQuantity()); params.put("ifsQuantity",materialRequisitionIssueDto.getIfsQuantity());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionReserve", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionReserve", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"MaterialRequisitionReserve",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"MaterialRequisitionReserve",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -387,6 +470,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(materialRequisitionIssueDto.getIfsSiteID(),
"IFS接口",
"查询ifsMR预留",
"IFS",
"MaterialRequisitionMaterialLine",
materialRequisitionIssueDto.getIfsOrderNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -394,6 +485,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addMaterialRequisitionIssue(MaterialRequisitionIssueDto materialRequisitionIssueDto){ public String addMaterialRequisitionIssue(MaterialRequisitionIssueDto materialRequisitionIssueDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -413,7 +505,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsHandlingUntitID",materialRequisitionIssueDto.getIfsHandlingUntitID()); params.put("ifsHandlingUntitID",materialRequisitionIssueDto.getIfsHandlingUntitID());
params.put("ifsQuantity",materialRequisitionIssueDto.getIfsQuantity()); params.put("ifsQuantity",materialRequisitionIssueDto.getIfsQuantity());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionIssue", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionIssue", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"MaterialRequisitionIssue",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"MaterialRequisitionIssue",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -425,6 +517,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(materialRequisitionIssueDto.getIfsSiteID(),
"IFS接口",
"查询ifsMR发料",
"IFS",
"MaterialRequisitionIssue",
materialRequisitionIssueDto.getIfsOrderNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -432,7 +532,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addOtherInbound(OtherTransactionIfsDto otherTransactionIfsDto) { public String addOtherInbound(OtherTransactionIfsDto otherTransactionIfsDto) {
String jsonBody = "";
try { try {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName", ifsDBName); params.put("ifsDBName", ifsDBName);
@ -451,12 +551,20 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsNote", otherTransactionIfsDto.getIfsReason()); params.put("ifsNote", otherTransactionIfsDto.getIfsReason());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ReceiveInventoryPart", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ReceiveInventoryPart", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl + "ReceiveInventoryPart", jsonBody, null); String ifsResponse = HttpUtils.doPost(ifsUrl + "ReceiveInventoryPart", jsonBody, null);
return ifsResponse; return ifsResponse;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(otherTransactionIfsDto.getIfsSiteID(),
"IFS接口",
"查询ifs其他预留",
"IFS",
"ReceiveInventoryPart",
otherTransactionIfsDto.getIfsPartNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("其它入库同步IFS失败"); throw new XJException("其它入库同步IFS失败");
} }
@ -464,7 +572,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addOtherOutbound(OtherTransactionIfsDto otherTransactionIfsDto) { public String addOtherOutbound(OtherTransactionIfsDto otherTransactionIfsDto) {
String jsonBody = "";
try { try {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName", ifsDBName); params.put("ifsDBName", ifsDBName);
@ -482,12 +590,20 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsNote", otherTransactionIfsDto.getIfsReason()); params.put("ifsNote", otherTransactionIfsDto.getIfsReason());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","IssueInventoryPart", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","IssueInventoryPart", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl + "IssueInventoryPart", jsonBody, null); String ifsResponse = HttpUtils.doPost(ifsUrl + "IssueInventoryPart", jsonBody, null);
return ifsResponse; return ifsResponse;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(otherTransactionIfsDto.getIfsSiteID(),
"IFS接口",
"查询ifs其他发料",
"IFS",
"IssueInventoryPart",
otherTransactionIfsDto.getIfsPartNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("其它出库同步IFS失败"); throw new XJException("其它出库同步IFS失败");
} }
@ -495,6 +611,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<IssueForMaterialRequisitionVo> getIssueForMaterialRequisition(String workOrderNo, String site,String releaseNo,String sequenceNo) { public List<IssueForMaterialRequisitionVo> getIssueForMaterialRequisition(String workOrderNo, String site,String releaseNo,String sequenceNo) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -506,7 +623,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","IssueForMaterialRequisition", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","IssueForMaterialRequisition", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "IssueForMaterialRequisition", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "IssueForMaterialRequisition", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -514,6 +631,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
List<IssueForMaterialRequisitionVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<IssueForMaterialRequisitionVo>>() {}); List<IssueForMaterialRequisitionVo> mrList = mapper.readValue(ifsResponse, new TypeReference<List<IssueForMaterialRequisitionVo>>() {});
return mrList; return mrList;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifsMR发料",
"IFS",
"IssueForMaterialRequisition",
workOrderNo+";"+releaseNo+";"+ sequenceNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -521,6 +646,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addMaterialRequisitionUnIssue(MaterialRequisitionUnIssueDto materialRequisitionUnIssueDto){ public String addMaterialRequisitionUnIssue(MaterialRequisitionUnIssueDto materialRequisitionUnIssueDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -544,7 +670,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsQty",materialRequisitionUnIssueDto.getIfsQty()); params.put("ifsQty",materialRequisitionUnIssueDto.getIfsQty());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionUnIssue", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","MaterialRequisitionUnIssue", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"MaterialRequisitionUnIssue",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"MaterialRequisitionUnIssue",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -556,6 +682,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(materialRequisitionUnIssueDto.getIfsSiteID(),
"IFS接口",
"查询ifs退料",
"IFS",
"MaterialRequisitionUnIssue",
materialRequisitionUnIssueDto.getIfsPartNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -563,6 +697,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<PurchaseOrderVo> getPurchaseOrder(String outsourcingNo, String site) { public List<PurchaseOrderVo> getPurchaseOrder(String outsourcingNo, String site) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -572,7 +707,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrder", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrder", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrder", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrder", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -580,6 +715,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
List<PurchaseOrderVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderVo>>() {}); List<PurchaseOrderVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderVo>>() {});
return orderVos; return orderVos;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs委外",
"IFS",
"PurchaseOrder",
outsourcingNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -587,6 +730,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<PurchaseOrderLineVo> getPurchaseOrderLine(String outsourcingNo, String site) { public List<PurchaseOrderLineVo> getPurchaseOrderLine(String outsourcingNo, String site) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -596,7 +740,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderLine", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderLine", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrderLine", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrderLine", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -604,6 +748,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
List<PurchaseOrderLineVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderLineVo>>() {}); List<PurchaseOrderLineVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderLineVo>>() {});
return orderVos; return orderVos;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs委外",
"IFS",
"PurchaseOrderLine",
outsourcingNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -611,6 +763,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<POLineSupplierMaterialVo> getPOLineSupplierMaterial(String outsourcingNo, String site) { public List<POLineSupplierMaterialVo> getPOLineSupplierMaterial(String outsourcingNo, String site) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -620,7 +773,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","POLineSupplierMaterial", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","POLineSupplierMaterial", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "POLineSupplierMaterial", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "POLineSupplierMaterial", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -628,6 +781,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
List<POLineSupplierMaterialVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<POLineSupplierMaterialVo>>() {}); List<POLineSupplierMaterialVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<POLineSupplierMaterialVo>>() {});
return orderVos; return orderVos;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs委外",
"IFS",
"POLineSupplierMaterial",
outsourcingNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("获取IFS采购供应商材料失败"+e.getMessage()); throw new XJException("获取IFS采购供应商材料失败"+e.getMessage());
} }
@ -635,6 +796,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addPurchaseOrderReserveComponent(PurchaseOrderReserveComponentDto purchaseOrderReserveComponentDto){ public String addPurchaseOrderReserveComponent(PurchaseOrderReserveComponentDto purchaseOrderReserveComponentDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -656,7 +818,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsReverseQty",purchaseOrderReserveComponentDto.getIfsReverseQty()); params.put("ifsReverseQty",purchaseOrderReserveComponentDto.getIfsReverseQty());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderReserveComponent", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderReserveComponent", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"PurchaseOrderReserveComponent",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"PurchaseOrderReserveComponent",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -668,6 +830,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(purchaseOrderReserveComponentDto.getIfsSiteID(),
"IFS接口",
"查询ifs委外预留",
"IFS",
"PurchaseOrderReserveComponent",
purchaseOrderReserveComponentDto.getIfsOrderNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -675,6 +845,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addPurchaseOrderIssueComponent(PurchaseOrderReserveComponentDto purchaseOrderReserveComponentDto){ public String addPurchaseOrderIssueComponent(PurchaseOrderReserveComponentDto purchaseOrderReserveComponentDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -696,7 +867,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsQtyToShip",purchaseOrderReserveComponentDto.getIfsQtyToShip()); params.put("ifsQtyToShip",purchaseOrderReserveComponentDto.getIfsQtyToShip());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderIssueComponent", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderIssueComponent", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"PurchaseOrderIssueComponent",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"PurchaseOrderIssueComponent",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -708,6 +879,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(purchaseOrderReserveComponentDto.getIfsSiteID(),
"IFS接口",
"查询ifs委外发料",
"IFS",
"PurchaseOrderIssueComponent",
purchaseOrderReserveComponentDto.getIfsOrderNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -715,6 +894,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<IssueForPurchaseOrderVo> getIssueForPurchaseOrder(String orderNo, String site, String releaseNo,String sequenceNo,String lineItemNo) { public List<IssueForPurchaseOrderVo> getIssueForPurchaseOrder(String orderNo, String site, String releaseNo,String sequenceNo,String lineItemNo) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -727,7 +907,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","IssueForPurchaseOrder", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","IssueForPurchaseOrder", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "IssueForPurchaseOrder", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "IssueForPurchaseOrder", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -735,6 +915,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
List<IssueForPurchaseOrderVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<IssueForPurchaseOrderVo>>() {}); List<IssueForPurchaseOrderVo> orderVos = mapper.readValue(ifsResponse, new TypeReference<List<IssueForPurchaseOrderVo>>() {});
return orderVos; return orderVos;
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs委外发料",
"IFS",
"IssueForPurchaseOrder",
orderNo+";"+releaseNo+";"+ sequenceNo+";"+lineItemNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("获取IFS采购供应商材料失败"+e.getMessage()); throw new XJException("获取IFS采购供应商材料失败"+e.getMessage());
} }
@ -742,6 +930,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addPurchaseOrderUnIssueComponent(PurchaseOrderUnIssueComponentDto purchaseOrderUnIssueComponentDto){ public String addPurchaseOrderUnIssueComponent(PurchaseOrderUnIssueComponentDto purchaseOrderUnIssueComponentDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -763,7 +952,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsQty",purchaseOrderUnIssueComponentDto.getIfsQty()); params.put("ifsQty",purchaseOrderUnIssueComponentDto.getIfsQty());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderUnIssueComponent", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderUnIssueComponent", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"PurchaseOrderUnIssueComponent",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"PurchaseOrderUnIssueComponent",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -775,6 +964,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(purchaseOrderUnIssueComponentDto.getIfsSiteId(),
"IFS接口",
"查询ifs委外退料",
"IFS",
"PurchaseOrderUnIssueComponent",
purchaseOrderUnIssueComponentDto.getIfsOrderNo(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -782,6 +979,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<PurchaseOrderReceiptVo> getPurchaseOrderReceipt(String purchaseOrderNo, String site) { public List<PurchaseOrderReceiptVo> getPurchaseOrderReceipt(String purchaseOrderNo, String site) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -791,11 +989,19 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderReceiptLocation", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderReceiptLocation", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrderReceiptLocation", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrderReceiptLocation", jsonBody, null);
return objectMapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderReceiptVo>>() {}); return objectMapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderReceiptVo>>() {});
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs委外退料",
"IFS",
"PurchaseOrderReceiptLocation",
purchaseOrderNo,
jsonBody,
e.getMessage(),e.getMessage());
log.error("获取采购订单接收记录失败: {}", e.getMessage()); log.error("获取采购订单接收记录失败: {}", e.getMessage());
throw new XJException("获取采购订单接收记录失败: " + e.getMessage()); throw new XJException("获取采购订单接收记录失败: " + e.getMessage());
} }
@ -803,6 +1009,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String purchaseOrderMoveToStockOneLocation(PurchaseOrderMoveToStockDto dto) { public String purchaseOrderMoveToStockOneLocation(PurchaseOrderMoveToStockDto dto) {
String jsonBody = "";
try { try {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName", dto.getIfsDBName()); params.put("ifsDBName", dto.getIfsDBName());
@ -828,7 +1035,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsInQtyToMove", dto.getIfsInQtyToMove()); params.put("ifsInQtyToMove", dto.getIfsInQtyToMove());
params.put("ifsCatchQtyToMove", dto.getIfsCatchQtyToMove() != null ? dto.getIfsCatchQtyToMove() : 0); params.put("ifsCatchQtyToMove", dto.getIfsCatchQtyToMove() != null ? dto.getIfsCatchQtyToMove() : 0);
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderMoveToStockOneLocation", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","PurchaseOrderMoveToStockOneLocation", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl + "PurchaseOrderMoveToStockOneLocation", jsonBody, null); String ifsResponse = HttpUtils.doPost(ifsUrl + "PurchaseOrderMoveToStockOneLocation", jsonBody, null);
@ -842,6 +1049,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
throw new XJException(errorMessage); throw new XJException(errorMessage);
} }
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface(dto.getIfsSiteID(),
"IFS接口",
"查询ifs采购订单移库",
"IFS",
"PurchaseOrderMoveToStockOneLocation",
dto.getIfsPartNo(),
jsonBody,
e.getMessage(),e.getMessage());
log.error("采购订单移库失败: {}", e.getMessage()); log.error("采购订单移库失败: {}", e.getMessage());
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -849,6 +1064,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<InventoryPartInStockVo> getInventoryPartInStock(String site) { public List<InventoryPartInStockVo> getInventoryPartInStock(String site) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -856,7 +1072,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsSiteID", site "ifsSiteID", site
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","InventoryPartInStock", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","InventoryPartInStock", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "InventoryPartInStock", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "InventoryPartInStock", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -866,6 +1082,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
return inventoryPartInStockVos; return inventoryPartInStockVos;
}catch (Exception e) { }catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs在库库存",
"IFS",
"InventoryPartInStock",
site,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("获取IFS库存在库信息失败"+e.getMessage()); throw new XJException("获取IFS库存在库信息失败"+e.getMessage());
} }
@ -873,6 +1097,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<AnInventoryPartInStockVo> getAnInventoryPartInStock(String site,String partNo) { public List<AnInventoryPartInStockVo> getAnInventoryPartInStock(String site,String partNo) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -881,7 +1106,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsPartNo",partNo "ifsPartNo",partNo
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","AnInventoryPartInStock", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","AnInventoryPartInStock", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "AnInventoryPartInStock", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "AnInventoryPartInStock", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -891,6 +1116,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
return inventoryPartInStockVos; return inventoryPartInStockVos;
}catch (Exception e) { }catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs物料库存",
"IFS",
"AnInventoryPartInStock",
partNo,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("获取IFS库存在库信息失败"+e.getMessage()); throw new XJException("获取IFS库存在库信息失败"+e.getMessage());
} }
@ -898,6 +1131,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<ShipmentVo> getShipment(String site,String shipmentId) { public List<ShipmentVo> getShipment(String site,String shipmentId) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -906,7 +1140,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsShipmentID",shipmentId "ifsShipmentID",shipmentId
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","Shipment", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","Shipment", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "Shipment", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "Shipment", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -916,6 +1150,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
return shipmentVos; return shipmentVos;
}catch (Exception e) { }catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs Shipment查询",
"IFS",
"Shipment",
shipmentId,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("获取IFS shipment信息失败:"+e.getMessage()); throw new XJException("获取IFS shipment信息失败:"+e.getMessage());
} }
@ -923,6 +1165,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public List<ShipmentLineVo> getShipmentLineVo(String site,String shipmentId) { public List<ShipmentLineVo> getShipmentLineVo(String site,String shipmentId) {
String jsonBody = "";
try { try {
Map<String, Object> params = Map.of( Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName, "ifsDBName", ifsDBName,
@ -931,7 +1174,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
"ifsShipmentID",shipmentId "ifsShipmentID",shipmentId
); );
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ShipmentLine", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ShipmentLine", jsonBody);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "ShipmentLine", jsonBody, null); String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "ShipmentLine", jsonBody, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -941,6 +1184,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
return shipmentLineVos; return shipmentLineVos;
}catch (Exception e) { }catch (Exception e) {
ErrorLogUtils.logInterface(site,
"IFS接口",
"查询ifs ShipmentLine查询",
"IFS",
"ShipmentLine",
shipmentId,
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException("获取IFS shipmentLine信息失败"+e.getMessage()); throw new XJException("获取IFS shipmentLine信息失败"+e.getMessage());
} }
@ -948,6 +1199,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addShipmentCreatePickList(ShipmentCreateDto shipmentCreateDto){ public String addShipmentCreatePickList(ShipmentCreateDto shipmentCreateDto){
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -958,7 +1210,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsLocationNo",shipmentCreateDto.getIfsLocationNo()); params.put("ifsLocationNo",shipmentCreateDto.getIfsLocationNo());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
log.info("IFS请求接口名称:{},请求参数: {}","ShipmentCreatePickList", jsonBody); log.info("IFS请求接口名称:{},请求参数: {}","ShipmentCreatePickList", jsonBody);
String ifsResponse = HttpUtils.doPost(ifsUrl+"ShipmentCreatePickList",jsonBody,null); String ifsResponse = HttpUtils.doPost(ifsUrl+"ShipmentCreatePickList",jsonBody,null);
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){ if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)){
@ -970,6 +1222,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
} }
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(shipmentCreateDto.getIfsSiteID(),
"IFS接口",
"查询ifs成品发货",
"IFS",
"ShipmentCreatePickList",
shipmentCreateDto.getIfsShipmentID(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new XJException(e.getMessage()); throw new XJException(e.getMessage());
} }
@ -979,6 +1239,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
@Override @Override
public String addShipmentLineManualReserve(ShipmentLineManualReserveDto shipmentLineManualReserveDto){ public String addShipmentLineManualReserve(ShipmentLineManualReserveDto shipmentLineManualReserveDto){
IfsShipmentReserveLog log = new IfsShipmentReserveLog(); IfsShipmentReserveLog log = new IfsShipmentReserveLog();
String jsonBody = "";
try{ try{
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ifsDBName",ifsDBName); params.put("ifsDBName",ifsDBName);
@ -1010,7 +1271,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
params.put("ifsBlockedForPickByChoice",shipmentLineManualReserveDto.getIfsBlockedForPickByChoice()); params.put("ifsBlockedForPickByChoice",shipmentLineManualReserveDto.getIfsBlockedForPickByChoice());
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
jsonBody = objectMapper.writeValueAsString(params);
// 记录日志 - 请求数据 // 记录日志 - 请求数据
log.setSite(shipmentLineManualReserveDto.getIfsSiteID()); log.setSite(shipmentLineManualReserveDto.getIfsSiteID());
@ -1053,6 +1314,14 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ifsShipmentReserveLogService.saveShipmentReserveLog(log); ifsShipmentReserveLogService.saveShipmentReserveLog(log);
return ifsResponse; return ifsResponse;
}catch (Exception e){ }catch (Exception e){
ErrorLogUtils.logInterface(shipmentLineManualReserveDto.getIfsSiteID(),
"IFS接口",
"查询ifs成品发货预留",
"IFS",
"ShipmentLineManualReserve",
shipmentLineManualReserveDto.getIfsShipmentID(),
jsonBody,
e.getMessage(),e.getMessage());
e.printStackTrace(); e.printStackTrace();
// 更新日志 - 错误信息 // 更新日志 - 错误信息
if (log.getId() != null) { if (log.getId() != null) {

Loading…
Cancel
Save