Browse Source

面料损耗更新

fenghaifu 2 years ago
parent
commit
dcc20dfac5

+ 9 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricMoOrderCK.java

@@ -59,8 +59,8 @@ public class FabricMoOrderCK {
     private  Double iMoney;
     private  Double iMoney;
     @ApiModelProperty(value = "是否异常")
     @ApiModelProperty(value = "是否异常")
     private Boolean abnormal;
     private Boolean abnormal;
-    // 委外订单子表id
-    private Integer MODetailsID;
+    // 委外订单子表id,明细行要合并,可能会有多个
+    private String MODetailsID;
     // 入库物料编号+颜色
     // 入库物料编号+颜色
     private  String cInvCodeColorIn;
     private  String cInvCodeColorIn;
 
 
@@ -77,6 +77,11 @@ public class FabricMoOrderCK {
         return cInvCodeOut+cColorOut+cBatchOut;
         return cInvCodeOut+cColorOut+cBatchOut;
     }
     }
 
 
+    // 委外订单行出库详情分组
+    public String getGroupId(){
+        return cOmVenAbbName+cOmCode+cCode+getInvOutId()+oConvertUtils.getString(iPrice);
+    }
+
     /**
     /**
      * 根据采购入库生成记录
      * 根据采购入库生成记录
      * @param editOmList
      * @param editOmList
@@ -222,8 +227,8 @@ public class FabricMoOrderCK {
      * @param invOutId
      * @param invOutId
      * @return
      * @return
      */
      */
