关务推送增加字段

This commit is contained in:
秦鸿展
2026-07-06 20:45:27 +08:00
parent 930894b37e
commit 2a33823ef2
@@ -1,13 +1,17 @@
package com.mhd.oms.interfaces.facade.materialPushRecord;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
import com.mhd.oms.domain.materialPushRecord.service.MaterialPushRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Api(tags = "物料推送记录")
@RestController
@@ -17,10 +21,27 @@ public class MaterialPushRecordApi {
@Resource
private MaterialPushRecordService materialPushRecordService;
@Resource
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
@ApiOperation("批量查询物料推送数据(先按orderId查单证推送快照,再按物料id查推送快照,最后调WMS)")
@GetMapping("/getBatchByIds")
public AjaxResult getBatchByIds(@RequestParam("materialBaseInfoIds") List<Long> materialBaseInfoIds,
@RequestParam("orderId") Long orderId) {
return AjaxResult.success(materialPushRecordService.getBatchByIds(materialBaseInfoIds, orderId));
// 查询订单的境内货源地、最终目的国
String domesticSourcePlace = "";
String destinationCountry = "";
if (orderId != null) {
BusinessDocumentOrder order = businessDocumentOrderMapper.selectById(orderId);
if (order != null) {
domesticSourcePlace = order.getDomesticSourcePlace() != null ? order.getDomesticSourcePlace() : "";
destinationCountry = order.getDestinationCountry() != null ? order.getDestinationCountry() : "";
}
}
Map<String, Object> result = new LinkedHashMap<>();
result.put("tableData", materialPushRecordService.getBatchByIds(materialBaseInfoIds, orderId));
result.put("domesticSourcePlace", domesticSourcePlace);
result.put("destinationCountry", destinationCountry);
return AjaxResult.success(result);
}
}