Merge branch 'dev' into dev-ty1.2
# Conflicts: # mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java # mhd_wms/src/main/java/com/mhd/wms/domain/stockInOrder/repository/todo/StockInOrderDO.java # mhd_wms/src/main/java/com/mhd/wms/domain/stockOutOrder/repository/todo/StockOutOrderDO.java # mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockInOrder/StockInOrderDTO.java # mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockOutOrder/StockOutOrderDTO.java
This commit is contained in:
+102
@@ -358,4 +358,106 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="getkctzjl" resultType="com.mhd.oms.domain.executionInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO">
|
||||
select * from "NGWL_TEST_WMS".INVENTORY_ADJUSTMENT_RECORD where MATERIAL_BASE_INFO_ID = #{materialBaseInfoId} and RELATE_NO = #{orderNumber} and ADJUST_TYPE = #{adjustType}
|
||||
</select>
|
||||
|
||||
<!-- ========== 入库明细查询(关联入库执行单) ========== -->
|
||||
<resultMap type="com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO" id="InMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
||||
<result property="inOrderStatus" column="in_order_status" />
|
||||
<result property="inOrderAuditStatus" column="in_order_audit_status" />
|
||||
<result property="orderShipperId" column="order_shipper_id" />
|
||||
<result property="orderShipperCode" column="order_shipper_code" />
|
||||
<result property="orderShipperName" column="order_shipper_name" />
|
||||
</resultMap>
|
||||
|
||||
<select id="queryInOrderDetailList" parameterType="com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO"
|
||||
resultMap="InMaterialDetailWithOrderResult">
|
||||
select
|
||||
a.material_detail_id, a.organization_id, a.organization_name, a.top_organization_id, a.unique_id,
|
||||
a.in_order_number, a.material_base_info_id, a.material_code, a.material_name, a.bar_code,
|
||||
a.quantity, a.receipt_quantity, a.shelves_quantity,
|
||||
a.receipt_status, a.shelves_status, a.pack_id, a.pack_code, a.pack_name,
|
||||
a.pack_detail_id, a.unit_code, a.unit_name, a.unit_number, a.material_warehouse_control_id,
|
||||
a.serial_number_manage, a.quality_inspection_manage, a.quality_inspection_stage,
|
||||
a.quality_inspection_rule, a.quality_inspection_ratio, a.quality_inspection_term,
|
||||
a.quality_inspection_results, a.allow_overcharge, a.overcharge_ratio,
|
||||
a.batch_number, a.material_status_code, a.material_status_name,
|
||||
a.distribute_rule_id, a.distribute_rule_code, a.distribute_rule_name,
|
||||
a.container_id, a.container_code, a.container_type, a.container_type_name,
|
||||
a.warehouse_id, a.warehouse_code, a.warehouse_name,
|
||||
a.storage_section_id, a.storage_code, a.storage_name,
|
||||
a.storage_location_id, a.storage_location_code, a.storage_location_name,
|
||||
a.level, a.parent_unique_id,
|
||||
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.over_stock_id, a.over_stock_status, a.over_stock_type,
|
||||
a.SPECIFICATION_MODEL, a.SKU_CODE, a.INVOICE_NO, a.LITER, a.DIMENSIONS,
|
||||
a.DECLARATION_UNIT, a.BATCH_REF_NO, a.SHEET_REF_NO,
|
||||
a.ORIGIN_COUNTRY, a.BOX_PALLET_NO, a.CURRENCY, a.UNIT,
|
||||
a.DECLARED_QUANTITY, a.BOX_COUNT, a.PIECE_COUNT, a.INBOUND_QUANTITY,
|
||||
a.TOTAL_NET_WEIGHT, a.TOTAL_GROSS_WEIGHT, a.TOTAL_VOLUME, a.TOTAL_AREA, a.TOTAL_PRICE,
|
||||
a.PRODUCTION_DATE, a.EXPIRY_DATE, a.INVENTORY_DATE,
|
||||
a.EXT_ATTR_1, a.EXT_ATTR_2, a.EXT_ATTR_3, a.EXT_ATTR_4,
|
||||
a.contract_fee, a.monthly_warehouse_fee, a.half_month_wh_fee, a.discount_rate,
|
||||
a.single_volume, a.single_gross_weight, a.lot_no,
|
||||
a.drink_date, a.fire_insure_fee, a.unit_price,
|
||||
a.line_num_gw, a.spec_gw, a.unit_gw, a.qty_gw, a.erp_curr_gw, a.erp_price_gw, a.amount_gw,
|
||||
b.shipper_id as order_shipper_id,
|
||||
b.shipper_code as order_shipper_code,
|
||||
b.shipper_name as order_shipper_name,
|
||||
b.status as in_order_status,
|
||||
b.audit_status as in_order_audit_status
|
||||
from execution_in_material_detail a
|
||||
left join execution_stock_in_order b on a.in_order_number = b.in_order_number
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and a.material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and a.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="inOrderNumber != null and inOrderNumber != ''">
|
||||
and b.in_order_number like concat('%', #{inOrderNumber}, '%')
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and b.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and b.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and b.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and b.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and b.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="inOrderTypeCode != null and inOrderTypeCode != ''">
|
||||
and b.order_type_code = #{inOrderTypeCode}
|
||||
</if>
|
||||
<if test="inStatus != null ">
|
||||
and b.status = #{inStatus}
|
||||
</if>
|
||||
<if test="inOrderExpectStartTime != null">
|
||||
and b.expect_time >= #{inOrderExpectStartTime}
|
||||
</if>
|
||||
<if test="inOrderExpectEndTime != null">
|
||||
and b.expect_time <= #{inOrderExpectEndTime}
|
||||
</if>
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
+105
@@ -448,4 +448,109 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="getkcIdByUniqueId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
select MATERIAL_INVENTORY_ID from "NGWL_TEST_WMS".OUT_MATERIAL_DETAIL where UNIQUE_ID = #{uniqueId}
|
||||
</select>
|
||||
|
||||
<!-- ========== 出库明细查询(关联出库执行单) ========== -->
|
||||
<resultMap type="com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO"
|
||||
id="OutMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
||||
<result property="outOrderStatus" column="out_order_status" />
|
||||
<result property="outOrderAuditStatus" column="out_order_audit_status" />
|
||||
<result property="orderShipperId" column="order_shipper_id" />
|
||||
<result property="orderShipperCode" column="order_shipper_code" />
|
||||
<result property="orderShipperName" column="order_shipper_name" />
|
||||
<result property="orderOutboundDate" column="order_outbound_date" />
|
||||
<result property="orderOutboundTime" column="order_outbound_time" />
|
||||
</resultMap>
|
||||
|
||||
<select id="queryOutOrderDetailList"
|
||||
parameterType="com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO"
|
||||
resultMap="OutMaterialDetailWithOrderResult">
|
||||
select
|
||||
a.material_detail_id, a.organization_id, a.organization_name, a.top_organization_id, a.unique_id,
|
||||
a.out_order_number, a.material_base_info_id, a.material_code, a.material_name, a.bar_code,
|
||||
a.weight_limit, a.volume_limit, a.quantity, a.allocation_quantity, a.picking_quantity, a.check_quantity,
|
||||
a.pack_id, a.pack_code, a.pack_name, a.pack_detail_id, a.unit_code, a.unit_name,
|
||||
a.material_warehouse_control_id, a.serial_number_manage,
|
||||
a.material_inventory_id, a.batch_number,
|
||||
a.warehouse_id, a.warehouse_code, a.warehouse_name,
|
||||
a.storage_section_id, a.storage_code, a.storage_name,
|
||||
a.storage_location_id, a.storage_location_code, a.storage_location_name,
|
||||
a.level, a.parent_unique_id, a.allow_modify,
|
||||
a.container_id, a.container_code, a.container_type, a.container_type_name,
|
||||
a.material_status_code, a.material_status_name,
|
||||
a.remark, a.create_time, a.create_by, a.create_by_name, a.gen_picking_order,
|
||||
a.update_time, a.update_by, a.update_by_name, a.del_flag,
|
||||
a.over_stock_id, a.over_stock_status, a.over_stock_type,
|
||||
a.COMMODITY_NAME, a.COMMODITY_NO, a.MATERIAL_NO,
|
||||
a.SPECIFICATION_MODEL, a.SKUCODE, a.INVOICE_NO, a.LITER, a.SIZE,
|
||||
a.DECLARE_UNIT, a.BATCH_REF_NO, a.SHEET_REF_NO,
|
||||
a.COUNTRY_OF_ORIGIN, a.BOX_PALLET_NO, a.CURRENCY,
|
||||
a.DECLARE_QUANTITY, a.CASE_COUNT, a.PIECE_COUNT, a.OUTBOUND_QUANTITY,
|
||||
a.TOTAL_NET_WEIGHT, a.TOTAL_GROSS_WEIGHT, a.TOTAL_VOLUME, a.TOTAL_AREA, a.TOTAL_AMOUNT,
|
||||
a.UNIT, a.EXT_ATTR_1, a.EXT_ATTR_2, a.PRODUCTION_DATE, a.EXPIRY_DATE, a.INVENTORY_DATE,
|
||||
a.EXT_ATTR_3, a.EXT_ATTR_4,
|
||||
a.contract_fee, a.monthly_warehouse_fee, a.half_month_wh_fee, a.discount_rate,
|
||||
a.single_volume, a.single_gross_weight, a.lot_no, a.in_order_number,
|
||||
a.stock_unit, a.stock_quantity, a.inventory_quantity,
|
||||
a.line_num_gw, a.spec_gw, a.unit_gw, a.qty_gw,
|
||||
a.erp_curr_gw, a.erp_price_gw, a.amount_gw, a.in_order_number_gw, a.in_line_num_gw,
|
||||
b.shipper_id as order_shipper_id,
|
||||
b.shipper_code as order_shipper_code,
|
||||
b.shipper_name as order_shipper_name,
|
||||
b.OUTBOUND_DATE as order_outbound_date,
|
||||
b.OUTBOUND_TIME as order_outbound_time,
|
||||
b.status as out_order_status,
|
||||
b.audit_status as out_order_audit_status
|
||||
from execution_out_material_detail a
|
||||
left join execution_stock_out_order b on a.out_order_number = b.out_order_number
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and a.material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and a.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="outOrderNumber != null and outOrderNumber != ''">
|
||||
and b.out_order_number like concat('%', #{outOrderNumber}, '%')
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and b.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and b.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and b.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and b.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and b.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="outOrderTypeCode != null and outOrderTypeCode != ''">
|
||||
and b.order_type_code = #{outOrderTypeCode}
|
||||
</if>
|
||||
<if test="outStatus != null ">
|
||||
and b.status = #{outStatus}
|
||||
</if>
|
||||
<if test="outOrderExpectStartTime != null">
|
||||
and b.expect_time >= #{outOrderExpectStartTime}
|
||||
</if>
|
||||
<if test="outOrderExpectEndTime != null">
|
||||
and b.expect_time <= #{outOrderExpectEndTime}
|
||||
</if>
|
||||
and a.del_flag = 1
|
||||
and b.del_flag = 1
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
+2
-1
@@ -107,6 +107,7 @@
|
||||
<result property="fireInsureFee" column="FIRE_INSURE_FEE" />
|
||||
<result property="discount" column="DISCOUNT" />
|
||||
<result property="isFreeManpowerFee" column="IS_FREE_MANPOWER_FEE" />
|
||||
<result property="executionInOrderNumber" column="EXECUTION_IN_ORDER_NUMBER" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -144,7 +145,7 @@
|
||||
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reservation_audit_time,a.reservation_audit_name
|
||||
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number
|
||||
,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity,
|
||||
a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME
|
||||
a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME,a.execution_in_order_number
|
||||
</sql>
|
||||
|
||||
<sql id="joinStockInOrderPo">
|
||||
|
||||
+2
-1
@@ -108,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="pushByName" column="PUSH_BY_NAME" />
|
||||
<result property="trainNo" column="TRAIN_NO" />
|
||||
<result property="amount" column="AMOUNT" />
|
||||
<result property="executionOutOrderNumber" column="EXECUTION_OUT_ORDER_NUMBER" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -126,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.CUSTOMS_INSPECTION_FLAG,a.NEED_DECLARE_FLAG,a.NEED_TRANSPORT_FLAG,a.picture_app,a.reservation_audit_time,a.reservation_audit_name
|
||||
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.tms_order_number,
|
||||
a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.RESERVATION_ORDER_SOURCE,a.OUTBOUND_TIME,a.RETURN_QUANTITY,a.DELIVERY_NAME,a.CUSTOMER_NUMBER,a.INVOICE_NUMBER,a.RETURN_ORDER_NUMBER,a.TOTAL_AMOUNT,
|
||||
a.ROUTE,a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME
|
||||
a.ROUTE,a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME,a.execution_out_order_number
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
@@ -831,4 +831,53 @@
|
||||
WHERE in_order_number = #{inOrderNumber}
|
||||
</select>
|
||||
|
||||
<!-- 跨4张入库单表查询指定前缀+组织+仓库的所有入库单号(取最大序号+1,防止删单后单号重复) -->
|
||||
<select id="getMaxStockInOrderByPrefixAndOrgAndWarehouse" resultType="java.lang.String">
|
||||
SELECT in_order_number FROM reserve_stock_in_order
|
||||
WHERE in_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT in_order_number FROM reservation_stock_in_order
|
||||
WHERE in_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT in_order_number FROM execution_stock_in_order
|
||||
WHERE in_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT in_order_number FROM NGWL_TEST_WMS.stock_in_order
|
||||
WHERE in_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -548,4 +548,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 跨4张入库单表查询指定前缀+组织+仓库的所有入库单号(取最大序号+1,防止删单后单号重复) -->
|
||||
<select id="getMaxStockOutOrderByPrefixAndOrgAndWarehouse" resultType="java.lang.String">
|
||||
SELECT out_order_number FROM reserve_stock_out_order
|
||||
WHERE out_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT out_order_number FROM reservation_stock_out_order
|
||||
WHERE out_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT out_order_number FROM execution_stock_out_order
|
||||
WHERE out_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT out_order_number FROM NGWL_TEST_WMS.stock_out_order
|
||||
WHERE out_order_number LIKE concat(#{prefix}, '%')
|
||||
AND del_flag = 1
|
||||
<if test="organizationId != null">
|
||||
AND organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user