|
@@ -56,13 +56,13 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
/**
|
|
|
* 查询库位库存信息列表
|
|
|
*
|
|
|
- * @param locationId
|
|
|
+ * @param locationId 需要为库位ID
|
|
|
* @return 库位库存信息
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<InvLotLocId> selectInvLotLocIdList(String locationId) {
|
|
|
+ public List<InvLotLocId> selectInvLotLocIdList(Long locationId) {
|
|
|
InvLotLocId invLotLocId = new InvLotLocId();
|
|
|
- invLotLocId.setLocationId(locationId);
|
|
|
+ invLotLocId.setLocationId(locationId.toString());
|
|
|
return invLotLocIdMapper.selectInvLotLocIdList(invLotLocId);
|
|
|
}
|
|
|
|
|
@@ -187,6 +187,38 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
return AjaxResult.success("下发任务成功!");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult clear(String locationId, Long warehouseId, String updateBy) {
|
|
|
+ Long id; // 库位ID
|
|
|
+ BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationId, warehouseId);
|
|
|
+ if (baseLocationInfo == null) {
|
|
|
+ return AjaxResult.error("不存在对应库位:" + locationId);
|
|
|
+ }
|
|
|
+ id = baseLocationInfo.getId();
|
|
|
+ // 是否任务空闲
|
|
|
+ Boolean isIdle = baseLocationInfoService.verifyLocationIsIdle(locationId, warehouseId);
|
|
|
+ if (!isIdle) {
|
|
|
+ return AjaxResult.error("库位需要空闲状态!" + locationId);
|
|
|
+ }
|
|
|
+ // 获取库存
|
|
|
+ List<InvLotLocId> invLotLocIdList = selectInvLotLocIdList(id);
|
|
|
+ if (invLotLocIdList.size() == 0) {
|
|
|
+ return AjaxResult.error("不存在对应库存!");
|
|
|
+ }
|
|
|
+ for (InvLotLocId invLotLocId : invLotLocIdList) {
|
|
|
+ // 是否需要清理批次表inv_lot_att
|
|
|
+ }
|
|
|
+ // 清除库存
|
|
|
+ int i = invLotLocIdMapper.deleteInvLotLocIdByLocationId(id);
|
|
|
+ if (i <= 0) {
|
|
|
+ return AjaxResult.error("清理库存失败!");
|
|
|
+ }
|
|
|
+ // 修改库位为空闲无货
|
|
|
+ baseLocationInfoService.updateLocationIdleAndEmpty(id, warehouseId, updateBy);
|
|
|
+
|
|
|
+ return AjaxResult.success("操作成功!");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 新增库位库存信息
|
|
|
*
|