完善单据保存中增加更新成本价的逻辑

This commit is contained in:
jishenghua
2024-05-23 23:29:32 +08:00
parent 3727271fd0
commit 0292446e15
2 changed files with 28 additions and 10 deletions

View File

@@ -145,7 +145,8 @@
</select>
<select id="findDetailByDepotIdsAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap">
select tb.* from
select tb.number, tb.bar_code, tb.material_name, tb.type, tb.sub_type, tb.b_num, tb.unit_price,
tb.b_num*tb.unit_price as all_price, tb.depotName, tb.oTime from
(select dh.number,me.bar_code,m.name material_name,dh.type,dh.sub_type,
case
when type='入库' then ifnull(di.basic_number,0)
@@ -157,7 +158,7 @@
when dh.sub_type='盘点复盘' then ifnull(di.basic_number,0)
else 0
end
as b_num, di.unit_price, di.all_price,
as b_num, di.unit_price,
(select name from jsh_depot d where d.id=di.depot_id and ifnull(d.delete_flag,'0') !='1') as depotName,
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depot_head dh
@@ -200,7 +201,7 @@
union all
--单独构造记录:调拨入库
select dh.number,me.bar_code,m.name material_name,dh.type,dh.sub_type,
ifnull(di.basic_number,0) as b_num, di.unit_price, di.all_price,
ifnull(di.basic_number,0) as b_num, di.unit_price,
(select concat(name,'[调入]') from jsh_depot d where d.id=di.another_depot_id and ifnull(d.delete_flag,'0') !='1') as depotName,
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depot_head dh