非通宇 保税仓出口订单推送;

This commit is contained in:
王奎兴
2026-06-11 17:27:06 +08:00
parent 889f5f34bc
commit e9a56f5a31
4 changed files with 68 additions and 78 deletions
@@ -57,9 +57,14 @@ public interface ReservationOutMaterialDetailMapper extends BaseMapper<Reservati
public Long getKcId(@Param("lotNo") String lotNo);
public String getLot(@Param("uniqueId") Long uniqueId);
public Long getkcIdByUniqueId(@Param("uniqueId") Long uniqueId);
public String getInOrderNumber(@Param("id") Long id);
public String getWarehouse(@Param("id") Long id);
public String getOpWhLoc(@Param("id") Long id);
public String getLotByKcId(@Param("id") Long id);
public String getInLotNo(@Param("inOrderNumber") String inOrderNumber, @Param("baseId") Long baseId);
}
@@ -1143,7 +1143,11 @@ public class ReservationStockOutOrderApplicationService {
String[] split = lotNo.split("-");
if (split.length == 2) {
item.put("lineNum", split[1]);
} else {
item.put("lineNum", 1);
}
} else {
item.put("lineNum", 1);
}
item.put("qty", detail.getQuantity());
@@ -1168,54 +1172,40 @@ public class ReservationStockOutOrderApplicationService {
}
// 库存关联信息(实体默认值 + WMS覆盖)
item.put("orderINo", detail.getInOrderNumber() != null ? detail.getInOrderNumber() : "");
if (detail.getLotNo() != null && detail.getLotNo().contains("-")) {
String lotNumStr = detail.getLotNo().substring(detail.getLotNo().lastIndexOf("-") + 1);
try {
Integer lotRowNum = Integer.valueOf(lotNumStr);
item.put("orderIRow", lotRowNum);
item.put("billIRow", lotRowNum);
} catch (NumberFormatException ignored) {}
}
item.put("warehouse", detail.getWarehouseName() != null ? detail.getWarehouseName() : "");
item.put("opWhLoc", detail.getStorageLocationName() != null ? detail.getStorageLocationName() : "");
// WMS仓储数据(如有则覆盖)
if (detail.getLotNo() != null) {
Long kcId = reservationOutMaterialDetailMapper.getKcId(detail.getLotNo());
if (kcId != null) {
String inOrderNumber = reservationOutMaterialDetailMapper.getInOrderNumber(kcId);
String inLotNo = inOrderNumber != null ? reservationOutMaterialDetailMapper.getInLotNo(inOrderNumber, detail.getMaterialBaseInfoId()) : null;
String warehouse = reservationOutMaterialDetailMapper.getWarehouse(kcId);
String opWhLoc = reservationOutMaterialDetailMapper.getOpWhLoc(kcId);
Long kcId = reservationOutMaterialDetailMapper.getkcIdByUniqueId(detail.getUniqueId());
if (kcId != null) {
String inOrderNumber = reservationOutMaterialDetailMapper.getInOrderNumber(kcId);
String warehouseCode = reservationOutMaterialDetailMapper.getWarehouse(kcId);
String opWhLoc = reservationOutMaterialDetailMapper.getOpWhLoc(kcId);
String inLotNo = reservationOutMaterialDetailMapper.getLotByKcId(kcId);
if (inOrderNumber != null) {
item.put("orderINo", inOrderNumber);
}
if (warehouse != null) {
item.put("warehouse", warehouse);
if (warehouseCode != null) {
item.put("warehouse", warehouseCode);
}
if (opWhLoc != null) {
item.put("opWhLoc", opWhLoc);
}
item.put("opWhLoc", opWhLoc != null ? opWhLoc : "");
// billI = 入库单号
if (inOrderNumber != null) {
item.put("billI", inOrderNumber);
}
if (inLotNo != null) {
if (inLotNo.contains("-")) {
String numStr = inLotNo.substring(inLotNo.lastIndexOf("-") + 1);
try {
Integer result = Integer.valueOf(numStr);
item.put("orderIRow", result);
item.put("billIRow", result);
} catch (NumberFormatException e) {
}
if (inLotNo != null && inLotNo.contains("-")) {
String[] split = inLotNo.split("-");
if (split.length == 2) {
item.put("orderIRow", split[1]);
item.put("billIRow", split[1]);
} else {
item.put("orderIRow", 1);
item.put("billIRow", 1);
}
} else {
item.put("orderIRow", 1);
item.put("billIRow", 1);
}
}
}
orderList.add(item);
}
order.put("orderList", orderList);