|
|
@ -2,6 +2,7 @@ package com.yvan.workbench.controller; |
|
|
|
|
|
|
|
|
import com.galaxis.rcs.common.entity.LccBasLocation; |
|
|
import com.galaxis.rcs.common.entity.LccBasLocation; |
|
|
import com.galaxis.rcs.common.entity.StoreLocation; |
|
|
import com.galaxis.rcs.common.entity.StoreLocation; |
|
|
|
|
|
import com.galaxis.rcs.common.enums.LCCDirection; |
|
|
import com.galaxis.rcs.inv.InvManager; |
|
|
import com.galaxis.rcs.inv.InvManager; |
|
|
import com.google.common.base.Strings; |
|
|
import com.google.common.base.Strings; |
|
|
import com.yvan.entity.BasLocationVo; |
|
|
import com.yvan.entity.BasLocationVo; |
|
|
@ -240,9 +241,18 @@ public class InvController { |
|
|
return R.success("Inventory moved successfully"); |
|
|
return R.success("Inventory moved successfully"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static R<?> loadInv(@RequestBody Map<String, Object> params) { |
|
|
public static R<?> queryInv(@RequestBody Map<String, Object> params) { |
|
|
String projectUuid = Conv.asString(params.get("projectUUID")); |
|
|
String projectUuid = Conv.asString(params.get("projectUUID")); |
|
|
Long envId = Conv.asLong(params.get("envId")); |
|
|
Long envId = Conv.asLong(params.get("envId")); |
|
|
|
|
|
String lpn = Conv.asString(params.get("lpn")); |
|
|
|
|
|
String locCode = Conv.asString(params.get("locCode")); |
|
|
|
|
|
String wayPoint = Conv.asString(params.get("wayPoint")); |
|
|
|
|
|
String wayDirection = Conv.asString(params.get("wayDirection")); |
|
|
|
|
|
String catalogCode = Conv.asString(params.get("catalogCode")); |
|
|
|
|
|
String rack = Conv.asString(params.get("rack")); |
|
|
|
|
|
Integer bay = Conv.asInteger(params.get("bay"), -1); |
|
|
|
|
|
Integer level = Conv.asInteger(params.get("level"), -1); |
|
|
|
|
|
Integer cell = Conv.asInteger(params.get("cell"), -1); |
|
|
|
|
|
|
|
|
if (Strings.isNullOrEmpty(projectUuid)) { |
|
|
if (Strings.isNullOrEmpty(projectUuid)) { |
|
|
return R.fail("projectUUID must not be null"); |
|
|
return R.fail("projectUUID must not be null"); |
|
|
@ -251,8 +261,6 @@ public class InvController { |
|
|
return R.fail("envId must not be null"); |
|
|
return R.fail("envId must not be null"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String catalogCode = Conv.asString(params.get("catalogCode")); |
|
|
|
|
|
|
|
|
|
|
|
var selectAction = queryDSL.select(QueryDslUtils.linkedMap( |
|
|
var selectAction = queryDSL.select(QueryDslUtils.linkedMap( |
|
|
lccInvLpn.lpn, |
|
|
lccInvLpn.lpn, |
|
|
lccBasContainer.containerType, |
|
|
lccBasContainer.containerType, |
|
|
@ -275,10 +283,42 @@ public class InvController { |
|
|
) |
|
|
) |
|
|
.where(lccInvLpn.envId.eq(envId)); |
|
|
.where(lccInvLpn.envId.eq(envId)); |
|
|
|
|
|
|
|
|
|
|
|
if (!Strings.isNullOrEmpty(lpn)) { |
|
|
|
|
|
selectAction.where(lccInvLpn.lpn.eq(lpn)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!Strings.isNullOrEmpty(locCode)) { |
|
|
|
|
|
selectAction.where(lccInvLpn.locCode.eq(locCode)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!Strings.isNullOrEmpty(wayPoint)) { |
|
|
|
|
|
selectAction.where(lccBasLocation.wayPoint.eq(wayPoint)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!Strings.isNullOrEmpty(wayDirection)) { |
|
|
|
|
|
selectAction.where(lccBasLocation.locDirection.eq( |
|
|
|
|
|
LCCDirection.fromString(wayDirection).toString() |
|
|
|
|
|
)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (!Strings.isNullOrEmpty(catalogCode)) { |
|
|
if (!Strings.isNullOrEmpty(catalogCode)) { |
|
|
selectAction.where(lccBasLocation.catalogCode.in(catalogCode, "N/A")); |
|
|
selectAction.where(lccBasLocation.catalogCode.in(catalogCode, "N/A")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!Strings.isNullOrEmpty(rack)) { |
|
|
|
|
|
selectAction.where(lccBasLocation.rack.eq(rack)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (bay != null && bay >= 0) { |
|
|
|
|
|
selectAction.where(lccBasLocation.bay.eq(bay)); |
|
|
|
|
|
} |
|
|
|
|
|
if (level != null && level >= 0) { |
|
|
|
|
|
selectAction.where(lccBasLocation.level.eq(level)); |
|
|
|
|
|
} |
|
|
|
|
|
if (cell != null && cell >= 0) { |
|
|
|
|
|
selectAction.where(lccBasLocation.cell.eq(cell)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var list = selectAction.fetch(); |
|
|
var list = selectAction.fetch(); |
|
|
|
|
|
|
|
|
return R.success(list); |
|
|
return R.success(list); |
|
|
|