-    public static Double getSaveOmOutPrice(List<FabricOMOrder> editOmList, Integer modetailsID, String invOutId){
-        Optional<FabricOMOrder> findOpt = editOmList.stream().filter(e->e.getMODetailsID().indexOf(modetailsID.toString())>-1).findFirst();
+    public static Double getSaveOmOutPrice(List<FabricOMOrder> editOmList, String modetailsID, String invOutId){
+        Optional<FabricOMOrder> findOpt = editOmList.stream().filter(e->e.getMODetailsID().indexOf(modetailsID)>-1).findFirst();
         if (findOpt.isPresent()){
         if (findOpt.isPresent()){
             FabricOMOrder findItem = findOpt.get();
             FabricOMOrder findItem = findOpt.get();
             List<FabricMoOrderCK> ckList = findItem.getFabricMoOrderCKList();
             List<FabricMoOrderCK> ckList = findItem.getFabricMoOrderCKList();

+ 7 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricMoOrderRK.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
+import org.jeecg.common.util.oConvertUtils;
 
 
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
@@ -47,12 +48,16 @@ public class FabricMoOrderRK {
     private  Double iSQuantityN;
     private  Double iSQuantityN;
     @ApiModelProperty(value = "成本")
     @ApiModelProperty(value = "成本")
     private  Double iPrice;
     private  Double iPrice;
-    // 委外订单子表id
-    private Integer MODetailsID;
+    // 委外订单子表id,明细行要合并,可能会有多个
+    private String MODetailsID;
     // 计算过程临时用到的,累计使用数量
     // 计算过程临时用到的,累计使用数量
     private Double iTempUseSum;
     private Double iTempUseSum;
 
 
     public String getInvId(){return cInvCode+cColor+cBatch;}
     public String getInvId(){return cInvCode+cColor+cBatch;}
+    // 委外订单行入库详情分组
+    public String getGroupId(){
+        return cPlanCode+getInvId()+ oConvertUtils.getString(iPrice);
+    }
 
 
 
 
 }
 }

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

@@ -4,7 +4,7 @@
 
 
 	<!-- 获取 头信息 主要是成衣委外及源头订单信息 -->
 	<!-- 获取 头信息 主要是成衣委外及源头订单信息 -->
 	<select id="getFabricLossData" resultType="org.jeecg.modules.report.entity.FabricLoss">
 	<select id="getFabricLossData" resultType="org.jeecg.modules.report.entity.FabricLoss">
-		select distinct * from VIEW_FabricLoss_Head_Clothes where cCode like CONCAT('%',#{code},'%')
+		select distinct * from VIEW_FabricLoss_Head_Clothes where (cCode like CONCAT('%',#{code},'%') and cCode not like '%样%')
 	</select>
 	</select>
 	<!-- 获取计划员 103的面料委外制单人,供应商分类是染厂的 -->
 	<!-- 获取计划员 103的面料委外制单人,供应商分类是染厂的 -->
 	<select id="getPlanner" resultType="java.lang.String">
 	<select id="getPlanner" resultType="java.lang.String">
@@ -14,7 +14,7 @@
 		(y.cInvCCode like '01%' or y.cInvCCode like '02%' or y.cInvCCode like '03%' or y.cInvCCode like '04%')   )
 		(y.cInvCCode like '01%' or y.cInvCCode like '02%' or y.cInvCCode like '03%' or y.cInvCCode like '04%')   )
 		and
 		and
 		exists (select x.cVenCode from Vendor x where x.cVenCode=om_momain.cVenCode and x.cVCCode='0105')
 		exists (select x.cVenCode from Vendor x where x.cVenCode=om_momain.cVenCode and x.cVCCode='0105')
-		and cCode like CONCAT(#{code},'%')
+		and (cCode like CONCAT(#{code},'%') and cCode not like '%样%')
 	</select>
 	</select>
 	<!-- 制单人 103的委外发票制单人 -->
 	<!-- 制单人 103的委外发票制单人 -->
 	<!--
 	<!--
@@ -33,12 +33,12 @@
 	<!-- 排单数量 -->
 	<!-- 排单数量 -->
 	<select id="getNumber" resultType="java.lang.String">
 	<select id="getNumber" resultType="java.lang.String">
 		select sum(isnull(iQuantity,0))as 'iQuantity'  from VIEW_OM_MOMain_ALL_Clothes
 		select sum(isnull(iQuantity,0))as 'iQuantity'  from VIEW_OM_MOMain_ALL_Clothes
-		where cCode like CONCAT(#{code},'%')
+		where (cCode like CONCAT(#{code},'%') and cCode not like '%样%')
 	</select>
 	</select>
 	<!-- 销售出库数量 -->
 	<!-- 销售出库数量 -->
 	<select id="getSaleOutSum" resultType="java.lang.String">
 	<select id="getSaleOutSum" resultType="java.lang.String">
 		select isnull(sum(iQuantity),0) as 'iQuantity' from VIEW_FabricLoss_Head_Clothes_SaleOut_Sum where
 		select isnull(sum(iQuantity),0) as 'iQuantity' from VIEW_FabricLoss_Head_Clothes_SaleOut_Sum where
-		cCode like CONCAT(#{code},'%')
+		(cCode like CONCAT(#{code},'%') and cCode not like '%样%')
 	</select>
 	</select>
 	<!--
 	<!--
 	<select id="getPrice" resultType="java.lang.String">
 	<select id="getPrice" resultType="java.lang.String">
@@ -76,217 +76,13 @@
 		inner join Inventory c on b.cInvCode=c.cInvCode
 		inner join Inventory c on b.cInvCode=c.cInvCode
 		inner join Vendor  d on a.cVenCode=d.cVenCode
 		inner join Vendor  d on a.cVenCode=d.cVenCode
 		inner join VendorClass e on d.cVCCode =e.cVCCode
 		inner join VendorClass e on d.cVCCode =e.cVCCode
-		where a.cPOID like CONCAT(#{code},'%')
+		where (a.cPOID like CONCAT(#{code},'%') and a.cPOID not like '%样%')
 		and (c.cInvCCode LIKE '01%'
 		and (c.cInvCCode LIKE '01%'
 		or c.cInvCCode LIKE '02%'
 		or c.cInvCCode LIKE '02%'
 		or c.cInvCCode LIKE '03%'
 		or c.cInvCCode LIKE '03%'
 		or c.cInvCCode LIKE '04%') and c.cInvCCode not in ('0299','0399','0499')
 		or c.cInvCCode LIKE '04%') and c.cInvCCode not in ('0299','0399','0499')
 		) as t1 group by cVCName,cVenName,cVenAbbName,cPOID,cInvCode,cInvName,cColor
 		) as t1 group by cVCName,cVenName,cVenAbbName,cPOID,cInvCode,cInvName,cColor
 	</select>
 	</select>
-	<!-- 其他入库纱,找委外订单的材料出库单,获取物料号+批号,物料号+批号再其他入库单 -->
-	<!--
-	<select id="getPurchaseListOtherInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
-		(
-			SELECT
-				a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,d.cInvName,a.cInvCode,isnull(a.cFree1,'') as cColor,
-				isnull(isnull(stuff((SELECT ',' + x.cdefine9 FROM rdrecord08 x
-					inner join RdRecords08 y on x.id=y.id
-					where y.cInvCode + isnull( y.cFree1, '' ) + isnull( y.cBatch, '' )=
-					a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) FOR XML path('') ), 1, 1, ''),cBatch),'') as cPlanCode,g.cVenAbbName
-			FROM
-				rdrecords11 a
-				INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
-				INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
-				inner join om_momain f on f.moid = e.moid
-				inner join vendor g on f.cVenCode=g.cVenCode
-			WHERE
-				(a.cbatch is null or a.cbatch='' or a.cbatch &lt;&gt; '期初') and
-				(d.cInvCCode LIKE '01%' or d.cInvCCode LIKE '02%' or d.cInvCCode LIKE '03%' or d.cInvCCode LIKE '04%') and
-				a.comcode LIKE CONCAT(#{code},'%') and
-				a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) IN (
-					SELECT
-					b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
-					FROM
-					RdRecords08 b
-					INNER JOIN rdrecord08 a ON a.id = b.ID
-					WHERE
-					a.cbustype = '其他入库'
-				) and
-				a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) not IN (
-					SELECT
-					u.cInvCode + isnull( u.cFree1, '' ) + isnull( u.cBatch, '' )
-					FROM
-					rdrecords01 u
-					inner join RdRecord01 v on u.id=v.id
-					inner join OM_MODetails w on u.iOMoDID =w.MODetailsID
-					inner join om_momain x on w.moid  =x.moid
-					where x.cCode  like CONCAT(#{code},'%')
-				) and
-				d.cinvname &lt;&gt; '杂纱' and a.iquantity>0
-		) union all (
-			SELECT
-				a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,d.cInvName,a.cInvCode,isnull(a.cFree1,'') as cColor,
-				isnull(isnull(stuff((SELECT ',' + x.cdefine9 FROM rdrecord08 x
-					inner join RdRecords08 y on x.id=y.id
-					where y.cInvCode + isnull( y.cFree1, '' ) + isnull( y.cBatch, '' ) in (
-					select cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') from VIEW_FabricLoss_AssemVouchs where
-					cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'')=a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' )
-					) FOR XML path('') ), 1, 1, ''),cBatch),'') as cPlanCode,g.cVenAbbName
-			FROM
-				rdrecords11 a
-				INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
-				INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
-				inner join om_momain f on f.moid = e.moid
-				inner join vendor g on f.cVenCode=g.cVenCode
-			WHERE
-				(a.cbatch is null or a.cbatch='' or a.cbatch &lt;&gt; '期初') and
-				(d.cInvCCode LIKE '01%' or d.cInvCCode LIKE '02%' or d.cInvCCode LIKE '03%' or d.cInvCCode LIKE '04%') and
-				a.comcode LIKE CONCAT(#{code},'%') and
-				a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) IN (
-					select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
-					cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
-					select b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
-					FROM
-						RdRecords08 b
-						INNER JOIN rdrecord08 a ON a.id = b.ID
-					WHERE
-					a.cbustype in ('其他入库','转换入库')
-					)
-				) and
-				a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) not IN (
-					SELECT
-					b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
-					FROM
-					RdRecords08 b
-					INNER JOIN rdrecord08 a ON a.id = b.ID
-					WHERE
-					a.cbustype = '其他入库'
-				) and
-				a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) not IN (
-					SELECT
-					u.cInvCode + isnull( u.cFree1, '' ) + isnull( u.cBatch, '' )
-					FROM
-					rdrecords01 u
-					inner join RdRecord01 v on u.id=v.id
-					inner join OM_MODetails w on u.iOMoDID =w.MODetailsID
-					inner join om_momain x on w.moid  =x.moid
-					where x.cCode  like CONCAT(#{code},'%')
-				) and
-				d.cinvname &lt;&gt; '杂纱'  and a.iquantity>0
-		) union all (
-			SELECT
-				a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,
-				isnull(a.cBatch,'') as cBatch,d.cInvName,a.cInvCode,isnull(a.cFree1,'') as cColor,'杂纱' as cPlanCode,g.cVenAbbName
-			FROM
-				rdrecords11 a
-				INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
-				INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
-				inner join om_momain f on f.moid = e.moid
-				inner join vendor g on f.cVenCode=g.cVenCode
-			WHERE
-				(a.cbatch is null or a.cbatch='' or a.cbatch &lt;&gt; '期初') and
-				(d.cInvCCode LIKE '01%' or d.cInvCCode LIKE '02%' or d.cInvCCode LIKE '03%' or d.cInvCCode LIKE '04%') and
-				a.comcode LIKE CONCAT(#{code},'%') and
-				d.cinvname='杂纱' and a.iquantity>0
-		)
-	</select>-->
-	<!-- 来源余纱,找委外订单的材料出库单,获取物料号+批号。如果物料号+批号在形态转换单中,取转换前物料+批号。判断物料+批号,是否在其他采购入库里 -->
-	<!--
-	<select id="getPurchaseListOtherPurInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
-
-		(
-		SELECT
-			a.autoid,a.comcode as cCode,case when a.iSQuantity is null or a.iSQuantity=0 then a.iquantity else a.iSQuantity end as iQuantity,
-			isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,a.cInvCode,isnull(a.cFree1,'') as cColor,d.cInvName,
-			case when a.cBatch is not null and a.cBatch='期初' then '期初'
-			else
-				isnull(stuff((
-				select ','+x.cPOID from RdRecords01 u
-				inner join RdRecord01 v on u.id=v.id
-				inner join PO_Podetails w on u.iPOsID =w.ID
-				inner join PO_Pomain x on w.POID  =x.POID
-				where x.cPOID  not like CONCAT(#{code},'%') and v.cbustype='普通采购' and
-				u.cinvcode+isnull(u.cfree1,'')+isnull(u.cbatch,'') = a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'')
-				FOR XML path('')
-				), 1, 1, ''),'')
-			end	as cPlanCode,g.cVenAbbName
-		FROM
-			rdrecords11 a
-			INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
-			INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
-			inner join om_momain f on f.moid = e.moid
-			inner join vendor g on f.cVenCode=g.cVenCode
-		WHERE
-			(d.cInvCCode LIKE '01%'
-			or d.cInvCCode LIKE '02%'
-			or d.cInvCCode LIKE '03%'
-			or d.cInvCCode LIKE '04%') and
-			a.comcode LIKE CONCAT(#{code},'%') and
-			d.cInvName &lt;&gt; '杂纱' and
-			a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
-			select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-			inner join RdRecord01 a on a.id=b.id
-			inner join PO_Podetails  c on b.iPOsID =c.ID
-			inner join PO_Pomain d on c.POID  =d.POID
-			where d.cPOID  not like CONCAT(#{code},'%') and a.cbustype='普通采购'
-			)  and
-			a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') not in (
-			select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-			inner join RdRecord01 a on a.id=b.id
-			inner join PO_Podetails  c on b.iPOsID =c.ID
-			inner join PO_Pomain d on c.POID  =d.POID
-			where d.cPOID  like CONCAT(#{code},'%') and a.cbustype='普通采购'
-			) and a.iQuantity&lt;&gt;0
-		) union all (
-		SELECT
-			a.autoid,a.comcode as cCode,case when a.iSQuantity is null or a.iSQuantity=0 then a.iquantity else a.iSQuantity end as iQuantity,
-			isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,a.cInvCode,isnull(a.cFree1,'') as cColor,d.cInvName,
-			case when a.cBatch is not null and a.cBatch='期初' then '期初'
-			else
-				isnull(stuff((
-				select ','+x.cPOID from RdRecords01 u
-				inner join RdRecord01 v on u.id=v.id
-				inner join PO_Podetails w on u.iPOsID =w.ID
-				inner join PO_Pomain x on w.POID  =x.POID
-				where x.cPOID  not like CONCAT(#{code},'%') and v.cbustype='普通采购' and
-				u.cinvcode+isnull(u.cfree1,'')+isnull(u.cbatch,'') in (
-				select cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') from VIEW_FabricLoss_AssemVouchs where
-				cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'')=a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'')
-				)
-
-				FOR XML path('')
-				), 1, 1, ''),'')
-			end	as cPlanCode,g.cVenAbbName
-		FROM
-			rdrecords11 a
-			INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
-			INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
-			inner join om_momain f on f.moid = e.moid
-			inner join vendor g on f.cVenCode=g.cVenCode
-		WHERE
-			(d.cInvCCode LIKE '01%'
-			or d.cInvCCode LIKE '02%'
-			or d.cInvCCode LIKE '03%'
-			or d.cInvCCode LIKE '04%') and
-			a.comcode LIKE CONCAT(#{code},'%') and
-			d.cInvName &lt;&gt; '杂纱' and
-			a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
-				select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
-				cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
-					select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-					inner join RdRecord01 a on a.id=b.id
-					inner join PO_Podetails  c on b.iPOsID =c.ID
-					inner join PO_Pomain d on c.POID  =d.POID
-					where d.cPOID not like CONCAT(#{code},'%') and a.cbustype='普通采购')
-				and cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') not in (
-					select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-					inner join RdRecord01 a on a.id=b.id
-					inner join PO_Podetails  c on b.iPOsID =c.ID
-					inner join PO_Pomain d on c.POID  =d.POID
-					where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购')
-			) and a.iQuantity&lt;&gt;0
-		)
-	</select>-->
 	<!--获取所有委外订单 cComUnitCode : 计量单位,02(PCS)根,04(M)米-->
 	<!--获取所有委外订单 cComUnitCode : 计量单位,02(PCS)根,04(M)米-->
 	<select id="getOmOrderListAll" resultType="org.jeecg.modules.report.entity.FabricOMOrder">
 	<select id="getOmOrderListAll" resultType="org.jeecg.modules.report.entity.FabricOMOrder">
 		select MODetailsID,cVCName,cVenName,cVenAbbName,cVenCode,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber,
 		select MODetailsID,cVCName,cVenName,cVenAbbName,cVenCode,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber,
@@ -305,7 +101,7 @@
 				inner join VendorClass e on d.cVCCode =e.cVCCode
 				inner join VendorClass e on d.cVCCode =e.cVCCode
 			WHERE
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
 				c.cInvCCode NOT LIKE '19%'
-				AND a.cCode LIKE CONCAT(#{code},'%')
+				AND (a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
 		) union all (
 		) union all (
 			SELECT b.MODetailsID,e.cVCName,d.cVenName ,d.cVenAbbName ,a.cVenCode ,c.cInvCode,c.cInvName,c.cComUnitCode,
 			SELECT b.MODetailsID,e.cVCName,d.cVenName ,d.cVenAbbName ,a.cVenCode ,c.cInvCode,c.cInvName,c.cComUnitCode,
 				isnull(b.cFree1,'') as cColor,
 				isnull(b.cFree1,'') as cColor,
@@ -323,31 +119,13 @@
 				inner join Inventory h on h.cinvcode=g.cinvcode
 				inner join Inventory h on h.cinvcode=g.cinvcode
 			WHERE
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
 				c.cInvCCode NOT LIKE '19%'
-				AND a.cCode LIKE CONCAT(#{code},'%') and g.cMoCode LIKE CONCAT(#{code},'%')
+				AND (a.cCode LIKE CONCAT(#{code},'%') and g.cMoCode LIKE CONCAT(#{code},'%')
+					and a.cCode not like '%样%' and g.cMoCode not like '%样%')
 		)) as t1
 		)) as t1
 		group by MODetailsID,cVCName,cVenName,cVenAbbName,cVenCode,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
 		group by MODetailsID,cVCName,cVenName,cVenAbbName,cVenCode,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
 		having (sum(iQuantityOut)>0 or sum(iQuantityIn)>0)
 		having (sum(iQuantityOut)>0 or sum(iQuantityIn)>0)
 		order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
 		order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
-<!--
-		select * from (
-		SELECT b.MODetailsID,e.cVCName,d.cVenName ,d.cVenAbbName ,a.cVenCode ,c.cInvCode,c.cInvName,c.cComUnitCode,
-		isnull(b.cFree1,'') as cColor,
-		isnull((select sum(x.iQuantity-x.iSQuantity+isnull(y.iQuantity,0)) from rdrecords11 x
-		left join VIEW_OM_OUT_SETTLEVOUCE y on x.autoid=y.iRdsID
-		where y.cmocode like CONCAT(#{code},'%') and x.iOMoDID=b.MODetailsID),0) as iQuantityOut,
-		isnull((select sum(iQuantity) from RdRecords01 x where x.iOMoDID=b.MODetailsID),0) as iQuantityIn,
-		b.iQuantity,isnull(b.cdefine30,'') as cColorNumber
-		FROM
-		om_momain a
-		INNER JOIN OM_MODetails b ON a.moid = b.moid
-		INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-		inner join Vendor  d on a.cVenCode=d.cVenCode
-		inner join VendorClass e on d.cVCCode =e.cVCCode
-		WHERE
-		c.cInvCCode NOT LIKE '19%'
-		AND a.cCode LIKE CONCAT(#{code},'%')
-		) as t1 where (iQuantityOut>0 or iQuantityIn>0)
-		order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber-->
+
 
 
 	</select>
 	</select>
 	<!--获取销售出库委外订单行id-->
 	<!--获取销售出库委外订单行id-->
@@ -362,68 +140,12 @@
 				inner join VendorClass e on d.cVCCode =e.cVCCode
 				inner join VendorClass e on d.cVCCode =e.cVCCode
 			WHERE
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
 				c.cInvCCode NOT LIKE '19%'
-				AND a.cCode LIKE CONCAT(#{code},'%')
+				AND (a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
 				and b.cInvCode+isnull(b.cFree1,'') in (
 				and b.cInvCode+isnull(b.cFree1,'') in (
-				select cInvCode+isnull(cFree1,'') from rdrecords32 where cbatch like CONCAT(#{code},'%')
+				select cInvCode+isnull(cFree1,'') from rdrecords32 where (cbatch like CONCAT(#{code},'%') and cbatch not like '%样%')
 				)
 				)
 
 
 	</select>
 	</select>
-	<!--获取本次采购入库的委外材料出库单,已核销的取核销数量-->
-	<!--
-	<select id="getOmOutList" resultType="map">
-		SELECT
-			g.cVenName,
-			g.cVenAbbName,
-			e.cCode,
-			b.cInvName,
-			isnull( a.cFree1, '' ) AS cColor,
-			b.cInvCode,
-			isnull( a.iSQuantity, a.iQuantity ) AS iQuantity,
-			a.autoid,
-			a.iPrice,
-			a.cBatch
-		FROM
-			rdrecords11 a
-			INNER JOIN Inventory b ON a.cInvCode = b.cInvCode
-			INNER JOIN OM_MODetails d ON d.MODetailsID = a.iOMoDID
-			INNER JOIN om_momain e ON e.moid = d.moid
-			INNER JOIN vendor g ON e.cVenCode = g.cVenCode
-		WHERE
-			b.cInvCCode NOT LIKE '19%'
-			AND e.cCode LIKE CONCAT(#{code},'%')
-			and (
-				a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
-				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-				inner join RdRecord01 a on a.id=b.id
-				inner join PO_Podetails  c on b.iPOsID =c.ID
-				inner join PO_Pomain d on c.POID  =d.POID
-				where d.cPOID  like CONCAT(#{code},'%') and a.cbustype='普通采购'
-				)
-				or a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
-					select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
-						cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
-						select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-						inner join RdRecord01 a on a.id=b.id
-						inner join PO_Podetails  c on b.iPOsID =c.ID
-						inner join PO_Pomain d on c.POID  =d.POID
-						where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购')
-				)
-			)
-
-	</select>-->
-	<!--获取本次采购入库的形态转换-->
-	<!--
-	<select id="getAssemVouchList" resultType="map">
-
-		select * from VIEW_FabricLoss_AssemVouchs where
-		cInvCode+isnull(cAVBatch,'')+isnull(cColor,'') in (
-			select cInvCode+isnull(cBatch,'')+isnull(cFree1,'')  from RdRecords01
-			where iposid in (
-			select b.id from PO_Pomain a inner join PO_Podetails b on a.POID  =b.POID
-			and a.cPOID like CONCAT(#{code},'%')
-			)
-		)
-	</select>-->
 	<!--获取本次采购入库单,含发票和结算数据-->
 	<!--获取本次采购入库单,含发票和结算数据-->
 	<select id="getPurchaseInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderIn">
 	<select id="getPurchaseInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderIn">
 		select a.cCode,a.cBusType,b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,b.iQuantity,e.cInvName,
 		select a.cCode,a.cBusType,b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,b.iQuantity,e.cInvName,
@@ -438,46 +160,13 @@
 		inner join Inventory e on b.cinvcode=e.cinvcode
 		inner join Inventory e on b.cinvcode=e.cinvcode
 		inner join Vendor f on f.cVenCode=a.cVenCode
 		inner join Vendor f on f.cVenCode=a.cVenCode
 		inner join VendorClass g on g.cVCCode =f.cVCCode
 		inner join VendorClass g on g.cVCCode =f.cVCCode
-		where d.cPOID like CONCAT(#{code},'%')
+		where (d.cPOID like CONCAT(#{code},'%') and d.cPOID not like '%样%')
 	</select>
 	</select>
 	<!--获取费用支出-->
 	<!--获取费用支出-->
 	<select id="getExpensesList" resultType="org.jeecg.modules.report.entity.FabricExpenses">
 	<select id="getExpensesList" resultType="org.jeecg.modules.report.entity.FabricExpenses">
 		select * from VIEW_FabricLoss_Expenses
 		select * from VIEW_FabricLoss_Expenses
-		where cSOCode like CONCAT(#{code},'%')
+		where cSOCode like CONCAT(#{code},'%') and cSOCode not like '%样%'
 	</select>
 	</select>
-	<!--获取采购入库价格列表-->
-	<!--<select id="getPurchuseInPriceList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
-		select distinct '普通采购' as cBusType,e.cVCName,d.cVenName ,d.cVenAbbName,c.cInvCode,isnull(c.cFree1,'') as cColor,
-			isnull(c.cBatch,'') as cBatch
-		from PO_Pomain a
-		inner join PO_Podetails b on  a.poid=b.poid
-		inner join Vendor  d on a.cVenCode=d.cVenCode
-		inner join VendorClass e on d.cVCCode =e.cVCCode
-		inner join RdRecords01 c on c.iposid=b.id
-		inner join Inventory f on c.cinvcode=f.cinvcode
-		where a.cPOID like CONCAT(#{code},'%') and e.cVCName not like '成衣厂'
-			and (f.cInvCCode in ('0201','0301','0401') or f.cInvCCode like '01%')
-	</select>-->
-	<!--获取委外订单发票金额-->
-	<!--<select id="getOmInvoiceMoneyList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
-
-		select a.cBusType,g.cVCName,f.cVenName ,f.cVenAbbName,isnull(sum(c.iSum),0) as iMoney
-			from RdRecord01 a
-			inner join RdRecords01 b on a.id=b.id
-			inner join PurBillVouchs c on c.RdsId=b.autoid
-			inner join OM_MODetails d on d.MODetailsID=b.iOMoDID
-			inner join om_momain e on d.moid = e.moid
-			inner join Vendor  f on f.cVenCode=e.cVenCode
-		inner join VendorClass g on g.cVCCode =f.cVCCode
-		inner join Inventory h on b.cinvcode=h.cinvcode
-			where a.cbustype='委外加工'
-			and e.cCode  like CONCAT(#{code},'%')
-			and g.cVCName not like '成衣厂'
-			and (h.cInvCCode IN ('0201','0301','0401','0299','0399','0499') OR h.cInvCCode like '01%')
-			and b.cInvCode &lt;&gt; 'N3000002426'
-			group by a.cBusType,g.cVCName,f.cVenName ,f.cVenAbbName
-			order by a.cBusType,g.cVCName,f.cVenName ,f.cVenAbbName
-	</select>-->
 	<!--获取委外订单运费发票金额-->
 	<!--获取委外订单运费发票金额-->
 	<select id="getOmInvoiceMoneyYfList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
 	<select id="getOmInvoiceMoneyYfList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
 		select '运费发票' as cBusType,g.cVCName,f.cVenName ,f.cVenAbbName,isnull(sum(d.iSum),0) as iMoney
 		select '运费发票' as cBusType,g.cVCName,f.cVenName ,f.cVenAbbName,isnull(sum(d.iSum),0) as iMoney
@@ -486,7 +175,7 @@
 			inner join PurBillVouch e on d.PBVID =e.PBVID
 			inner join PurBillVouch e on d.PBVID =e.PBVID
 			inner join Vendor  f on f.cVenCode=e.cVenCode
 			inner join Vendor  f on f.cVenCode=e.cVenCode
 		inner join VendorClass g on g.cVCCode =f.cVCCode
 		inner join VendorClass g on g.cVCCode =f.cVCCode
-		where  e.cdefine2  like CONCAT(#{code},'%')
+		where  (e.cdefine2  like CONCAT(#{code},'%') and e.cdefine2 not like '%样%')
 			and d.cInvCode='N3000002426'
 			and d.cInvCode='N3000002426'
 			and g.cVCName not like '成衣厂'
 			and g.cVCName not like '成衣厂'
 			group by g.cVCName,f.cVenName ,f.cVenAbbName
 			group by g.cVCName,f.cVenName ,f.cVenAbbName
@@ -500,7 +189,7 @@
 		select cPBVCode,cVenName,cVenAbbName,cShipTime,isnull(sum(iSum),0) as iSum,
 		select cPBVCode,cVenName,cVenAbbName,cShipTime,isnull(sum(iSum),0) as iSum,
 		isnull(sum(iOriSum),0) as iOriSum,isnull(sum(iQuantity),0) as iQuantity,
 		isnull(sum(iOriSum),0) as iOriSum,isnull(sum(iQuantity),0) as iQuantity,
 		isnull(sum(iPBVQuantity),0) as iPBVQuantity,isnull(sum(iSQuantity),0) as iSQuantity
 		isnull(sum(iPBVQuantity),0) as iPBVQuantity,isnull(sum(iSQuantity),0) as iSQuantity
-		from VIEW_FabricLoss_Cost_Clothes where cCode like CONCAT(#{code},'%')
+		from VIEW_FabricLoss_Cost_Clothes where cCode like CONCAT(#{code},'%') and cCode not like '%样%'
 		group by
 		group by
 		cPBVCode,cVenName,cVenAbbName,cShipTime
 		cPBVCode,cVenName,cVenAbbName,cShipTime
 		order by cPBVCode,cVenName,cVenAbbName,cShipTime
 		order by cPBVCode,cVenName,cVenAbbName,cShipTime
@@ -508,7 +197,7 @@
 	<!--开票成本-辅料-->
 	<!--开票成本-辅料-->
 	<select id="getCostAssistList" resultType="org.jeecg.modules.report.entity.FabricCostAssist">
 	<select id="getCostAssistList" resultType="org.jeecg.modules.report.entity.FabricCostAssist">
 
 
-		select * from VIEW_FabricLoss_Cost_Assist where cPoid like CONCAT(#{code},'%')
+		select * from VIEW_FabricLoss_Cost_Assist where cPoid like CONCAT(#{code},'%') and cPoid not like '%样%'
 		and cVenAbbName not in ('宁波森语','马菲羊','森语集团')
 		and cVenAbbName not in ('宁波森语','马菲羊','森语集团')
 		order by cAccount,cPoid,cVenAbbName,cInvName,cComUnitName
 		order by cAccount,cPoid,cVenAbbName,cInvName,cComUnitName
 	</select>
 	</select>
@@ -516,81 +205,10 @@
 	<select id="getCostClothList" resultType="org.jeecg.modules.report.entity.FabricCostCloth">
 	<select id="getCostClothList" resultType="org.jeecg.modules.report.entity.FabricCostCloth">
 
 
 		select cVenName,cSOCode,cSBVCode,cShipTime,cInvName,isnull(iPrice,0) as iPrice,isnull(sum(iQuantity),0) as iQuantity,isnull(sum(iNatSum),0) as iNatSum
 		select cVenName,cSOCode,cSBVCode,cShipTime,cInvName,isnull(iPrice,0) as iPrice,isnull(sum(iQuantity),0) as iQuantity,isnull(sum(iNatSum),0) as iNatSum
-		 from VIEW_FabricLoss_Cost_Cloth where cSOCode like CONCAT(#{code},'%')
+		 from VIEW_FabricLoss_Cost_Cloth where cSOCode like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		 group by cVenName,cSOCode,cSBVCode,cShipTime,cInvName,iPrice
 		 group by cVenName,cSOCode,cSBVCode,cShipTime,cInvName,iPrice
 		order by cVenName,cSBVCode,cInvName
 		order by cVenName,cSBVCode,cInvName
 	</select>
 	</select>
-	<!--获取委外入库物料被其他委外订单使用的金额 -->
-	<!--
-	<select id="getOmInToOtherMoney" resultType="java.lang.String">
-		select isnull(sum(b.iprice),0) as iPrice from rdrecords11 b
-		inner join OM_MODetails c on b.iOMoDID=c.MODetailsID
-		inner join om_momain d on c.MOID =d.MOID
-		where (b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'')
-		in
-		(
-		select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-		inner join OM_MODetails  c on b.iOMoDID=c.MODetailsID
-		inner join om_momain d on c.MOID =d.MOID
-		where d.ccode like CONCAT(#{code},'%')
-		)
-		or b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') in (
-			select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
-				cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
-				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-				inner join OM_MODetails  c on b.iOMoDID=c.MODetailsID
-				inner join om_momain d on c.MOID =d.MOID
-				where d.ccode like CONCAT(#{code},'%')
-				)
-		)
-		)
-		and d.ccode not like CONCAT(#{code},'%')
-	</select>-->
-	<!--获取使用其他委外入库物料的金额 -->
-	<!--
-	<select id="getOmOtherToCurMoney" resultType="java.lang.String">
-
-		SELECT
-			isnull(sum(a.iprice),0) as iPrice
-		FROM
-			rdrecords11 a
-			INNER JOIN Inventory b ON a.cInvCode = b.cInvCode
-			INNER JOIN OM_MODetails d ON d.MODetailsID = a.iOMoDID
-			INNER JOIN om_momain e ON e.moid = d.moid
-		WHERE
-			b.cInvCCode NOT LIKE '19%'
-			AND e.cCode LIKE CONCAT(#{code},'%')
-			and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
-				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-				inner join OM_MODetails  c on b.iOMoDID=c.MODetailsID
-				inner join om_momain d on c.MOID =d.MOID
-				where d.ccode like CONCAT(#{code},'%')
-			)
-			and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
-				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-				inner join PO_Podetails c on  b.iposid=c.id
-				inner join PO_Pomain d on d.poid=c.poid
-				where d.cPOID like  CONCAT(#{code},'%')
-			)
-			and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
-				select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
-				cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
-				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-				inner join OM_MODetails  c on b.iOMoDID=c.MODetailsID
-				inner join om_momain d on c.MOID =d.MOID
-				where d.ccode like  CONCAT(#{code},'%')
-				)
-			)
-			and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
-				select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
-				cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
-				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
-				inner join PO_Podetails c on  b.iposid=c.id
-				inner join PO_Pomain d on d.poid=c.poid
-				where d.cPOID like  CONCAT(#{code},'%')
-				)
-			)
-	</select>-->
 	<!--获取采购入库物料被其他委外订单使用明细 -->
 	<!--获取采购入库物料被其他委外订单使用明细 -->
 	<select id="getPoOrderInToOther" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
 	<select id="getPoOrderInToOther" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
 		select cCode,cInvCode,cColor,
 		select cCode,cInvCode,cColor,
@@ -599,12 +217,12 @@
 		(
 		(
 		select cInvCode,isnull(cFree1,'') as cColor,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,iUnitCost as iPrice
 		select cInvCode,isnull(cFree1,'') as cColor,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,iUnitCost as iPrice
 		from rdrecords11 where
 		from rdrecords11 where
-		comcode not like CONCAT(#{code},'%')
+		comcode not like CONCAT(#{code},'%') and comcode not like '%样%'
 		and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 			select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 			select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 			inner join PO_Podetails  c on b.iposid=c.id
 			inner join PO_Podetails  c on b.iposid=c.id
 			inner join PO_Pomain d on c.POID =d.POID
 			inner join PO_Pomain d on c.POID =d.POID
-			where d.cPOID like CONCAT(#{code},'%')
+			where d.cPOID like CONCAT(#{code},'%')  and d.cPOID not like '%样%'
 		)
 		)
 		or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 			select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
 			select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
@@ -612,48 +230,26 @@
 				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 				select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 				inner join PO_Podetails  c on b.iposid=c.id
 				inner join PO_Podetails  c on b.iposid=c.id
 				inner join PO_Pomain d on c.POID =d.POID
 				inner join PO_Pomain d on c.POID =d.POID
-				where d.cPOID like CONCAT(#{code},'%')
+				where d.cPOID like CONCAT(#{code},'%') and d.cPOID not like '%样%'
 		)
 		)
 		)
 		)
 		)
 		)
 		) as t1
 		) as t1
 		group by cCode,cInvCode,cColor
 		group by cCode,cInvCode,cColor
 	</select>
 	</select>
-	<!--委外订单-材料出库详情-->
-	<!--
-	<select id="getOmOutDetailList" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
-		select f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
-			 x.cInvCode as cInvCodeIn,y.cInvName as cInvNameIn,x.cFree1 as cColorIn,x.cBatch as cBatchIn,
-			 d.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,d.cFree1 as cColorOut,d.cBatch as cBatchOut,
-			 x.iProcessFee/x.iQuantity as iProcessPrice, d.iQuantity/x.iQuantity as iRate,
-			 d.iQuantity as iQuantityOut,x.iQuantity as iQuantityIn,
-			 isnull((select sum(iSum)/sum(iPBVQuantity ) from PurBillVouchs  x where x.RdsId =e.autoid and f.cbustype='普通采购'),0) as iPurchusePrice
-		FROM
-		om_momain a
-		INNER JOIN OM_MODetails b ON a.moid = b.moid
-		INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-		inner join RdRecords01 x on x.iOMoDID=b.MODetailsID
-		INNER JOIN Inventory y ON x.cinvcode = y.cinvcode
-		inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
-		INNER JOIN Inventory z ON d.cinvcode = z.cinvcode
-		left join rdrecords01 e on d.cInvCode=e.cInvCode
-			and isnull(d.cFree1,'')=isnull(e.cFree1,'') and isnull(d.cBatch,'')=isnull(e.cBatch,'')
-		left join rdrecord01 f on e.id=f.id
-		left join Vendor g on g.cVenCode=f.cVenCode
-		WHERE
-		c.cInvCCode NOT LIKE '19%'
-		AND a.cCode LIKE CONCAT(#{code},'%')
-
-	</select>-->
 	<!--委外订单-采购入库详情-->
 	<!--委外订单-采购入库详情-->
 	<select id="getOmInDetailList" resultType="org.jeecg.modules.report.entity.FabricMoOrderRK">
 	<select id="getOmInDetailList" resultType="org.jeecg.modules.report.entity.FabricMoOrderRK">
+	select cPlanCode,cCode,MODetailsID,cVCName,cVenName,cVenAbbName,cInvCCode,cInvCode,cInvName,cColor,cBatch,
+		sum(iQuantityIn) as iQuantityIn,sum(iProcessFee) as iProcessFee,sum(iSQuantity) as iSQuantity,
+		sum(iQuantityOut) as iQuantityOut,sum(iSumBillQuantity) as iSumBillQuantity
+	 from (
 		select isnull(a.cCode,'') as cPlanCode,z.cCode,b.MODetailsID,
 		select isnull(a.cCode,'') as cPlanCode,z.cCode,b.MODetailsID,
 		d.cVCName,c.cVenName,c.cVenAbbName,
 		d.cVCName,c.cVenName,c.cVenAbbName,
 			 x.cInvCode as cInvCode,y.cInvName as cInvName,isnull(x.cFree1,'') as cColor,isnull(x.cBatch,'') as cBatch,
 			 x.cInvCode as cInvCode,y.cInvName as cInvName,isnull(x.cFree1,'') as cColor,isnull(x.cBatch,'') as cBatch,
 			 isnull(x.iQuantity,0) as iQuantityIn,
 			 isnull(x.iQuantity,0) as iQuantityIn,
 			 isnull(isnull((select  sum(n.iSum) from  PurBillVouchs  n where n.RdsId =x.autoid),x.iProcessFee),0) as iProcessFee,
 			 isnull(isnull((select  sum(n.iSum) from  PurBillVouchs  n where n.RdsId =x.autoid),x.iProcessFee),0) as iProcessFee,
 			 isnull(x.iSumBillQuantity,0) as iSumBillQuantity,isnull(x.iSQuantity,0) as iSQuantity,
 			 isnull(x.iSumBillQuantity,0) as iSumBillQuantity,isnull(x.iSQuantity,0) as iSQuantity,
-			 (select sum(isnull(iquantity,0)) as iQuantityOut from rdrecords11 d where d.iOMoDID=b.MODetailsID) as iQuantityOut,
+			 isnull((select sum(isnull(iquantity,0)) as iQuantityOut from rdrecords11 d where d.iOMoDID=b.MODetailsID),0) as iQuantityOut,
 			 y.cInvCCode
 			 y.cInvCCode
 		FROM
 		FROM
 		om_momain a
 		om_momain a
@@ -665,46 +261,10 @@
 			inner join VendorClass d on d.cVCCode =c.cVCCode
 			inner join VendorClass d on d.cVCCode =c.cVCCode
 		WHERE
 		WHERE
 		y.cInvCCode NOT LIKE '19%'
 		y.cInvCCode NOT LIKE '19%'
-		AND a.cCode LIKE CONCAT(#{code},'%')
+		AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
+	) as t1 group by cPlanCode,cCode,MODetailsID,cVCName,cVenName,cVenAbbName,cInvCCode,cInvCode,cInvName,cColor,cBatch
 
 
 	</select>
 	</select>
-	<!-- 获取委外出库的纱数量 -->
-	<!--
-	<select id="getOmOutList01" resultType="org.jeecg.modules.report.entity.FabricInventoryOut">
-		SELECT
-			b.cInvName,
-			isnull( a.cFree1, '' ) AS cColor,
-			b.cInvCode,
-			sum(isnull( a.iSQuantity, a.iQuantity )) AS iQuantity,
-			a.cBatch
-		FROM
-			rdrecords11 a
-			INNER JOIN Inventory b ON a.cInvCode = b.cInvCode
-			INNER JOIN OM_MODetails d ON d.MODetailsID = a.iOMoDID
-			INNER JOIN om_momain e ON e.moid = d.moid
-		WHERE
-			b.cInvCCode NOT LIKE '19%'
-			AND e.cCode LIKE CONCAT(#{code},'%')
-			and b.cInvCCode like '01%'
-			group by b.cinvname,a.cFree1,b.cinvcode,a.cbatch
-
-	</select>-->
-	<!-- 获取委外订单行id,入库物料编号+颜色,处理费用,入库数量 -->
-	<!--
-	<select id="getOmRowInfoList" resultType="map">
-		select b.MODetailsID,
-			 b.cinvcode+isnull(b.cfree1,'') as cInvCodeColorIn,
-			 isnull((select  isnull(sum(y.iSum),sum(x.iProcessFee)) from  rdrecords01 x inner join PurBillVouchs  y on y.RdsId =x.autoid where x.iOMoDID=b.MODetailsID),0) as iProcessFee,
-			 isnull((select  sum(x.iQuantity) from  rdrecords01 x where x.iOMoDID=b.MODetailsID),0) as iQuantityIn
-
-		FROM
-		om_momain a
-		INNER JOIN OM_MODetails b ON a.moid = b.moid
-		INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-		WHERE
-		c.cInvCCode NOT LIKE '19%'
-		AND a.cCode LIKE CONCAT(#{code},'%')
-	</select>-->
 	<!-- 获取委外订单行id,出库物料信息,出库数量 -->
 	<!-- 获取委外订单行id,出库物料信息,出库数量 -->
 	<select id="getOmRowOutList" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
 	<select id="getOmRowOutList" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
 		select MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut,cOmCode,cOmVenAbbName,sum(iQuantityOut) as iQuantityOut from
 		select MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut,cOmCode,cOmVenAbbName,sum(iQuantityOut) as iQuantityOut from
@@ -723,7 +283,7 @@
 				inner join Vendor x on x.cVenCode=a.cVenCode
 				inner join Vendor x on x.cVenCode=a.cVenCode
 			WHERE
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
 				c.cInvCCode NOT LIKE '19%'
-				AND a.cCode LIKE CONCAT(#{code},'%')
+				AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
 		) union all (
 		) union all (
 			select b.MODetailsID,
 			select b.MODetailsID,
 				g.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(g.cColor,'') as cColorOut,
 				g.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(g.cColor,'') as cColorOut,
@@ -740,182 +300,13 @@
 				inner join Vendor x on x.cVenCode=a.cVenCode
 				inner join Vendor x on x.cVenCode=a.cVenCode
 			WHERE
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
 				c.cInvCCode NOT LIKE '19%'
-				AND a.cCode LIKE CONCAT(#{code},'%')
+				AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
 		)) as t1
 		)) as t1
 		group by MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut,cOmCode,cOmVenAbbName
 		group by MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut,cOmCode,cOmVenAbbName
-<!--
-		select b.MODetailsID,
-			 d.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(d.cFree1,'') as cColorOut,
-			 isnull(d.cBatch,'') as cBatchOut,
-			 isnull(sum(d.iQuantity-d.iSQuantity+isnull(y.iQuantity,0)),0) as iQuantityOut,
-			 z.cInvCCode as cInvCCodeOut,a.cCode as cOmCode,x.cVenAbbName as cOmVenAbbName
-		FROM
-		om_momain a
-		INNER JOIN OM_MODetails b ON a.moid = b.moid
-		INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-		inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
-		INNER JOIN Inventory z ON d.cinvcode = z.cinvcode
-		inner join Vendor x on x.cVenCode=a.cVenCode
-		left outer join VIEW_OM_OUT_SETTLEVOUCE y on d.autoid=y.iRdsID
-		WHERE
-		c.cInvCCode NOT LIKE '19%'
-		AND a.cCode LIKE CONCAT(#{code},'%')
-		AND (y.cmocode is null or y.cmocode LIKE CONCAT(#{code},'%'))
-		group by b.MODetailsID,
-			 d.cInvCode,z.cInvName,d.cFree1,d.cBatch,z.cInvCCode,a.cCode,x.cVenAbbName-->
 	</select>
 	</select>
-	<!-- 获取委外订单出库物料的入库物料信息:包含采购入库、委外入库 -->
-	<!--
-	<select id="getOmRowInList" resultType="map">
-
-			select f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
-			e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
-			e.iQuantity,
-			case when f.cbustype='委外加工' then 0 else
-				isnull(isnull((select sum(iSum) from PurBillVouchs  x where x.RdsId =e.autoid),iSum ),0)
-			end as iPurchuseMoney,
-			e.iOMoDID as MODetailsID,
-			(select top 1 x.cCode from om_momain x inner join OM_MODetails y on x.moid = y.moid where e.iOMoDID =y.MODetailsID) as moCode,
-			(select top 1 x.cPOID from PO_Pomain x inner join PO_Podetails y on x.POID = y.POID where e.iPOsID =y.id) as poCode
-			from rdrecords01 e
-				inner join rdrecord01 f on e.id=f.id
-				inner join Vendor g on g.cVenCode=f.cVenCode
-				where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
-
-					select
-						 d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
-					FROM
-					om_momain a
-					INNER JOIN OM_MODetails b ON a.moid = b.moid
-					INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-					inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
-					WHERE
-					c.cInvCCode NOT LIKE '19%'
-					AND a.cCode like CONCAT(#{code},'%')
-
-				) and e.iQuantity>0
-	</select>-->
-	<!-- 获取委外订单出库物料的入库物料信息:包含其他入库 -->
-	<!--
-	<select id="getOmRowInList2" resultType="map">
-		select f.cBusType,f.cCode,'' as cVenName,'' as cVenAbbName,
-			e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
-			e.iQuantity,
-			isnull(case when f.cMaker='王行乔' then e.iPrice else e.iPrice*1.13 end,0) as iPurchuseMoney,
-			null as MODetailsID,'其他入库' as moCode,'其他入库' as poCode
-		from rdrecords08 e
-				inner join rdrecord08 f on e.id=f.id
-		where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
-
-			select
-				 d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
-			FROM
-			om_momain a
-			INNER JOIN OM_MODetails b ON a.moid = b.moid
-			INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-			inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
-			WHERE
-			f.cbustype='其他入库'
-			and c.cInvCCode NOT LIKE '19%'
-			AND a.cCode like CONCAT(#{code},'%')
-
-
-		)  and e.iQuantity>0 order by e.autoid desc
-	</select>-->
-	<!-- 根据形态转换物料获取采购入库 -->
-	<!--
-	<select id="getOmRowInListWithAV" resultType="map">
-
-	select e.autoid,f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
-		e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
-		e.iQuantity,
-		case when f.cbustype='委外加工' then 0 else
-			isnull(isnull((select sum(iSum) from PurBillVouchs  x where x.RdsId =e.autoid),iSum ),0)
-		end as iPurchuseMoney,
-		e.iOMoDID as MODetailsID,
-		(select top 1  x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') from
-				VIEW_FabricLoss_AssemVouchs x where
-				x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'')=e.cInvCode+isnull(e.cfree1,'')+isnull(e.cBatch,'')) as cInvIdOut,
-		(select top 1 x.cCode from om_momain x inner join OM_MODetails y on x.moid = y.moid where e.iOMoDID =y.MODetailsID) as moCode,
-			(select top 1 x.cPOID from PO_Pomain x inner join PO_Podetails y on x.POID = y.POID where e.iPOsID =y.id) as poCode
-	from rdrecords01 e
-		inner join rdrecord01 f on e.id=f.id
-		inner join Vendor g on g.cVenCode=f.cVenCode
-	where
-		e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
-			select x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'') from
-				VIEW_FabricLoss_AssemVouchs x
-				where x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') in (
-					select
-						e.cInvCode+isnull(e.cFree1,'')+isnull(e.cBatch,'')
-						from rdrecords08 e
-							inner join rdrecord08 f on e.id=f.id
-							where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
-
-								select
-									 d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
-								FROM
-								om_momain a
-								INNER JOIN OM_MODetails b ON a.moid = b.moid
-								INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-								inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
-								WHERE
-								f.cbustype='转换入库'
-								and c.cInvCCode NOT LIKE '19%'
-								AND a.cCode like CONCAT(#{code},'%')
-
-
-							)  and e.iQuantity>0
-				)
-
-		)
-		and e.iQuantity>0
-	</select>-->
-	<!-- 根据形态转换物料获取其他入库信息 -->
-	<!--
-	<select id="getOmRowInListWithAV2" resultType="map">
-	select e.autoid,f.cBusType,f.cCode,'' as cVenName,'' as cVenAbbName,
-		e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
-		e.iQuantity,
-		isnull(case when f.cMaker='王行乔' then e.iPrice else e.iPrice*1.13 end,0) as iPurchuseMoney,
-		null as MODetailsID,
-		(select top 1  x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') from
-				VIEW_FabricLoss_AssemVouchs x where
-				x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'')=e.cInvCode+isnull(e.cfree1,'')+isnull(e.cBatch,'')) as cInvIdOut,
-				'其他入库' as moCode,'其他入库' as poCode
-	from rdrecords08 e
-		inner join rdrecord08 f on e.id=f.id
-	where
-		e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
-			select x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'') from
-				VIEW_FabricLoss_AssemVouchs x
-				where x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') in (
-					select
-						e.cInvCode+isnull(e.cFree1,'')+isnull(e.cBatch,'')
-						from rdrecords08 e
-							inner join rdrecord08 f on e.id=f.id
-							where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
-
-								select
-									 d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
-								FROM
-								om_momain a
-								INNER JOIN OM_MODetails b ON a.moid = b.moid
-								INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-								inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
-								WHERE
-								f.cbustype='转换入库'
-								and c.cInvCCode NOT LIKE '19%'
-								AND a.cCode like CONCAT(#{code},'%')
-							)  and e.iQuantity>0
-				)
-
-		)
-		and e.iQuantity>0 and f.cbustype in ('其他入库','转换入库') order by e.autoid desc
-	</select>-->
 	<!-- 获取销售订单附件 -->
 	<!-- 获取销售订单附件 -->
 	<select id="getSoAccList" resultType="org.jeecg.modules.report.entity.AccessorItem">
 	<select id="getSoAccList" resultType="org.jeecg.modules.report.entity.AccessorItem">
-		select distinct cFileId,Filename from VIEW_ACC_LIST_SO where cSoCode=#{cSoCode}
+		select distinct cFileId,Filename from VIEW_ACC_LIST_SO where cSoCode=#{cSoCode} and cSoCode not like '%样%'
 	</select>
 	</select>
 	<!-- 获取附件详情 -->
 	<!-- 获取附件详情 -->
 	<select id="getAccDetail" resultType="map">
 	<select id="getAccDetail" resultType="map">
@@ -928,7 +319,7 @@
 		from OM_MOMain a inner join om_modetails b on a.moid=b.moid
 		from OM_MOMain a inner join om_modetails b on a.moid=b.moid
 			inner join VoucherAccessories f on f.voucherid=a.moid
 			inner join VoucherAccessories f on f.voucherid=a.moid
 		where f.vouchertypeid='OM01'
 		where f.vouchertypeid='OM01'
-			and a.cCode like CONCAT(#{code},'%')
+			and a.cCode like CONCAT(#{code},'%')  and a.cCode not like '%样%'
 	</select>
 	</select>
 	<!-- 获取采购入库仓库库存 -->
 	<!-- 获取采购入库仓库库存 -->
 	<select id="getPurchaseStockList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
 	<select id="getPurchaseStockList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
@@ -942,7 +333,7 @@
 				inner join PO_Podetails p on o.POID  =p.POID
 				inner join PO_Podetails p on o.POID  =p.POID
 				inner join Inventory q on p.cInvCode=q.cInvCode
 				inner join Inventory q on p.cInvCode=q.cInvCode
 				inner join RdRecords01 r on r.iposid=p.id
 				inner join RdRecords01 r on r.iposid=p.id
-				where o.cPOID like CONCAT(#{code},'%')
+				where o.cPOID like CONCAT(#{code},'%')  and o.cPOID not like '%样%'
 				and (q.cInvCCode LIKE '01%'
 				and (q.cInvCCode LIKE '01%'
 				or q.cInvCCode LIKE '02%'
 				or q.cInvCCode LIKE '02%'
 				or q.cInvCCode LIKE '03%'
 				or q.cInvCCode LIKE '03%'
@@ -959,17 +350,6 @@
 		</foreach>
 		</foreach>
 
 
 	</select>
 	</select>
-	<!-- 获取委外订单国外出库数量 -->
-	<!--
-	<select id="getOmInGwOutList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
-		select b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,b.iQuantity from rdrecord32  a inner join rdrecords32 b
-		on a.id=b.id
-		where b.cinvCode+isnull(cfree1,'')+isnull(cbatch,'') in
-		<foreach  item="item" collection="invIdList" index="index"  open="(" separator="," close=")">
-			#{item}
-		</foreach>
-
-	</select>-->
 	<!-- 获取事故单 -->
 	<!-- 获取事故单 -->
 	<select id="getAccidentList" resultType="org.jeecg.modules.report.entity.FabricAccident">
 	<select id="getAccidentList" resultType="org.jeecg.modules.report.entity.FabricAccident">
 		SELECT ah.cPBVMemo,ah.cPBVCode,VEN.cVenAbbName,sum(A.iOriSum) as iOriSum
 		SELECT ah.cPBVMemo,ah.cPBVCode,VEN.cVenAbbName,sum(A.iOriSum) as iOriSum
@@ -978,7 +358,7 @@
 		left join Inventory inv on inv.cInvCode=a.cInvCode
 		left join Inventory inv on inv.cInvCode=a.cInvCode
 		left join Vendor ven on ven.cVenCode=ah.cvencode
 		left join Vendor ven on ven.cVenCode=ah.cvencode
 		where cPBVBillType='03'
 		where cPBVBillType='03'
-			and inv.cInvName='事故单' and ah.cDefine2 like CONCAT(#{code},'%')
+			and inv.cInvName='事故单' and ah.cDefine2 like CONCAT(#{code},'%') and ah.cDefine2 not like '%样%'
 		group by ah.cPBVMemo,ah.cPBVCode,VEN.cVenAbbName
 		group by ah.cPBVMemo,ah.cPBVCode,VEN.cVenAbbName
 
 
 	</select>
 	</select>
@@ -1067,12 +447,12 @@
 	(
 	(
 		select cInvCode,isnull(cFree1,'') as cColor,isnull(cbatch,'') as cBatch,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,0 as iPrice
 		select cInvCode,isnull(cFree1,'') as cColor,isnull(cbatch,'') as cBatch,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,0 as iPrice
 		from rdrecords11 where
 		from rdrecords11 where
-		comcode not like CONCAT(#{code},'%')
+		(comcode not like CONCAT(#{code},'%') or comcode like '%样%')
 		and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 		select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 		INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
 		INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
 		inner join om_momain f on f.moid = e.moid
 		inner join om_momain f on f.moid = e.moid
-		where f.cCode like CONCAT(#{code},'%')
+		where f.cCode like CONCAT(#{code},'%')  and f.cCode not like '%样%'
 		)
 		)
 		or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
 		select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
@@ -1080,7 +460,7 @@
 		select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 		select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 		INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
 		INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
 		inner join om_momain f on f.moid = e.moid
 		inner join om_momain f on f.moid = e.moid
-		where f.cCode like CONCAT(#{code},'%')
+		where f.cCode like CONCAT(#{code},'%') and f.cCode not like '%样%'
 		)
 		)
 		)
 		)
 		)
 		)
@@ -1099,7 +479,7 @@
 				inner join OM_MODetails p on o.moid  =p.moid
 				inner join OM_MODetails p on o.moid  =p.moid
 				inner join Inventory q on p.cInvCode=q.cInvCode
 				inner join Inventory q on p.cInvCode=q.cInvCode
 				inner join RdRecords01 r on r.iOMoDID=p.MODetailsID
 				inner join RdRecords01 r on r.iOMoDID=p.MODetailsID
-				where o.cCode like CONCAT(#{code},'%')
+				where o.cCode like CONCAT(#{code},'%')  and o.cCode not like '%样%'
 		)
 		)
 	</select>
 	</select>
 	<!--获取本次委外入库的形态转换-->
 	<!--获取本次委外入库的形态转换-->
@@ -1110,7 +490,7 @@
 			select cInvCode+isnull(cBatch,'')+isnull(cFree1,'')  from RdRecords01
 			select cInvCode+isnull(cBatch,'')+isnull(cFree1,'')  from RdRecords01
 			where iOMoDID in (
 			where iOMoDID in (
 			select b.MODetailsID from om_momain a inner join OM_MODetails b on a.moid  =b.moid
 			select b.MODetailsID from om_momain a inner join OM_MODetails b on a.moid  =b.moid
-			and a.cCode like CONCAT(#{code},'%')
+			and a.cCode like CONCAT(#{code},'%') and a.cCode not like '%样%'
 			)
 			)
 		)
 		)
 	</select>
 	</select>
@@ -1155,26 +535,6 @@
 		)
 		)
 		) as t1
 		) as t1
 		group by  MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut
 		group by  MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut
-<!--
-		select b.MODetailsID,
-		d.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(d.cFree1,'') as cColorOut,
-		isnull(d.cBatch,'') as cBatchOut,
-		isnull(sum(d.iQuantity-d.iSQuantity+isnull(y.iQuantity,0)),0) as iQuantityOut,
-		z.cInvCCode as cInvCCodeOut
-		FROM
-		om_momain a
-		inner join OM_MODetails b on a.moid = b.moid
-		INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
-		inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
-		INNER JOIN Inventory z ON d.cinvcode = z.cinvcode
-		left outer join VIEW_OM_OUT_SETTLEVOUCE y on d.autoid=y.iRdsID
-		WHERE
-		b.MODetailsID in
-		<foreach  item="item" collection="detailIdList" index="index"  open="(" separator="," close=")">
-			#{item}
-		</foreach>
-		AND (y.cmocode is null or y.cmocode=a.cCode)
-		group by  b.MODetailsID,d.cInvCode,z.cInvName,d.cFree1,d.cBatch,z.cInvCCode-->
 	</select>
 	</select>
 	<!-- 根据物料id获取入库信息:采购入库、委外入库、转换入库、其他入库 -->
 	<!-- 根据物料id获取入库信息:采购入库、委外入库、转换入库、其他入库 -->
 	<select id="getInListByInvId" resultType="org.jeecg.modules.report.entity.FabricCommonIn">
 	<select id="getInListByInvId" resultType="org.jeecg.modules.report.entity.FabricCommonIn">
@@ -1217,7 +577,7 @@
 	<!-- 获取成衣委外出库 -->
 	<!-- 获取成衣委外出库 -->
 	<select id="getOmOutList19" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
 	<select id="getOmOutList19" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
 
 
-		select * from VIEW_OM_OUT_19 where cOmCode like CONCAT(#{code},'%')
+		select * from VIEW_OM_OUT_19 where cOmCode like CONCAT(#{code},'%') and cOmCode not like '%样%'
 
 
 	</select>
 	</select>
 	<!-- 根据委外订单子表id,获取入库详情-->
 	<!-- 根据委外订单子表id,获取入库详情-->
@@ -1254,7 +614,8 @@
 		inner join OM_MODetails b on a.moid=b.moid
 		inner join OM_MODetails b on a.moid=b.moid
 		inner join rdrecords32 c on c.iorderdid  =b.isosid
 		inner join rdrecords32 c on c.iorderdid  =b.isosid
 		INNER JOIN Inventory d ON c.cinvcode = d.cinvcode
 		INNER JOIN Inventory d ON c.cinvcode = d.cinvcode
-		where a.ccode like CONCAT(#{code},'%')
+		where a.ccode like CONCAT(#{code},'%')  and a.ccode not like '%样%' and
+			(d.cInvCCode like '01%' or d.cInvCCode like '02%' or d.cInvCCode like '03%' or d.cInvCCode like '04%')
 
 
 	</select>
 	</select>
 </mapper>
 </mapper>

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

@@ -679,10 +679,6 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 		});
 		});
 		fabricCostInvoiceList = fabricCostInvoiceList.stream().sorted(Comparator.comparing(FabricCostInvoice::getOrder)).collect(Collectors.toList());
 		fabricCostInvoiceList = fabricCostInvoiceList.stream().sorted(Comparator.comparing(FabricCostInvoice::getOrder)).collect(Collectors.toList());
 
 
-		// 转入成本
-		//fabricCostInvoiceList.addAll(getInCost(ret.getFabricPoOrderList(), omOrderList));
-		// 转出成本
-		//List<FabricCostInvoice> outCostList = getOutCost(ret.getCCode(), ret.getFabricPoOrderList(), ret.getFabricOMOrderList1(), ret.getFabricOMOrderList2());
 		List<FabricCostInvoice> inoutCostList = getInOutCost(ret.getCCode(), ret.getFabricPoOrderList(), ret.getFabricOMOrderList1(), ret.getFabricOMOrderList2(), editData);
 		List<FabricCostInvoice> inoutCostList = getInOutCost(ret.getCCode(), ret.getFabricPoOrderList(), ret.getFabricOMOrderList1(), ret.getFabricOMOrderList2(), editData);
 
 
 		fabricCostInvoiceList.addAll(inoutCostList);
 		fabricCostInvoiceList.addAll(inoutCostList);
@@ -690,344 +686,6 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 		ret.setFabricCostInvoiceList(fabricCostInvoiceList);
 		ret.setFabricCostInvoiceList(fabricCostInvoiceList);
 	}
 	}
 
 
-	/**
-	 * 委外出库材料,找出不在采购入库和委外入库中,计算转入成本
-	 * @param poOrderList - 采购入库详情
-	 * @param omOrderList - 委外订单
-	 * @return
-	 */
-	/*
-	private List<FabricCostInvoice> getInCost(List<FabricPoOrder> poOrderList, List<FabricOMOrder> omOrderList){
-		// 采购出入库去掉末尾两行:来源余纱、其他入库纱
-		List<FabricPoOrder> poOrderListReal = poOrderList.stream().filter(e->!e.getCPOID().equals("来源余料") &&
-				!e.getCPOID().equals("其他入库")).collect(Collectors.toList());
-		// 合并所有采购入库物料批次。借用FabricPoOrderIn类
-		List<FabricPoOrderIn> allInList = new ArrayList<>();
-		for (FabricPoOrder item : poOrderListReal){
-			List<FabricPoOrderIn> inList = item.getFabricPoOrderInList();
-			if (oConvertUtils.listIsNotEmpty(inList)){
-				for (FabricPoOrderIn itemIn : inList){
-					Optional<FabricPoOrderIn> findItemOpt = allInList.stream().filter(e->
-							e.getInvId().equalsIgnoreCase(itemIn.getInvId())).findFirst();
-					if (findItemOpt.isPresent()){
-						FabricPoOrderIn formatItem = findItemOpt.get();
-						Double dMoney = formatItem.getIPrice()*formatItem.getIQuantity()+itemIn.getIPrice()*itemIn.getIQuantity();
-						Double dQuantity = formatItem.getIQuantity()+itemIn.getIQuantity();
-						formatItem.setIPrice(dMoney/dQuantity);
-						formatItem.setIQuantity(dQuantity);
-
-					}else {
-						FabricPoOrderIn formatItem = new FabricPoOrderIn();
-						formatItem.setCInvCode(itemIn.getCInvCode());
-						formatItem.setCColor(itemIn.getCColor());
-						formatItem.setCBatch(itemIn.getCBatch());
-						formatItem.setCInvName(itemIn.getCInvName());
-						formatItem.setIQuantity(itemIn.getIQuantity());
-						formatItem.setIPrice(itemIn.getIPrice());
-						allInList.add(formatItem);
-					}
-				}
-			}
-		}
-		// 合并所有委外入库物料批次。借用FabricPoOrderIn类
-		for (FabricOMOrder item : omOrderList){
-			List<FabricMoOrderRK> inList = item.getFabricMoOrderRKList();
-			if (oConvertUtils.listIsNotEmpty(inList)){
-				for (FabricMoOrderRK itemIn : inList){
-					Optional<FabricPoOrderIn> findItemOpt = allInList.stream().filter(e->
-							e.getInvId().equalsIgnoreCase(itemIn.getInvId())).findFirst();
-					if (findItemOpt.isPresent()){
-						FabricPoOrderIn formatItem = findItemOpt.get();
-						Double dMoney = formatItem.getIPrice()*formatItem.getIQuantity()+itemIn.getIPrice()*itemIn.getIQuantityIn();
-						Double dQuantity = formatItem.getIQuantity()+itemIn.getIQuantityIn();
-						formatItem.setIPrice(dMoney/dQuantity);
-						formatItem.setIQuantity(dQuantity);
-					}else {
-						FabricPoOrderIn formatItem = new FabricPoOrderIn();
-						formatItem.setCInvCode(item.getCInvCode());
-						formatItem.setCColor(item.getCColor());
-						formatItem.setCBatch(itemIn.getCBatch());
-						formatItem.setIQuantity(itemIn.getIQuantityIn());
-						formatItem.setCInvName(itemIn.getCInvName());
-						formatItem.setIPrice(itemIn.getIPrice());
-						allInList.add(formatItem);
-					}
-				}
-			}
-		}
-
-
-		// 合并所有出的
-		List<FabricMoOrderCK> omOutListAll = new ArrayList<>();
-		for (FabricOMOrder omOrder : omOrderList){
-			List<FabricMoOrderCK> outList = omOrder.getFabricMoOrderCKList();
-			if (oConvertUtils.listIsNotEmpty(outList)) {
-				for (FabricMoOrderCK omOut : outList) {
-					FabricMoOrderCK outCopy = new FabricMoOrderCK();
-					outCopy.setCBatchOut(omOut.getCBatchOut());
-					outCopy.setCInvCodeOut(omOut.getCInvCodeOut());
-					outCopy.setCColorOut(omOut.getCColorOut());
-					outCopy.setIQuantity(omOut.getIQuantity());
-					outCopy.setIPrice(omOut.getIPrice());
-					outCopy.setCInvNameOut(omOut.getCInvNameOut());
-					outCopy.setCVCName(omOrder.getCVCName());
-					outCopy.setCVenAbbName(omOrder.getCVenAbbName());
-					outCopy.setCPlanCode(omOut.getCPlanCode());
-
-					omOutListAll.add(outCopy);
-				}
-			}
-
-		}
-		// 出-入
-		for (FabricMoOrderCK itemOut : omOutListAll){
-
-			double outLeft = itemOut.getIQuantity();
-			for (FabricPoOrderIn itemIn : allInList){
-				if (itemOut.getInvOutId().equalsIgnoreCase(itemIn.getInvId())){
-					double inLeft = itemIn.getIQuantity();
-					outLeft -= inLeft;
-					if (outLeft<0){
-						inLeft = outLeft*-1;
-					}else{
-						inLeft = 0;
-					}
-					itemIn.setIQuantity(inLeft);
-					if (outLeft<=0){
-						break;
-					}
-				}
-
-			}
-			itemOut.setIQuantity(outLeft);
-		}
-		List<FabricCostInvoice> costInvoiceList = new ArrayList<>();
-
-		// 计算总转入成本、设置详情
-		List<FabricCostInvoiceDetail> invoiceDetailList = new ArrayList<>();
-		for (FabricMoOrderCK itemOut : omOutListAll){
-			if (itemOut.getIQuantity()>0){
-				FabricCostInvoice fabricCostInvoice = new FabricCostInvoice();
-				fabricCostInvoice.setCVCName(itemOut.getCVCName());
-				fabricCostInvoice.setCVenAbbName(itemOut.getCPlanCode()+" "+itemOut.getCVenAbbName());
-				fabricCostInvoice.setCBusType("转入成本");
-				fabricCostInvoice.setIMoney(DoubleOperation.mul(itemOut.getIQuantity(),itemOut.getIPrice(), 2));
-				if (fabricCostInvoice.getIMoney()!=0) {
-					costInvoiceList.add(fabricCostInvoice);
-					invoiceDetailList.add(FabricCostInvoiceDetail.get(fabricCostInvoice, itemOut));
-				}
-			}
-		}
-		// 分组
-		List<FabricCostInvoice> costInvoiceListGroup = new ArrayList<>();
-		for (FabricCostInvoice fabricCostInvoice : costInvoiceList){
-			Optional<FabricCostInvoice> findOpt = costInvoiceListGroup.stream().filter(e->
-					e.getId().equalsIgnoreCase(fabricCostInvoice.getId())).findFirst();
-			if (findOpt.isPresent()){
-				FabricCostInvoice find = findOpt.get();
-				BigDecimal bdVal = new BigDecimal(find.getIMoney()+fabricCostInvoice.getIMoney());
-				find.setIMoney(bdVal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
-			}else{
-				costInvoiceListGroup.add(fabricCostInvoice);
-				List<FabricCostInvoiceDetail> findList = invoiceDetailList.stream().filter(e->e.getCParentId().equalsIgnoreCase(fabricCostInvoice.getId())).collect(Collectors.toList());
-				fabricCostInvoice.setCostInvoiceDetailList(findList);
-			}
-		}
-		return costInvoiceListGroup;
-	}
-*/
-	/**
-	 * 根据采购入库详情,委外订单详情,获取转出成本。(入库数量-出库数量) * 单价
-	 * @param code - 计划号
-	 * @param poOrderList - 采购入库详情
-	 * @param omOrderListGn - 委外订单国内
-	 * @param omOrderListGw - 委外订单国外
-	 * @return
-	 */
-	/*
-	private List<FabricCostInvoice> getOutCost(String code, List<FabricPoOrder> poOrderList, List<FabricOMOrder> omOrderListGn, List<FabricOMOrder> omOrderListGw){
-		// 采购出入库去掉末尾两行:来源余纱、其他入库纱
-		List<FabricPoOrder> poOrderListReal = poOrderList.stream().filter(e->!e.getCPOID().equals("来源余料") &&
-				!e.getCPOID().equals("其他入库")).collect(Collectors.toList());
-		// 合并所有采购入库+委外入库的物料批次。借用FabricPoOrderIn类
-		List<FabricPoOrderIn> allInList = new ArrayList<>();
-		for (FabricPoOrder item : poOrderListReal){
-			List<FabricPoOrderIn> inList = item.getFabricPoOrderInList();
-			if (oConvertUtils.listIsNotEmpty(inList)){
-				for (FabricPoOrderIn itemIn : inList){
-					Optional<FabricPoOrderIn> findItemOpt = allInList.stream().filter(e->
-							e.getInvId().equalsIgnoreCase(itemIn.getInvId())).findFirst();
-					if (findItemOpt.isPresent()){
-						FabricPoOrderIn formatItem = findItemOpt.get();
-						Double dMoney = formatItem.getIPrice()*formatItem.getIQuantity()+itemIn.getIPrice()*itemIn.getIQuantity();
-						Double dQuantity = formatItem.getIQuantity()+itemIn.getIQuantityInvoice();
-						formatItem.setIPrice(dMoney/dQuantity);
-						formatItem.setIQuantity(dQuantity);
-
-					}else {
-						FabricPoOrderIn formatItem = JSON.parseObject(JSON.toJSONString(itemIn),FabricPoOrderIn.class);
-						formatItem.setCInvName(formatItem.getCInvName()+ " " +formatItem.getCColor());
-						allInList.add(formatItem);
-
-					}
-				}
-			}
-		}
-
-		for (FabricOMOrder item : omOrderListGn){
-			List<FabricMoOrderRK> inList = item.getFabricMoOrderRKList();
-			if (oConvertUtils.listIsNotEmpty(inList)){
-				for (FabricMoOrderRK itemIn : inList){
-					FabricPoOrderIn formatItem = new FabricPoOrderIn();
-					formatItem.setCInvCode(item.getCInvCode());
-					formatItem.setCColor(item.getCColor());
-					formatItem.setCBatch(itemIn.getCBatch());
-					formatItem.setIQuantity(itemIn.getIQuantityIn());
-					formatItem.setIPrice(itemIn.getIPrice());
-					formatItem.setCBusType("1");        // 国内
-					formatItem.setCInvName(itemIn.getCInvName()+" "+itemIn.getCColor());
-					formatItem.setCPlanCode(itemIn.getCPlanCode());
-					allInList.add(formatItem);
-				}
-			}
-		}
-
-		for (FabricOMOrder item : omOrderListGw){
-			List<FabricMoOrderRK> inList = item.getFabricMoOrderRKList();
-			if (oConvertUtils.listIsNotEmpty(inList)){
-				for (FabricMoOrderRK itemIn : inList){
-					FabricPoOrderIn formatItem = new FabricPoOrderIn();
-					formatItem.setCInvCode(item.getCInvCode());
-					formatItem.setCColor(item.getCColor());
-					formatItem.setCBatch(itemIn.getCBatch());
-					formatItem.setIQuantity(itemIn.getIQuantityIn());
-					formatItem.setIPrice(itemIn.getIPrice());
-					formatItem.setCBusType("2");        // 国外
-					formatItem.setCInvName(itemIn.getCInvName()+" "+itemIn.getCColor());
-					formatItem.setCPlanCode(itemIn.getCPlanCode());
-					allInList.add(formatItem);
-				}
-			}
-		}
-
-		List<FabricPoOrderOut> invOutGnList = new ArrayList<>();
-		List<FabricMoOrderCK> moOrderCKList = fabricLossMapper.getOmOutList19(code);
-		for (FabricMoOrderCK moOrderCK : moOrderCKList){
-			moOrderCK.setIPrice(0.0);
-			invOutGnList.add(FabricPoOrderOut.getByMoOut(moOrderCK));
-		}
-		List<FabricPoOrderOut> invOutGwList = new ArrayList<>();
-		moOrderCKList = fabricLossMapper.getSaleOutList(code);
-		for (FabricMoOrderCK moOrderCK : moOrderCKList){
-			moOrderCK.setIPrice(0.0);
-			invOutGwList.add(FabricPoOrderOut.getByMoOut(moOrderCK));
-		}
-		List<FabricPoOrderOut> allInvOutList = new ArrayList<>();
-		allInvOutList.addAll(invOutGnList);
-		allInvOutList.addAll(invOutGwList);
-
-		// 扣减出库数量
-		List<FabricOMOrder> omOrderListAll = new ArrayList<>();
-		omOrderListAll.addAll(omOrderListGn);
-		omOrderListAll.addAll(omOrderListGw);
-		// 转换国内外出库数量
-		List<FabricMoOrderCK> omOutListAll = new ArrayList<>();
-		for (FabricOMOrder omOrder : omOrderListAll){
-			List<FabricMoOrderCK> outList = omOrder.getFabricMoOrderCKList();
-			if (oConvertUtils.listIsNotEmpty(outList)) {
-				for (FabricMoOrderCK omOut : outList) {
-					FabricMoOrderCK outCopy = new FabricMoOrderCK();
-					outCopy.setCBatchOut(omOut.getCBatchOut());
-					outCopy.setCInvCodeOut(omOut.getCInvCodeOut());
-					outCopy.setCColorOut(omOut.getCColorOut());
-					outCopy.setIQuantity(omOut.getIQuantity());
-					outCopy.setCSourceInvId(omOut.getCSourceInvId());
-					omOutListAll.add(outCopy);
-				}
-			}
-
-		}
-		for (FabricPoOrderIn itemIn : allInList){
-			boolean bOmFind = false;
-
-			double inLeft = itemIn.getIQuantity();
-			for (FabricMoOrderCK outItem : omOutListAll){
-				if (outItem.getInvOutId().equalsIgnoreCase(itemIn.getInvId()) ||
-				outItem.getCSourceInvId().equalsIgnoreCase(itemIn.getInvId())){
-					double outLeft = outItem.getIQuantity();
-					bOmFind = true;
-					inLeft -= outLeft;
-					if (inLeft<0){
-						outLeft = inLeft*-1;
-					}else{
-						outLeft = 0;
-					}
-					outItem.setIQuantity(outLeft);
-					if (inLeft<=0){
-						break;
-					}
-				}
-
-			}
-			itemIn.setIQuantity(inLeft);
-			if (inLeft>0){
-				for (FabricPoOrderOut outItem : allInvOutList){
-					if (outItem.getInvId().equalsIgnoreCase(itemIn.getInvId())){
-						double outLeft = outItem.getIQuantity();
-						inLeft -= outLeft;
-						if (inLeft<0){
-							outLeft = inLeft*-1;
-						}else{
-							outLeft = 0;
-						}
-						outItem.setIQuantity(outLeft);
-						if (inLeft<=0){
-							break;
-						}
-					}
-
-				}
-				itemIn.setIQuantity(inLeft);
-			}
-		}
-		List<FabricCostInvoice> costInvoiceList = new ArrayList<>();
-		List<FabricCostInvoiceDetail> costInvoiceDetailList = new ArrayList<>();
-		// 计算总转入成本,设置详情
-		for (FabricPoOrderIn itemIn : allInList){
-			if (itemIn.getIQuantity()>0){
-				FabricCostInvoice fabricCostInvoice = new FabricCostInvoice();
-				fabricCostInvoice.setCVCName(itemIn.getCInvName());
-				fabricCostInvoice.setCVenAbbName("");
-				fabricCostInvoice.setCBusType("转出成本");
-				BigDecimal bdVal = new BigDecimal(itemIn.getIQuantity()*itemIn.getIPrice()*-1);
-				fabricCostInvoice.setIMoney(bdVal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
-				if (fabricCostInvoice.getIMoney()!=0) {
-					costInvoiceList.add(fabricCostInvoice);
-					costInvoiceDetailList.add(FabricCostInvoiceDetail.get(fabricCostInvoice, itemIn));
-				}
-			}
-		}
-
-		// 分组
-		List<FabricCostInvoice> costInvoiceListGroup = new ArrayList<>();
-		for (FabricCostInvoice fabricCostInvoice : costInvoiceList){
-			Optional<FabricCostInvoice> findOpt = costInvoiceListGroup.stream().filter(e->
-					e.getId().equalsIgnoreCase(fabricCostInvoice.getId())).findFirst();
-			if (findOpt.isPresent()){
-				FabricCostInvoice find = findOpt.get();
-				BigDecimal bdVal = new BigDecimal(find.getIMoney()+fabricCostInvoice.getIMoney());
-				find.setIMoney(bdVal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
-			}else{
-				costInvoiceListGroup.add(fabricCostInvoice);
-				List<FabricCostInvoiceDetail> findList = costInvoiceDetailList.stream().filter(e->e.getCParentId().equalsIgnoreCase(fabricCostInvoice.getId())).collect(Collectors.toList());
-				fabricCostInvoice.setCostInvoiceDetailList(findList);
-			}
-		}
-
-		return costInvoiceListGroup;
-
-	}
-*/
 	/**
 	/**
 	 * 设置委外订单详情,包含成本
 	 * 设置委外订单详情,包含成本
 	 * @param code - 计划号
 	 * @param code - 计划号
@@ -1187,6 +845,43 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 					}
 					}
 				}
 				}
 			}
 			}
+			// 出入库详情分组
+			List<FabricMoOrderCK> ckList = omOrder.getFabricMoOrderCKList();
+			List<FabricMoOrderCK> groupCkList = new ArrayList<>();
+			for (FabricMoOrderCK ckItem : ckList){
+				Optional<FabricMoOrderCK> findOpt = groupCkList.stream().filter(e->e.getGroupId().equalsIgnoreCase(ckItem.getGroupId())).findFirst();
+				if (findOpt.isPresent()){
+					FabricMoOrderCK findItem = findOpt.get();
+					findItem.setMODetailsID(findItem.getMODetailsID()+","+ckItem.getMODetailsID());
+					findItem.setIQuantityOut(DoubleOperation.add(findItem.getIQuantityOut(),ckItem.getIQuantityOut()));
+					findItem.setIQuantity(DoubleOperation.add(findItem.getIQuantity(),ckItem.getIQuantity()));
+					findItem.setIQuantityIn(DoubleOperation.add(findItem.getIQuantityIn(),ckItem.getIQuantityIn()));
+					findItem.setIMoney(DoubleOperation.add(findItem.getIMoney(),ckItem.getIMoney()));
+				}else{
+					groupCkList.add(ckItem);
+				}
+			}
+			omOrder.setFabricMoOrderCKList(groupCkList.stream().filter(e->e.getIQuantityOut()>0).collect(Collectors.toList()));
+
+			List<FabricMoOrderRK> rkList = omOrder.getFabricMoOrderRKList();
+			List<FabricMoOrderRK> groupRkList = new ArrayList<>();
+			for (FabricMoOrderRK rkItem : rkList){
+				Optional<FabricMoOrderRK> findOpt = groupRkList.stream().filter(e->e.getGroupId().equalsIgnoreCase(rkItem.getGroupId())).findFirst();
+				if (findOpt.isPresent()){
+					FabricMoOrderRK findItem = findOpt.get();
+					findItem.setMODetailsID(findItem.getMODetailsID()+","+rkItem.getMODetailsID());
+					findItem.setIQuantityOut(DoubleOperation.add(findItem.getIQuantityOut(),rkItem.getIQuantityOut()));
+					findItem.setIProcessFee(DoubleOperation.add(findItem.getIProcessFee(),rkItem.getIProcessFee()));
+					findItem.setIQuantityIn(DoubleOperation.add(findItem.getIQuantityIn(),rkItem.getIQuantityIn()));
+					findItem.setISQuantity(DoubleOperation.add(findItem.getISQuantity(),rkItem.getISQuantity()));
+					findItem.setISQuantityN(DoubleOperation.add(findItem.getISQuantityN(),rkItem.getISQuantityN()));
+					findItem.setISumBillQuantity(DoubleOperation.add(findItem.getISumBillQuantity(),rkItem.getISumBillQuantity()));
+					findItem.setISumBillQuantityN(DoubleOperation.add(findItem.getISumBillQuantityN(),rkItem.getISumBillQuantityN()));
+				}else{
+					groupRkList.add(rkItem);
+				}
+			}
+			omOrder.setFabricMoOrderRKList(groupRkList.stream().filter(e->e.getIQuantityIn()>0).collect(Collectors.toList()));
 		}
 		}
 
 
 	}
 	}