zengtx 2 anni fa
parent
commit
7dc1060dd3

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/controller/SyCostAllocationController.java

@@ -232,6 +232,9 @@ public class SyCostAllocationController {
         if(list.size()==0 && entity.isSuccess() == true){
             return Result.error("该计划号未查到面损表,不允许保存!");
         }
+        if(list.size()!=0 && !list.get(0).getStatus().equals("完成")){
+            return Result.error("该计划号未完成,不允许保存!");
+        }
 
         Result<T> result = syCostAllocationService.saveMain(planNum, json);
         return result;

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

@@ -110,9 +110,9 @@
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
 		where iordercode in (
 		select distinct od.csocode
-		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
+		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 om.cPOID like CONCAT(#{code},'%')
 		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and (i.cInvCCode != '0499' or i.cInvName like '%棉%') and i.cInvCCode != '0299' and rs.cBatch like CONCAT(#{code},'%')

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

@@ -51,15 +51,10 @@
 		,sum(bi.iMoney) as priceExcludingtax,max(bi.iCost) as iCost
 		from UFDATA_103_2021.dbo.PO_Pomain pom
 		join UFDATA_103_2021.dbo.PO_Podetails pod on pod.POID  = pom.POID
-		join UFDATA_103_2021.dbo.HY_DZ_K7_SYNERGISMLOGDID hy on pod.id = hy.predid
-
-		join UFDATA_103_2021.dbo.PO_Podetails pd on pd.iorderdid=hy.did
-		join UFDATA_103_2021.dbo.PO_Pomain pm on pd.POID  = pm.POID
-		join UFDATA_103_2021.dbo.PurBillVouchs bi  on bi.iPOsID=pd.ID
+		join UFDATA_103_2021.dbo.PurBillVouchs bi  on bi.iPOsID=pod.ID
 		join UFDATA_103_2021.dbo.PurBillVouch bm  on bm.PBVID=bi.PBVID
 		join UFDATA_103_2021.dbo.Vendor ven on bm.cVenCode = ven.cVenCode
-		join UFDATA_103_2021.dbo.Inventory oti on oti.cInvCode=pd.cInvCode
-		where pm.cVenCode != 'T010001' and pom.cVenCode = 'T010001'
+		join UFDATA_103_2021.dbo.Inventory oti on oti.cInvCode=pod.cInvCode
 		GROUP BY bi.cInvCode,pod.iorderdid) as t2 where t1.cInvCode=t2.cInvCode and t2.iorderdid=t1.isosid
 		) t3  GROUP BY t3.goodsName
 

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

@@ -30,9 +30,9 @@
 			sum(shs.iSum) as exportPrice,
 			sum(iNatSum) as rmbAmount,
 			case when max(so.cexch)='人民币' then avg(so.procesUnitPriceusd) else round(avg(so.procesUnitPriceusd)*sh.iExchRate,4) end as procesUnitPricermb,
-			case when max(so.cexch)='人民币' then round(avg(so.procesUnitPriceusd)/sh.iExchRate,4) else avg(so.procesUnitPriceusd) end as procesUnitPriceusd,
+			case when max(so.cexch)='人民币' then 0 else avg(so.procesUnitPriceusd) end as procesUnitPriceusd,
 				case when max(so.cexch)='人民币' then avg(so.procesUnitPriceusd) else round(avg(so.procesUnitPriceusd)*sh.iExchRate,4) end* sum(shs.iQuantity) as processCost,
-			case when max(so.cexch)='人民币' then round(avg(so.procesUnitPriceusd)/sh.iExchRate,4) else avg(so.procesUnitPriceusd) end * sum(shs.iQuantity) as processCostUsd,
+			case when max(so.cexch)='人民币' then 0 else avg(so.procesUnitPriceusd) end * sum(shs.iQuantity) as processCostUsd,
 			v.cVenName AS processUnit
 		 FROM
 			UFDATA_101_2021.dbo.SaleBillVouch sh
@@ -71,9 +71,9 @@
 			sum(shs.iSum) as exportPrice,
 			sum(iNatSum) as rmbAmount,
 			case when max(so.cexch)='人民币' then avg(so.iOriTaxCost) else round(avg(so.iOriTaxCost)*sh.iExchRate,4) end as procesUnitPricermb,
-			case when max(so.cexch)='人民币' then round(avg(so.iOriTaxCost)/sh.iExchRate,4) else avg(so.iOriTaxCost) end as procesUnitPriceusd,
+			case when max(so.cexch)='人民币' then 0 else avg(so.iOriTaxCost) end as procesUnitPriceusd,
 				case when max(so.cexch)='人民币' then avg(so.iOriTaxCost) else round(avg(so.iOriTaxCost)*sh.iExchRate,4) end * sum(shs.iQuantity) as processCost,
-			case when max(so.cexch)='人民币' then round(avg(so.iOriTaxCost)/sh.iExchRate,4) else avg(so.iOriTaxCost) end * sum(shs.iQuantity) as processCostUsd,
+			case when max(so.cexch)='人民币' then 0 else avg(so.iOriTaxCost) end * sum(shs.iQuantity) as processCostUsd,
 			v.cVenName AS processUnit
 		FROM
 			UFDATA_102_2021.dbo.SaleBillVouch sh
@@ -125,10 +125,10 @@
 		sum(shs.iSum) as exportPrice,
 		sum(iNatSum) as rmbAmount,
 		case when max(so.cexch)='人民币' then avg(so.iOriTaxCost) else round(avg(so.iOriTaxCost)*sh.iExchRate,4) end as procesUnitPricermb,
-		case when max(so.cexch)='人民币' then round(avg(so.iOriTaxCost)/sh.iExchRate,4) else avg(so.iOriTaxCost) end as procesUnitPriceusd,
+		case when max(so.cexch)='人民币' then 0 else avg(so.iOriTaxCost) end as procesUnitPriceusd,
 
 			case when max(so.cexch)='人民币' then avg(so.iOriTaxCost) else round(avg(so.iOriTaxCost)*sh.iExchRate,4) end * sum(shs.iQuantity) as processCost,
-		case when max(so.cexch)='人民币' then round(avg(so.iOriTaxCost)/sh.iExchRate,4) else avg(so.iOriTaxCost) end * sum(shs.iQuantity) as processCostUsd,
+		case when max(so.cexch)='人民币' then 0 else avg(so.iOriTaxCost) end * sum(shs.iQuantity) as processCostUsd,
 		v.cVenName AS processUnit
 		 FROM
 			UFDATA_101_2021.dbo.SaleBillVouch sh