Commit ddcedce8 by 赵剑炜

盘点上报时不删除销毁物资

parent 45f31323
...@@ -6,9 +6,11 @@ import java.math.BigDecimal; ...@@ -6,9 +6,11 @@ import java.math.BigDecimal;
@Data @Data
public class InvSummaryDto { public class InvSummaryDto {
private String id;
private String typeId; private String typeId;
private String sizeId; private String sizeId;
private String locationId; private String locationId;
private Integer count; private Integer count;
private BigDecimal price; private BigDecimal price;
private String epc;
} }
...@@ -27,6 +27,9 @@ public interface InventoryMapper extends BaseMapper<Inventory> { ...@@ -27,6 +27,9 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
List<WarehouseInvDto> GetViewWarehouseInv(@Param("warehouseId") String warehouseId,@Param("typeIdsList") List<String> typeIdsList,@Param("sizeIds") List<String> sizeIds); List<WarehouseInvDto> GetViewWarehouseInv(@Param("warehouseId") String warehouseId,@Param("typeIdsList") List<String> typeIdsList,@Param("sizeIds") List<String> sizeIds);
List<ViewEquipmentDto> GetViewEquipment(@Param("epcList") List<String> epcList); List<ViewEquipmentDto> GetViewEquipment(@Param("epcList") List<String> epcList);
List<EpcListDto> GetViewCountByepcs(@Param("epcList") List<String> epcList); List<EpcListDto> GetViewCountByepcs(@Param("epcList") List<String> epcList);
List<InvSummaryDto> selectEpcsByWarehouse(@Param("warehouseId") String warehouseId,
@Param("typeIdList")List<String> typeIdList,
@Param("sizeIdList")List<String> sizeIdList);
List<InventoryMapDto> GetViewInventoryMap(@Param("warehouseId") String warehouseId); List<InventoryMapDto> GetViewInventoryMap(@Param("warehouseId") String warehouseId);
......
...@@ -654,7 +654,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -654,7 +654,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
if(req.getState().equals("0"))//确认结果 if(req.getState().equals("0"))//确认结果
{ {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
List<WarehouseInventory> DeleteList; // List<WarehouseInventory> DeleteList;
List<WarehouseInventory> SaveEpcList =new ArrayList<>(); List<WarehouseInventory> SaveEpcList =new ArrayList<>();
List<BussinessDetail> bussinessDetail = bussinessInventoryDetailService.list( List<BussinessDetail> bussinessDetail = bussinessInventoryDetailService.list(
new LambdaQueryWrapper<BussinessDetail>().eq(BussinessDetail::getInventoryId, req.getOrderId()) new LambdaQueryWrapper<BussinessDetail>().eq(BussinessDetail::getInventoryId, req.getOrderId())
...@@ -746,7 +746,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -746,7 +746,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
} }
LambdaQueryWrapper<WarehouseInventory> queryWrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<WarehouseInventory> queryWrapper = new LambdaQueryWrapper<>();
params.put("warehouseId", BI.getWarehouseId()); // 添加一个空的列表 params.put("warehouseId", BI.getWarehouseId()); // 添加一个空的列表
// 从Map中获取sizeIds,假设它们存储为List类型 // 从Map中获取sizeIds,假设它们存储为List类型
List<String> sizeIds = (List<String>) params.get("sizeIds"); List<String> sizeIds = (List<String>) params.get("sizeIds");
...@@ -754,20 +754,20 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -754,20 +754,20 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
List<String> typeIds = (List<String>) params.get("typeIds"); List<String> typeIds = (List<String>) params.get("typeIds");
// 检查sizeIds是否不为空且不是空列表 // 检查sizeIds是否不为空且不是空列表
if (sizeIds != null && !sizeIds.isEmpty()) { if (sizeIds != null && !sizeIds.isEmpty()) {
queryWrapper.in(WarehouseInventory::getSizeId, sizeIds); // queryWrapper.in(WarehouseInventory::getSizeId, sizeIds);
} }
// 检查sizeIds是否不为空且不是空列表 // 检查sizeIds是否不为空且不是空列表
if (typeIds != null && !typeIds.isEmpty()) { if (typeIds != null && !typeIds.isEmpty()) {
queryWrapper.in(WarehouseInventory::getTypeId, typeIds); // queryWrapper.in(WarehouseInventory::getTypeId, typeIds);
} }
// 添加查询条件,仅查询warehouseId为111的记录 // // 添加查询条件,仅查询warehouseId符合的记录
queryWrapper.eq(WarehouseInventory::getLocationId, BI.getWarehouseId()); // queryWrapper.eq(WarehouseInventory::getLocationId, BI.getWarehouseId());
DeleteList = warehouseInventoryService.list(queryWrapper); // DeleteList = warehouseInventoryService.list(queryWrapper);
List<InvSummaryDto> invDelete= inventoryMapper.selectEpcsByWarehouse(BI.getWarehouseId(),typeIds,sizeIds);
List<String> removeIds = invDelete.stream() // 创建流
.map(InvSummaryDto::getId) // 提取每个InvSummaryDto对象的id
.collect(Collectors.toList()); // 收集到列表中
// 检查sizeIds是否不为空且不是空列表
if (sizeIds != null && !sizeIds.isEmpty()) {
queryWrapper.in(WarehouseInventory::getSizeId, sizeIds);
}
List<WarehouseInvDto> DeleteFakeEpc = inventoryMapper.GetViewWarehouseInv(BI.getWarehouseId(), typeIds, sizeIds); List<WarehouseInvDto> DeleteFakeEpc = inventoryMapper.GetViewWarehouseInv(BI.getWarehouseId(), typeIds, sizeIds);
...@@ -917,9 +917,13 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -917,9 +917,13 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
BI.setUpdateTime(DateTimeUtil.getCurrentDateTime()); BI.setUpdateTime(DateTimeUtil.getCurrentDateTime());
//删除同组织机构下该EPC其他仓库的位置信息 //删除同组织机构下该EPC其他仓库的位置信息
inventoryMapper.DeleteEpcsWithoutWarehouse(UpdateInventorys, String.valueOf(BI.getOrgId()),String.valueOf(BI.getWarehouseId())); inventoryMapper.DeleteEpcsWithoutWarehouse(UpdateInventorys, String.valueOf(BI.getOrgId()),String.valueOf(BI.getWarehouseId()));
if (DeleteList.size()>0)//删除库内全部的EPC信息 // if (DeleteList.size()>0)//删除库内全部的EPC信息
// {
// warehouseInventoryService.removeBatchByIds(DeleteList);
// }
if (removeIds.size()>0)//删除库内全部的EPC信息
{ {
warehouseInventoryService.removeBatchByIds(DeleteList); warehouseInventoryService.removeByIds(removeIds);
} }
if (DeleteSummary.size()>0) if (DeleteSummary.size()>0)
......
...@@ -134,6 +134,34 @@ ...@@ -134,6 +134,34 @@
AND bwi.location_id != #{warehouseId} AND bwi.location_id != #{warehouseId}
</delete> </delete>
<select id="selectEpcsByWarehouse" resultType="com.junmp.jyzb.api.bean.dto.InvSummaryDto">
SELECT
bi.epc,
bi.type_id as typeId,
bi.size_id as sizeId,
bwi.id as id,
bwi.location_id as locationId,
bi.price
FROM
`base_inventory` `bi`
JOIN
`base_warehouse_inventory` `bwi` ON `bi`.`epc` = `bwi`.`epc`
WHERE bwi.location_id=#{warehouseId} and bi.state!="destory"
<if test="typeIdList!=null and typeIdList.size() > 0">
AND bi.type_id IN
<foreach collection="typeIdList " item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="sizeIdList != null and sizeIdList.size() > 0">
AND bi.size_id IN
<foreach item="item" collection="sizeIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="selectWarehouseByEpcs" resultType="com.junmp.jyzb.api.bean.dto.InvSummaryDto"> <select id="selectWarehouseByEpcs" resultType="com.junmp.jyzb.api.bean.dto.InvSummaryDto">
SELECT SELECT
bi.type_id as typeId, bi.type_id as typeId,
...@@ -150,6 +178,7 @@ ...@@ -150,6 +178,7 @@
open="(" separator="," close=")"> open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
and bwi.org_id=#{orgId} and bwi.location_id!=#{warehouseId} and bwi.org_id=#{orgId} and bwi.location_id!=#{warehouseId}
GROUP BY GROUP BY
bi.size_id, bi.type_id, bi.price,bwi.location_id bi.size_id, bi.type_id, bi.price,bwi.location_id
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论