|
|
|
@ -6,6 +6,8 @@ import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.gaotao.common.exception.XJException; |
|
|
|
import com.gaotao.common.utils.*; |
|
|
|
import com.gaotao.modules.factory.dao.AccessSiteMapper; |
|
|
|
import com.gaotao.modules.factory.entity.Site; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
@ -55,20 +57,26 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
private HandlingUnitDetailService handlingUnitDetailService; |
|
|
|
@Autowired |
|
|
|
private AgvClientUtil agvClientUtil; |
|
|
|
@Autowired |
|
|
|
private AccessSiteMapper accessSiteMapper; |
|
|
|
|
|
|
|
@Value("${custom.ifs-url}") |
|
|
|
private String ifsUrl; |
|
|
|
@Value("${custom.ifs-ifsDBName}") |
|
|
|
private String ifsDBName; |
|
|
|
@Value("${custom.ifs-domainUserID}") |
|
|
|
private String domainUserID; |
|
|
|
|
|
|
|
@Value("${custom.wcs-url}") |
|
|
|
private String wcsUrl; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Map<String, Object>> getPoList(PurchaseOrderDto purchaseOrder) { |
|
|
|
try { |
|
|
|
// 注意:这里应该根据实际的IFS接口调用方式进行调整 |
|
|
|
// 如果需要获取多行数据,可能需要先获取PO头,再获取行数据 |
|
|
|
Map<String, Object> params = Map.of( |
|
|
|
"ifsDBName", "UPD24", |
|
|
|
"domainUserID", "CCL_WMS", |
|
|
|
Map<String, Object> params = Map.of("ifsDBName", ifsDBName, "domainUserID", domainUserID, |
|
|
|
"ifsSiteID", purchaseOrder.getSite(), |
|
|
|
"ifsPurchaseOrderNo", purchaseOrder.getPoNumber() |
|
|
|
); |
|
|
|
@ -78,8 +86,8 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
|
|
|
|
/*Map<String, Object> params2 = Map.of( |
|
|
|
"ifsDBName", "UPD24", |
|
|
|
"domainUserID", "CCL_WMS", |
|
|
|
"ifsDBName", ifsDBName, |
|
|
|
"domainUserID", domainUserID, |
|
|
|
"ifsSiteID", "55", |
|
|
|
"partNo", "80900095-1DF", |
|
|
|
"qtyToIssue", 10, |
|
|
|
@ -219,11 +227,15 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
.eq(TransHeader::getTransNo, transHeader.getTransNo()) |
|
|
|
.update(); |
|
|
|
} |
|
|
|
// 处理托盘和AGV调度逻辑 |
|
|
|
handlePalletAndAGVDispatch(inData, transHeader); |
|
|
|
|
|
|
|
// 同步到IFS |
|
|
|
syncToIFS(inData, transHeader); |
|
|
|
|
|
|
|
// 如果工厂是立体仓库,则需处理托盘和AGV调度逻辑 |
|
|
|
List<Map<String, Object>> sites = accessSiteMapper.getSiteById(inData.getSite()); |
|
|
|
if (!sites.isEmpty() && sites.getFirst().get("verticalWarehouseFlag")!=null |
|
|
|
&& "Y".equals(sites.getFirst().get("verticalWarehouseFlag").toString())) { |
|
|
|
handlePalletAndAGVDispatch(inData, transHeader); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
throw new XJException("采购入库失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
@ -462,7 +474,7 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
try { |
|
|
|
JSONObject ifsRequest = new JSONObject(); |
|
|
|
ifsRequest.put("ifsDBName", "IFSTEST"); |
|
|
|
ifsRequest.put("domainUserID", "CCL_WMS"); |
|
|
|
ifsRequest.put("domainUserID", domainUserID); |
|
|
|
ifsRequest.put("ifsSiteID", "55"); |
|
|
|
ifsRequest.put("poNumber", inData.getPoNo()); |
|
|
|
ifsRequest.put("orderNo", inData.getOrderNo()); |
|
|
|
|