Browse Source

成本分配

zengtx 1 year ago
parent
commit
a78d2bacf0

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

@@ -48,8 +48,8 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		join UFDATA_101_2021.dbo.OM_MOMaterials ot on ot.MoDetailsID=od.MODetailsID
 		join UFDATA_101_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
-		and om.cCode like CONCAT(#{code},'%') 	and omi.cInvCcode like '19%' and om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
+		and om.cCode like CONCAT(#{code},'%') 	and omi.cInvCcode like '19%' and om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		GROUP BY oti.cInvCode
 		) vim on vim.cInvCode = vif.cInvCode
 		where trim(vif.cCode) like CONCAT(#{code},'%')
@@ -65,7 +65,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		from UFDATA_101_2021.dbo.PO_POmain om
 		join UFDATA_101_2021.dbo.PO_PODetails od on om.poid=od.poid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 		and om.cPOID like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode
@@ -77,7 +77,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		from UFDATA_101_2021.dbo.om_momain om
 		join UFDATA_101_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 		and om.cCode like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode
@@ -91,7 +91,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		from UFDATA_101_2021.dbo.om_momain om
 		join UFDATA_101_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode
@@ -125,8 +125,8 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		join UFDATA_103_2021.dbo.OM_MOMaterials ot on ot.MoDetailsID=od.MODetailsID
 		join UFDATA_103_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
-		and om.cCode like CONCAT(#{code},'%') and om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
+		and om.cCode like CONCAT(#{code},'%') and om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		and omi.cInvCcode like '19%'
 		GROUP BY oti.cInvCode
 		) vim on vim.cInvCode = vif.cInvCode
@@ -143,7 +143,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		from UFDATA_103_2021.dbo.PO_POmain om
 		join UFDATA_103_2021.dbo.PO_PODetails od on om.poid=od.poid
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 		and om.cPOID like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode
@@ -155,7 +155,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		from UFDATA_103_2021.dbo.om_momain om
 		join UFDATA_103_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 		and om.cCode like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode
@@ -169,7 +169,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		from UFDATA_103_2021.dbo.om_momain om
 		join UFDATA_103_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode
@@ -182,6 +182,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 
 <!--	面料转入数量链接方法-->
 	<select id="queryTransferByFabric" resultType="org.jeecg.modules.cost.entity.SyTransfer">
+
 		select
 		tab2.cinvName as goodsName,tab2.cFree1 as color,tab2.cBatch as planCode,
 		case when tab2.jian-isnull(tab1.purchaseQuantity,0) <![CDATA[<=]]> 0 then 0
@@ -190,30 +191,40 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		(
 		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,rs.cBatch,rs.cFree1 from UFDATA_101_2021.dbo.rdrecords01 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
-		where iordercode in (
-		select distinct od.csocode
+		where cPOID in (
+		select distinct om.cPOID
+		from UFDATA_101_2021.dbo.PO_POmain om
+		join UFDATA_101_2021.dbo.PO_PODetails od on om.poid=od.poid
+		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
+		and om.cPOID like CONCAT(#{code},'%')
+		)
+		GROUP BY i.cInvName,rs.cBatch,rs.cFree1
+		union all
+		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,rs.cBatch,rs.cFree1 from UFDATA_101_2021.dbo.rdrecords01 rs
+		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		where cPOID in (
+		select distinct om.cCode
 		from UFDATA_101_2021.dbo.om_momain om
 		join UFDATA_101_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
-		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%' or i.cInvCcode like '02%') and (i.cInvCCode != '0399' or i.cInvName like '%带%') and (i.cInvCCode != '0499' or i.cInvName like '%带%') and (i.cInvCCode != '0299' or i.cInvName like '%带%')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
+		and om.cCode like CONCAT(#{code},'%')
+		)
 		GROUP BY i.cInvName,rs.cBatch,rs.cFree1
 		)tab1
 		right join
 		(
 		select i.cInvName,sum(rs.iQuantity) as jian,rs.cBatch,rs.cFree1 from UFDATA_101_2021.dbo.rdrecords11 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
-		where iordercode in (
-		select distinct od.csocode
+		where comcode in (
+		select distinct om.ccode
 		from UFDATA_101_2021.dbo.om_momain om
 		join UFDATA_101_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%' or i.cInvCcode like '02%')
-		and (i.cInvCCode != '0399' or i.cInvName like '%带%') and (i.cInvCCode != '0499' or i.cInvName like '%带%')
-		and (i.cInvCCode != '0299' or i.cInvName like '%带%')
+		)
 		GROUP BY i.cInvName,rs.cBatch,rs.cFree1
 		)tab2 on tab2.cInvName=tab1.cInvName and tab2.cBatch=tab1.cBatch and tab1.cfree1=tab2.cfree1
 		where tab2.jian-isnull(tab1.purchaseQuantity,0) > 0 and tab2.cinvName = #{goodName}
@@ -226,35 +237,47 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		else tab2.jian-isnull(tab1.purchaseQuantity,0) end as number
 		from
 		(
+
 		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,rs.cBatch,rs.cFree1 from UFDATA_103_2021.dbo.rdrecords01 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
-		where iordercode in (
-		select distinct od.csocode
+		where cPOID in (
+		select distinct om.cPOID
+		from UFDATA_103_2021.dbo.PO_POmain om
+		join UFDATA_103_2021.dbo.PO_PODetails od on om.poid=od.poid
+		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
+		and om.cPOID like CONCAT(#{code},'%')
+		)
+		GROUP BY i.cInvName,rs.cBatch,rs.cFree1
+		union all
+		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,rs.cBatch,rs.cFree1 from UFDATA_103_2021.dbo.rdrecords01 rs
+		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		where cPOID in (
+		select distinct om.cCode
 		from UFDATA_103_2021.dbo.om_momain om
 		join UFDATA_103_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
-		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%' or i.cInvCcode like '02%') and (i.cInvCCode != '0399' or i.cInvName like '%带%') and (i.cInvCCode != '0499' or i.cInvName like '%带%') and (i.cInvCCode != '0299' or i.cInvName like '%带%')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
+		and om.cCode like CONCAT(#{code},'%')
+		)
 		GROUP BY i.cInvName,rs.cBatch,rs.cFree1
 		)tab1
 		right join
 		(
 		select i.cInvName,sum(rs.iQuantity) as jian,rs.cBatch,rs.cFree1 from UFDATA_103_2021.dbo.rdrecords11 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
-		where iordercode in (
-		select distinct od.csocode
+		where comcode in (
+		select distinct om.ccode
 		from UFDATA_103_2021.dbo.om_momain om
 		join UFDATA_103_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%' or i.cInvCcode like '02%')
-		and (i.cInvCCode != '0399' or i.cInvName like '%带%') and (i.cInvCCode != '0499' or i.cInvName like '%带%')
-		and (i.cInvCCode != '0299' or i.cInvName like '%带%')
+		)
 		GROUP BY i.cInvName,rs.cBatch,rs.cFree1
 		)tab2 on tab2.cInvName=tab1.cInvName and tab2.cBatch=tab1.cBatch and tab1.cfree1=tab2.cfree1
 		where tab2.jian-isnull(tab1.purchaseQuantity,0) > 0 and tab2.cinvName = #{goodName}
+
     </select>
 
 
@@ -266,7 +289,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 	join UFDATA_101_2021.dbo.OM_MOMaterials ot on ot.MoDetailsID=od.MODetailsID
 	join UFDATA_101_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 	join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-	WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%' and om.cCode LIKE CONCAT(#{code},'%') and oti.cInvName = #{goodName}
+	WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%' and om.cCode LIKE CONCAT(#{code},'%') and oti.cInvName = #{goodName}
 	and (oti.cInvCcode like '03%' or oti.cInvCcode like '04%') and oti.cInvCCode != '0399' and oti.cInvCCode != '0499'
 	GROUP BY oti.cInvName,ot.cFree1
 
@@ -278,7 +301,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 	join UFDATA_103_2021.dbo.OM_MOMaterials ot on ot.MoDetailsID=od.MODetailsID
 	join UFDATA_103_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 	join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-	WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%' and om.cCode LIKE CONCAT(#{code},'%') and oti.cInvName = #{goodName}
+	WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%' and om.cCode LIKE CONCAT(#{code},'%') and oti.cInvName = #{goodName}
 	and (oti.cInvCcode like '03%' or oti.cInvCcode like '04%') and oti.cInvCCode != '0399' and oti.cInvCCode != '0499'
 	GROUP BY oti.cInvName,ot.cFree1
 	</select>
@@ -297,7 +320,7 @@ select
 		join UFDATA_101_2021.dbo.OM_MOMaterials ot on ot.MoDetailsID=od.MODetailsID
 		join UFDATA_101_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%') and oti.cInvName = #{goodName}
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%') and oti.cInvName = #{goodName}
 		GROUP BY ot.cFree1
 		) tab
 		left join
@@ -309,7 +332,7 @@ select
 			from UFDATA_101_2021.dbo.PO_POmain om
 		join UFDATA_101_2021.dbo.PO_PODetails od on om.poid=od.poid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		 and om.cPOID like CONCAT(#{code},'%')
 		)  and i.cInvName = #{goodName}
 		 and rs.cBatch like CONCAT(#{code},'%')
@@ -331,7 +354,7 @@ select
 		join UFDATA_103_2021.dbo.OM_MOMaterials ot on ot.MoDetailsID=od.MODetailsID
 		join UFDATA_103_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%') and oti.cInvName = #{goodName}
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%') and oti.cInvName = #{goodName}
 		GROUP BY ot.cFree1
 		) tab
 		left join
@@ -343,7 +366,7 @@ select
 			from UFDATA_101_2021.dbo.PO_POmain om
 		join UFDATA_103_2021.dbo.PO_PODetails od on om.poid=od.poid
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		 and om.cPOID like CONCAT(#{code},'%')
 		)  and i.cInvName = #{goodName}
 		 and rs.cBatch like CONCAT(#{code},'%')

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

@@ -49,7 +49,7 @@
 		JOIN UFDATA_103_2021.dbo.Inventory omi ON omi.cInvCode= od.cInvCode
 		WHERE
 		om.iVerifyStateNew = 2
-		AND ( om.cCloser IS NULL OR om.cCloser= 'asuser' )
+		AND ( om.cCloser IS NULL OR om.cCloser!='asuser' )
 		AND omi.cInvCcode LIKE '19%'
 		AND om.cCode LIKE CONCAT(#{code},'%')
 
@@ -94,7 +94,7 @@
 		JOIN UFDATA_103_2021.dbo.Inventory omi ON omi.cInvCode= od.cInvCode
 		WHERE
 		om.iVerifyStateNew = 2
-		AND ( om.cCloser IS NULL OR om.cCloser= 'asuser' )
+		AND ( om.cCloser IS NULL OR om.cCloser!='asuser' )
 		AND omi.cInvCcode LIKE '19%'
 		AND om.cCode LIKE CONCAT(#{code},'%')
 
@@ -136,7 +136,7 @@
 		from UFDATA_103_2021.dbo.PO_POmain om
 		join UFDATA_103_2021.dbo.PO_PODetails od on om.POID=od.POID
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		and om.cPOID LIKE CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName
@@ -148,7 +148,7 @@
 		from UFDATA_103_2021.dbo.om_momain om
 		join UFDATA_103_2021.dbo.OM_MODetails od on om.MOID=od.MOID
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		and om.cCode like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName
@@ -162,7 +162,7 @@
 		from UFDATA_103_2021.dbo.om_momain om
 		join UFDATA_103_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		and omi.cInvCcode like '19%' and om.cCode LIKE CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName--,rs.cBatch
@@ -196,7 +196,7 @@
 		join UFDATA_101_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%'
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 		and om.cCode LIKE CONCAT(#{code},'%')
 		group by ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		) as t1,
@@ -227,7 +227,7 @@
 		join UFDATA_101_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%'
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 		and om.cCode LIKE CONCAT(#{code},'%')
 		group by ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		) as t1
@@ -261,7 +261,7 @@
 		join UFDATA_101_2021.dbo.Inventory oti on oti.cInvCode=ot.cInvCode
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%'
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 		and om.cCode LIKE CONCAT(#{code},'%')
 		group by ot.cInvCode,od.isosid,om.ccode,oti.cInvName
 		) as t1,
@@ -299,7 +299,7 @@
 		from UFDATA_101_2021.dbo.PO_POmain om
 		join UFDATA_101_2021.dbo.PO_PODetails od on om.POID=od.POID
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		and om.cPOID LIKE CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName
@@ -311,7 +311,7 @@
 		from UFDATA_101_2021.dbo.om_momain om
 		join UFDATA_101_2021.dbo.OM_MODetails od on om.MOID=od.MOID
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		and om.cCode like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName
@@ -325,7 +325,7 @@
 		from UFDATA_101_2021.dbo.om_momain om
 		join UFDATA_101_2021.dbo.OM_MODetails od on om.moid=od.moid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 		and omi.cInvCcode like '19%' and om.cCode LIKE CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName
@@ -369,7 +369,7 @@
 						 where pm.cVenCode != 'T010001' and pom.cVenCode = 'T010001'
 						 GROUP BY pod.cInvCode,pod.iorderdid
 				 ) pb on pb.cInvCode=ot.cInvCode and pb.iorderdid=od.isosid
-				WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%'
+				WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 							and om.cCode LIKE CONCAT(#{code},'%') and (oti.cInvCcode like '05%' or oti.cInvCcode like '06%'
 							or oti.cInvCcode like '07%' or oti.cInvCCode = '0399' or oti.cInvCCode = '0499')
 							and oti.cInvName = #{goodName}
@@ -384,7 +384,7 @@
 		from UFDATA_101_2021.dbo.PO_POmain om
 		join UFDATA_101_2021.dbo.PO_PODetails od on om.POID=od.POID
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		and om.cPOID like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName,rs.cBatch
@@ -398,7 +398,7 @@
 						from UFDATA_101_2021.dbo.om_momain om
 						join UFDATA_101_2021.dbo.OM_MODetails od on om.moid=od.moid
 						join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-						WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+						WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 									and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
 				) and (i.cInvCcode like '05%' or i.cInvCcode like '06%' or i.cInvCcode like '07%'
 						or i.cInvCCode = '0399' or i.cInvCCode = '0499' or i.cInvCCode = '0299')
@@ -425,7 +425,7 @@
 						join UFDATA_103_2021.dbo.PurBillVouchs bi  on bi.iPOsID=p.ID
 						GROUP BY p.cInvCode,p.iorderdid
 				 ) pb on pb.cInvCode=ot.cInvCode and pb.iorderdid=od.isosid
-				WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%'
+				WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 							and om.cCode LIKE CONCAT(#{code},'%') and (oti.cInvCcode like '05%' or oti.cInvCcode like '06%'
 							or oti.cInvCcode like '07%' or oti.cInvCCode = '0399' or oti.cInvCCode = '0499')
 							and oti.cInvName = #{goodName}
@@ -440,7 +440,7 @@
 		from UFDATA_103_2021.dbo.PO_POmain om
 		join UFDATA_103_2021.dbo.PO_PODetails od on om.POID=od.POID
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser!='asuser')
 		and om.cPOID like CONCAT(#{code},'%')
 		)
 		GROUP BY i.cInvCode,i.cInvName,rs.cBatch
@@ -454,7 +454,7 @@
 						from UFDATA_103_2021.dbo.om_momain om
 						join UFDATA_103_2021.dbo.OM_MODetails od on om.moid=od.moid
 						join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-						WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
+						WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser')
 									and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
 				) and (i.cInvCcode like '05%' or i.cInvCcode like '06%' or i.cInvCcode like '07%'
 						or i.cInvCCode = '0399' or i.cInvCCode = '0499' or i.cInvCCode = '0299')
@@ -493,7 +493,7 @@
 						 where pm.cVenCode != 'T010001' and pom.cVenCode = 'T010001'
 						 GROUP BY pod.cInvCode,pod.iorderdid
 				 ) pb on pb.cInvCode=ot.cInvCode and pb.iorderdid=od.isosid
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%'
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 					and om.cCode LIKE CONCAT(#{code},'%') and (oti.cInvCcode like '05%' or oti.cInvCcode like '06%'
 					or oti.cInvCcode like '07%' or oti.cInvCCode = '0399' or oti.cInvCCode = '0499')
 					and oti.cInvName = #{goodName}
@@ -514,7 +514,7 @@
 				join UFDATA_103_2021.dbo.PurBillVouchs bi  on bi.iPOsID=p.ID
 				GROUP BY p.cInvCode,p.iorderdid
 		 ) pb on pb.cInvCode=ot.cInvCode and pb.iorderdid=od.isosid
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and omi.cInvCcode like '19%'
+		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and omi.cInvCcode like '19%'
 					and om.cCode LIKE CONCAT(#{code},'%') and (oti.cInvCcode like '05%' or oti.cInvCcode like '06%'
 					or oti.cInvCcode like '07%' or oti.cInvCCode = '0399' or oti.cInvCCode = '0499')
 					and oti.cInvName = #{goodName}

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

@@ -40,7 +40,7 @@
                      UFDATA_101_2021.dbo.OM_MOMain om     
                      inner JOIN UFDATA_101_2021.dbo.OM_MODetails od ON om.MOID = od.MOID      
                      WHERE     
-                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and om.cCode like CONCAT(#{code},'%') 
+                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and om.cCode like CONCAT(#{code},'%')
                      ) 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.Inventory c on c.cInvCode=s.cInvCode     
@@ -68,7 +68,7 @@
                      UFDATA_103_2021.dbo.OM_MOMain om     
                      inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID      
                      WHERE     
-                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and om.cCode like CONCAT(#{code},'%') 
+                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and om.cCode like CONCAT(#{code},'%')
                      ) 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.Inventory c on c.cInvCode=a.cInvCode     
@@ -108,7 +108,7 @@
                      UFDATA_103_2021.dbo.OM_MOMain om     
                      inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID      
                      WHERE     
-                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and om.cCode like CONCAT(#{code},'%') 
+                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and om.cCode like CONCAT(#{code},'%')
                      ) 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.Inventory c on c.cInvCode=a.cInvCode     
@@ -146,7 +146,7 @@
                      UFDATA_103_2021.dbo.OM_MOMain om
                      inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
                      WHERE
-                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and om.cCode like CONCAT(#{code},'%')
+                     om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and om.cCode like CONCAT(#{code},'%')
                      ) 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.Inventory c on c.cInvCode=a.cInvCode

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

@@ -86,7 +86,7 @@ GROUP BY sbv.cDefine10,sbv.iExchRate,sbv.cSOCode
 									 left join UFDATA_103_2021.dbo.PurBillVouch pb  on bi.PBVID =pb.PBVID 
 									 	left join UFDATA_103_2021.dbo.Inventory inv on bi.cInvCode = inv.cInvCode
 									 WHERE
-									 om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and om.cCode like CONCAT(#{code},'%') and inv.cInvCCode like '19%'
+									 om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and om.cCode like CONCAT(#{code},'%') and inv.cInvCCode like '19%'
 									 GROUP BY od.csoordercode
 									 ) o ON a.csocode = o.csoordercode 
 						inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
@@ -145,7 +145,7 @@ GROUP BY sbv.cDefine10,sbv.iExchRate,sbv.cSOCode
 									  left join UFDATA_103_2021.dbo.PurBillVouch pb  on bi.PBVID =pb.PBVID 
 										left join UFDATA_103_2021.dbo.Inventory inv on bi.cInvCode = inv.cInvCode
 									 WHERE
-									 om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and om.cCode like CONCAT(#{code},'%') and inv.cInvCCode like '19%'
+									 om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and om.cCode like CONCAT(#{code},'%') and inv.cInvCCode like '19%'
 									 GROUP BY od.csoordercode
 									 ) o ON a.csocode = o.csoordercode 
 						inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
@@ -205,7 +205,7 @@ UNION ALL
 									  left join UFDATA_103_2021.dbo.PurBillVouch pb  on bi.PBVID =pb.PBVID 
 										left join UFDATA_103_2021.dbo.Inventory inv on bi.cInvCode = inv.cInvCode
 									 WHERE
-									 om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser') and om.cCode like CONCAT(#{code},'%') and inv.cInvCCode like '19%'
+									 om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser!='asuser') and om.cCode like CONCAT(#{code},'%') and inv.cInvCCode like '19%'
 									 GROUP BY od.csoordercode
 									 ) o ON a.csocode = o.csoordercode 
 						inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/impl/SyCostAllocationServiceImpl.java

@@ -378,7 +378,8 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
             SyCostAllocationIngredient Ingredient = list4.get(i);
             //若转入数量不为0则给转入数据对象赋值
             if(0!=Ingredient.getIngredientsTransferQuantity().compareTo(BigDecimal.ZERO)){
-                List<SyTransfer> transferlist  = syCostAllocationIngredientMapper.queryTransferByIngredient(plannum,Ingredient.getGoodsName());
+                List<SyTransfer> transferlist  = syCostAllocationFabricMapper.queryTransferByFabric(plannum,Ingredient.getGoodsName());
+//                syCostAllocationIngredientMapper.queryTransferByIngredient(plannum,Ingredient.getGoodsName());
                 Ingredient.setSyTransfers(transferlist);
             }
             //若剩余数量不为0则给转入数据对象赋值