diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/entity/ItemKey.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/entity/ItemKey.java new file mode 100644 index 0000000..976c7fa --- /dev/null +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/entity/ItemKey.java @@ -0,0 +1,106 @@ +package org.cpte.modules.base.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: 物料属性 + * @author: cpte + * @Date: 2025-10-27 + * @Version: V1.0 + */ +@TableName("base_item_key") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Schema(description = "物料属性表") +public class ItemKey implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @Schema(description = "物料") + @JsonSerialize(using = ToStringSerializer.class) + private java.lang.Long itemId; + + /** + * 外部仓库 + */ + @Schema(description = "外部仓库") + private java.lang.String whCode; + + /** + * 项目号 + */ + @Schema(description = "项目号") + private java.lang.String project; + /** + * 任务号 + */ + @Schema(description = "任务号") + private java.lang.String taskNo; + /** + * 批次号 + */ + @Schema(description = "批次号") + private java.lang.String propC1; + /** + * 外部库存状态 + */ + @Schema(description = "外部库存状态") + private java.lang.String propC3; + + /** + * 所属部门 + */ + @Schema(description = "所属部门") + private String sysOrgCode; + /** + * 租户ID + */ + @Excel(name = "租户ID", width = 15) + @Schema(description = "租户ID") + private Long tenantId; + /** + * 创建人 + */ + @Schema(description = "创建人") + private String createBy; + /** + * 创建日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建日期") + private Date createTime; + /** + * 更新人 + */ + @Schema(description = "更新人") + private String updateBy; + /** + * 更新日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新日期") + private Date updateTime; +} diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/mapper/ItemKeyMapper.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/mapper/ItemKeyMapper.java new file mode 100644 index 0000000..9ed70bd --- /dev/null +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/mapper/ItemKeyMapper.java @@ -0,0 +1,39 @@ +package org.cpte.modules.base.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.cpte.modules.base.entity.ItemKey; + +import java.util.List; + +/** + * @Description: 物料属性 + * @author: cpte + * @Date: 2025-10-27 + * @Version: V1.0 + */ +public interface ItemKeyMapper extends BaseMapper { + /** + * 查询物料属性 + * + * @param itemId 物料ID + * @param whCode 外部仓库 + * @param project 项目号 + * @param taskNo 任务号 + * @param propC1 批次号 + * @param propC3 外部库存状态 + * @return ItemKey + */ + ItemKey queryItemKey(@Param("itemId") Long itemId, @Param("whCode") String whCode, + @Param("project") String project, @Param("taskNo") String taskNo, + @Param("propC1") String propC1, @Param("propC3") String propC3); + + List queryItemKeyByIds(@Param("itemKeyIds") List itemKeyIds); + + List queryItemKeys(@Param("itemIds") List itemIds, @Param("whCodeList") List whCodeList, + @Param("projectList") List projectList, @Param("taskNoList") List taskNoList, + @Param("propC1List") List propC1List, @Param("propC3List") List propC3List); + +} diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/mapper/xml/ItemKeyMapper.xml b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/mapper/xml/ItemKeyMapper.xml new file mode 100644 index 0000000..e85c331 --- /dev/null +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/mapper/xml/ItemKeyMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + \ No newline at end of file diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/IItemKeyService.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/IItemKeyService.java new file mode 100644 index 0000000..3dcd938 --- /dev/null +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/IItemKeyService.java @@ -0,0 +1,26 @@ +package org.cpte.modules.base.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.cpte.modules.base.entity.ItemKey; + +/** + * @Description: 物料属性 + * @author: cpte + * @Date: 2025-10-27 + * @Version: V1.0 + */ +public interface IItemKeyService extends IService { + + /** + * 构建物料属性 + * + * @param itemId 物料ID + * @param whCode 外部仓库 + * @param project 项目号 + * @param taskNo 任务号 + * @param propC1 批次号 + * @param propC3 外部库存状态 + * @return ItemKey + */ + ItemKey createItemKey(Long itemId, String whCode, String project, String taskNo, String propC1, String propC3); +} diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/IPointService.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/IPointService.java index e81f622..bf313e4 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/IPointService.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/IPointService.java @@ -1,10 +1,7 @@ package org.cpte.modules.base.service; -import org.apache.ibatis.annotations.Param; import org.cpte.modules.base.entity.Point; import com.baomidou.mybatisplus.extension.service.IService; -import org.cpte.modules.receive.entity.Asn; -import org.cpte.modules.receive.entity.AsnDetail; import java.util.List; import java.util.Map; diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/AreaServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/AreaServiceImpl.java index d6b92de..e113c12 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/AreaServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/AreaServiceImpl.java @@ -18,12 +18,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class AreaServiceImpl extends ServiceImpl implements IAreaService { - @Autowired - private AreaMapper areaMapper; - @Override public Area validateArea(String areaCode) { - Area area = areaMapper.queryByAreaCode(areaCode); + Area area = this.baseMapper.queryByAreaCode(areaCode); if (area == null) { throw new RuntimeException("系统无【" + areaCode + "】库区,请维护"); } diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/ItemKeyServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/ItemKeyServiceImpl.java new file mode 100644 index 0000000..be74934 --- /dev/null +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/ItemKeyServiceImpl.java @@ -0,0 +1,51 @@ +package org.cpte.modules.base.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.shiro.SecurityUtils; +import org.cpte.modules.base.entity.ItemKey; +import org.cpte.modules.base.mapper.ItemKeyMapper; +import org.cpte.modules.base.service.IItemKeyService; +import org.jeecg.common.system.vo.LoginUser; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; + +/** + * @Description: 物料属性 + * @author: cpte + * @Date: 2025-10-27 + * @Version: V1.0 + */ +@Service +public class ItemKeyServiceImpl extends ServiceImpl implements IItemKeyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public ItemKey createItemKey(Long itemId, String whCode, String project, String taskNo, String propC1, String propC3) { + LoginUser sysUser = null; + try { + sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + } catch (Exception e) { + log.error("获取登录用户信息失败"); + } + ItemKey itemKey = this.baseMapper.queryItemKey(itemId, whCode, project, taskNo, propC1, propC3); + if (itemKey != null) { + return itemKey; + } + itemKey = ItemKey.builder() + .itemId(itemId) + .whCode(whCode) + .project(project) + .taskNo(taskNo) + .propC1(propC1) + .propC3(propC3) + .sysOrgCode(sysUser == null ? "A05" : sysUser.getOrgCode()) + .tenantId(sysUser == null ? 1000L : Long.parseLong(sysUser.getRelTenantIds())) + .createBy(sysUser == null ? "saiWms" : sysUser.getUsername()) + .createTime(new Date()) + .build(); + return this.save(itemKey) ? itemKey : null; + } +} diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/ItemServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/ItemServiceImpl.java index 8f6b87a..a2fea7c 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/ItemServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/ItemServiceImpl.java @@ -24,9 +24,6 @@ import java.util.Map; @Service public class ItemServiceImpl extends ServiceImpl implements IItemService { - @Autowired - private ItemMapper itemMapper; - /** * 验证物料 * @@ -35,7 +32,7 @@ public class ItemServiceImpl extends ServiceImpl implements II */ @Override public Item validateItem(String itemCode) { - Item item = itemMapper.queryByItemCode(itemCode); + Item item = this.baseMapper.queryByItemCode(itemCode); if (item == null) { throw new RuntimeException("系统无【" + itemCode + "】物料,请维护"); } @@ -61,9 +58,7 @@ public class ItemServiceImpl extends ServiceImpl implements II //查询物料 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(Item::getItemCode, itemCodes); - queryWrapper.eq(Item::getDelFlag, 0); - queryWrapper.eq(Item::getIzActive, 1); - return itemMapper.selectList(queryWrapper); + return this.baseMapper.selectList(queryWrapper); } /** diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/PointServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/PointServiceImpl.java index a32d5ba..c2f0bc4 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/PointServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/PointServiceImpl.java @@ -32,9 +32,6 @@ public class PointServiceImpl extends ServiceImpl implements @Autowired private IAreaService iAreaService; - @Autowired - private PointMapper pointMapper; - @Autowired private RedisUtil redisUtil; @@ -46,7 +43,7 @@ public class PointServiceImpl extends ServiceImpl implements */ @Override public Point validatePoint(String pointCode) { - Point point = pointMapper.queryByPointCode(pointCode); + Point point = this.baseMapper.queryByPointCode(pointCode); if (point == null) { throw new RuntimeException("系统无【" + pointCode + "】库位,请维护"); } @@ -62,13 +59,13 @@ public class PointServiceImpl extends ServiceImpl implements @Override public void bindPoint(Point point) { point.setStatus(CommonStatusEnum.USED.getValue()); - pointMapper.updateById(point); + this.baseMapper.updateById(point); } @Override public void unbindPoint(Point point) { point.setStatus(CommonStatusEnum.FREE.getValue()); - pointMapper.updateById(point); + this.baseMapper.updateById(point); } /** @@ -84,9 +81,7 @@ public class PointServiceImpl extends ServiceImpl implements //查询库位 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(Point::getPointCode, pointCodes); - queryWrapper.eq(Point::getDelFlag, 0); - queryWrapper.eq(Point::getIzActive, 1); - return pointMapper.selectList(queryWrapper); + return this.baseMapper.selectList(queryWrapper); } /** @@ -124,7 +119,7 @@ public class PointServiceImpl extends ServiceImpl implements @Override public Point getWorkStationPoint(Integer status, String areaCode, String key) { - List dstPointList = pointMapper.queryPoints(null, status, areaCode); + List dstPointList = this.baseMapper.queryPoints(null, status, areaCode); if (dstPointList.isEmpty()) { String desc = AreaTypeEnum.getDescByValue(areaCode); throw new RuntimeException("【" + desc + "】" + "无空闲库位"); @@ -145,17 +140,17 @@ public class PointServiceImpl extends ServiceImpl implements @Override public List findByColAndLayer(String colNum, String layerNum) { - return pointMapper.findByColAndLayer(colNum, layerNum); + return this.baseMapper.findByColAndLayer(colNum, layerNum); } @Override public List queryPoints(String pointCode, Integer status, String areaCode) { - return pointMapper.queryPoints(pointCode, status, areaCode); + return this.baseMapper.queryPoints(pointCode, status, areaCode); } @Override public List findClusterPoint(Long itemId, String whCode, List projects, List taskNos, List propC1List, List propC3List, String areaCode) { - return pointMapper.findPointsWithSkuBatchPo(itemId, whCode,projects,taskNos, propC1List, propC3List, areaCode); + return this.baseMapper.findPointsWithSkuBatchPo(itemId, whCode,projects,taskNos, propC1List, propC3List, areaCode); } } diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/StockServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/StockServiceImpl.java index 098d759..d6b9041 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/StockServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/base/service/impl/StockServiceImpl.java @@ -30,9 +30,6 @@ import java.util.Objects; @Service public class StockServiceImpl extends ServiceImpl implements IStockService { - @Autowired - private StockMapper stockMapper; - /** * 验证容器 * @@ -41,7 +38,7 @@ public class StockServiceImpl extends ServiceImpl implements */ @Override public Stock validateStock(String StockCode) { - Stock stock = stockMapper.queryByStockCode(StockCode); + Stock stock = this.baseMapper.queryByStockCode(StockCode); if (stock == null) { throw new RuntimeException("系统无【" + StockCode + "】容器,请维护"); } @@ -65,7 +62,7 @@ public class StockServiceImpl extends ServiceImpl implements public void bindStock(Stock stock, Point point) { stock.setPointId(point == null ? null : point.getId()); stock.setStatus(CommonStatusEnum.USED.getValue()); - stockMapper.updateById(stock); + this.baseMapper.updateById(stock); } @@ -82,7 +79,7 @@ public class StockServiceImpl extends ServiceImpl implements //查询容器 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(Stock::getStockCode, stockCodes); - return stockMapper.selectList(queryWrapper); + return this.baseMapper.selectList(queryWrapper); } /** diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java index ba0b992..6441a6d 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/conveyorLine/service/impl/IConveyorLineServiceImpl.java @@ -7,8 +7,10 @@ import org.apache.commons.lang3.StringUtils; import org.cpte.modules.agvTask.entity.AgvTask; import org.cpte.modules.agvTask.mapper.AgvTaskMapper; import org.cpte.modules.agvTask.service.IAgvTaskService; +import org.cpte.modules.base.entity.ItemKey; import org.cpte.modules.base.entity.Point; import org.cpte.modules.base.entity.Stock; +import org.cpte.modules.base.mapper.ItemKeyMapper; import org.cpte.modules.base.mapper.PointMapper; import org.cpte.modules.base.mapper.StockMapper; import org.cpte.modules.base.service.IPointService; @@ -22,7 +24,6 @@ import org.cpte.modules.receive.entity.Asn; import org.cpte.modules.receive.entity.AsnDetail; import org.cpte.modules.receive.mapper.AsnDetailMapper; import org.cpte.modules.receive.mapper.AsnMapper; -import org.cpte.modules.shipping.entity.PickDetail; import org.cpte.modules.shipping.entity.Task; import org.cpte.modules.shipping.mapper.TaskMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -55,6 +56,9 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { @Autowired private AgvTaskMapper agvTaskMapper; + @Autowired + private ItemKeyMapper itemKeyMapper; + @Autowired private InventoryMapper inventoryMapper; @@ -274,8 +278,10 @@ public class IConveyorLineServiceImpl implements IConveyorLineService { List neighbors = inventoryMapper.findNeighborPoints( point.getColNum(), point.getLayerNum(), String.valueOf(minDepth), String.valueOf(maxDepth)); + List itemKeyIds = neighbors.stream().map(Inventory::getItemKeyId).distinct().toList(); + List itemKeys = itemKeyMapper.queryItemKeyByIds(itemKeyIds); - for (Inventory neighbor : neighbors) { + for (ItemKey neighbor : itemKeys) { if (neighbor.getItemId() != null) { // 同SKU加分 if (neighbor.getItemId().equals(itemId)) { diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/entity/Inventory.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/entity/Inventory.java index 776b836..4a0dae6 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/entity/Inventory.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/entity/Inventory.java @@ -51,6 +51,15 @@ public class Inventory implements Serializable { @Dict(dictTable = "base_item", dicCode = "id", dicText = "item_code") @JsonSerialize(using = ToStringSerializer.class) private java.lang.Long itemId; + + /** + * 物料属性 + */ + @Excel(name = "物料属性", width = 15) + @Schema(description = "物料属性") + @JsonSerialize(using = ToStringSerializer.class) + private java.lang.Long itemKeyId; + /** * 库位ID */ @@ -87,45 +96,6 @@ public class Inventory implements Serializable { @JsonSerialize(using = ToStringSerializer.class) private java.lang.Long receiveRecordId; - /** - * 外部仓库 - */ - @Excel(name = "外部仓库", width = 15) - @Schema(description = "外部仓库") - private java.lang.String whCode; - - /** - * 项目号 - */ - @Schema(description = "项目号") - private java.lang.String project; - /** - * 任务号 - */ - @Schema(description = "任务号") - private java.lang.String taskNo; - - /** - * 批次号 - */ - @Excel(name = "批次号", width = 15) - @Schema(description = "批次号") - private java.lang.String propC1; - - /** - * 外部库存状态 - */ - @Excel(name = "外部库存状态", width = 15) - @Schema(description = "外部库存状态") - private java.lang.String propC3; - - /** - * 序列号 - */ - @Excel(name = "序列号", width = 15) - @Schema(description = "序列号") - private java.lang.String propC2; - /** * 库存状态 */ @@ -133,20 +103,14 @@ public class Inventory implements Serializable { @Schema(description = "库存状态") @Dict(dicCode = "inventory_status") private java.lang.Integer status; - /** - * 生产日期 - */ - @Excel(name = "生产日期", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - @Schema(description = "生产日期") - private java.util.Date propD1; + /** * 描述 */ @Excel(name = "描述", width = 15) @Schema(description = "描述") private java.lang.String description; + /** * 所属部门 */ diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/InventoryMapper.java b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/InventoryMapper.java index bcc5139..bff2e09 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/InventoryMapper.java +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/InventoryMapper.java @@ -26,17 +26,6 @@ public interface InventoryMapper extends BaseMapper { @Select("select * from data_inventory where stock_id = #{stockId} and quantity>0 for update") Inventory queryByStockId(@Param("stockId") Long stockId); - /** - * 查询库存列表 - * - * @param itemIds 物料ID - * @param propC1List 批次号 - * @param propC3List 外部库存状态 - * @param whCodeList 外部仓库 - * @return List - */ - List queryInventory(@Param("itemIds") List itemIds, @Param("propC1List") List propC1List, @Param("propC3List") List propC3List, @Param("whCodeList") List whCodeList); - // 查询相邻库位(同一巷道,深度±3范围内) @Select("SELECT di.* " + "FROM data_inventory di " + @@ -49,6 +38,13 @@ public interface InventoryMapper extends BaseMapper { @Param("layerNum") String layerNum, @Param("minDepth") String minDepth, @Param("maxDepth") String maxDepth); + /** + * 根据物料属性ID集合查询库存数据 + * + * @param itemKeyIds 物料属性ID集合 + * @return List + */ + List queryInventoryByItemKeyId(@Param("itemKeyIds") List itemKeyIds); /** diff --git a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/xml/InventoryMapper.xml b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/xml/InventoryMapper.xml index 9a1ce6e..3a8da7f 100644 --- a/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/xml/InventoryMapper.xml +++ b/cpte-boot-module/cpte-module-wms/src/main/java/org/cpte/modules/inventory/mapper/xml/InventoryMapper.xml @@ -1,50 +1,16 @@ - + SELECT di.* FROM data_inventory di + JOIN base_item_key bik ON di.item_key_id = bik.id + WHERE di.status in (1,2) + AND di.quantity > 0 + AND bik.id IN + + #{itemKeyId} - - - AND prop_c1 IN - - #{propC1} - - - - AND (prop_c1 IS NULL OR prop_c1 = '') - - - - - - AND prop_c3 IN - - #{propC3} - - - - AND (prop_c3 IS NULL OR prop_c3 = '') - - - - - - AND wh_code IN - - #{whCode} - - - - AND (wh_code IS NULL OR wh_code = '') - - - ORDER BY create_time + ORDER BY di.create_time