浏览代码

成本分配

zengtx 1 年之前
父节点
当前提交
1621dd9a9d

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationFabricMapper.xml

@@ -51,7 +51,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 
 
 		WHERE om.iVerifyStateNew = 2
 		WHERE om.iVerifyStateNew = 2
 		and om.cCode like CONCAT(#{code},'%') 	and omi.cInvCcode like '19%'
 		and om.cCode like CONCAT(#{code},'%') 	and omi.cInvCcode like '19%'
-		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ) or om.cCloser='asuser')
 		GROUP BY om.cCode,oti.cInvCode
 		GROUP BY om.cCode,oti.cInvCode
 		) vim on vim.cInvCode = vif.cInvCode
 		) vim on vim.cInvCode = vif.cInvCode
 		where trim(vif.cCode) like CONCAT(#{code},'%')
 		where trim(vif.cCode) like CONCAT(#{code},'%')
@@ -131,7 +131,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		WHERE om.iVerifyStateNew = 2
 		WHERE om.iVerifyStateNew = 2
 		and om.cCode like CONCAT(#{code},'%')
 		and om.cCode like CONCAT(#{code},'%')
 		and omi.cInvCcode like '19%'
 		and omi.cInvCcode like '19%'
-		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ) or om.cCloser='asuser')
 		GROUP BY om.cCode,oti.cInvCode
 		GROUP BY om.cCode,oti.cInvCode
 		) vim on vim.cInvCode = vif.cInvCode
 		) vim on vim.cInvCode = vif.cInvCode
 		where trim(vif.cCode) like CONCAT(#{code},'%')
 		where trim(vif.cCode) like CONCAT(#{code},'%')

+ 5 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationIngredientMapper.xml

@@ -53,7 +53,7 @@
 
 
 		AND omi.cInvCcode LIKE '19%'
 		AND omi.cInvCcode LIKE '19%'
 		AND om.cCode LIKE CONCAT(#{code},'%')
 		AND om.cCode LIKE CONCAT(#{code},'%')
-and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
 		GROUP BY om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName ) AS t1
 		GROUP BY om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName ) AS t1
 
 
 		left join (SELECT ven.cVenAbbName AS cVenAbbName,bi.cInvCode,pod.isosid,SUM ( bi.iSum ) AS rmbAmount,SUM ( bi.iOriSum ) AS usdAmount,
 		left join (SELECT ven.cVenAbbName AS cVenAbbName,bi.cInvCode,pod.isosid,SUM ( bi.iSum ) AS rmbAmount,SUM ( bi.iOriSum ) AS usdAmount,
@@ -99,7 +99,7 @@ and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY !=
 
 
 		AND omi.cInvCcode LIKE '19%'
 		AND omi.cInvCcode LIKE '19%'
 		AND om.cCode LIKE CONCAT(#{code},'%')
 		AND om.cCode LIKE CONCAT(#{code},'%')
-and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
 		GROUP BY om.ccode,ot.cInvCode,om.ccode,oti.cInvName ) AS t1
 		GROUP BY om.ccode,ot.cInvCode,om.ccode,oti.cInvName ) AS t1
 
 
 		left join (
 		left join (
@@ -200,7 +200,7 @@ and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY !=
 join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.cCode and ot.cInvCode = vif.cInvCode
 join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.cCode and ot.cInvCode = vif.cInvCode
 		WHERE om.iVerifyStateNew = 2  and omi.cInvCcode like '19%'
 		WHERE om.iVerifyStateNew = 2  and omi.cInvCcode like '19%'
 		and om.cCode LIKE CONCAT(#{code},'%')
 		and om.cCode LIKE CONCAT(#{code},'%')
-		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
 		group by om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		group by om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		) as t1,
 		) as t1,
 		(
 		(
@@ -232,7 +232,7 @@ join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.
 join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.cCode and ot.cInvCode = vif.cInvCode
 join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.cCode and ot.cInvCode = vif.cInvCode
 		WHERE om.iVerifyStateNew = 2  and omi.cInvCcode like '19%'
 		WHERE om.iVerifyStateNew = 2  and omi.cInvCcode like '19%'
 		and om.cCode LIKE CONCAT(#{code},'%')
 		and om.cCode LIKE CONCAT(#{code},'%')
-		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
 		group by  om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		group by  om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		) as t1
 		) as t1
 		left join (
 		left join (
@@ -267,7 +267,7 @@ join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.
 join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.cCode and ot.cInvCode = vif.cInvCode
 join UFDATA_103_2021.dbo.cost_allocation_accessories_view vif on om.ccode = vif.cCode and ot.cInvCode = vif.cInvCode
 		WHERE om.iVerifyStateNew = 2  and omi.cInvCcode like '19%'
 		WHERE om.iVerifyStateNew = 2  and omi.cInvCcode like '19%'
 		and om.cCode LIKE CONCAT(#{code},'%')
 		and om.cCode LIKE CONCAT(#{code},'%')
-		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+		and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
 		group by om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		group by om.ccode,ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		) as t1,
 		) as t1,
 		(
 		(

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationMapper.xml

@@ -38,7 +38,7 @@
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_101_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_101_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
       WHERE
       WHERE
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
-                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
                      ) o ON s.isosid  = o.isosid AND s.cInvCode = o.cInvCode     
                      ) o ON s.isosid  = o.isosid AND s.cInvCode = o.cInvCode     
         inner JOIN UFDATA_101_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
         inner JOIN UFDATA_101_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
         inner JOIN UFDATA_101_2021.dbo.Inventory c on c.cInvCode=s.cInvCode     
         inner JOIN UFDATA_101_2021.dbo.Inventory c on c.cInvCode=s.cInvCode     
@@ -68,7 +68,7 @@
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
       WHERE
       WHERE
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
-                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
                      ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode     
                      ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode     
         inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
         inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
         inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode     
         inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode     
@@ -106,7 +106,7 @@
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
     WHERE
     WHERE
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
-                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
                      ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode     
                      ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode     
         inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
         inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
         inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode     
         inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode     
@@ -141,7 +141,7 @@
                         inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
                         inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
                            WHERE
                            WHERE
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
-                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) ))
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
                      ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode
                      ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode
         inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
         inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
         inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode
         inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode