瀏覽代碼

面料损耗更新

fenghaifu 1 年之前
父節點
當前提交
d664c27b85

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

@@ -119,7 +119,7 @@ public class FabricMoOrderCK {
         retItem.setIQuantity(DoubleOperation.getScale(curSum,4));
         retItem.setIQuantityOut(retItem.getIQuantity());
         retItem.setIQuantityIn(inSum);
-        Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId());
+        Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId(), retItem.getCCode());
         if (iPrice == null){
             retItem.setIPrice(DoubleOperation.getScale(poOrderIn.getIPrice(),4));
             retItem.setICalPrice(retItem.getIPrice());
@@ -167,7 +167,7 @@ public class FabricMoOrderCK {
         retItem.setIQuantity(DoubleOperation.getScale(curSum,4));
         retItem.setIQuantityOut(retItem.getIQuantity());
         retItem.setIQuantityIn(inSum);
-        Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId());
+        Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId(), retItem.getCCode());
         if (iPrice == null){
             retItem.setIPrice(DoubleOperation.getScale(commonIn.getIPrice(),4));
             retItem.setICalPrice(retItem.getIPrice());
@@ -219,7 +219,7 @@ public class FabricMoOrderCK {
         retItem.setIQuantity(DoubleOperation.getScale(curSum,4));
         retItem.setIQuantityOut(retItem.getIQuantity());
         retItem.setIQuantityIn(inSum);
-        Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId());
+        Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId(), retItem.getCCode());
 
         if (iPrice == null){
             retItem.setIPrice(DoubleOperation.getScale(moIn.getIPrice(),4));
@@ -244,13 +244,14 @@ public class FabricMoOrderCK {
      * @param invOutId
      * @return
      */
-    public static Double getSaveOmOutPrice(List<FabricOMOrder> editOmList, String modetailsID, String invOutId){
+    public static Double getSaveOmOutPrice(List<FabricOMOrder> editOmList, String modetailsID, String invOutId, String ccode){
+        String formatCode = oConvertUtils.getString(ccode);
         Optional<FabricOMOrder> findOpt = editOmList.stream().filter(e->e.getMODetailsID().indexOf(modetailsID)>-1).findFirst();
         if (findOpt.isPresent()){
             FabricOMOrder findItem = findOpt.get();
             List<FabricMoOrderCK> ckList = findItem.getFabricMoOrderCKList();
             if (oConvertUtils.listIsNotEmpty(ckList)){
-                Optional<FabricMoOrderCK> findCkOpt = ckList.stream().filter(e->e.getInvOutId().equalsIgnoreCase(invOutId)).findFirst();
+                Optional<FabricMoOrderCK> findCkOpt = ckList.stream().filter(e->e.getInvOutId().equalsIgnoreCase(invOutId) && formatCode.equalsIgnoreCase(oConvertUtils.getString(e.getCCode()))).findFirst();
                 if (findCkOpt.isPresent()){
                     FabricMoOrderCK findCkItem = findCkOpt.get();
                     if (!findCkItem.getIPrice().equals(findCkItem.getICalPrice())){
@@ -264,13 +265,10 @@ public class FabricMoOrderCK {
     }
 
     /**
-     * 判断是否是采购里面需要展示的物料,物料分类以01,02,03,04开头的是
+     * 判断其他入库和来源余料是否是采购里面需要展示的物料,物料分类以01开头的是
      * @return
      */
     public boolean isPoInventory(){
-        return cInvCCodeOut.startsWith("01") ||
-                cInvCCodeOut.startsWith("02") ||
-                cInvCCodeOut.startsWith("03") ||
-                cInvCCodeOut.startsWith("04");
+        return cInvCCodeOut.startsWith("01");
     }
 }

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

@@ -66,6 +66,8 @@ public class FabricOMOrder {
     private List<Map<String,Object>>childrens=new ArrayList<>();
     @ApiModelProperty(value = "委外类型")
     private  String motype;
+    @ApiModelProperty(value = "门幅")
+    private  String cWidth;
     // 顺序号
     private int order;
 

+ 38 - 38
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 distinct * from VIEW_FabricLoss_Head_Clothes where (cCode like CONCAT('%',#{code},'%') and cCode not like '%样%')
+		select distinct * from VIEW_FabricLoss_Head_Clothes where (trim(cCode) like CONCAT('%',#{code},'%') and cCode not like '%样%')
 	</select>
 	<!-- 获取计划员 103的面料委外制单人,供应商分类是染厂的 -->
 	<select id="getPlanner" resultType="java.lang.String">
@@ -14,17 +14,17 @@
 		(y.cInvCCode like '01%' or y.cInvCCode like '02%' or y.cInvCCode like '03%' or y.cInvCCode like '04%')   )
 		and
 		exists (select x.cVenCode from Vendor x where x.cVenCode=om_momain.cVenCode and x.cVCCode in ('0104','0105','0102'))
-		and (cCode like CONCAT(#{code},'%') and cCode not like '%样%')
+		and (trim(cCode) like CONCAT(#{code},'%') and cCode not like '%样%')
 	</select>
 	<!-- 排单数量 -->
 	<select id="getNumber" resultType="java.lang.String">
 		select sum(isnull(iQuantity,0))as 'iQuantity'  from VIEW_OM_MOMain_ALL_Clothes
-		where (cCode like CONCAT(#{code},'%') and cCode not like '%样%')
+		where (trim(cCode) like CONCAT(#{code},'%') and cCode not like '%样%')
 	</select>
 	<!-- 销售出库数量 -->
 	<select id="getSaleOutSum" resultType="java.lang.String">
 		select isnull(sum(iQuantity),0) as 'iQuantity' from VIEW_FabricLoss_Head_Clothes_SaleOut_Sum where
-		(cCode like CONCAT(#{code},'%') and cCode not like '%样%')
+		(trim(cCode) like CONCAT(#{code},'%') and cCode not like '%样%')
 	</select>
 
 	<!--获取采购订单,物料名为物料名+颜色-->
@@ -39,7 +39,7 @@
 		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 (a.cPOID like CONCAT(#{code},'%') and a.cPOID not like '%样%')
+		where (trim(a.cPOID) like CONCAT(#{code},'%') and a.cPOID not like '%样%')
 		and (c.cInvCCode LIKE '01%'
 		or c.cInvCCode LIKE '02%'
 		or c.cInvCCode LIKE '03%'
@@ -48,14 +48,14 @@
 	</select>
 	<!--获取所有委外订单 cComUnitCode : 计量单位,02(PCS)根,04(M)米-->
 	<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,cWidth,
 		sum(iQuantityOut) as iQuantityOut,sum(iQuantityIn) as iQuantityIn,sum(iQuantity) as iQuantity 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-isnull(x.iSQuantity,0)) from rdrecords11 x	where 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
+				b.iQuantity,isnull(b.cdefine30,'') as cColorNumber,isnull(b.cDefine23 ,'') as cWidth
 			FROM
 			om_momain a
 				INNER JOIN OM_MODetails b ON a.moid = b.moid
@@ -64,13 +64,13 @@
 				inner join VendorClass e on d.cVCCode =e.cVCCode
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
-				AND (a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
+				AND (trim(a.cCode) LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
 		) union all (
 			SELECT b.MODetailsID,e.cVCName,d.cVenName ,d.cVenAbbName ,a.cVenCode ,c.cInvCode,c.cInvName,c.cComUnitCode,
 				isnull(b.cFree1,'') as cColor,
 				g.iQuantity as iQuantityOut,
 				0 as iQuantityIn,
-				0 as iQuantity,isnull(b.cdefine30,'') as cColorNumber
+				0 as iQuantity,isnull(b.cdefine30,'') as cColorNumber,isnull(b.cDefine23 ,'') as cWidth
 			FROM
 				om_momain a
 				INNER JOIN OM_MODetails b ON a.moid = b.moid
@@ -82,12 +82,12 @@
 				inner join Inventory h on h.cinvcode=g.cinvcode
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
-				AND (a.cCode LIKE CONCAT(#{code},'%') and g.cMoCode LIKE CONCAT(#{code},'%')
+				AND (trim(a.cCode) LIKE CONCAT(#{code},'%') and trim(g.cMoCode) LIKE CONCAT(#{code},'%')
 					and a.cCode not like '%样%' and g.cMoCode not like '%样%')
 		)) 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,cWidth
 
-		order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
+		order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber,cWidth
 
 
 	</select>
@@ -103,9 +103,9 @@
 				inner join VendorClass e on d.cVCCode =e.cVCCode
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
-				AND (a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
+				AND (trim(a.cCode) LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
 				and b.cInvCode+isnull(b.cFree1,'') in (
-				select cInvCode+isnull(cFree1,'') from rdrecords32 where (cbatch like CONCAT(#{code},'%') and cbatch not like '%样%')
+				select cInvCode+isnull(cFree1,'') from rdrecords32 where (trim(cbatch) like CONCAT(#{code},'%') and cbatch not like '%样%')
 				)
 
 	</select>
@@ -126,12 +126,12 @@
 		inner join Inventory e on b.cinvcode=e.cinvcode
 		inner join Vendor f on f.cVenCode=a.cVenCode
 		inner join VendorClass g on g.cVCCode =f.cVCCode
-		where (d.cPOID like CONCAT(#{code},'%') and d.cPOID not like '%样%')
+		where (trim(d.cPOID) like CONCAT(#{code},'%') and d.cPOID not like '%样%')
 	</select>
 	<!--获取费用支出-->
 	<select id="getExpensesList" resultType="org.jeecg.modules.report.entity.FabricExpenses">
 		select * from VIEW_FabricLoss_Expenses
-		where cSOCode like CONCAT(#{code},'%') and cSOCode not like '%样%'
+		where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 	</select>
 	<!--获取委外订单运费发票金额-->
 	<select id="getOmInvoiceMoneyYfList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
@@ -141,7 +141,7 @@
 			inner join PurBillVouch e on d.PBVID =e.PBVID
 			inner join Vendor  f on f.cVenCode=e.cVenCode
 		inner join VendorClass g on g.cVCCode =f.cVCCode
-		where  (e.cdefine2  like CONCAT(#{code},'%') and e.cdefine2 not like '%样%')
+		where  (trim(e.cdefine2)  like CONCAT(#{code},'%') and e.cdefine2 not like '%样%')
 			and d.cInvCode='N3000002426'
 			and g.cVCName not like '成衣厂'
 			group by g.cVCName,f.cVenName ,f.cVenAbbName
@@ -155,7 +155,7 @@
 		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(iPBVQuantity),0) as iPBVQuantity,isnull(sum(iSQuantity),0) as iSQuantity
-		from VIEW_FabricLoss_Cost_Clothes where cCode like CONCAT(#{code},'%') and cCode not like '%样%'
+		from VIEW_FabricLoss_Cost_Clothes where trim(cCode) like CONCAT(#{code},'%') and cCode not like '%样%'
 		group by
 		cPBVCode,cVenName,cVenAbbName,cShipTime
 		order by cPBVCode,cVenName,cVenAbbName,cShipTime
@@ -163,7 +163,7 @@
 	<!--开票成本-辅料-->
 	<select id="getCostAssistList" resultType="org.jeecg.modules.report.entity.FabricCostAssist">
 
-		select * from VIEW_FabricLoss_Cost_Assist where cPoid like CONCAT(#{code},'%') and cPoid not like '%样%'
+		select * from VIEW_FabricLoss_Cost_Assist where trim(cPoid) like CONCAT(#{code},'%') and cPoid not like '%样%'
 		and cVenAbbName not in ('宁波森语','马菲羊','森语集团') and iquantityinvoice>0
 		order by cAccount,cPoid,cVenAbbName,cInvName,cComUnitName
 	</select>
@@ -171,7 +171,7 @@
 	<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
-		 from VIEW_FabricLoss_Cost_Cloth where cSOCode like CONCAT(#{code},'%') and cSOCode not like '%样%'
+		 from VIEW_FabricLoss_Cost_Cloth where trim(cSOCode) like CONCAT(#{code},'%') and cSOCode not like '%样%'
 		 group by cVenName,cSOCode,cSBVCode,cShipTime,cInvName,iPrice
 		order by cVenName,cSBVCode,cInvName
 	</select>
@@ -183,12 +183,12 @@
 		(
 		select cInvCode,isnull(cFree1,'') as cColor,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,iUnitCost as iPrice
 		from rdrecords11 where
-		comcode not like CONCAT(#{code},'%') and comcode not like '%样%'
+		trim(comcode) not like CONCAT(#{code},'%') and comcode not like '%样%'
 		and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') 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 c.POID =d.POID
-			where d.cPOID like CONCAT(#{code},'%')  and d.cPOID not like '%样%'
+			where trim(d.cPOID) like CONCAT(#{code},'%')  and d.cPOID not like '%样%'
 		)
 		or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 			select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
@@ -196,7 +196,7 @@
 				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 c.POID =d.POID
-				where d.cPOID like CONCAT(#{code},'%') and d.cPOID not like '%样%'
+				where trim(d.cPOID) like CONCAT(#{code},'%') and d.cPOID not like '%样%'
 		)
 		)
 		)
@@ -230,7 +230,7 @@
 			inner join VendorClass d on d.cVCCode =c.cVCCode
 		WHERE
 		y.cInvCCode NOT LIKE '19%'
-		AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
+		AND trim(a.cCode) LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
 	) as t1 group by cPlanCode,cCode,MODetailsID,cVCName,cVenName,cVenAbbName,cInvCCode,cInvCName,cInvCode,cInvName,cColor,cBatch,dDate
 
 	</select>
@@ -254,7 +254,7 @@
 				inner join Vendor x on x.cVenCode=a.cVenCode
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
-				AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
+				AND trim(a.cCode) LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
 		) union all (
 			select b.MODetailsID,
 				g.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(g.cColor,'') as cColorOut,
@@ -273,7 +273,7 @@
 				inner join Vendor x on x.cVenCode=a.cVenCode
 			WHERE
 				c.cInvCCode NOT LIKE '19%'
-				AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
+				AND trim(a.cCode) LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
 		)) as t1
 		group by MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut,cInvCNameOut,cOmCode,cOmVenAbbName
 	</select>
@@ -296,7 +296,7 @@
 		from OM_MOMain a inner join om_modetails b on a.moid=b.moid
 			inner join VoucherAccessories f on f.voucherid=a.moid
 		where f.vouchertypeid='OM01'
-			and a.cCode like CONCAT(#{code},'%')  and a.cCode not like '%样%'
+			and trim(a.cCode) like CONCAT(#{code},'%')  and a.cCode not like '%样%'
 	</select>
 	<!-- 获取采购入库仓库库存 -->
 	<select id="getPurchaseStockList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
@@ -310,7 +310,7 @@
 				inner join PO_Podetails p on o.POID  =p.POID
 				inner join Inventory q on p.cInvCode=q.cInvCode
 				inner join RdRecords01 r on r.iposid=p.id
-				where o.cPOID like CONCAT(#{code},'%')  and o.cPOID not like '%样%'
+				where trim(o.cPOID) like CONCAT(#{code},'%')  and o.cPOID not like '%样%'
 				and (q.cInvCCode LIKE '01%'
 				or q.cInvCCode LIKE '02%'
 				or q.cInvCCode LIKE '03%'
@@ -335,7 +335,7 @@
 		left join Inventory inv on inv.cInvCode=a.cInvCode
 		left join Vendor ven on ven.cVenCode=ah.cvencode
 		where cPBVBillType='03'
-			and inv.cInvName='事故单' and ah.cDefine2 like CONCAT(#{code},'%') and ah.cDefine2 not like '%样%'
+			and inv.cInvName='事故单' and trim(ah.cDefine2) like CONCAT(#{code},'%') and ah.cDefine2 not like '%样%'
 		group by ah.cPBVMemo,ah.cPBVCode,VEN.cVenAbbName
 
 	</select>
@@ -434,12 +434,12 @@
 	(
 		select cInvCode,isnull(cFree1,'') as cColor,isnull(cbatch,'') as cBatch,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,0 as iPrice
 		from rdrecords11 where
-		(comcode not like CONCAT(#{code},'%') or comcode like '%样%')
+		(trim(comcode) not like CONCAT(#{code},'%') or comcode like '%样%')
 		and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		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_momain f on f.moid = e.moid
-		where f.cCode like CONCAT(#{code},'%')  and f.cCode not like '%样%'
+		where trim(f.cCode) like CONCAT(#{code},'%')  and f.cCode not like '%样%'
 		)
 		or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 		select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
@@ -447,7 +447,7 @@
 		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_momain f on f.moid = e.moid
-		where f.cCode like CONCAT(#{code},'%') and f.cCode not like '%样%'
+		where trim(f.cCode) like CONCAT(#{code},'%') and f.cCode not like '%样%'
 		)
 		)
 		)
@@ -466,7 +466,7 @@
 				inner join OM_MODetails p on o.moid  =p.moid
 				inner join Inventory q on p.cInvCode=q.cInvCode
 				inner join RdRecords01 r on r.iOMoDID=p.MODetailsID
-				where o.cCode like CONCAT(#{code},'%')  and o.cCode not like '%样%'
+				where trim(o.cCode) like CONCAT(#{code},'%')  and o.cCode not like '%样%'
 		)
 	</select>
 	<!--获取本次委外入库的形态转换-->
@@ -477,7 +477,7 @@
 			select cInvCode+isnull(cBatch,'')+isnull(cFree1,'')  from RdRecords01
 			where iOMoDID in (
 			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 not like '%样%'
+			and trim(a.cCode) like CONCAT(#{code},'%') and a.cCode not like '%样%'
 			)
 		)
 	</select>
@@ -590,7 +590,7 @@
 	<!-- 获取成衣委外出库 -->
 	<select id="getOmOutList19" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
 
-		select * from VIEW_OM_OUT_19 where cOmCode like CONCAT(#{code},'%') and cOmCode not like '%样%'
+		select * from VIEW_OM_OUT_19 where trim(cOmCode) like CONCAT(#{code},'%') and cOmCode not like '%样%'
 
 	</select>
 	<!-- 根据委外订单子表id,获取入库详情-->
@@ -636,9 +636,9 @@
 					inner join rdrecords32 c on c.iorderdid  =b.isosid and b.cinvcode=c.cinvcode
 					INNER JOIN Inventory d ON c.cinvcode = d.cinvcode
 					inner join SO_SODetails e on e.iSOsID=c.isodid
-					where a.ccode like CONCAT(#{code},'%')  and a.ccode not like '%样%' and
+					where trim(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%')
-			) or e.cSOCode like CONCAT(#{code},'%')
+			) or trim(e.cSOCode) like CONCAT(#{code},'%')
 		) as t1 where cInvCCode like '01%' or cInvCCode like '02%' or cInvCCode like '03%' or cInvCCode like '04%'
 	</select>
 	<!--获取本次采购入库的形态转换-->
@@ -649,7 +649,7 @@
 			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},'%') and a.cPOID not like '%样%'
+			and trim(a.cPOID) like CONCAT(#{code},'%') and a.cPOID not like '%样%'
 			)
 		)
 	</select>

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

@@ -768,6 +768,16 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 				find.setIQuantity(DoubleOperation.add(find.getIQuantity(), omOrder.getIQuantity()));
 				find.setIQuantityIn(DoubleOperation.add(find.getIQuantityIn(), omOrder.getIQuantityIn()));
 				find.setMODetailsID(find.getMODetailsID()+","+omOrder.getMODetailsID());
+				if (oConvertUtils.isNotEmpty(omOrder.getCWidth())){
+					if (oConvertUtils.isEmpty(find.getCWidth())){
+						find.setCWidth(omOrder.getCWidth());
+					}else{
+						if ((","+find.getCWidth()+",").indexOf(","+omOrder.getCWidth()+",") == -1){
+							find.setCWidth(find.getCWidth()+","+omOrder.getCWidth());
+						}
+
+					}
+				}
 			}else{
 				ret.add(omOrder);
 			}
@@ -802,7 +812,8 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 			Double dMoney = 0.0,dNoTaxMoney=0.0;
 			if (oConvertUtils.listIsNotEmpty(poOrder.getFabricPoOrderInList())){
 				for (FabricPoOrderIn orderIn : poOrder.getFabricPoOrderInList()){
-					dMoney = DoubleOperation.add(dMoney, DoubleOperation.mul(orderIn.getIPrice(),orderIn.getIQuantityInvoice(),2));
+					//dMoney = DoubleOperation.add(dMoney, DoubleOperation.mul(orderIn.getIPrice(),orderIn.getIQuantityInvoice(),2));
+					dMoney = DoubleOperation.add(dMoney, orderIn.getIPurchuseMoney());
 					dNoTaxMoney = DoubleOperation.add(dNoTaxMoney, DoubleOperation.mul(orderIn.getINoTaxPrice(),orderIn.getIQuantityInvoice(),2));
 				}
 			}
@@ -1068,7 +1079,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 			e.setIQuantityOut(DoubleOperation.getScale(e.getIQuantityOut(), 4));
 			e.setCBusType("其他入库");
 			Double dPrice = 0.0;
-			Double savePrice = FabricMoOrderCK.getSaveOmOutPrice(editOmList, e.getMODetailsID(), e.getInvOutId());
+			Double savePrice = FabricMoOrderCK.getSaveOmOutPrice(editOmList, e.getMODetailsID(), e.getInvOutId(), e.getCCode());
 			if (savePrice != null){
 				dPrice =DoubleOperation.getScale(savePrice,4);
 			}
@@ -1176,7 +1187,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 			outList.forEach(e->invIdList.add(e.getInvOutId()));
 			List<FabricCommonIn> inList = new ArrayList<>();
 			if (oConvertUtils.listIsNotEmpty(invIdList)) {
-				fabricLossMapper.getInListByInvId(invIdList);
+				inList = fabricLossMapper.getInListByInvId(invIdList);
 			}
 			// 设置价格比例,入库价格保留四位小数
 			inList.forEach(e->{