报关回写;

This commit is contained in:
王奎兴
2026-06-23 10:50:23 +08:00
parent ab10adb0d2
commit d04df87e19
2 changed files with 19 additions and 3 deletions
@@ -22,6 +22,8 @@ import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil; import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
import com.mhd.system.api.model.LoginUser; import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.application.service.materialBaseInfo.MaterialBaseInfoApplicationService; import com.mhd.wms.application.service.materialBaseInfo.MaterialBaseInfoApplicationService;
import com.mhd.wms.domain.customsDeclarationDetail.repository.facade.ICustomsDeclarationDetailService;
import com.mhd.wms.domain.customsDeclarationDetail.repository.todo.CustomsDeclarationDetailDO;
import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO; import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO;
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail; import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService; import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService;
@@ -93,7 +95,8 @@ public class PickingOrderApplicationService {
private IPickingMaterialDetailService pickingMaterialDetailService; private IPickingMaterialDetailService pickingMaterialDetailService;
@Autowired @Autowired
private IInMaterialDetailService inMaterialDetailService; private IInMaterialDetailService inMaterialDetailService;
@Autowired
private ICustomsDeclarationDetailService customsDeclarationDetailService;
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
private static final String API_NAME = "save_qnBill_e"; private static final String API_NAME = "save_qnBill_e";
@@ -784,7 +787,7 @@ public class PickingOrderApplicationService {
CloseableHttpResponse customsResponse = customsHttpClient.execute(customsHttpPost); CloseableHttpResponse customsResponse = customsHttpClient.execute(customsHttpPost);
String customsResponseString = EntityUtils.toString(customsResponse.getEntity()); String customsResponseString = EntityUtils.toString(customsResponse.getEntity());
log.info("customsResponseString:{}", customsResponseString);
if (customsResponse.getStatusLine().getStatusCode() == 200) { if (customsResponse.getStatusLine().getStatusCode() == 200) {
JSONObject customsJson = JSONObject.parseObject(customsResponseString); JSONObject customsJson = JSONObject.parseObject(customsResponseString);
JSONArray customsData = customsJson.getJSONArray("data"); JSONArray customsData = customsJson.getJSONArray("data");
@@ -803,6 +806,19 @@ public class PickingOrderApplicationService {
log.error("调用报关回写接口失败: pickingOrderNumber={}", pickingOrder.getPickingOrderNumber(), e); log.error("调用报关回写接口失败: pickingOrderNumber={}", pickingOrder.getPickingOrderNumber(), e);
} }
// ========== 写入报关明细表 ==========
if (StringUtils.isNotBlank(bondInvtNo)) {
CustomsDeclarationDetailDO detailDO = new CustomsDeclarationDetailDO();
detailDO.setDocumentNumber(pickingOrder.getPickingOrderNumber());
detailDO.setBondInvtNo(bondInvtNo);
detailDO.setInvtRow(invtRow);
detailDO.setInOrderNumber(pickingOrder.getOrderNumber());
detailDO.setOrganizationId(pickingOrder.getOrganizationId());
detailDO.setOrganizationName(pickingOrder.getOrganizationName());
detailDO.setTopOrganizationId(pickingOrder.getTopOrganizationId());
customsDeclarationDetailService.insert(detailDO);
}
// 3. 构建主单 // 3. 构建主单
Map<String, Object> order = new HashMap<>(); Map<String, Object> order = new HashMap<>();
// etpsPreentNo: 入库单号 - 取拣货明细中的入库单号(第一个) // etpsPreentNo: 入库单号 - 取拣货明细中的入库单号(第一个)
@@ -2712,7 +2712,7 @@ public class StockShelfOrderApplicationService {
CloseableHttpResponse customsResponse = customsHttpClient.execute(customsHttpPost); CloseableHttpResponse customsResponse = customsHttpClient.execute(customsHttpPost);
String customsResponseString = EntityUtils.toString(customsResponse.getEntity()); String customsResponseString = EntityUtils.toString(customsResponse.getEntity());
log.info("customsResponseString:{}", customsResponseString);
if (customsResponse.getStatusLine().getStatusCode() == 200) { if (customsResponse.getStatusLine().getStatusCode() == 200) {
com.alibaba.fastjson.JSONObject customsJson = com.alibaba.fastjson.JSONObject.parseObject(customsResponseString); com.alibaba.fastjson.JSONObject customsJson = com.alibaba.fastjson.JSONObject.parseObject(customsResponseString);
com.alibaba.fastjson.JSONArray customsData = customsJson.getJSONArray("data"); com.alibaba.fastjson.JSONArray customsData = customsJson.getJSONArray("data");