Quellcode durchsuchen

订单自动拉取增加判断,成本分配面料调整

zengtx vor 1 Jahr
Ursprung
Commit
188df1d1bf

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

@@ -62,18 +62,20 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		(
 		select i.cInvCode,max(i.cInvName) as cInvName,sum(rs.iQuantity) as purchaseQuantity,max(rs.cBatch) as cBatch from UFDATA_101_2021.dbo.rdrecords01 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_101_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		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')
+		WHERE om.cVerifier is not null
 		and om.cPOID like CONCAT(#{code},'%')
-		)
+		) and r.cBusType = '普通采购'
 		GROUP BY i.cInvCode
 		union all
 		select i.cInvCode as cInvCode,max(i.cInvName) as cInvName,sum(rs.iQuantity) as purchaseQuantity,max(rs.cBatch) as cBatch from UFDATA_101_2021.dbo.rdrecords01 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_101_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		where cPOID in (
 		select distinct om.cCode
 		from UFDATA_101_2021.dbo.om_momain om
@@ -81,7 +83,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.cVerifier is not null
 		and om.cCode like CONCAT(#{code},'%')
-		)
+		) and r.cBusType = '委外加工'
 		GROUP BY i.cInvCode
 		)tab1
 		right join
@@ -143,18 +145,20 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		(
 		select i.cInvCode as cInvCode,max(i.cInvName) as cInvName,sum(rs.iQuantity) as purchaseQuantity,max(rs.cBatch) as cBatch from UFDATA_103_2021.dbo.rdrecords01 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_103_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		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')
+		WHERE om.cVerifier is not null
 		and om.cPOID like CONCAT(#{code},'%')
-		)
+		) and r.cBusType = '普通采购'
 		GROUP BY i.cInvCode
 		union all
 		select i.cInvCode as cInvCode,max(i.cInvName) as cInvName,sum(rs.iQuantity) as purchaseQuantity,max(rs.cBatch) as cBatch from UFDATA_103_2021.dbo.rdrecords01 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_103_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		where cPOID in (
 		select distinct om.cCode
 		from UFDATA_103_2021.dbo.om_momain om
@@ -162,7 +166,7 @@ where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.cVerifier is not null
 		and om.cCode like CONCAT(#{code},'%')
-		)
+		) and r.cBusType = '委外加工'
 		GROUP BY i.cInvCode
 		)tab1
 		right join

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

@@ -97,6 +97,7 @@
 		(
 		select i.cInvCode,i.cInvName,sum(rs.iQuantity) as purchaseQuantity from UFDATA_103_2021.dbo.rdrecords01 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_103_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		where cPOID in (
 		select om.cPOID
 		from UFDATA_103_2021.dbo.PO_POmain om
@@ -104,11 +105,12 @@
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.cVerifier is not null
 		and om.cPOID LIKE CONCAT(#{code},'%')
-		)
+		) and r.cBusType = '普通采购'
 		GROUP BY i.cInvCode,i.cInvName
 		UNION ALL
 		select i.cInvCode,i.cInvName,sum(rs.iQuantity) as purchaseQuantity from UFDATA_103_2021.dbo.rdrecords01 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_103_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		where cPOID in (
 		select om.cCode
 		from UFDATA_103_2021.dbo.om_momain om
@@ -116,7 +118,7 @@
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.cVerifier is not null
 		and om.cCode like CONCAT(#{code},'%')
-		)
+		) and r.cBusType = '委外加工'
 		GROUP BY i.cInvCode,i.cInvName
 		)tab1 on tab1.cInvName=tab.goodsName and tab1.cInvCode=tab.cInvCode
 		left join
@@ -260,6 +262,7 @@
 		(
 		select i.cInvCode,i.cInvName,sum(rs.iQuantity) as purchaseQuantity from UFDATA_101_2021.dbo.rdrecords01 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_101_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		where cPOID in (
 		select om.cPOID
 		from UFDATA_101_2021.dbo.PO_POmain om
@@ -267,11 +270,12 @@
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.cVerifier is not null
 		and om.cPOID LIKE CONCAT(#{code},'%')
-		)
+		)  and r.cBusType = '普通采购'
 		GROUP BY i.cInvCode,i.cInvName
 		UNION ALL
 		select i.cInvCode,i.cInvName,sum(rs.iQuantity) as purchaseQuantity from UFDATA_101_2021.dbo.rdrecords01 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
+		join UFDATA_101_2021.dbo.rdrecord01 r on rs.ID = r.ID
 		where cPOID in (
 		select om.cCode
 		from UFDATA_101_2021.dbo.om_momain om
@@ -279,7 +283,7 @@
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.cVerifier is not null
 		and om.cCode like CONCAT(#{code},'%')
-		)
+		) and r.cBusType = '委外加工'
 		GROUP BY i.cInvCode,i.cInvName
 		)tab1 on tab1.cInvName=tab.goodsName and tab1.cInvCode=tab.cInvCode
 		left join

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/job/AddOrderJob.java

@@ -135,6 +135,10 @@ public class AddOrderJob implements Job,ApplicationContextAware {
                         " left join Vendor v on s.cDefine12=v.cVenName" +
                         " where s.iStatus = 1 and (s.cCloser is null or s.cCloser='asuser') AND (s.cdefine15 is null or  s.cdefine15 !='1' and s.cdefine15 !='2') and dverifydate > "+formattedDate;
 
+                //103的销售订单只取客户是101的
+                if(account.equals("103")){
+                    sql=sql+" and s.cCusCode = 'T020001' ";
+                }
                 if(this.parameter==null || this.parameter.equals("") || this.parameter.equals(" ")){
                     sql=sql+" order by s.dDate desc ";
                 }else {

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/InterfaceConnUtils.java

@@ -106,6 +106,7 @@ public class InterfaceConnUtils {
 
         } catch (Exception e) {
             e.printStackTrace();
+            log.info("调用接口失败!");
         }
         return onejb;
     }