Browse Source

面料损耗更新

fenghaifu 1 year ago
parent
commit
22bf609fc4

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

@@ -548,7 +548,7 @@
 		<foreach  item="item" collection="invIdList" index="index"  open="(" separator="," close=")">
 			#{item}
 		</foreach>
-		) union all (
+		) union all
 		(
 		select  b.AutoId,a.cCode,isnull(b.cPOID,'') as cPlanCode,a.cBusType,e.cVCName,d.cVenName,d.cVenAbbName,
 		b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,f.cInvName,b.iQuantity,
@@ -568,7 +568,7 @@
 			#{item}
 		</foreach>
 		)
-		) union all (
+		 union all (
 		select  b.AutoId,a.cCode, isnull(a.cdefine9,'') as cPlanCode,a.cBusType,'' as cVCName,'' as cVenName,'' as cVenAbbName,
 		b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,f.cInvname,b.iQuantity,
 		isnull(case when a.cMaker='王行乔' then b.iPrice/b.iQuantity else b.iPrice*1.13/b.iQuantity end,0) as iPrice,

+ 9 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricLossServiceImpl.java

@@ -739,7 +739,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 			}
 			BigDecimal bDLoss = new BigDecimal(dLoss);
 			fabricOMOrder.setCQuantityLoss(bDLoss.setScale(2, BigDecimal.ROUND_HALF_UP).toString()+"%");
-			fabricOMOrder.setIQuantityMoreLess(DoubleOperation.sub(fabricOMOrder.getIQuantityIn(),fabricOMOrder.getIQuantity()));
+			fabricOMOrder.setIQuantityMoreLess(DoubleOperation.getScale(DoubleOperation.sub(fabricOMOrder.getIQuantityIn(),fabricOMOrder.getIQuantity()),4));
 		}
 		// 委外订单国外子表id
 		List<String> omDetailIdListGw = fabricLossMapper.getOmOrderListGw(code);
@@ -1199,10 +1199,17 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 				}else {
 					e.setIPrice(DoubleOperation.getScale(e.getIPrice(), 4));
 				}
+
 			});
 			// 设置形态转换的源头单价,及源头物料
 			setAssemVouchInPriceList(inList);
 
+			inList.forEach(e->{
+
+				if ("杂纱".equalsIgnoreCase(e.getCInvName())){
+					e.setIPrice(0.0);
+				}
+			});
 			// 每行设置金额
 			//for (FabricCommonIn item : commonInList){
 			for (Integer detailId : moDetailIdList){
@@ -1673,6 +1680,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 			// 设置损耗,清除采购数量
 			for (FabricPoOrder poOrder:toAddpoOrderList){
 				poOrder.setIQuantityLeftRate(DoubleOperation.div(poOrder.getIQuantityLeft(),poOrder.getIQuantityIn(), 4));
+				poOrder.setIQuantityLeft(DoubleOperation.getScale(poOrder.getIQuantityLeft(),4));
 				poOrder.setIQuantityIn(0.0);
 			}
 			poOrderList.addAll(toAddpoOrderList);