|
|
@@ -145,10 +145,10 @@
|
|
|
</select>
|
|
|
<!-- 插入入库流水 -->
|
|
|
<insert id="addStorage">
|
|
|
- insert into tld_storage(wllb_code,supplier_id,serial,produc_date,produc_batch,capacity,seq,type,user_id,department_id,storage_location_code,scrq)
|
|
|
+ insert into tld_storage(wllb_code,supplier_id,serial,produc_date,produc_batch,capacity,seq,type,user_id,department_id,storage_location_code,scrq,storage_code,wbs)
|
|
|
values
|
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
|
|
- (#{item.wllbCode},#{item.suppId},#{item.serial},#{item.producDate},#{item.producDate},#{item.num},#{item.seq},#{item.type},#{item.userId},#{item.departmentId},#{item.storageLocationCode},now())
|
|
|
+ (#{item.wllbCode},#{item.suppId},#{item.serial},#{item.producDate},#{item.producDate},#{item.num},#{item.seq},#{item.type},#{item.userId},#{item.departmentId},#{item.storageLocationCode},now(),#{storageCode},#{wbs})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<!-- 插入库存 -->
|
|
|
@@ -192,7 +192,9 @@
|
|
|
c.user_name as userName,
|
|
|
e.name as departmentName,
|
|
|
g.storage_location_name as storageLocationName,
|
|
|
- a.scrq
|
|
|
+ a.scrq,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs
|
|
|
from tld_storage a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_user c on a.user_id = c.id
|
|
|
@@ -244,7 +246,9 @@
|
|
|
c.user_name as userName,
|
|
|
e.name as departmentName,
|
|
|
g.storage_location_name as storageLocationName,
|
|
|
- a.scrq
|
|
|
+ a.scrq,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs
|
|
|
from tld_storage a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_user c on a.user_id = c.id
|
|
|
@@ -280,7 +284,7 @@
|
|
|
tld_id,
|
|
|
specification_and_model,
|
|
|
unit_of_measurement,
|
|
|
- size,
|
|
|
+ ifnull(size, 0) as size,
|
|
|
wllb_class,
|
|
|
is_not_disable,
|
|
|
is_recommend,
|
|
|
@@ -361,8 +365,8 @@
|
|
|
<!-- 半成品跟部分产成品入库存 -->
|
|
|
<insert id="addInventoryNotice">
|
|
|
insert into
|
|
|
- tld_inventory(storage_location_code,material_id,amount,hold,amount_lock,account_sleeve,wbs,produc_date,scrq,wllb_class,produc_batch,attribute,serial,supplier_id,wllb_code,account_sleeve)
|
|
|
- value(#{storageLocationCode},#{materialId},#{warehousingNum},'0','0',#{companyNumber},#{wbs},now(),now(),#{wllbClass},#{producBatch},#{attribute},#{serial},#{supplierId},#{wllbCode},#{companyNumber});
|
|
|
+ tld_inventory(storage_location_code,material_id,amount,hold,amount_lock,account_sleeve,wbs,produc_date,scrq,wllb_class,produc_batch,attribute,serial,supplier_id,wllb_code,totime)
|
|
|
+ value(#{storageLocationCode},#{materialId},#{warehousingNum},'0','0',#{companyNumber},#{wbs},#{producBatch},now(),#{wllbClass},#{producBatch},#{attribute},#{serial},#{supplierId},#{wllbCode},now());
|
|
|
update tld_notice set warehousing_num = #{warehousingNum},type = '1' where notice_id = #{noticeId} and material_id = #{materialId}
|
|
|
</insert>
|
|
|
<!-- 查询库存里是否存在半成品虚拟库位 -->
|
|
|
@@ -371,12 +375,12 @@
|
|
|
</select>
|
|
|
<!-- 增加半成品/产成品虚拟库位数量 -->
|
|
|
<update id="updateInventoryNotice">
|
|
|
- update tld_inventory set amount = amount + #{warehousingNum} where storage_location_code = #{storageLocationCode} and material_id = #{materialId};
|
|
|
+ update tld_inventory set amount = amount + #{warehousingNum},totime = now() where storage_location_code = #{storageLocationCode} and material_id = #{materialId};
|
|
|
update tld_notice set warehousing_num = #{warehousingNum},type = '1' where notice_id = #{noticeId} and material_id = #{materialId}
|
|
|
</update>
|
|
|
<!-- 半成品出库库存查询 -->
|
|
|
<select id="getHalfInventory" resultType="com.tld.model.Inventory">
|
|
|
- select storage_location_code,wllb_class,material_id,amount from tld_inventory where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and account_sleeve = #{accountSleeve}
|
|
|
+ select storage_location_code,wllb_class,material_id,amount from tld_inventory where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and account_sleeve = #{companyNumber} and wbs = #{wbs}
|
|
|
</select>
|
|
|
<!-- 删除库存信息 -->
|
|
|
<delete id="delInventoryNotice">
|
|
|
@@ -388,8 +392,8 @@
|
|
|
</update>
|
|
|
<!-- 新增半成品入库流水 -->
|
|
|
<insert id="addProduct">
|
|
|
- insert into tld_half_product(wllb_code,produc_date,produc_batch,capacity,user_id,storage_location_code,scrq,storage_code)
|
|
|
- value(#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{storageCode})
|
|
|
+ insert into tld_half_product(wllb_code,produc_date,produc_batch,capacity,user_id,storage_location_code,scrq,storage_code,wbs)
|
|
|
+ value(#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{storageCode},#{wbs})
|
|
|
</insert>
|
|
|
<!-- 查询半成品入库流水-->
|
|
|
<select id="getProduct" resultType="com.tld.model.Notice">
|
|
|
@@ -404,7 +408,9 @@
|
|
|
a.storage_location_code,
|
|
|
a.scrq,
|
|
|
b.name as materialName,
|
|
|
- b.code as materialCode
|
|
|
+ b.code as materialCode,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs
|
|
|
from tld_half_product a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_user c on a.user_id = c.id
|
|
|
@@ -428,7 +434,9 @@
|
|
|
a.produc_date,
|
|
|
a.capacity,
|
|
|
c.user_name,
|
|
|
- a.scrq
|
|
|
+ a.scrq,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs
|
|
|
from tld_half_product a
|
|
|
left join tld_material b on a.wllb_code = b.code
|
|
|
left join tld_user c on a.user_id = c.id
|
|
|
@@ -472,8 +480,8 @@
|
|
|
</update>
|
|
|
<!-- 新增半成品流水 -->
|
|
|
<insert id="addRemovalHalfProduct">
|
|
|
- insert into tld_removal_half_product(wllb_code,num,user_id,scrq,ask_goods_id,department,storage_code)
|
|
|
- value(#{wllbCode},#{num},#{userId},now(),#{askGoodsId},#{department},#{storageCode})
|
|
|
+ insert into tld_removal_half_product(wllb_code,num,user_id,scrq,ask_goods_id,department,storage_code,wbs)
|
|
|
+ value(#{wllbCode},#{num},#{userId},now(),#{askGoodsId},#{department},#{storageCode},#{wbs})
|
|
|
</insert>
|
|
|
<!-- 查询指定物料内容 -->
|
|
|
<select id="getMaterial" resultType="com.tld.model.MaterialClass">
|
|
|
@@ -523,8 +531,8 @@
|
|
|
</select>
|
|
|
<!-- 产成品入库 -->
|
|
|
<insert id="addHalf">
|
|
|
- insert into tld_half(wllb_code,produc_date,produc_batch,capacity,user_id,storage_location_code,scrq,serial,seq,attribute)
|
|
|
- value(#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{serial},#{seq},#{attribute})
|
|
|
+ insert into tld_half(wllb_code,produc_date,produc_batch,capacity,user_id,storage_location_code,scrq,serial,seq,attribute,storage_code,wbs)
|
|
|
+ value(#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{serial},#{seq},#{attribute},#{storageCode},#{wbs})
|
|
|
</insert>
|
|
|
<!-- 查询虚拟表数据进行入库 -->
|
|
|
<select id="getVirtualNotice" resultType="com.tld.model.WarehousingVirtual">
|
|
|
@@ -564,7 +572,9 @@
|
|
|
a.attribute,
|
|
|
b.name as materialName,
|
|
|
c.user_name as userName,
|
|
|
- b.code as materialCode
|
|
|
+ b.code as materialCode,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs
|
|
|
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
|
|
|
@@ -592,7 +602,9 @@
|
|
|
a.scrq,
|
|
|
a.serial,
|
|
|
a.seq,
|
|
|
- a.attribute
|
|
|
+ a.attribute,
|
|
|
+ a.storage_code,
|
|
|
+ a.wbs
|
|
|
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
|
|
|
@@ -649,4 +661,8 @@
|
|
|
<update id="updateStorage">
|
|
|
update tld_storage set storage_code = #{storageCode} where wllb_code = #{wllbCode} and supplier_id = #{suppId} and serial = #{serial} and produc_batch = #{producDate}
|
|
|
</update>
|
|
|
+ <!-- 查询公共设置 -->
|
|
|
+ <select id="getNumUtil" resultType="int">
|
|
|
+ select num from tld_util where type = #{type}
|
|
|
+ </select>
|
|
|
</mapper>
|