|
|
|
@ -129,7 +129,7 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
public List<IfsInventoryPartInStock> getInventoryPartInStock(String site,String partNo) throws JsonProcessingException { |
|
|
|
Map<String, Object> params = Map.of( |
|
|
|
"ifsDBName", ifsDBName, |
|
|
|
"domainUserID", domainUserID, |
|
|
|
"domainUserID", getCurrentDomainUserID(), |
|
|
|
"ifsSiteID", site, |
|
|
|
"ifsPartNo", partNo |
|
|
|
); |
|
|
|
@ -183,16 +183,16 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
} |
|
|
|
|
|
|
|
private String getCurrentDomainUserID() { |
|
|
|
// if (ldapFlag) { |
|
|
|
// try { |
|
|
|
// SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
// if (currentUser != null && StringUtils.isNotBlank(currentUser.getDomainAccount())) { |
|
|
|
// return currentUser.getDomainAccount(); |
|
|
|
// } |
|
|
|
// } catch (Exception e) { |
|
|
|
// // 如果获取当前用户失败,使用默认配置 |
|
|
|
// } |
|
|
|
// } |
|
|
|
if (ldapFlag) { |
|
|
|
try { |
|
|
|
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
if (currentUser != null && StringUtils.isNotBlank(currentUser.getDomainAccount())) { |
|
|
|
return currentUser.getDomainAccount(); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
// 如果获取当前用户失败,使用默认配置 |
|
|
|
} |
|
|
|
} |
|
|
|
return domainUserID; |
|
|
|
} |
|
|
|
|
|
|
|
@ -208,7 +208,7 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
@Override |
|
|
|
public String changeWdrNo(IfsChangeWdrNoDto data) { |
|
|
|
try { |
|
|
|
log.info("开始调用IFS ChangeWdrNo接口 - rqrq,partNo={}, fromWdrNo={}, toWdrNo={}", |
|
|
|
log.info("开始调用IFS ChangeWdrNo接口 - rqrq,partNo={}, fromWdrNo={}, toWdrNo={}", |
|
|
|
data.getIfsPartNo(), data.getIfsFromWdrNo(), data.getIfsToWdrNo()); |
|
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
@ -230,11 +230,11 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
|
|
|
|
|
|
|
|
log.info("ChangeWdrNo请求参数 - rqrq:{}", jsonBody); |
|
|
|
|
|
|
|
|
|
|
|
String ifsResponse = HttpUtils.doPost(ifsUrl + "ChangeWdrNo", jsonBody, null); |
|
|
|
|
|
|
|
|
|
|
|
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)) { |
|
|
|
log.info("IFS ChangeWdrNo成功 - rqrq"); |
|
|
|
} else { |
|
|
|
@ -259,7 +259,7 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
@Override |
|
|
|
public String changeExpiryDate(IfsChangeExpiryDateDto data) { |
|
|
|
try { |
|
|
|
log.info("开始调用IFS ChangeExpiryDate接口 - rqrq,partNo={}, lotBatchNo={}, expiryDate={}", |
|
|
|
log.info("开始调用IFS ChangeExpiryDate接口 - rqrq,partNo={}, lotBatchNo={}, expiryDate={}", |
|
|
|
data.getIfsPartNo(), data.getIfsLotBatchNo(), data.getIfsExpiryDate()); |
|
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
@ -279,11 +279,11 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
|
|
|
|
|
|
|
|
log.info("ChangeExpiryDate请求参数 - rqrq:{}", jsonBody); |
|
|
|
|
|
|
|
|
|
|
|
String ifsResponse = HttpUtils.doPost(ifsUrl + "ChangeExpiryDate", jsonBody, null); |
|
|
|
|
|
|
|
|
|
|
|
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)) { |
|
|
|
log.info("IFS ChangeExpiryDate成功 - rqrq"); |
|
|
|
} else { |
|
|
|
@ -291,7 +291,7 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
String errorMessage = IfsErrorMessageUtils.extractOracleErrorMessage(ifsResponse); |
|
|
|
throw new RuntimeException(errorMessage); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ifsResponse; |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("IFS ChangeExpiryDate异常 - rqrq:{}", e.getMessage()); |
|
|
|
@ -309,7 +309,7 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
@Override |
|
|
|
public String changeAvailabilityControlId(IfsChangeAvailabilityControlIdDto data) { |
|
|
|
try { |
|
|
|
log.info("开始调用IFS ChangeAvailabilityControlID接口 - rqrq,partNo={}, lotBatchNo={}, controlId={}", |
|
|
|
log.info("开始调用IFS ChangeAvailabilityControlID接口 - rqrq,partNo={}, lotBatchNo={}, controlId={}", |
|
|
|
data.getIfsPartNo(), data.getIfsLotBatchNo(), data.getIfsAvailabilityControlID()); |
|
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
@ -329,11 +329,11 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
|
|
|
|
|
|
|
|
log.info("ChangeAvailabilityControlID请求参数 - rqrq:{}", jsonBody); |
|
|
|
|
|
|
|
|
|
|
|
String ifsResponse = HttpUtils.doPost(ifsUrl + "ChangeAvailabilityControlID", jsonBody, null); |
|
|
|
|
|
|
|
|
|
|
|
if ("IFSUpdated".equals(ifsResponse) || "\"IFSUpdated\"".equals(ifsResponse)) { |
|
|
|
log.info("IFS ChangeAvailabilityControlID成功 - rqrq"); |
|
|
|
} else { |
|
|
|
@ -341,7 +341,7 @@ public class IfsApiServiceImpl implements IfsApiService { |
|
|
|
String errorMessage = IfsErrorMessageUtils.extractOracleErrorMessage(ifsResponse); |
|
|
|
throw new RuntimeException(errorMessage); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ifsResponse; |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("IFS ChangeAvailabilityControlID异常 - rqrq:{}", e.getMessage()); |
|
|
|
|