Merge branch 'dev_20260429' into dev_WMS20260401
# Conflicts: # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java # mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java
This commit is contained in:
@@ -58,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="specificationModel" column="SPECIFICATION_MODEL" />
|
||||
<result property="stockQuantity" column="stock_quantity" />
|
||||
<result property="copyCode" column="copy_code" />
|
||||
<result property="goodsType" column="goods_type" />
|
||||
<result property="pushStatus" column="push_status" />
|
||||
<result property="pushTime" column="push_time" />
|
||||
<result property="pushBy" column="push_by" />
|
||||
<result property="grossWeight" column="gross_weight" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -66,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
material_classify_name, a.material_type, a.material_type_name, a.pack_id, a.pack_code, a.pack_name, a.unit_code, a.unit_name, a.brand_id, a.brand_code, a.brand_name, a.shelf_life, a.weight_limit, a.volume_limit, a.material_shape,
|
||||
material_shape_name, a.material_size, a.material_length, a.material_width, a.material_height, a.remark, a.nullify, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.common,
|
||||
sku_code, a.unit_price, a.currency, a.origin_country, a.hs_code, a.declaration_unit, a.statutory_unit, a.statutory_second_unit, a.copy_code,
|
||||
a.push_status,a.push_time,a.push_by,a.goods_type,a.gross_weight,
|
||||
specification_model as specification_model,nvl(b.stock_qty,0) as stock_quantity from material_base_info a left join (
|
||||
select material_base_info_id, sum(INVENTORY_QUANTITY) as stock_qty from MATERIAL_INVENTORY group by material_base_info_id
|
||||
) b on a.material_base_info_id = b.material_base_info_id
|
||||
@@ -209,6 +215,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and mgr.batch_id = #{batchId}
|
||||
and mgr.del_flag = 1
|
||||
)
|
||||
</if>
|
||||
<if test="pushStatus != null">
|
||||
and a.push_status = #{pushStatus}
|
||||
</if>
|
||||
<if test="pushTimeStart != null and pushTimeStart != ''">
|
||||
and date_format(a.push_time,'%Y-%m-%d') >= #{pushTimeStart}
|
||||
</if>
|
||||
<if test="pushTimeEnd != null and pushTimeEnd != ''">
|
||||
and date_format(a.push_time,'%Y-%m-%d') <= #{pushTimeEnd}
|
||||
</if>
|
||||
<if test="createTimeStart != null and createTimeStart != ''">
|
||||
and date_format(a.create_time,'%Y-%m-%d') >= #{createTimeStart}
|
||||
</if>
|
||||
<if test="createTimeEnd != null and createTimeEnd != ''">
|
||||
and date_format(a.create_time,'%Y-%m-%d') <= #{createTimeEnd}
|
||||
</if>
|
||||
<if test="updateTimeStart != null and updateTimeStart != ''">
|
||||
and date_format(a.update_time,'%Y-%m-%d') >= #{updateTimeStart}
|
||||
</if>
|
||||
<if test="updateTimeEnd != null and updateTimeEnd != ''">
|
||||
and date_format(a.update_time,'%Y-%m-%d') <= #{updateTimeEnd}
|
||||
</if>
|
||||
<!-- 传 1:只查公共 , 2:只查自己的 ,3:公共的和自己的 -->
|
||||
<choose>
|
||||
@@ -281,4 +308,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where material_base_info_id = #{materialBaseInfoId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBatchByIds" resultType="com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO">
|
||||
select * from material_base_info
|
||||
where material_base_info_id in
|
||||
<foreach collection="materialBaseInfoIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -89,6 +89,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.in_order_number,a.lot_number
|
||||
</sql>
|
||||
|
||||
<!-- 按物料(wl)汇总:仓库/库区/库位取创建时间最新的一条明细(与 queryListByWl 中 loc 子查询一致;并列时取 material_inventory_id 更大) -->
|
||||
<sql id="selectMaterialInventoryPoWl">
|
||||
a.material_inventory_id, a.organization_id, a.organization_name, a.top_organization_id,
|
||||
a.shipper_id, a.shipper_code, a.shipper_name,
|
||||
loc.warehouse_id, loc.warehouse_code, loc.warehouse_name,
|
||||
loc.storage_section_id, loc.storage_code, loc.storage_name, loc.storage_location_id, loc.storage_location_code, loc.storage_location_name, a.material_base_info_id,a.material_detail_id,
|
||||
a.batch_number,a.material_status_code,a.material_status_name,a.container_id,a.container_code,a.container_type,a.container_type_name
|
||||
,IFNULL (sum(a.freeze_quantity), 0) freeze_quantity,a.is_able,
|
||||
IFNULL (sum(a.inventory_quantity), 0) inventory_quantity,
|
||||
IFNULL (sum(a.allocation_quantity), 0) allocation_quantity,
|
||||
a.remark, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name,
|
||||
a.del_flag,a.unit,
|
||||
IFNULL (sum(a.area), 0) area,
|
||||
IFNULL (sum(a.NET_WEIGHT), 0) NET_WEIGHT,
|
||||
IFNULL (sum(a.GROSS_WEIGHT), 0) GROSS_WEIGHT,
|
||||
IFNULL (sum(a.VOLUME), 0) VOLUME,
|
||||
a.ext_attr_1, a.ext_attr_2, a.ext_attr_3, a.ext_attr_4,
|
||||
a.production_date, a.expiry_date, a.inventory_date,
|
||||
a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name,
|
||||
a.bar_code as inv_bar_code,
|
||||
a.in_order_number,a.lot_number
|
||||
</sql>
|
||||
|
||||
<sql id="selectMaterialInventoryPo1">
|
||||
<if test="materialInventoryId != null ">
|
||||
and a.material_inventory_id = #{materialInventoryId}
|
||||
@@ -183,6 +206,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="freezeQuantity != null ">
|
||||
and a.freeze_quantity = #{freezeQuantity}
|
||||
</if>
|
||||
<if test="excludeZeroInventoryQuantity != null and excludeZeroInventoryQuantity == true">
|
||||
and COALESCE(a.inventory_quantity, 0) > 0
|
||||
</if>
|
||||
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and a.create_by_name like concat('%', #{createByName}, '%')
|
||||
@@ -208,6 +234,124 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!-- 与 selectMaterialInventoryPo1 相同条件,表别名为 mi(用于 queryListByWl 最新明细子查询) -->
|
||||
<sql id="selectMaterialInventoryPo1Mi">
|
||||
<if test="materialInventoryId != null ">
|
||||
and mi.material_inventory_id = #{materialInventoryId}
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and mi.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and mi.organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and mi.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and mi.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and mi.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and mi.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and mi.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="storageSectionId != null ">
|
||||
and mi.storage_section_id = #{storageSectionId}
|
||||
</if>
|
||||
<if test="storageCode != null and storageCode != ''">
|
||||
and mi.storage_code = #{storageCode}
|
||||
</if>
|
||||
<if test="storageName != null and storageName != ''">
|
||||
and mi.storage_name like concat('%', #{storageName}, '%')
|
||||
</if>
|
||||
<if test="storageLocationId != null ">
|
||||
and mi.storage_location_id = #{storageLocationId}
|
||||
</if>
|
||||
<if test="storageLocationCode != null and storageLocationCode != ''">
|
||||
and mi.storage_location_code = #{storageLocationCode}
|
||||
</if>
|
||||
<if test="storageLocationName != null and storageLocationName != ''">
|
||||
and mi.storage_location_name like concat('%', #{storageLocationName}, '%')
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and mi.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialDetailId != null ">
|
||||
and mi.material_detail_id, = #{materialDetailId}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="containerOrBatch != null and containerOrBatch != ''">
|
||||
and (mi.container_code like concat('%', #{containerOrBatch}, '%') or mi.batch_number like concat('%', #{containerOrBatch}, '%'))
|
||||
</when>
|
||||
<when test="batchNumber != null and batchNumber != '' and containerCode != null and containerCode != '' and batchNumber == containerCode">
|
||||
and (mi.batch_number like concat('%', #{batchNumber}, '%') or mi.container_code like concat('%', #{containerCode}, '%'))
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="batchNumber != null and batchNumber != ''">
|
||||
and mi.batch_number like concat('%', #{batchNumber}, '%')
|
||||
</if>
|
||||
<if test="containerCode != null and containerCode != ''">
|
||||
and mi.container_code like concat('%', #{containerCode}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="materialStatusCode != null and materialStatusCode != ''">
|
||||
and mi.material_status_code like concat('%', #{materialStatusCode}, '%')
|
||||
</if>
|
||||
<if test="materialStatusName != null and materialStatusName != ''">
|
||||
and mi.material_status_name like concat('%', #{materialStatusName}, '%')
|
||||
</if>
|
||||
<if test="containerId != null ">
|
||||
and mi.container_id = #{containerId}
|
||||
</if>
|
||||
<if test="containerType != null and containerType != ''">
|
||||
and mi.container_type like concat('%', #{containerType}, '%')
|
||||
</if>
|
||||
<if test="containerTypeName != null and containerTypeName != ''">
|
||||
and mi.container_type_name like concat('%', #{containerTypeName}, '%')
|
||||
</if>
|
||||
<if test="inventoryQuantity != null ">
|
||||
and mi.inventory_quantity = #{inventoryQuantity}
|
||||
</if>
|
||||
<if test="allocationQuantity != null ">
|
||||
and mi.allocation_quantity = #{allocationQuantity}
|
||||
</if>
|
||||
<if test="freezeQuantity != null ">
|
||||
and mi.freeze_quantity = #{freezeQuantity}
|
||||
</if>
|
||||
<if test="excludeZeroInventoryQuantity != null and excludeZeroInventoryQuantity == true">
|
||||
and COALESCE(mi.inventory_quantity, 0) > 0
|
||||
</if>
|
||||
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and mi.create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and mi.update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<choose>
|
||||
<when test="delFlag != null"> and mi.del_flag = #{delFlag} </when>
|
||||
<otherwise> and mi.del_flag = 1 </otherwise>
|
||||
</choose>
|
||||
<if test="storageInfo != null and storageInfo != ''">
|
||||
and (mi.storage_location_code = #{storageInfo} or material_code = #{storageInfo} or material_name like concat('%', #{storageInfo}, '%') or bar_code = #{storageInfo})
|
||||
</if>
|
||||
<if test="batchRefNo != null and batchRefNo != ''">
|
||||
and mi.BATCH_REF_NO like concat('%', #{batchRefNo}, '%')
|
||||
</if>
|
||||
<if test="sheetRefNo != null and sheetRefNo != ''">
|
||||
and mi.SHEET_REF_NO like concat('%', #{sheetRefNo}, '%')
|
||||
</if>
|
||||
<if test="boxPalletNo != null and boxPalletNo != ''">
|
||||
and mi.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
@@ -249,15 +393,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="queryListByWl" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
<include refid="selectMaterialInventoryPoWl"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from material_inventory a
|
||||
left join material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
inner join (
|
||||
select material_base_info_id, warehouse_id, warehouse_code, warehouse_name,
|
||||
storage_section_id, storage_code, storage_name,
|
||||
storage_location_id, storage_location_code, storage_location_name
|
||||
from (
|
||||
select mi.material_base_info_id, mi.warehouse_id, mi.warehouse_code, mi.warehouse_name,
|
||||
mi.storage_section_id, mi.storage_code, mi.storage_name,
|
||||
mi.storage_location_id, mi.storage_location_code, mi.storage_location_name,
|
||||
row_number() over (partition by mi.material_base_info_id order by mi.create_time desc, mi.material_inventory_id desc) as wl_rn
|
||||
from material_inventory mi
|
||||
left join material_base_info b on mi.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1Mi"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
) wl_ranked where wl_ranked.wl_rn = 1
|
||||
) loc on loc.material_base_info_id = a.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
GROUP BY a.MATERIAL_BASE_INFO_ID
|
||||
GROUP BY a.MATERIAL_BASE_INFO_ID,
|
||||
loc.warehouse_id, loc.warehouse_code, loc.warehouse_name,
|
||||
loc.storage_section_id, loc.storage_code, loc.storage_name,
|
||||
loc.storage_location_id, loc.storage_location_code, loc.storage_location_name
|
||||
</select>
|
||||
|
||||
<!-- 按货主+物料汇总:A货主物料1、A货主物料2、B货主物料1、B货主物料2 为 4 行;库位取该货主+该物料下创建时间最新的一条明细 -->
|
||||
<select id="queryListByHzWl" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPoWl"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from material_inventory a
|
||||
left join material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
inner join (
|
||||
select shipper_id, material_base_info_id, warehouse_id, warehouse_code, warehouse_name,
|
||||
storage_section_id, storage_code, storage_name,
|
||||
storage_location_id, storage_location_code, storage_location_name
|
||||
from (
|
||||
select mi.shipper_id, mi.material_base_info_id, mi.warehouse_id, mi.warehouse_code, mi.warehouse_name,
|
||||
mi.storage_section_id, mi.storage_code, mi.storage_name,
|
||||
mi.storage_location_id, mi.storage_location_code, mi.storage_location_name,
|
||||
row_number() over (partition by mi.shipper_id, mi.material_base_info_id order by mi.create_time desc, mi.material_inventory_id desc) as hzwl_rn
|
||||
from material_inventory mi
|
||||
left join material_base_info b on mi.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1Mi"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
) hzwl_ranked where hzwl_ranked.hzwl_rn = 1
|
||||
) loc on loc.shipper_id = a.shipper_id and loc.material_base_info_id = a.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
GROUP BY a.SHIPPER_ID, a.MATERIAL_BASE_INFO_ID,
|
||||
loc.warehouse_id, loc.warehouse_code, loc.warehouse_name,
|
||||
loc.storage_section_id, loc.storage_code, loc.storage_name,
|
||||
loc.storage_location_id, loc.storage_location_code, loc.storage_location_name
|
||||
</select>
|
||||
|
||||
<select id="queryListByHz" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
@@ -540,6 +738,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="inOrderNumber" column="in_order_number" />
|
||||
<result property="lotNumber" column="lot_number" />
|
||||
<result property="inventoryUpdateTime" column="inventory_update_time" />
|
||||
<result property="pickLastUpdateTime" column="pick_last_update_time" />
|
||||
<result property="checkLastUpdateTime" column="check_last_update_time" />
|
||||
<result property="latestChangeTime" column="latest_change_time" />
|
||||
</resultMap>
|
||||
<select id="queryImmediateInventoryList" parameterType="com.mhd.wms.domain.statementStatistics.todo.ImmediateInventoryDO"
|
||||
resultMap="queryImmediateInventoryListResult">
|
||||
@@ -653,7 +855,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.organization_name,
|
||||
a.top_organization_id,
|
||||
a.batch_number,
|
||||
a.in_order_number,a.lot_number
|
||||
a.in_order_number,
|
||||
a.lot_number,
|
||||
a.update_time inventory_update_time,
|
||||
(
|
||||
SELECT MAX(c.update_time)
|
||||
FROM picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
) pick_last_update_time,
|
||||
(
|
||||
SELECT MAX(c.update_time)
|
||||
FROM OUT_MATERIAL_DETAIL c
|
||||
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
|
||||
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
|
||||
WHERE
|
||||
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
|
||||
AND d.DEL_FLAG = 1
|
||||
AND c.DEL_FLAG = 1
|
||||
and e.del_flag = 1
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
) check_last_update_time,
|
||||
GREATEST(
|
||||
IFNULL(a.update_time, '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM OUT_MATERIAL_DETAIL c
|
||||
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
|
||||
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
|
||||
WHERE
|
||||
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
|
||||
AND d.DEL_FLAG = 1
|
||||
AND c.DEL_FLAG = 1
|
||||
and e.del_flag = 1
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00')
|
||||
) latest_change_time
|
||||
FROM
|
||||
material_inventory a
|
||||
left join material_base_info b on a.material_base_info_id=b.material_base_info_id
|
||||
@@ -925,6 +1186,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="freezeQuantityEnd != null ">
|
||||
and a.freeze_quantity < #{freezeQuantityEnd}
|
||||
</if>
|
||||
ORDER BY GREATEST(
|
||||
IFNULL(a.update_time, '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM OUT_MATERIAL_DETAIL c
|
||||
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
|
||||
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
|
||||
WHERE
|
||||
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
|
||||
AND d.DEL_FLAG = 1
|
||||
AND c.DEL_FLAG = 1
|
||||
and e.del_flag = 1
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00')
|
||||
) DESC, a.material_inventory_id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectOneByWhere" parameterType="com.mhd.wms.domain.statementStatistics.todo.ImmediateInventoryDO"
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<result property="materialCode" column="material_code"/>
|
||||
<result property="materialName" column="material_name"/>
|
||||
<result property="barCode" column="bar_code"/>
|
||||
<result property="size" column="SIZE"/>
|
||||
<result property="unitCode" column="unit_code"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="pendingReviewQty" column="pending_review_qty"/>
|
||||
@@ -232,6 +233,7 @@
|
||||
d.material_code,
|
||||
d.material_name,
|
||||
d.bar_code,
|
||||
d.SIZE,
|
||||
d.unit_code,
|
||||
d.unit_name,
|
||||
d.pending_review_qty,
|
||||
|
||||
Reference in New Issue
Block a user