Browse Source

getCurrentDomainUserID()

master
han\hanst 5 days ago
parent
commit
f221c44aa1
  1. 2
      src/main/java/com/gaotao/modules/inspection/service/impl/IfsInspectionHistoryServiceImpl.java
  2. 2
      src/main/java/com/gaotao/modules/po/service/impl/PoServiceImpl.java
  3. 23
      src/main/java/com/gaotao/modules/production/service/impl/ProductionWithdrawalServiceImpl.java

2
src/main/java/com/gaotao/modules/inspection/service/impl/IfsInspectionHistoryServiceImpl.java

@ -77,7 +77,7 @@ public class IfsInspectionHistoryServiceImpl implements IfsInspectionHistoryServ
// 构建请求参数参考getPoList的实现
Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName,
"domainUserID", domainUserID,
"domainUserID", getCurrentDomainUserID(),
"ifsSiteID", site,
"ifsTransactionID", ifsTransId
);

2
src/main/java/com/gaotao/modules/po/service/impl/PoServiceImpl.java

@ -116,7 +116,7 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen
@Override
public List<Map<String, Object>> getPoList(PurchaseOrderDto purchaseOrder) {
try {
Map<String, Object> params = Map.of("ifsDBName", ifsDBName, "domainUserID", domainUserID,
Map<String, Object> params = Map.of("ifsDBName", ifsDBName, "domainUserID", getCurrentDomainUserID(),
"ifsSiteID", purchaseOrder.getSite(),
"ifsPurchaseOrderNo", purchaseOrder.getPoNumber()
);

23
src/main/java/com/gaotao/modules/production/service/impl/ProductionWithdrawalServiceImpl.java

@ -17,6 +17,7 @@ import com.gaotao.modules.trans.service.TransHeaderService;
import com.gaotao.modules.trans.service.TransNoControlService;
import com.gaotao.modules.warehouse.service.InventoryStockService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -79,6 +80,24 @@ public class ProductionWithdrawalServiceImpl implements ProductionWithdrawalServ
@Value("${custom.ifs-domainUserID}")
private String domainUserID;
@Value("${ldap-control.control-flag:false}")
private Boolean ldapFlag;
/**
* 获取当前用户的域控账号如果开启了域控账号则获取用户的域控账号否则使用配置的默认值
*/
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) {
// 如果获取当前用户失败使用默认配置
}
}
return domainUserID;
}
/**
* @Author System
* @Description 从IFS获取工单接收历史记录
@ -96,7 +115,7 @@ public class ProductionWithdrawalServiceImpl implements ProductionWithdrawalServ
// 构建IFS接口参数
Map<String, Object> params = new HashMap<>();
params.put("ifsDBName", queryDto.getIfsDBName() != null ? queryDto.getIfsDBName() : ifsDBName);
params.put("domainUserID", queryDto.getDomainUserID() != null ? queryDto.getDomainUserID() : domainUserID);
params.put("domainUserID", getCurrentDomainUserID());
params.put("ifsSiteID", queryDto.getIfsSiteID());
params.put("ifsOrderNo", queryDto.getIfsOrderNo());
params.put("ifsReleaseNo", queryDto.getIfsReleaseNo());
@ -406,7 +425,7 @@ public class ProductionWithdrawalServiceImpl implements ProductionWithdrawalServ
// 构建IFS接口参数
Map<String, Object> params = new HashMap<>();
params.put("ifsDBName", ifsDBName);
params.put("domainUserID", domainUserID);
params.put("domainUserID", getCurrentDomainUserID());
params.put("ifsContract", dto.getSite());
params.put("ifsOrderNo", dto.getOrderNo());
params.put("ifsReleaseNo", dto.getReleaseNo());

Loading…
Cancel
Save