| 
					
				 | 
			
			
				@@ -277,18 +277,6 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "       group by MODetailsID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "       ) o ON r.iOMoDID  = o.MODetailsID   " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "           group by b.cVenName,b.cInvName,b.cPOID,b.cfree1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-/*                    " SELECT v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "   isnull(sum(od.iSendQTY),0)+isnull(sum(p.iQuantity),0) as yi " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "    FROM rdrecords01 rs1  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join rdrecord01 r1 on r1.id=rs1.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join PO_Podetails p on p.ID=rs1.iPOsID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MODetails o on o.MODetailsID =rs1.iOMoDID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MOMaterials od on od.MoDetailsID=o.MODetailsID  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Inventory  c on c.cInvCode=rs1.cInvCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Vendor v ON r1.cVenCode= v.cVenCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " where rs1.cBatch != ' "+plannum+"' and rs1.cPOID  like ' "+plannum+"%' and v.cVenName='"+Fabric.getProcessUnit()+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            "' and c.cInvName='"+Fabric.getGoodsName()+"' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " group BY v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1";*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             /*转入*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String sqlTransfer = "     select b.cInvName as goodsName,b.cPOID as planCode,b.cfree1 as color,max(b.yi ) as number " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "     FROM ( " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -316,18 +304,6 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "     group BY v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1,rs1.cInvCode,rs1.cBatch " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "        ) b on r.cBatch = b.cBatch and b.cInvCode=r.cInvCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "    group by b.cVenName,b.cInvName,b.cPOID,b.cfree1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    /*" SELECT v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "   isnull(sum(od.iSendQTY),0)+isnull(sum(p.iQuantity),0) as yi " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "    FROM rdrecords01 rs1  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join rdrecord01 r1 on r1.id=rs1.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join PO_Podetails p on p.ID=rs1.iPOsID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MODetails o on o.MODetailsID =rs1.iOMoDID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MOMaterials od on od.MoDetailsID=o.MODetailsID  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Inventory  c on c.cInvCode=rs1.cInvCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Vendor v ON r1.cVenCode= v.cVenCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " where rs1.cBatch = ' "+plannum+"' and rs1.cPOID not like ' "+plannum+"%' and v.cVenName='"+Fabric.getProcessUnit()+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "' and c.cInvName='"+Fabric.getGoodsName()+"' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " group BY v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1";*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<Map<String, Object>> remainingList  = senYuDataSourceOne.queryForList(sqlRemaining); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(remainingList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<JSONObject> remainingJson = JsonChangeUtils.toJSONObject(remainingList); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -422,18 +398,6 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "       group by MODetailsID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "       ) o ON r.iOMoDID  = o.MODetailsID   " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "           group by b.cVenName,b.cInvName,b.cPOID,b.cfree1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    /*" SELECT v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "   isnull(sum(od.iSendQTY),0)+isnull(sum(p.iQuantity),0) as yi " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "    FROM rdrecords01 rs1  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join rdrecord01 r1 on r1.id=rs1.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join PO_Podetails p on p.ID=rs1.iPOsID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MODetails o on o.MODetailsID =rs1.iOMoDID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MOMaterials od on od.MoDetailsID=o.MODetailsID  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Inventory  c on c.cInvCode=rs1.cInvCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Vendor v ON r1.cVenCode= v.cVenCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " where rs1.cBatch != ' "+plannum+"' and rs1.cPOID  like ' "+plannum+"%' and v.cVenName='"+Ingredient.getProcessUnit()+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "' and c.cInvName='"+Ingredient.getGoodsName()+"' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " group BY v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1";*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             /*转入*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String sqlTransfer = "     select b.cInvName as goodsName,b.cPOID as planCode,b.cfree1 as color,max(b.yi ) as number " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "     FROM ( " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -461,18 +425,6 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "     group BY v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1,rs1.cInvCode,rs1.cBatch " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "        ) b on r.cBatch = b.cBatch and b.cInvCode=r.cInvCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     "    group by b.cVenName,b.cInvName,b.cPOID,b.cfree1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                   /* " SELECT v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "   isnull(sum(od.iSendQTY),0)+isnull(sum(p.iQuantity),0) as yi " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "    FROM rdrecords01 rs1  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join rdrecord01 r1 on r1.id=rs1.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join PO_Podetails p on p.ID=rs1.iPOsID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MODetails o on o.MODetailsID =rs1.iOMoDID " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " left join OM_MOMaterials od on od.MoDetailsID=o.MODetailsID  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Inventory  c on c.cInvCode=rs1.cInvCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " LEFT JOIN Vendor v ON r1.cVenCode= v.cVenCode  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " where rs1.cBatch = ' "+plannum+"' and rs1.cPOID not like ' "+plannum+"%' and v.cVenName='"+Ingredient.getProcessUnit()+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "' and c.cInvName='"+Ingredient.getGoodsName()+"' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    " group BY v.cVenName,c.cInvName,rs1.cPOID,rs1.cfree1";*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<Map<String, Object>> remainingList  = senYuDataSourceOne.queryForList(sqlRemaining); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(remainingList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<JSONObject> remainingJson = JsonChangeUtils.toJSONObject(remainingList); 
			 |