parent
							
								
									771ce18c17
								
							
						
					
					
						commit
						9b8be78c1b
					
				| 
						 | 
					@ -126,7 +126,6 @@ import com.dev.energy.server.util.LocalizedMessage;
 | 
				
			||||||
import com.dev.energy.server.web.security.UserHolder;
 | 
					import com.dev.energy.server.web.security.UserHolder;
 | 
				
			||||||
import com.sun.mail.util.MailSSLSocketFactory;
 | 
					import com.sun.mail.util.MailSSLSocketFactory;
 | 
				
			||||||
import com.sun.org.apache.xpath.internal.operations.And;
 | 
					import com.sun.org.apache.xpath.internal.operations.And;
 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.apache.log4j.Logger;
 | 
					import org.apache.log4j.Logger;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @author  dev
 | 
					 * @author  dev
 | 
				
			||||||
| 
						 | 
					@ -3707,8 +3706,6 @@ public class DefaultInventoryManager extends DefaultBaseManager implements Inven
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	/*输送线上的库存*/
 | 
					 | 
				
			||||||
	private static List<Long> invIds =new ArrayList<Long>();
 | 
					 | 
				
			||||||
	//添加整理库存
 | 
						//添加整理库存
 | 
				
			||||||
			public void createReceivingInventory(ReceivedRecord receivedRecord,Location dstloc) {
 | 
								public void createReceivingInventory(ReceivedRecord receivedRecord,Location dstloc) {
 | 
				
			||||||
				
 | 
									
 | 
				
			||||||
| 
						 | 
					@ -3746,4 +3743,5 @@ public class DefaultInventoryManager extends DefaultBaseManager implements Inven
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				
 | 
									
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,6 @@ import java.util.Iterator;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
import java.util.Properties;
 | 
					import java.util.Properties;
 | 
				
			||||||
import java.util.stream.Collectors;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import net.sf.json.JSONArray;
 | 
					import net.sf.json.JSONArray;
 | 
				
			||||||
import net.sf.json.JSONObject;
 | 
					import net.sf.json.JSONObject;
 | 
				
			||||||
| 
						 | 
					@ -98,7 +97,6 @@ import com.dev.energy.server.model.EntityFactory;
 | 
				
			||||||
import com.dev.energy.server.service.pojo.DefaultBaseManager;
 | 
					import com.dev.energy.server.service.pojo.DefaultBaseManager;
 | 
				
			||||||
import com.dev.energy.server.util.LocalizedMessage;
 | 
					import com.dev.energy.server.util.LocalizedMessage;
 | 
				
			||||||
import com.dev.energy.server.web.security.UserHolder;
 | 
					import com.dev.energy.server.web.security.UserHolder;
 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.apache.log4j.Logger;
 | 
					import org.apache.log4j.Logger;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @author  dev
 | 
					 * @author  dev
 | 
				
			||||||
| 
						 | 
					@ -1526,6 +1524,7 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public   void allocateWaveDoc(List<Long> WaveDocIds) {
 | 
						public   void allocateWaveDoc(List<Long> WaveDocIds) {
 | 
				
			||||||
		for(Long id:WaveDocIds){
 | 
							for(Long id:WaveDocIds){
 | 
				
			||||||
| 
						 | 
					@ -1536,21 +1535,10 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
				new String[] { "id"},new Object[] {wd.getId()});
 | 
									new String[] { "id"},new Object[] {wd.getId()});
 | 
				
			||||||
				if(PickTicketDetails.size()>0){
 | 
									if(PickTicketDetails.size()>0){
 | 
				
			||||||
					for(PickTicketDetail ptd :PickTicketDetails){
 | 
										for(PickTicketDetail ptd :PickTicketDetails){
 | 
				
			||||||
						StringBuffer sqlBuffer=new StringBuffer();
 | 
					 | 
				
			||||||
						sqlBuffer.append(" from Inventory i where i.itemKey.item.id=:id and i.status='已入库' and i.location.type not in ('RECEIVE','SHIP') and i.quantity-i.queuedQuantity>0 "
 | 
					 | 
				
			||||||
								+" order by ");
 | 
					 | 
				
			||||||
						if (invIds.size()>0) {
 | 
					 | 
				
			||||||
							sqlBuffer.append(" CASE  "
 | 
					 | 
				
			||||||
									+"   WHEN i.id IN ("+invIds.stream()
 | 
					 | 
				
			||||||
						               .map(String::valueOf)
 | 
					 | 
				
			||||||
						               .collect(Collectors.joining(","))+") THEN 1 "
 | 
					 | 
				
			||||||
									+"   ELSE 0 "
 | 
					 | 
				
			||||||
									+" END, ");
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
						sqlBuffer.append("i.itemKey.lotInfo.propC3,i.itemKey.lotInfo.propC1,i.quantity");
 | 
					 | 
				
			||||||
						//分配库存
 | 
											//分配库存
 | 
				
			||||||
						List<Inventory> Inventorys = commonDao.findByQuery(
 | 
											List<Inventory> Inventorys = commonDao.findByQuery(
 | 
				
			||||||
						sqlBuffer.toString(),
 | 
											" from Inventory i where i.itemKey.item.id=:id and i.status='已入库' and i.location.type not in ('RECEIVE','SHIP') and i.quantity-i.queuedQuantity>0 "
 | 
				
			||||||
 | 
													+" order by i.itemKey.lotInfo.propC3,i.itemKey.lotInfo.propC1,i.quantity",
 | 
				
			||||||
						new String[] { "id" },new Object[] { ptd.getItem().getId() });
 | 
											new String[] { "id" },new Object[] { ptd.getItem().getId() });
 | 
				
			||||||
						if (Inventorys.size() > 0) {
 | 
											if (Inventorys.size() > 0) {
 | 
				
			||||||
							double allocatedQuantity = 0;
 | 
												double allocatedQuantity = 0;
 | 
				
			||||||
| 
						 | 
					@ -1585,17 +1573,6 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
									task.setItemKey(inventory.getItemKey());
 | 
														task.setItemKey(inventory.getItemKey());
 | 
				
			||||||
									task.setStorageDate(inventory.getStorageDate());
 | 
														task.setStorageDate(inventory.getStorageDate());
 | 
				
			||||||
									task.setSrcLoc(inventory.getLocation());
 | 
														task.setSrcLoc(inventory.getLocation());
 | 
				
			||||||
									if (inventory.getLocation().getStock()!=null) {
 | 
					 | 
				
			||||||
										task.setStrBill7(inventory.getLocation().getStock().getLP());
 | 
					 | 
				
			||||||
									}
 | 
					 | 
				
			||||||
									String tItemCode=item.getCode().substring(0, 9);
 | 
					 | 
				
			||||||
									String ptCode = ptd.getPickTicket().getCode();
 | 
					 | 
				
			||||||
									char lastChar = ptCode.charAt(ptCode.length() - 1);
 | 
					 | 
				
			||||||
									if (Character.isUpperCase(lastChar)) {
 | 
					 | 
				
			||||||
						                //System.out.println("最后一位是大写字母");
 | 
					 | 
				
			||||||
										task.setStrBill8(tItemCode+lastChar);
 | 
					 | 
				
			||||||
						            } 
 | 
					 | 
				
			||||||
									
 | 
					 | 
				
			||||||
									task.setSOI(inventory.getSOI());
 | 
														task.setSOI(inventory.getSOI());
 | 
				
			||||||
									task.setPlanQuantity(allocateQty);
 | 
														task.setPlanQuantity(allocateQty);
 | 
				
			||||||
									task.setPlanQuantityMU(allocateQty);
 | 
														task.setPlanQuantityMU(allocateQty);
 | 
				
			||||||
| 
						 | 
					@ -1618,6 +1595,7 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
				logger.info("无波次任务!"+"\n");
 | 
									logger.info("无波次任务!"+"\n");
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
								
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	public   void allocatePlanAll(List<Long> WaveDocIds) {
 | 
						public   void allocatePlanAll(List<Long> WaveDocIds) {
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue