|
@@ -12,7 +12,7 @@
|
|
|
a.storage_location_code,
|
|
|
a.wllb_code
|
|
|
from tld_material_class a
|
|
|
- right join tld_material b on a.wllb_code = b.tld_id
|
|
|
+ join tld_material b on a.wllb_code = b.tld_id
|
|
|
where b.code = #{wllbCode}
|
|
|
</select>
|
|
|
<!-- 根据物料分类查询库位 -->
|
|
@@ -156,7 +156,7 @@
|
|
|
insert into tld_inventory(storage_location_code,wllb_class,material_id,amount,totime,hold,amount_lock,account_sleeve,wbs,supplier_id,serial,wllb_code,produc_date,scrq,produc_batch)
|
|
|
values
|
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
|
|
- (#{item.storageLocationCode},#{item.wllbClass},#{item.materialId},#{item.num},now(),'0','0',#{item.accountSleeve},#{item.wbs},#{item.suppId},#{item.serial},#{item.wllbCode},#{item.producDate}, now(),#{item.producDate}, '0')
|
|
|
+ (#{item.storageLocationCode},#{item.wllbClass},#{item.materialId},#{item.num},now(),'0','0',#{item.accountSleeve},#{item.wbs},#{item.suppId},#{item.serial},#{item.wllbCode},#{item.producDate}, now(),#{item.producDate})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<!-- 删除临时表数据 -->
|
|
@@ -170,7 +170,7 @@
|
|
|
<!-- 存入为gs穿的信息 -->
|
|
|
<insert id="addReturnWarehousing">
|
|
|
insert into tld_return_gs_warehousing(storage_code,gs_ck,source_type,move_type,entry_number,wbs,material_id,warehousing_num,receive_goods_id,scrq,order_number,user_name,storage_location_code)
|
|
|
- values(#{storageCode},#{gsCk},#{sourceType},#{moveType},#{entryNumber},#{wbs},#{materialId},#{warehousingNum},#{receiveGoodsId},now(),#{orderNumber},#{userName},#{storageLocationCode});
|
|
|
+ values(#{storageCode},#{gsCk},#{sourceType},#{moveType},#{entryNumber},#{wbs},#{materialId},#{warehousingNum},#{id},now(),#{orderNumber},#{userName},#{storageLocationCode});
|
|
|
</insert>
|
|
|
<!-- 入库回传 -->
|
|
|
<select id="getPlugOutWarehousing" resultType="com.tld.model.ReturnWarehousing">
|
|
@@ -272,8 +272,20 @@
|
|
|
from dual
|
|
|
</select>
|
|
|
<!-- 查询物料是否存在 -->
|
|
|
- <select id="getMateriaIsExist" resultType="int">
|
|
|
- select count(0) from tld_material where code = #{wllbCode}
|
|
|
+ <select id="getMateriaIsExist" resultType="com.tld.model.MaterialClass">
|
|
|
+ select
|
|
|
+ id,
|
|
|
+ code,
|
|
|
+ name,
|
|
|
+ tld_id,
|
|
|
+ specification_and_model,
|
|
|
+ unit_of_measurement,
|
|
|
+ size,
|
|
|
+ wllb_class,
|
|
|
+ is_not_disable,
|
|
|
+ is_recommend,
|
|
|
+ part_type
|
|
|
+ from tld_material where code = #{wllbCode}
|
|
|
</select>
|
|
|
<!-- 查询库存是否同物料同批次存在 -->
|
|
|
<select id="getInventoryProduc" resultType="int">
|
|
@@ -299,7 +311,8 @@
|
|
|
a.warehousing_num,
|
|
|
b.company_number,
|
|
|
c.name as materialName,
|
|
|
- c.wllb_class as wllbClass
|
|
|
+ c.wllb_class as wllbClass,
|
|
|
+ c.code as wllbCode
|
|
|
from tld_notice a
|
|
|
join tld_notice_f b on a.notice_id = b.notice_id
|
|
|
join tld_material c on a.material_id = c.tld_id
|
|
@@ -512,7 +525,7 @@
|
|
|
value(#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{scrq},#{serial},#{seq},#{attribute})
|
|
|
</insert>
|
|
|
<!-- 查询虚拟表数据进行入库 -->
|
|
|
- <select id="getVirtual" resultType="com.tld.model.WarehousingVirtual">
|
|
|
+ <select id="getVirtualNotice" resultType="com.tld.model.WarehousingVirtual">
|
|
|
select
|
|
|
a.id,
|
|
|
a.unique_code,
|
|
@@ -533,4 +546,64 @@
|
|
|
left join tld_user b on a.user_id = b.id
|
|
|
where a.unique_code = #{uniqueCode} and a.type = #{type} and a.notice_id = #{noticeId}
|
|
|
</select>
|
|
|
+ <!-- 产成品入库流水 -->
|
|
|
+ <select id="getHalf" resultType="com.tld.model.Notice">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ a.wllb_code,
|
|
|
+ a.produc_date,
|
|
|
+ a.produc_batch,
|
|
|
+ a.capacity,
|
|
|
+ a.user_id,
|
|
|
+ a.storage_location_code,
|
|
|
+ a.scrq,
|
|
|
+ a.serial,
|
|
|
+ a.seq,
|
|
|
+ a.attribute,
|
|
|
+ b.name as materialName,
|
|
|
+ c.user_name as userName
|
|
|
+ from tld_half a
|
|
|
+ left join tld_material b on a.wllb_code = b.code
|
|
|
+ left join tld_user c on a.user_id = c.id
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
+ <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>
|
|
|
+ </trim>
|
|
|
+ order by a.scrq desc
|
|
|
+ </select>
|
|
|
+ <!-- 产成品导出 -->
|
|
|
+ <select id="getHalfExcel" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ b.name as materialName,
|
|
|
+ a.produc_batch,
|
|
|
+ a.capacity,
|
|
|
+ c.user_name as userName
|
|
|
+ a.storage_location_code,
|
|
|
+ a.scrq,
|
|
|
+ a.serial,
|
|
|
+ a.seq,
|
|
|
+ a.attribute
|
|
|
+ from tld_half a
|
|
|
+ left join tld_material b on a.wllb_code = b.code
|
|
|
+ left join tld_user c on a.user_id = c.id
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
+ <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>
|
|
|
+ </trim>
|
|
|
+ order by a.scrq desc
|
|
|
+ </select>
|
|
|
</mapper>
|