|
@@ -64,7 +64,7 @@
|
|
|
a.wllb_class,
|
|
|
a.library_type,
|
|
|
a.material_id,
|
|
|
- a.amount,
|
|
|
+ (a.amount - ifnull(a.amount_lock, 0)) as amount,
|
|
|
a.total,
|
|
|
a.totime,
|
|
|
a.hold,
|
|
@@ -79,12 +79,12 @@
|
|
|
b.storage_location_name as storageLocationName
|
|
|
from tld_inventory a
|
|
|
left join tld_storage_location b on a.storage_location_code = b.storage_location_code
|
|
|
- where a.material_id = #{materialId} order by a.produc_date
|
|
|
+ where a.material_id = #{materialId} and a.hold = '0' order by a.produc_date
|
|
|
</select>
|
|
|
<!-- 新增出库虚拟表 -->
|
|
|
<insert id="addAskGoodsVitrual">
|
|
|
- insert into tld_ask_goods_vitrual(unique_code,supplier_id,serial,wllb_code,produc_date,ask_goods_id,type,storage_location_code,num,user_id,department)
|
|
|
- values(#{uniqueCode},#{supplierId},#{serial},#{wllbCode},#{producDate},#{askGoodsId},#{type},#{storageLocationCode},#{num},#{userId},#{department})
|
|
|
+ insert into tld_ask_goods_vitrual(unique_code,supplier_id,serial,wllb_code,produc_date,ask_goods_id,type,storage_location_code,num,user_id,department,attribute)
|
|
|
+ values(#{uniqueCode},#{supplierId},#{serial},#{wllbCode},#{producDate},#{askGoodsId},#{type},#{storageLocationCode},#{num},#{userId},#{department},#{attribute})
|
|
|
</insert>
|
|
|
<!-- 查询指定库存内容 -->
|
|
|
<select id="getInventory" resultType="com.tld.model.Inventory">
|
|
@@ -207,8 +207,8 @@
|
|
|
</select>
|
|
|
<!-- 新增返回gs数据字表信息 -->
|
|
|
<insert id="addReturnGsRemoval">
|
|
|
- insert into tld_return_gs_removal_z(material_id,wbs,num,entry_number,ask_goods_id,ask_id,storage_location_code)
|
|
|
- values(#{materialId},#{wbs},#{num},#{entryNumber},#{askGoodsId},#{askId},#{storageLocationCode})
|
|
|
+ insert into tld_return_gs_removal_z(material_id,wbs,num,entry_number,document_id,ask_id,storage_location_code)
|
|
|
+ values(#{materialId},#{wbs},#{num},#{entryNumber},#{documentId},#{documentPointsId},#{storageLocationCode})
|
|
|
</insert>
|
|
|
<!-- 查询要货单父级信息 -->
|
|
|
<select id="getAskDetailedF" resultType="com.tld.model.AskGoods">
|
|
@@ -225,8 +225,8 @@
|
|
|
</select>
|
|
|
<!-- 新增返回gs数据父表信息 -->
|
|
|
<insert id="addReturnGsRemovalF">
|
|
|
- insert into tld_return_gs_removal(ask_goods_id,removal_code,source_type,move_type,scrq)
|
|
|
- values(#{askGoodsId},#{removalCode},#{sourceType},#{moveType},now())
|
|
|
+ insert into tld_return_gs_removal(ask_goods_id,removal_code,source_type,move_type,scrq,delivery_type)
|
|
|
+ values(#{documentId},#{removalCode},#{sourceType},#{moveType},now(),#{deliveryType})
|
|
|
</insert>
|
|
|
<!-- 查询当天出库数量 -->
|
|
|
<select id="getReturnRemovalCount" resultType="int">
|
|
@@ -236,7 +236,7 @@
|
|
|
<select id="plugOutRemoval" resultType="java.util.Map">
|
|
|
select
|
|
|
id,
|
|
|
- ask_goods_id as askGoodsId,
|
|
|
+ document_id as askGoodsId,
|
|
|
removal_code as removalCode,
|
|
|
source_type as sourceType,
|
|
|
move_type as moveType
|
|
@@ -249,8 +249,8 @@
|
|
|
wbs,
|
|
|
num,
|
|
|
entry_number as entryNumber,
|
|
|
- ask_goods_id as askGoodsId,
|
|
|
- ask_id as askId
|
|
|
+ document_id as askGoodsId,
|
|
|
+ document_points_id as askId
|
|
|
from tld_return_gs_removal_z where ask_goods_id = #{askGoodsId}
|
|
|
</select>
|
|
|
<!-- 查询出库流水 -->
|
|
@@ -440,4 +440,57 @@
|
|
|
</if>
|
|
|
order by a.scrq desc
|
|
|
</select>
|
|
|
+ <!-- 产成品出库流水 -->
|
|
|
+ <select id="getRemovalHalf" resultType="com.tld.model.AskGoods">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ a.wllb_code,
|
|
|
+ a.num,
|
|
|
+ a.user_id,
|
|
|
+ a.scrq,
|
|
|
+ a.delivery_id,
|
|
|
+ a.company_number,
|
|
|
+ a.customer_code,
|
|
|
+ b.name as materialName,
|
|
|
+ c.user_name as userName,
|
|
|
+ e.name as customerName
|
|
|
+ from tld_removal_half a
|
|
|
+ left join tld_material b on a.wllb_code = b.code
|
|
|
+ left join tld_user c on a.user_id = c.id
|
|
|
+ left join tld_customer e on a.customer_code = e.code
|
|
|
+ <if test="wllbCode != null and wllbCode != ''">
|
|
|
+ and a.wllb_code = #{wllbCode}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and a.scrq <![CDATA[>=]]> #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and a.scrq <![CDATA[<=]]> #{endTime}
|
|
|
+ </if>
|
|
|
+ order by a.scrq desc
|
|
|
+ </select>
|
|
|
+ <!-- 产成品导出出库流水 -->
|
|
|
+ <select id="getRemovalHalfExcel" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ b.name as materialName,
|
|
|
+ a.num,
|
|
|
+ c.user_name as userName
|
|
|
+ a.scrq,
|
|
|
+ a.company_number,
|
|
|
+ e.name
|
|
|
+ from tld_removal_half a
|
|
|
+ left join tld_material b on a.wllb_code = b.code
|
|
|
+ left join tld_user c on a.user_id = c.id
|
|
|
+ left join tld_customer e on a.customer_code = e.code
|
|
|
+ <if test="wllbCode != null and wllbCode != ''">
|
|
|
+ and a.wllb_code = #{wllbCode}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and a.scrq <![CDATA[>=]]> #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and a.scrq <![CDATA[<=]]> #{endTime}
|
|
|
+ </if>
|
|
|
+ order by a.scrq desc
|
|
|
+ </select>
|
|
|
</mapper>
|