提交上架加显示、物料加库位组、交单加报错优化、波次创建和自动分配冲突。
							parent
							
								
									5e2f65926c
								
							
						
					
					
						commit
						619ebaa239
					
				| 
						 | 
					@ -200,7 +200,7 @@
 | 
				
			||||||
        <property name="jobDetail" ref="locationInventory"/>
 | 
					        <property name="jobDetail" ref="locationInventory"/>
 | 
				
			||||||
 		<property name="cronExpression">
 | 
					 		<property name="cronExpression">
 | 
				
			||||||
<!--             <value> 0 0 12,0 * * ?   </value> -->
 | 
					<!--             <value> 0 0 12,0 * * ?   </value> -->
 | 
				
			||||||
				 <value> 0 18 17 * * ?  </value> 
 | 
									 <value> 0 25 17 * * ?  </value> 
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
	</bean>
 | 
						</bean>
 | 
				
			||||||
	<!-- 	立库任务出库下发 -->
 | 
						<!-- 	立库任务出库下发 -->
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,6 +54,17 @@ public class WorkOrderAllocationInfo extends Entity{
 | 
				
			||||||
     * 工单分配的日期
 | 
					     * 工单分配的日期
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    private Date allocationDate;
 | 
					    private Date allocationDate;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    private Date storageDate;//库存日期
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
						public Date getStorageDate() {
 | 
				
			||||||
 | 
							return storageDate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setStorageDate(Date storageDate) {
 | 
				
			||||||
 | 
							this.storageDate = storageDate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public String getWorkOrderNumber() {
 | 
						public String getWorkOrderNumber() {
 | 
				
			||||||
		return workOrderNumber;
 | 
							return workOrderNumber;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,6 +32,7 @@
 | 
				
			||||||
        <property name="factory" column="Factory" type="string" length="100"/>
 | 
					        <property name="factory" column="Factory" type="string" length="100"/>
 | 
				
			||||||
        <property name="loc" column="LOC" type="string" length="100"/>
 | 
					        <property name="loc" column="LOC" type="string" length="100"/>
 | 
				
			||||||
        <property name="allocationDate" column="AllocationDate" type="date"/>
 | 
					        <property name="allocationDate" column="AllocationDate" type="date"/>
 | 
				
			||||||
 | 
					        <property name="storageDate" column="STORAGE_DATE" type="date"/>
 | 
				
			||||||
	</class>
 | 
						</class>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</hibernate-mapping>
 | 
					</hibernate-mapping>
 | 
				
			||||||
| 
						 | 
					@ -179,7 +179,7 @@ public interface CountPlanManager extends BaseManager {
 | 
				
			||||||
	void AGVworke(Long countPlanId,boolean w1,boolean w2,boolean w3,boolean w4,boolean w5,boolean w6,boolean w7,boolean w8,boolean w9,boolean w10,
 | 
						void AGVworke(Long countPlanId,boolean w1,boolean w2,boolean w3,boolean w4,boolean w5,boolean w6,boolean w7,boolean w8,boolean w9,boolean w10,
 | 
				
			||||||
			boolean w11,boolean w12,boolean w13,boolean w14,boolean w15,boolean w16,boolean w17,boolean w18,boolean w19,boolean w20,boolean w21,boolean w22,
 | 
								boolean w11,boolean w12,boolean w13,boolean w14,boolean w15,boolean w16,boolean w17,boolean w18,boolean w19,boolean w20,boolean w21,boolean w22,
 | 
				
			||||||
			boolean w601,boolean w602,boolean w603,boolean w604,boolean w605,double w31,double w32,double w33,double w34,double w35,double w36,double w37
 | 
								boolean w601,boolean w602,boolean w603,boolean w604,boolean w605,double w31,double w32,double w33,double w34,double w35,double w36,double w37
 | 
				
			||||||
			,double w38,double w39,double w40,double w41,double w42,double w43);
 | 
								,double w38,double w39,double w40,double w41,double w42,double w43,double w44);
 | 
				
			||||||
	@Transactional
 | 
						@Transactional
 | 
				
			||||||
	void AGVworke(Long countPlanId,boolean w1,boolean w2,boolean w3,boolean w4,boolean w5,boolean w6,boolean w7,boolean w8,boolean w9,boolean w10,
 | 
						void AGVworke(Long countPlanId,boolean w1,boolean w2,boolean w3,boolean w4,boolean w5,boolean w6,boolean w7,boolean w8,boolean w9,boolean w10,
 | 
				
			||||||
			boolean w11,boolean w12,boolean w13,boolean w14,boolean w15,boolean w16,boolean w17,boolean w18,boolean w19,boolean w20,boolean w21,boolean w22);
 | 
								boolean w11,boolean w12,boolean w13,boolean w14,boolean w15,boolean w16,boolean w17,boolean w18,boolean w19,boolean w20,boolean w21,boolean w22);
 | 
				
			||||||
| 
						 | 
					@ -194,6 +194,8 @@ public interface CountPlanManager extends BaseManager {
 | 
				
			||||||
	@Transactional
 | 
						@Transactional
 | 
				
			||||||
	JSONObject checkCountRecordItem(String crIds ,String propD2,String barCodes,String propC1,String countQuantity,long userId,long warehouseId,CommonDao commonDao);
 | 
						JSONObject checkCountRecordItem(String crIds ,String propD2,String barCodes,String propC1,String countQuantity,long userId,long warehouseId,CommonDao commonDao);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						@Transactional
 | 
				
			||||||
 | 
						void cleanCountRecordVIEW(List<Long> ids);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -58,6 +58,7 @@ import com.dev.swms.server.model.receiving.MoveDocDetail;
 | 
				
			||||||
import com.dev.swms.server.model.receiving.STATUS;
 | 
					import com.dev.swms.server.model.receiving.STATUS;
 | 
				
			||||||
import com.dev.swms.server.model.receiving.SlotType;
 | 
					import com.dev.swms.server.model.receiving.SlotType;
 | 
				
			||||||
import com.dev.swms.server.model.rules.ItemStorageRule;
 | 
					import com.dev.swms.server.model.rules.ItemStorageRule;
 | 
				
			||||||
 | 
					import com.dev.swms.server.model.view.CountRecordVIEW;
 | 
				
			||||||
import com.dev.swms.server.service.base.AgvTaskManager;
 | 
					import com.dev.swms.server.service.base.AgvTaskManager;
 | 
				
			||||||
import com.dev.swms.server.service.base.ItemManager;
 | 
					import com.dev.swms.server.service.base.ItemManager;
 | 
				
			||||||
import com.dev.swms.server.service.count.CountPlanManager;
 | 
					import com.dev.swms.server.service.count.CountPlanManager;
 | 
				
			||||||
| 
						 | 
					@ -1599,7 +1600,7 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
 | 
				
			||||||
			boolean w18,boolean w19,boolean w20,boolean w21,boolean w22) {
 | 
								boolean w18,boolean w19,boolean w20,boolean w21,boolean w22) {
 | 
				
			||||||
		AGVworke( countPlanId, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10,
 | 
							AGVworke( countPlanId, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10,
 | 
				
			||||||
				 w11, w12, w13, w14, w15, w16, w17,
 | 
									 w11, w12, w13, w14, w15, w16, w17,
 | 
				
			||||||
				 w18, w19, w20, w21,w22,false,false,false,false,false,0,0,0,0,0,0,0,0,0,0,0,0,0);
 | 
									 w18, w19, w20, w21,w22,false,false,false,false,false,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	public List<CountRecord> quserCountPlanTask(long zone_id,long countPlanId) {
 | 
						public List<CountRecord> quserCountPlanTask(long zone_id,long countPlanId) {
 | 
				
			||||||
		List<CountRecord>	ddq=commonDao.findByQuery(" from CountRecord c where  c.location.zone.id="+zone_id
 | 
							List<CountRecord>	ddq=commonDao.findByQuery(" from CountRecord c where  c.location.zone.id="+zone_id
 | 
				
			||||||
| 
						 | 
					@ -1611,7 +1612,7 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
 | 
				
			||||||
			boolean w11,boolean w12,boolean w13,boolean w14,boolean w15,boolean w16,boolean w17,
 | 
								boolean w11,boolean w12,boolean w13,boolean w14,boolean w15,boolean w16,boolean w17,
 | 
				
			||||||
			boolean w18,boolean w19,boolean w20,boolean w21,boolean w22,boolean w601,boolean w602,boolean w603,boolean w604,boolean w605,
 | 
								boolean w18,boolean w19,boolean w20,boolean w21,boolean w22,boolean w601,boolean w602,boolean w603,boolean w604,boolean w605,
 | 
				
			||||||
			double w31,double w32,double w33,double w34,double w35,double w36,double w37,double w38,
 | 
								double w31,double w32,double w33,double w34,double w35,double w36,double w37,double w38,
 | 
				
			||||||
			double w39,double w40,double w41,double w42,double w43) {
 | 
								double w39,double w40,double w41,double w42,double w43,double w44) {
 | 
				
			||||||
		CountPlan countPlan=commonDao.load(CountPlan.class, countPlanId);
 | 
							CountPlan countPlan=commonDao.load(CountPlan.class, countPlanId);
 | 
				
			||||||
		if(countPlan!=null) {
 | 
							if(countPlan!=null) {
 | 
				
			||||||
		//料箱区
 | 
							//料箱区
 | 
				
			||||||
| 
						 | 
					@ -1816,6 +1817,10 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
 | 
				
			||||||
				if(qd4.size()>0&&w43==0) {
 | 
									if(qd4.size()>0&&w43==0) {
 | 
				
			||||||
					throw new BusinessException("7#4楼地堆区有盘点任务,必须勾选");
 | 
										throw new BusinessException("7#4楼地堆区有盘点任务,必须勾选");
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
									List<CountRecord>	dd4=quserCountPlanTask(1813L, countPlanId);//4#地堆区
 | 
				
			||||||
 | 
									if(dd4.size()>0&&w44==0) {
 | 
				
			||||||
 | 
										throw new BusinessException("4#地堆区有盘点任务,必须勾选");
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
		int l=0;//料箱区
 | 
							int l=0;//料箱区
 | 
				
			||||||
		for(Stock stock:sts) {
 | 
							for(Stock stock:sts) {
 | 
				
			||||||
				//工作个数
 | 
									//工作个数
 | 
				
			||||||
| 
						 | 
					@ -1988,6 +1993,11 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
 | 
				
			||||||
					//1号万纬外仓
 | 
										//1号万纬外仓
 | 
				
			||||||
					distributeCountPlan(w43, qd4);
 | 
										distributeCountPlan(w43, qd4);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
									if(w44>0) {
 | 
				
			||||||
 | 
										//1号万纬外仓
 | 
				
			||||||
 | 
										distributeCountPlan(w44, dd4);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									
 | 
				
			||||||
				List<CountRecord>	countRecords=commonDao.findByQuery(" from CountRecord c where  c.countCode is null "
 | 
									List<CountRecord>	countRecords=commonDao.findByQuery(" from CountRecord c where  c.countCode is null "
 | 
				
			||||||
						+" and  c.countPlan.id="+countPlanId+" order by c.location.zone.code,c.location.code");
 | 
											+" and  c.countPlan.id="+countPlanId+" order by c.location.zone.code,c.location.code");
 | 
				
			||||||
				if(countRecords.size()==0) {
 | 
									if(countRecords.size()==0) {
 | 
				
			||||||
| 
						 | 
					@ -2364,5 +2374,16 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
 | 
				
			||||||
		return cr;
 | 
							return cr;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	
 | 
						public void cleanCountRecordVIEW(List<Long> ids) {
 | 
				
			||||||
 | 
							for(Long id:ids) {
 | 
				
			||||||
 | 
								CountRecordVIEW cv=commonDao.load(CountRecordVIEW.class, id);
 | 
				
			||||||
 | 
								List<CountRecord>	ddq=commonDao.findByQuery(" from CountRecord c where  c.countCode='"+cv.getCount_Code()
 | 
				
			||||||
 | 
										+"' and  c.countPlan.id="+cv.getCountPlan().getId()+" order by c.location.code");
 | 
				
			||||||
 | 
								for(CountRecord rd:ddq) {
 | 
				
			||||||
 | 
									rd.setWorker1(null);
 | 
				
			||||||
 | 
									commonDao.store(rd);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,19 @@ import java.util.Properties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public  class  ApiURL {
 | 
					public  class  ApiURL {
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	
 | 
						private static boolean isProcessing = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static synchronized boolean tryStartProcessing() {
 | 
				
			||||||
 | 
					        if (isProcessing) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        isProcessing = true;
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static synchronized void endProcessing() {
 | 
				
			||||||
 | 
					        isProcessing = false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
//	 public static byte[] readFileContents(String filePath) throws IOException {
 | 
					//	 public static byte[] readFileContents(String filePath) throws IOException {
 | 
				
			||||||
//	        return Files.readAllBytes(Paths.get(filePath));
 | 
					//	        return Files.readAllBytes(Paths.get(filePath));
 | 
				
			||||||
//	    }
 | 
					//	    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1195,12 +1195,13 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
					
 | 
										
 | 
				
			||||||
					  String sql = " select mdd.ID as inventoryId,s.LP as locCode,item.code as itemCode,item.BAR_CODE as barCode,item.name as itemName,ik.PROP_C1 as propC1,"
 | 
										  String sql = " select mdd.ID as inventoryId,s.LP as locCode,item.code as itemCode,item.BAR_CODE as barCode,item.name as itemName,ik.PROP_C1 as propC1,"
 | 
				
			||||||
					  + " mdd.move_Quantity,mdd.plan_Quantity-mdd.move_Quantity as invQuantity,ik.PROP_C2 as propC2,ik.PROP_C3 as propC3,md.RELATEBILLCODE,ik.PROP_C3 as propC5,z.name,"
 | 
										  + " mdd.move_Quantity,mdd.plan_Quantity-mdd.move_Quantity as invQuantity,ik.PROP_C2 as propC2,ik.PROP_C3 as propC3,md.RELATEBILLCODE,ik.PROP_C3 as propC5,z.name,"
 | 
				
			||||||
					  + " item.id,mdd.strBill11,CONVERT(varchar(100),ik.PROP_D2, 23) as propD2 "
 | 
										  + " item.id,mdd.strBill11 as strBill11,CONVERT(varchar(100),ik.PROP_D2, 23) as propD2 ,p.name as p_name"
 | 
				
			||||||
				      + " from Move_Doc_Detail mdd "
 | 
									      + " from Move_Doc_Detail mdd "
 | 
				
			||||||
				      + " left join move_Doc md on md.id= mdd.move_Doc_ID "
 | 
									      + " left join move_Doc md on md.id= mdd.move_Doc_ID "
 | 
				
			||||||
				      + " left join Stock s on s.id= mdd.SRC_LP "
 | 
									      + " left join Stock s on s.id= mdd.SRC_LP "
 | 
				
			||||||
				      + " left join ITEM_KEY ik on ik.id=mdd.ITEM_KEY_ID "
 | 
									      + " left join ITEM_KEY ik on ik.id=mdd.ITEM_KEY_ID "
 | 
				
			||||||
				      + " left join ITEM item on item.id=mdd.ITEM_ID "
 | 
									      + " left join ITEM item on item.id=mdd.ITEM_ID "
 | 
				
			||||||
 | 
									      + " left join POSITION p on p.id=item.POSITION_ID "
 | 
				
			||||||
				      + " left join zone z on z.id=mdd.warehouse_Area_ID_SRC "
 | 
									      + " left join zone z on z.id=mdd.warehouse_Area_ID_SRC "
 | 
				
			||||||
				      + " where 1=1 and mdd.PLAN_QUANTITY_MU-mdd.MOVE_QUANTITY>0";
 | 
									      + " where 1=1 and mdd.PLAN_QUANTITY_MU-mdd.MOVE_QUANTITY>0";
 | 
				
			||||||
					  if(itemCode!=null && itemCode.length()>0){
 | 
										  if(itemCode!=null && itemCode.length()>0){
 | 
				
			||||||
| 
						 | 
					@ -1211,7 +1212,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
							sql+=" and (upper(md.RELATEBILLCODE) like upper('"+ asn_code + "%') )";
 | 
												sql+=" and (upper(md.RELATEBILLCODE) like upper('"+ asn_code + "%') )";
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					   if(barCode!=null&&barCode.length()>0){
 | 
										   if(barCode!=null&&barCode.length()>0){
 | 
				
			||||||
						   sql+=" and (upper(s.LP) like upper('"+ barCode + "%') )";
 | 
											   sql+=" and (s.LP like '"+ barCode + "%' )";
 | 
				
			||||||
					   }else {
 | 
										   }else {
 | 
				
			||||||
						   msg="请扫描容器!";
 | 
											   msg="请扫描容器!";
 | 
				
			||||||
						   resultJson.put("status", status);
 | 
											   resultJson.put("status", status);
 | 
				
			||||||
| 
						 | 
					@ -1246,7 +1247,9 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
								data1.put("propC5", arrier[i++]==null?"":arrier[i-1]);
 | 
													data1.put("propC5", arrier[i++]==null?"":arrier[i-1]);
 | 
				
			||||||
								data1.put("zname", arrier[i++]==null?"":arrier[i-1]);
 | 
													data1.put("zname", arrier[i++]==null?"":arrier[i-1]);
 | 
				
			||||||
								i++;
 | 
													i++;
 | 
				
			||||||
 | 
													i++;
 | 
				
			||||||
								data1.put("propD2", arrier[i++]==null?"":arrier[i-1]);
 | 
													data1.put("propD2", arrier[i++]==null?"":arrier[i-1]);
 | 
				
			||||||
 | 
													data1.put("pname", arrier[i++]==null?"":arrier[i-1]);
 | 
				
			||||||
								Item item=this.load(Item.class, Long.parseLong(arrier[13].toString()));
 | 
													Item item=this.load(Item.class, Long.parseLong(arrier[13].toString()));
 | 
				
			||||||
								int beMarkWeight=0;
 | 
													int beMarkWeight=0;
 | 
				
			||||||
								MoveDocDetail  moveDocDetail=this.load(MoveDocDetail.class, Long.parseLong(arrier[0].toString()));
 | 
													MoveDocDetail  moveDocDetail=this.load(MoveDocDetail.class, Long.parseLong(arrier[0].toString()));
 | 
				
			||||||
| 
						 | 
					@ -7144,13 +7147,21 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
//		}
 | 
					//		}
 | 
				
			||||||
		SimpleDateFormat ymd = new SimpleDateFormat("yyyyMMdd");
 | 
							SimpleDateFormat ymd = new SimpleDateFormat("yyyyMMdd");
 | 
				
			||||||
		SimpleDateFormat ymd1 = new SimpleDateFormat("yyyy-MM-dd");
 | 
							SimpleDateFormat ymd1 = new SimpleDateFormat("yyyy-MM-dd");
 | 
				
			||||||
 | 
							String lp="";
 | 
				
			||||||
 | 
							Stock s	=commonDao.load(Stock.class, dstLP);
 | 
				
			||||||
 | 
							if(s==null) {
 | 
				
			||||||
 | 
								if(t.getDstLP()!=null) {
 | 
				
			||||||
 | 
									s=commonDao.load(Stock.class, t.getDstLP().getId());
 | 
				
			||||||
 | 
									lp=s.getLP();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}else {
 | 
				
			||||||
 | 
								lp=s.getLP();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		String barcode="QAR/"+t.getBillCode()+"/"+ ptd.getLineNumber()+"/"+item.getCode()+"/"+item.getUnit()+"/";
 | 
							String barcode="QAR/"+t.getBillCode()+"/"+ ptd.getLineNumber()+"/"+item.getCode()+"/"+item.getUnit()+"/";
 | 
				
			||||||
//		if(t.getBarCode()==null) {
 | 
								barcode +=  "/" + ymd.format(new Date());
 | 
				
			||||||
//			barcode+="/"+ymd.format(new Date());
 | 
					//			if(lp!=null&&lp.length()>0) {
 | 
				
			||||||
//		}else {
 | 
					//				barcode+="///"+lp;
 | 
				
			||||||
			barcode+="/"+ymd.format(new Date());
 | 
					//			}
 | 
				
			||||||
//		}
 | 
					 | 
				
			||||||
//		System.out.println(barcode);
 | 
					 | 
				
			||||||
		String emergent="";
 | 
							String emergent="";
 | 
				
			||||||
		if(pt!=null&&bt.getName().indexOf("工单")>=0&&pt.getEquatedQuantity()!=null
 | 
							if(pt!=null&&bt.getName().indexOf("工单")>=0&&pt.getEquatedQuantity()!=null
 | 
				
			||||||
				&&(pt.getEquatedQuantity().equals("H")||pt.getEquatedQuantity().equals("U")
 | 
									&&(pt.getEquatedQuantity().equals("H")||pt.getEquatedQuantity().equals("U")
 | 
				
			||||||
| 
						 | 
					@ -7171,16 +7182,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		String lp="";
 | 
							
 | 
				
			||||||
		Stock s	=commonDao.load(Stock.class, dstLP);
 | 
					 | 
				
			||||||
		if(s==null) {
 | 
					 | 
				
			||||||
			if(t.getDstLP()!=null) {
 | 
					 | 
				
			||||||
				s=commonDao.load(Stock.class, t.getDstLP().getId());
 | 
					 | 
				
			||||||
				lp=s.getLP();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}else {
 | 
					 | 
				
			||||||
			lp=s.getLP();
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		SimpleDateFormat hms = new SimpleDateFormat("HH:mm:ss");
 | 
							SimpleDateFormat hms = new SimpleDateFormat("HH:mm:ss");
 | 
				
			||||||
		Location lc=commonDao.load(Location.class, t.getSrcLoc().getId());
 | 
							Location lc=commonDao.load(Location.class, t.getSrcLoc().getId());
 | 
				
			||||||
		WarehouseArea zone=commonDao.load(WarehouseArea.class, lc.getZone().getId());
 | 
							WarehouseArea zone=commonDao.load(WarehouseArea.class, lc.getZone().getId());
 | 
				
			||||||
| 
						 | 
					@ -7503,7 +7505,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					String sql="select cr.count_Code ,i.CODE as icode ,max(z.NAME) z_name,sum(cr.QUANTITY) QUANTITY,"
 | 
										String sql="select cr.count_Code ,i.CODE as icode ,max(z.NAME) z_name,sum(cr.QUANTITY) QUANTITY,"
 | 
				
			||||||
							+"sum(cr.COUNT_QUANTITY) COUNT_QUANTITY,sum(cr.DELTA_QUANTITY) DELTA_QUANTITY ,ik.PROP_C1,"
 | 
												+"sum(cr.COUNT_QUANTITY) COUNT_QUANTITY,sum(cr.DELTA_QUANTITY) DELTA_QUANTITY ,ik.PROP_C1,"
 | 
				
			||||||
										 +"max(ik.PROP_C2),CONVERT(varchar(100), ik.PROP_D2, 23) as PROP_D2,max(ik.PROP_C3) PROP_C3,"
 | 
															 +"max(ik.PROP_C2) as PROP_C2,CONVERT(varchar(100), ik.PROP_D2, 23) as PROP_D2,max(ik.PROP_C3) PROP_C3,"
 | 
				
			||||||
										 + "max(cr.barCode) barCode,(i.SINGLE_ITEM) SINGLE_ITEM, (i.BE_MARK_WEIGHT) BE_MARK_WEIGHT,(i.isBOM) isBOM,"
 | 
															 + "max(cr.barCode) barCode,(i.SINGLE_ITEM) SINGLE_ITEM, (i.BE_MARK_WEIGHT) BE_MARK_WEIGHT,(i.isBOM) isBOM,"
 | 
				
			||||||
										 +" STUFF((select ','+CONVERT(nvarchar(10),b.id) "
 | 
															 +" STUFF((select ','+CONVERT(nvarchar(10),b.id) "
 | 
				
			||||||
													 +" from COUNT_RECORD b "
 | 
																		 +" from COUNT_RECORD b "
 | 
				
			||||||
| 
						 | 
					@ -7511,15 +7513,15 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
											+" left join ITEM_KEY ik2 on ik2.id=b.ITEM_KEY_ID "
 | 
																+" left join ITEM_KEY ik2 on ik2.id=b.ITEM_KEY_ID "
 | 
				
			||||||
										+"	left join ITEM item2 on item2.id=ik2.ITEM_ID "
 | 
															+"	left join ITEM item2 on item2.id=ik2.ITEM_ID "
 | 
				
			||||||
										+"	 where 1=1 and b.COUNT_PLAN_ID=max(cr.COUNT_PLAN_ID)"
 | 
															+"	 where 1=1 and b.COUNT_PLAN_ID=max(cr.COUNT_PLAN_ID)"
 | 
				
			||||||
										+"	 and b.count_Code=cr.count_Code "
 | 
															+"	 and b.count_Code=cr.count_Code and ik.PROP_C2=ik2.PROP_C2"
 | 
				
			||||||
										+"	 and loc2.id=l.ID and cr.NEED_COUNT=b.NEED_COUNT"
 | 
															+"	 and loc2.id=l.ID and cr.NEED_COUNT=b.NEED_COUNT"
 | 
				
			||||||
										+"	 and item2.id=i.id  and  "
 | 
															+"	 and item2.id=i.id   and  "
 | 
				
			||||||
										+ "( CONVERT(varchar(100), ik.PROP_D2, 23)=CONVERT(varchar(100), ik2.PROP_D2, 23) "
 | 
															+ "( CONVERT(varchar(100), ik.PROP_D2, 23)=CONVERT(varchar(100), ik2.PROP_D2, 23) "
 | 
				
			||||||
										+ " or (ik.PROP_D2 is null and ik2.PROP_D2 is null )) "
 | 
															+ " or (ik.PROP_D2 is null and ik2.PROP_D2 is null )) "
 | 
				
			||||||
										+"	 for xml Path('')),1,1,'') as tId,"
 | 
															+"	 for xml Path('')),1,1,'') as tId,"
 | 
				
			||||||
										+" cr.NEED_COUNT,max(i.NAME) ,max(i.UNIT) UNIT,"
 | 
															+" cr.NEED_COUNT,max(i.NAME) as i_name,max(i.UNIT) UNIT,"
 | 
				
			||||||
										+ "l.CODE as lcode,max(l.id) as lid,"
 | 
															+ "l.CODE as lcode,max(l.id) as lid,"
 | 
				
			||||||
										+ "sum(c.countQty-c.finishNo) as countNo ,max(c.count_Type)  count_Type"
 | 
															+ "sum(c.countQty-c.finishNo) as countNo ,max(c.count_Type)  count_Type "
 | 
				
			||||||
								+" from COUNT_RECORD cr "
 | 
													+" from COUNT_RECORD cr "
 | 
				
			||||||
								+" left join COUNT_PLAN c on c.ID=cr.COUNT_PLAN_ID "
 | 
													+" left join COUNT_PLAN c on c.ID=cr.COUNT_PLAN_ID "
 | 
				
			||||||
								+" left join ITEM_KEY ik on ik.ID =cr.ITEM_KEY_ID "
 | 
													+" left join ITEM_KEY ik on ik.ID =cr.ITEM_KEY_ID "
 | 
				
			||||||
| 
						 | 
					@ -7540,7 +7542,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
						System.out.println("请选择盘点单号");
 | 
											System.out.println("请选择盘点单号");
 | 
				
			||||||
					}		
 | 
										}		
 | 
				
			||||||
								sql+="  group by c.id,cr.count_Code,l.code,l.ID ,cr.NEED_COUNT,i.id,i.code,ik.PROP_C1,ik.PROP_D2,\r\n" + 
 | 
													sql+="  group by c.id,cr.count_Code,l.code,l.ID ,cr.NEED_COUNT,i.id,i.code,ik.PROP_C1,ik.PROP_D2,\r\n" + 
 | 
				
			||||||
										"				 i.SINGLE_ITEM,i.BE_MARK_WEIGHT,i.isBOM ";
 | 
															"				 i.SINGLE_ITEM,i.BE_MARK_WEIGHT,i.isBOM,ik.PROP_C2 ";
 | 
				
			||||||
								sql+=" order by cr.count_Code,l.CODE,cr.NEED_COUNT ";
 | 
													sql+=" order by cr.count_Code,l.CODE,cr.NEED_COUNT ";
 | 
				
			||||||
								Query   query   =   session.createSQLQuery(sql); 
 | 
													Query   query   =   session.createSQLQuery(sql); 
 | 
				
			||||||
								List<Object[]> objs  = query.list();
 | 
													List<Object[]> objs  = query.list();
 | 
				
			||||||
| 
						 | 
					@ -10369,9 +10371,9 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
		if (userId > 0) {
 | 
							if (userId > 0) {
 | 
				
			||||||
			if (warehouseId > 0) {
 | 
								if (warehouseId > 0) {
 | 
				
			||||||
				Worker worker1=commonDao.load(Worker.class, userId);
 | 
									Worker worker1=commonDao.load(Worker.class, userId);
 | 
				
			||||||
				String sql ="select max(pt.UPDATE_TIME),lc.code as lc_code,"
 | 
									String sql ="select max(t.dateBill3),lc.code as lc_code,"
 | 
				
			||||||
						+ "t.BILLCODE,s.LP as s_lp,z.name as z_name, "
 | 
											+ "t.BILLCODE,s.LP as s_lp,z.name as z_name, "
 | 
				
			||||||
						+ " max(DATEDIFF(MINUTE,pt.UPDATE_TIME, GETDATE())) as orderDate "
 | 
											+ " max(DATEDIFF(MINUTE,t.dateBill3, GETDATE())) as orderDate "
 | 
				
			||||||
						+ " , pt.equated_Quantity as soi " + 
 | 
											+ " , pt.equated_Quantity as soi " + 
 | 
				
			||||||
						"	from task t " + 
 | 
											"	from task t " + 
 | 
				
			||||||
						"	left join STOCK s on s.ID=t.DST_LP " + 
 | 
											"	left join STOCK s on s.ID=t.DST_LP " + 
 | 
				
			||||||
| 
						 | 
					@ -10391,7 +10393,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
					sql+=" and z.name = '"+zone_code.trim()+"' ";
 | 
										sql+=" and z.name = '"+zone_code.trim()+"' ";
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				sql+=" group by t.BILLCODE,s.LP,lc.code,z.name,pt.equated_Quantity " + 
 | 
									sql+=" group by t.BILLCODE,s.LP,lc.code,z.name,pt.equated_Quantity " + 
 | 
				
			||||||
					"	order by pt.equated_Quantity desc,max(pt.UPDATE_TIME),t.BILLCODE,z.name,lc.code,s.LP ";
 | 
										"	order by pt.equated_Quantity desc,max(t.dateBill3),t.BILLCODE,z.name,lc.code,s.LP ";
 | 
				
			||||||
				  Query   query   =   session.createSQLQuery(sql); 
 | 
									  Query   query   =   session.createSQLQuery(sql); 
 | 
				
			||||||
					List<Object[]> list= (List<Object[]>)query.list();
 | 
										List<Object[]> list= (List<Object[]>)query.list();
 | 
				
			||||||
				if(list.size()>0) {
 | 
									if(list.size()>0) {
 | 
				
			||||||
| 
						 | 
					@ -10415,9 +10417,9 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
 | 
				
			||||||
						if(soi!=null&&soi.length()>0) {
 | 
											if(soi!=null&&soi.length()>0) {
 | 
				
			||||||
							data1.put("bgColour", "1");//1=红色加急,
 | 
												data1.put("bgColour", "1");//1=红色加急,
 | 
				
			||||||
						}else {
 | 
											}else {
 | 
				
			||||||
							if(Long.parseLong(ordeDate)>210) {
 | 
												if(Long.parseLong(ordeDate)>30) {
 | 
				
			||||||
								data1.put("bgColour", "3");//3=浅蓝色,剩30分钟
 | 
													data1.put("bgColour", "3");//3=浅蓝色,剩30分钟
 | 
				
			||||||
							}else if(Long.parseLong(ordeDate)>180) {
 | 
												}else if(Long.parseLong(ordeDate)>60) {
 | 
				
			||||||
								data1.put("bgColour", "2");//2=黄色,剩余60分钟
 | 
													data1.put("bgColour", "2");//2=黄色,剩余60分钟
 | 
				
			||||||
							}else {
 | 
												}else {
 | 
				
			||||||
								data1.put("bgColour", "0");//0=无颜色,
 | 
													data1.put("bgColour", "0");//0=无颜色,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2003,12 +2003,19 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
						if (t.getPlanQuantity()>t.getMovedQuantityMU()) {
 | 
											if (t.getPlanQuantity()>t.getMovedQuantityMU()) {
 | 
				
			||||||
							//根据小task找到库存,并把占用数量退回。
 | 
												//根据小task找到库存,并把占用数量退回。
 | 
				
			||||||
							Inventory inventory=null;
 | 
												Inventory inventory=null;
 | 
				
			||||||
							List<Inventory> Inventorys =  commonDao.findByQuery(" from Inventory i where i.quantity>0 and i.queuedQuantity>0 and i.location.id=:locationId and i.itemKey.id=:itemKeyId ",
 | 
												String hql=" from Inventory i where i.quantity>0 and i.queuedQuantity>0 "
 | 
				
			||||||
 | 
														+ " and i.location.id=:locationId and i.itemKey.id=:itemKeyId ";
 | 
				
			||||||
 | 
														if(t.getBarCode()!=null&&t.getBarCode().length()>0) {
 | 
				
			||||||
 | 
															hql+=" and i.barCode='"+t.getBarCode()+"'";
 | 
				
			||||||
 | 
														}
 | 
				
			||||||
 | 
														if(t.getStrBill10()!=null&&t.getStrBill10().length()>0) {
 | 
				
			||||||
 | 
															hql+=" and i.statuss='"+t.getStrBill10()+"'";
 | 
				
			||||||
 | 
														}
 | 
				
			||||||
 | 
												List<Inventory> Inventorys =  commonDao.findByQuery(hql,
 | 
				
			||||||
							new String[] { "locationId","itemKeyId"},new Object[] {t.getSrcLoc().getId(),t.getItemKey().getId()});	
 | 
												new String[] { "locationId","itemKeyId"},new Object[] {t.getSrcLoc().getId(),t.getItemKey().getId()});	
 | 
				
			||||||
							if(Inventorys.size()>0){
 | 
												if(Inventorys.size()>0){
 | 
				
			||||||
								inventory=Inventorys.get(0);
 | 
													inventory=Inventorys.get(0);
 | 
				
			||||||
								inventory.setQueuedQuantity(inventory.getQueuedQuantity()-t.getPlanQuantity());	
 | 
													inventory.setQueuedQuantity(inventory.getQueuedQuantity()-t.getPlanQuantity());	
 | 
				
			||||||
								inventory.setVersion(inventory.getVersion());
 | 
					 | 
				
			||||||
								commonDao.store(inventory);
 | 
													commonDao.store(inventory);
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
							
 | 
												
 | 
				
			||||||
| 
						 | 
					@ -2039,17 +2046,7 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			
 | 
					
 | 
				
			||||||
//			shauxinInvQty(item.getId());//刷新item的库存数量
 | 
					 | 
				
			||||||
				
 | 
					 | 
				
			||||||
			
 | 
					 | 
				
			||||||
//		SeedWall sw=pt.getSeedWall();
 | 
					 | 
				
			||||||
//		if(sw!=null){
 | 
					 | 
				
			||||||
//			pt.setSeedWall(null);
 | 
					 | 
				
			||||||
//			commonDao.store(pt);
 | 
					 | 
				
			||||||
//			sw.setStatus(WarehouseAreaStatus.FREE);
 | 
					 | 
				
			||||||
//			commonDao.store(sw);
 | 
					 | 
				
			||||||
//		}
 | 
					 | 
				
			||||||
		shuaxinPick(pt);//刷新出库单
 | 
							shuaxinPick(pt);//刷新出库单
 | 
				
			||||||
		long etime = System.currentTimeMillis();
 | 
							long etime = System.currentTimeMillis();
 | 
				
			||||||
		System.out.printf("取消分配执行时长:"+(etime - stime)+"\n");
 | 
							System.out.printf("取消分配执行时长:"+(etime - stime)+"\n");
 | 
				
			||||||
| 
						 | 
					@ -2462,7 +2459,9 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
								continue;
 | 
													continue;
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
							//判断料号是不是整行库存发料
 | 
												//判断料号是不是整行库存发料
 | 
				
			||||||
							if(ptd.getItem().isBeWholeLine()&&unQty>allocateQty) {
 | 
												if(ptd.getItem().isBeWholeLine()&&unQty>allocateQty
 | 
				
			||||||
 | 
														&&pt.getSourceType()!=null
 | 
				
			||||||
 | 
														&&(pt.getSourceType().equals("261")||pt.getSourceType().equals("Z65"))) {
 | 
				
			||||||
								//保存跳过记录
 | 
													//保存跳过记录
 | 
				
			||||||
								saveWorkOrderAllocationInfo(inventory, ptd, unQty, allocateQty);
 | 
													saveWorkOrderAllocationInfo(inventory, ptd, unQty, allocateQty);
 | 
				
			||||||
								continue;
 | 
													continue;
 | 
				
			||||||
| 
						 | 
					@ -3085,7 +3084,8 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
								continue;
 | 
													continue;
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
							//判断料号是不是整行库存发料
 | 
												//判断料号是不是整行库存发料
 | 
				
			||||||
							if(ptd.getItem().isBeWholeLine()&&unQty>allocateQty) {
 | 
												if(ptd.getItem().isBeWholeLine()&&unQty>allocateQty&&pt.getSourceType()!=null
 | 
				
			||||||
 | 
														&&(pt.getSourceType().equals("261")||pt.getSourceType().equals("Z65"))) {
 | 
				
			||||||
								//保存跳过记录
 | 
													//保存跳过记录
 | 
				
			||||||
								saveWorkOrderAllocationInfo(inventory, ptd, unQty, allocateQty);
 | 
													saveWorkOrderAllocationInfo(inventory, ptd, unQty, allocateQty);
 | 
				
			||||||
								continue;
 | 
													continue;
 | 
				
			||||||
| 
						 | 
					@ -3850,6 +3850,7 @@ public class DefaultAutoAllocator extends DefaultBaseManager implements AutoAllo
 | 
				
			||||||
		woa.setLoc(inventory.getItemKey().getLotInfo().getPropC2());
 | 
							woa.setLoc(inventory.getItemKey().getLotInfo().getPropC2());
 | 
				
			||||||
		woa.setAllocationDate(new Date());
 | 
							woa.setAllocationDate(new Date());
 | 
				
			||||||
		woa.setRemarks("库存数量:"+allocateQty);
 | 
							woa.setRemarks("库存数量:"+allocateQty);
 | 
				
			||||||
 | 
							woa.setStorageDate(inventory.getStorageDate());
 | 
				
			||||||
		commonDao.store(woa);
 | 
							commonDao.store(woa);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,6 +7,7 @@ import java.io.FileInputStream;
 | 
				
			||||||
import java.io.IOException;
 | 
					import java.io.IOException;
 | 
				
			||||||
import java.io.InputStream;
 | 
					import java.io.InputStream;
 | 
				
			||||||
import java.io.InputStreamReader;
 | 
					import java.io.InputStreamReader;
 | 
				
			||||||
 | 
					import java.math.BigDecimal;
 | 
				
			||||||
import java.net.URL;
 | 
					import java.net.URL;
 | 
				
			||||||
import java.net.URLConnection;
 | 
					import java.net.URLConnection;
 | 
				
			||||||
import java.net.URLDecoder;
 | 
					import java.net.URLDecoder;
 | 
				
			||||||
| 
						 | 
					@ -2333,7 +2334,11 @@ public void addASNDetail(Long id,ASNDetail asnDetail) {
 | 
				
			||||||
			for(Long id:asnDetailIds){//循环整理(收货)
 | 
								for(Long id:asnDetailIds){//循环整理(收货)
 | 
				
			||||||
				ASNDetail  asnDetail=this.load(ASNDetail.class, id);//根据整理的这条数据获取它所有的明细
 | 
									ASNDetail  asnDetail=this.load(ASNDetail.class, id);//根据整理的这条数据获取它所有的明细
 | 
				
			||||||
				ASN asn=commonDao.load(ASN.class, asnDetail.getAsn().getId());
 | 
									ASN asn=commonDao.load(ASN.class, asnDetail.getAsn().getId());
 | 
				
			||||||
				if(receivedQuantity>asnDetail.getUnReceivedQuantity()){
 | 
									BigDecimal bg1 = new BigDecimal(receivedQuantity);//
 | 
				
			||||||
 | 
									receivedQuantity = bg1.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
 | 
				
			||||||
 | 
									BigDecimal bg2 = new BigDecimal(asnDetail.getUnReceivedQuantity());//
 | 
				
			||||||
 | 
									double f1 = bg2.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
 | 
				
			||||||
 | 
									if(receivedQuantity>f1){
 | 
				
			||||||
					throw new BusinessException("总数量不能大于订单数量"+asnDetail.getUnReceivedQuantity());
 | 
										throw new BusinessException("总数量不能大于订单数量"+asnDetail.getUnReceivedQuantity());
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				BillType bt=commonDao.load(BillType.class, asn.getBillType().getId());
 | 
									BillType bt=commonDao.load(BillType.class, asn.getBillType().getId());
 | 
				
			||||||
| 
						 | 
					@ -2517,15 +2522,14 @@ public void addASNDetail(Long id,ASNDetail asnDetail) {
 | 
				
			||||||
				asnDetail.setStatusDes(statusDes);
 | 
									asnDetail.setStatusDes(statusDes);
 | 
				
			||||||
				asnDetail.setWarehouseArea(warehouseArea);
 | 
									asnDetail.setWarehouseArea(warehouseArea);
 | 
				
			||||||
				asnDetail.getshaxin();
 | 
									asnDetail.getshaxin();
 | 
				
			||||||
				
 | 
					 | 
				
			||||||
				commonDao.store(asnDetail);
 | 
									commonDao.store(asnDetail);
 | 
				
			||||||
 | 
									
 | 
				
			||||||
				if(asn.getReceivedQuantity()==0){
 | 
									if(asn.getReceivedQuantity()==0){
 | 
				
			||||||
					asn.setStatus(ASNStatus.OPEN);
 | 
										asn.setStatus(ASNStatus.OPEN);
 | 
				
			||||||
				}else if(asn.getReceivedQuantity()<asn.getExpectedQuantity()&&asn.getReceivedQuantity()!=0){
 | 
									}else if(asn.getReceivedQuantity()<asn.getExpectedQuantity()&&asn.getReceivedQuantity()!=0){
 | 
				
			||||||
					asn.setStatus(ASNStatus.RECEIVING);
 | 
										asn.setStatus(ASNStatus.RECEIVING);
 | 
				
			||||||
				}else if(asn.getExpectedQuantity()==asn.getReceivedQuantity()){
 | 
									}else if(asn.getExpectedQuantity()==asn.getReceivedQuantity()){
 | 
				
			||||||
					asn.setStatus(ASNStatus.RECEIVED);
 | 
										asn.setStatus(ASNStatus.RECEIVED);
 | 
				
			||||||
					
 | 
					 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				if(asnDetail.getExpectedQtyOfMasterUnit()<=asnDetail.getReceivedQuantity()) {
 | 
									if(asnDetail.getExpectedQtyOfMasterUnit()<=asnDetail.getReceivedQuantity()) {
 | 
				
			||||||
					if(asn.getAccomplish()==null) {
 | 
										if(asn.getAccomplish()==null) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1275,16 +1275,9 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void activeAll(List<Long> pickTicketIds) {
 | 
						public void activeAll(List<Long> pickTicketIds) {
 | 
				
			||||||
 | 
							synchronized (DefaultWaveDocManager.class) {
 | 
				
			||||||
		String errMsg = "";
 | 
							String errMsg = "";
 | 
				
			||||||
		/*
 | 
					
 | 
				
			||||||
		 * for (Long id : pickTicketIds) { PickTicket pickTicket =
 | 
					 | 
				
			||||||
		 * commonDao.load(PickTicket.class, id); for(PickTicketDetail
 | 
					 | 
				
			||||||
		 * d:pickTicket.getPickTicketDetails()){
 | 
					 | 
				
			||||||
		 * errMsg+=autoAllocator.allocateDetail(d); }
 | 
					 | 
				
			||||||
		 * if(pickTicket.getAllocatedQuantity()>0){
 | 
					 | 
				
			||||||
		 * pickTicket.setStatus(PickTicketStatus.ALLOCATE);
 | 
					 | 
				
			||||||
		 * this.commonDao.store(pickTicket); } }
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		for (Long id : pickTicketIds) {
 | 
							for (Long id : pickTicketIds) {
 | 
				
			||||||
			PickTicket pt = commonDao.load(PickTicket.class, id);
 | 
								PickTicket pt = commonDao.load(PickTicket.class, id);
 | 
				
			||||||
			errMsg += autoAllocator.allocatePickticket(pt);
 | 
								errMsg += autoAllocator.allocatePickticket(pt);
 | 
				
			||||||
| 
						 | 
					@ -1307,6 +1300,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		LocalizedMessage.addLocalizedMessage(errMsg);
 | 
							LocalizedMessage.addLocalizedMessage(errMsg);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public List<Task> activePickTicketDetail(
 | 
						public List<Task> activePickTicketDetail(
 | 
				
			||||||
| 
						 | 
					@ -2809,6 +2803,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@SuppressWarnings("unchecked")
 | 
						@SuppressWarnings("unchecked")
 | 
				
			||||||
	public void manualAllocate(Map params, List<Long> id) {
 | 
						public void manualAllocate(Map params, List<Long> id) {
 | 
				
			||||||
 | 
							synchronized (DefaultWaveDocManager.class) {
 | 
				
			||||||
		PickTicketDetail ptd = commonDao.load(PickTicketDetail.class, id.get(0));
 | 
							PickTicketDetail ptd = commonDao.load(PickTicketDetail.class, id.get(0));
 | 
				
			||||||
		PickTicket pt = null;
 | 
							PickTicket pt = null;
 | 
				
			||||||
		if (ptd != null) {
 | 
							if (ptd != null) {
 | 
				
			||||||
| 
						 | 
					@ -2877,6 +2872,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
		if(pt!=null) {
 | 
							if(pt!=null) {
 | 
				
			||||||
		refreshOrderQuantity(pt);
 | 
							refreshOrderQuantity(pt);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public Task createTask(Inventory inventory, PickTicketDetail ptd, double allocateQty) {
 | 
						public Task createTask(Inventory inventory, PickTicketDetail ptd, double allocateQty) {
 | 
				
			||||||
| 
						 | 
					@ -4340,8 +4336,6 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
					if(srcInv.getQueuedQuantity()<=0) {
 | 
										if(srcInv.getQueuedQuantity()<=0) {
 | 
				
			||||||
						srcInv.setQueuedQuantity(0);
 | 
											srcInv.setQueuedQuantity(0);
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
//					srcInv.setVersion(srcInv.getVersion());
 | 
					 | 
				
			||||||
					// srcInv.setSOI(task.getBillCode());
 | 
					 | 
				
			||||||
					commonDao.store(srcInv);
 | 
										commonDao.store(srcInv);
 | 
				
			||||||
					if (task != null) {
 | 
										if (task != null) {
 | 
				
			||||||
						task.pickConfirm(itemKey, srcInv.getLocation(), newInventory.getLP(), task.getDstLoc(),
 | 
											task.pickConfirm(itemKey, srcInv.getLocation(), newInventory.getLP(), task.getDstLoc(),
 | 
				
			||||||
| 
						 | 
					@ -4370,9 +4364,13 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (wa!=null&&(wa.getLevels()==0||!wa.isBeBill())) {
 | 
								if (wa!=null&&(wa.getLevels()==0||!wa.isBeBill())) {
 | 
				
			||||||
				task.setInventoryStatus("合单完成");
 | 
									task.setInventoryStatus("合单完成");
 | 
				
			||||||
 | 
									task.setOperatorDate(new Date());//合单日期
 | 
				
			||||||
 | 
									task.setDateBill3(new Date());//合单任务完成日期
 | 
				
			||||||
 | 
									task.setDateBill5(new Date());//合单任务生成时间
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if(!bt.isBePresentation()&&wa.getCarrierType().getId()==3) {
 | 
								if(!bt.isBePresentation()&&wa.getCarrierType().getId()==3) {
 | 
				
			||||||
				task.setInventoryStatus("交单完成");
 | 
									task.setInventoryStatus("交单完成");
 | 
				
			||||||
 | 
									task.setDateline(new Date());
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if(beUnpacking!=null&&beUnpacking.length()>0) {
 | 
								if(beUnpacking!=null&&beUnpacking.length()>0) {
 | 
				
			||||||
			task.setBeUnpacking(true);
 | 
								task.setBeUnpacking(true);
 | 
				
			||||||
| 
						 | 
					@ -5667,6 +5665,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
		JSONArray array = new JSONArray();
 | 
							JSONArray array = new JSONArray();
 | 
				
			||||||
		List<Task> listtask=new ArrayList<Task>();
 | 
							List<Task> listtask=new ArrayList<Task>();
 | 
				
			||||||
		PickTicket pt = null;
 | 
							PickTicket pt = null;
 | 
				
			||||||
 | 
							String shalp="";
 | 
				
			||||||
		// TODO 自动生成的方法存根
 | 
							// TODO 自动生成的方法存根
 | 
				
			||||||
		for (Long id : ids) {
 | 
							for (Long id : ids) {
 | 
				
			||||||
			Task task = load(Task.class, id);
 | 
								Task task = load(Task.class, id);
 | 
				
			||||||
| 
						 | 
					@ -5688,6 +5687,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
				jsonobj2.put("TKNUM", task.getMovedQuantityMU());
 | 
									jsonobj2.put("TKNUM", task.getMovedQuantityMU());
 | 
				
			||||||
				jsonobj2.put("POSI2", toLoc == null ? "" : toLoc);
 | 
									jsonobj2.put("POSI2", toLoc == null ? "" : toLoc);
 | 
				
			||||||
				jsonobj2.put("CONT1", stock == null ? "BGHU" : stock.getLP());
 | 
									jsonobj2.put("CONT1", stock == null ? "BGHU" : stock.getLP());
 | 
				
			||||||
 | 
									shalp=jsonobj2.getString("CONT1");
 | 
				
			||||||
				jsonobj2.put("TKFIQ", task.getMovedQuantityMU());
 | 
									jsonobj2.put("TKFIQ", task.getMovedQuantityMU());
 | 
				
			||||||
				jsonobj2.put("POSI1", srcLoc);//起始点
 | 
									jsonobj2.put("POSI1", srcLoc);//起始点
 | 
				
			||||||
				jsonobj2.put("MEINS", i.getUnit());
 | 
									jsonobj2.put("MEINS", i.getUnit());
 | 
				
			||||||
| 
						 | 
					@ -5704,9 +5704,6 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
				listtask.add(task);
 | 
									listtask.add(task);
 | 
				
			||||||
		 }
 | 
							 }
 | 
				
			||||||
		jsonobj.put("INPUT", array);
 | 
							jsonobj.put("INPUT", array);
 | 
				
			||||||
//		if(pt != null && pt.getSourceType()!=null
 | 
					 | 
				
			||||||
//				&&pt.getSourceType().equals("261")) {
 | 
					 | 
				
			||||||
//		}	
 | 
					 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		if (pt != null && pt.getSourceType()!=null
 | 
							if (pt != null && pt.getSourceType()!=null
 | 
				
			||||||
				&&pt.getSourceType().equals("261")) {
 | 
									&&pt.getSourceType().equals("261")) {
 | 
				
			||||||
| 
						 | 
					@ -5716,16 +5713,14 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
			t.setContent(jsonobj.toString());
 | 
								t.setContent(jsonobj.toString());
 | 
				
			||||||
			t.setBillCodde("位置"+pt.getCode());
 | 
								t.setBillCodde("位置"+pt.getCode());
 | 
				
			||||||
			t.setBereturn(true);
 | 
								t.setBereturn(true);
 | 
				
			||||||
			String str=interfaceReqManager.doWmsReqSap(getPropertiesParm("ldxt.SAP")+ApiURL.doWmsReqSap, jsonobj.toString(),"位置"+pt.getCode());
 | 
								String str=interfaceReqManager.doWmsReqSap(getPropertiesParm("ldxt.SAP")+ApiURL.doWmsReqSap, 
 | 
				
			||||||
 | 
																		jsonobj.toString(),srcLoc+"位置"+pt.getCode()+","+shalp);
 | 
				
			||||||
			if(str!=null&&OUTPUT(str)) {
 | 
								if(str!=null&&OUTPUT(str)) {
 | 
				
			||||||
				t.setReturnMSG(returnOutPut(str));
 | 
									t.setReturnMSG(returnOutPut(str));
 | 
				
			||||||
				jsonob2.put("ZCODE", "true") ;
 | 
									jsonob2.put("ZCODE", "true") ;
 | 
				
			||||||
				jsonob2.put("MSG", t.getReturnMSG());
 | 
									jsonob2.put("MSG", t.getReturnMSG());
 | 
				
			||||||
				commonDao.store(t);
 | 
									commonDao.store(t);
 | 
				
			||||||
//				for(Task task1:listtask) {
 | 
					
 | 
				
			||||||
//					task1.setPositionStatus("1");//位置回传成功
 | 
					 | 
				
			||||||
//					commonDao.store(task1);
 | 
					 | 
				
			||||||
//				}
 | 
					 | 
				
			||||||
				return jsonob2;
 | 
									return jsonob2;
 | 
				
			||||||
			}else {
 | 
								}else {
 | 
				
			||||||
				try {
 | 
									try {
 | 
				
			||||||
| 
						 | 
					@ -7259,7 +7254,8 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
				ItemKey ik = commonDao.load(ItemKey.class, t.getItemKey().getId());
 | 
									ItemKey ik = commonDao.load(ItemKey.class, t.getItemKey().getId());
 | 
				
			||||||
				Item item = commonDao.load(Item.class, ik.getItem().getId());
 | 
									Item item = commonDao.load(Item.class, ik.getItem().getId());
 | 
				
			||||||
				Location srcLoc = commonDao.load(Location.class, t.getSrcLoc().getId());
 | 
									Location srcLoc = commonDao.load(Location.class, t.getSrcLoc().getId());
 | 
				
			||||||
				WarehouseArea zone = this.load(WarehouseArea.class, srcLoc.getZone().getId());
 | 
									WarehouseArea zone = commonDao.load(WarehouseArea.class, srcLoc.getZone().getId());
 | 
				
			||||||
 | 
									Stock dstLP=commonDao.load(Stock.class, t.getDstLP().getId());
 | 
				
			||||||
				Worker w = null;
 | 
									Worker w = null;
 | 
				
			||||||
				if(t.getWorker4()!=null) {
 | 
									if(t.getWorker4()!=null) {
 | 
				
			||||||
					 w = this.load(Worker.class, t.getWorker4().getId());  
 | 
										 w = this.load(Worker.class, t.getWorker4().getId());  
 | 
				
			||||||
| 
						 | 
					@ -7274,11 +7270,10 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
				String printName = "";
 | 
									String printName = "";
 | 
				
			||||||
				String barcode = "QAR/" + t.getBillCode() + "/" + ptd.getLineNumber() + "/" + item.getCode() + "/"
 | 
									String barcode = "QAR/" + t.getBillCode() + "/" + ptd.getLineNumber() + "/" + item.getCode() + "/"
 | 
				
			||||||
						+ item.getUnit() + "/";
 | 
											+ item.getUnit() + "/";
 | 
				
			||||||
//				if (t.getBarCode() == null) {
 | 
					 | 
				
			||||||
//					barcode += "/" + ymd.format(new Date());
 | 
					 | 
				
			||||||
//				} else {
 | 
					 | 
				
			||||||
					barcode +=  "/" + ymd.format(new Date());
 | 
										barcode +=  "/" + ymd.format(new Date());
 | 
				
			||||||
//				}
 | 
					//					if(dstLP!=null) {
 | 
				
			||||||
 | 
					//						barcode+="///"+dstLP.getLP();
 | 
				
			||||||
 | 
					//					}
 | 
				
			||||||
				logger.info(barcode);
 | 
									logger.info(barcode);
 | 
				
			||||||
				macs = printEquipment == null ? "" : printEquipment.getMac();
 | 
									macs = printEquipment == null ? "" : printEquipment.getMac();
 | 
				
			||||||
				printName = printEquipment == null ? "" : printEquipment.getPrintName();
 | 
									printName = printEquipment == null ? "" : printEquipment.getPrintName();
 | 
				
			||||||
| 
						 | 
					@ -8748,8 +8743,9 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				//其它出库的单子不能合单到工单交单的货架上
 | 
									//其它出库的单子不能合单到工单交单的货架上
 | 
				
			||||||
				if(bt.getId()!=1094&&loc.getLocations().getId()==8
 | 
									if(bt.getId()!=1094&&loc.getLocations().getId()==8
 | 
				
			||||||
						&&loc.getCode().substring(0, 1).equals("2")) {
 | 
											&&(loc.getCode().substring(0, 1).equals("2")
 | 
				
			||||||
					throw new BusinessException(loc.getCode()+"不能放生产交接货架上");
 | 
													||loc.getCode().substring(0, 1).equals("1"))) {
 | 
				
			||||||
 | 
										throw new BusinessException(pt.getCode()+"不能放生产交接货架上");
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			soi=t.getBillCode();
 | 
								soi=t.getBillCode();
 | 
				
			||||||
| 
						 | 
					@ -9500,7 +9496,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	//重新的合单完成按钮
 | 
						//重新的合单完成按钮
 | 
				
			||||||
	public String stockMakeTwo(String invIds,long locId,long userId,long warehouseId) {
 | 
						public synchronized String stockMakeTwo(String invIds,long locId,long userId,long warehouseId) {
 | 
				
			||||||
		String  taskStatus="已合单";
 | 
							String  taskStatus="已合单";
 | 
				
			||||||
		String msg="";
 | 
							String msg="";
 | 
				
			||||||
		boolean b=true;
 | 
							boolean b=true;
 | 
				
			||||||
| 
						 | 
					@ -9516,14 +9512,13 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
				+ " where inv.id in("+invIds+")  and inv.quantity>0) ";
 | 
									+ " where inv.id in("+invIds+")  and inv.quantity>0) ";
 | 
				
			||||||
		//当前需要合单的任务
 | 
							//当前需要合单的任务
 | 
				
			||||||
		List<Task> tasks= commonDao.findByQuery(tsql);
 | 
							List<Task> tasks= commonDao.findByQuery(tsql);
 | 
				
			||||||
		
 | 
							String taskStatus1="";//合单完成
 | 
				
			||||||
		//判定子任务是否完成
 | 
							//判定子任务是否完成
 | 
				
			||||||
		if(result.size()>0) {
 | 
							if(result.size()>0) {
 | 
				
			||||||
			String invid=result.get(0);
 | 
								String invid=result.get(0);
 | 
				
			||||||
			Inventory inv=commonDao.load(Inventory.class, Long.parseLong(invid));
 | 
								Inventory inv=commonDao.load(Inventory.class, Long.parseLong(invid));
 | 
				
			||||||
			Task t=commonDao.load(Task.class, inv.getTaskid());
 | 
								Task t=commonDao.load(Task.class, inv.getTaskid());
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			
 | 
					 | 
				
			||||||
			if(levels==0) {
 | 
								if(levels==0) {
 | 
				
			||||||
				Location sloc=commonDao.load(Location.class, t.getSrcLoc().getId());
 | 
									Location sloc=commonDao.load(Location.class, t.getSrcLoc().getId());
 | 
				
			||||||
				WarehouseArea zone=commonDao.load(WarehouseArea.class, sloc.getZone().getId());
 | 
									WarehouseArea zone=commonDao.load(WarehouseArea.class, sloc.getZone().getId());
 | 
				
			||||||
| 
						 | 
					@ -9566,7 +9561,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
					for (Task obj : tasksAll) {
 | 
										for (Task obj : tasksAll) {
 | 
				
			||||||
			            map.put(obj, Boolean.TRUE);
 | 
								            map.put(obj, Boolean.TRUE);
 | 
				
			||||||
			        }
 | 
								        }
 | 
				
			||||||
					
 | 
										//删除当前子任务数据
 | 
				
			||||||
					for (Task obj : tasks) {
 | 
										for (Task obj : tasks) {
 | 
				
			||||||
			            if (map.containsKey(obj)) {
 | 
								            if (map.containsKey(obj)) {
 | 
				
			||||||
			            	tasksAll.remove(obj);
 | 
								            	tasksAll.remove(obj);
 | 
				
			||||||
| 
						 | 
					@ -9639,6 +9634,9 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
				t.setInventoryStatus(taskStatus);
 | 
									t.setInventoryStatus(taskStatus);
 | 
				
			||||||
			 }else {
 | 
								 }else {
 | 
				
			||||||
				 t.setInventoryStatus("交单完成");
 | 
									 t.setInventoryStatus("交单完成");
 | 
				
			||||||
 | 
									 t.setDateBill5(new Date());
 | 
				
			||||||
 | 
									 t.setDateBill3(new Date());
 | 
				
			||||||
 | 
									 t.setDateline(new Date());
 | 
				
			||||||
			 }
 | 
								 }
 | 
				
			||||||
			 if(taskStatus.equals("合单完成")) {
 | 
								 if(taskStatus.equals("合单完成")) {
 | 
				
			||||||
				 t.setDateBill5(new Date());
 | 
									 t.setDateBill5(new Date());
 | 
				
			||||||
| 
						 | 
					@ -9745,7 +9743,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
								if(ptd.getSOI()!=null&&
 | 
													if(ptd.getSOI()!=null&&
 | 
				
			||||||
										(ptd.getSOI().equals("U")
 | 
															(ptd.getSOI().equals("U")
 | 
				
			||||||
										||ptd.getSOI().equals("X"))
 | 
															||ptd.getSOI().equals("X"))
 | 
				
			||||||
										&&(!dstLoc.isBeUrgent())) {
 | 
															&&!dstLoc.isBeUrgent()) {
 | 
				
			||||||
									throw new BusinessException("该地位不是加急交接点");
 | 
														throw new BusinessException("该地位不是加急交接点");
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
| 
						 | 
					@ -9757,7 +9755,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
								Worker worker=commonDao.load(Worker.class, userId);	
 | 
													Worker worker=commonDao.load(Worker.class, userId);	
 | 
				
			||||||
								List<Long>	taskids=commonDao.findByQuery(hql2);
 | 
													List<Long>	taskids=commonDao.findByQuery(hql2);
 | 
				
			||||||
								if(taskids.size()<tasks.size()) {
 | 
													if(taskids.size()<tasks.size()) {
 | 
				
			||||||
									throw new BusinessException("该地标上任务,未合单完成。");
 | 
														throw new BusinessException("该地标上任务,未合单完成");
 | 
				
			||||||
								}else {
 | 
													}else {
 | 
				
			||||||
									a=true;
 | 
														a=true;
 | 
				
			||||||
								if(a){
 | 
													if(a){
 | 
				
			||||||
| 
						 | 
					@ -9767,7 +9765,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
									List<Long> stoskids=commonDao.findByQuery(stolps);
 | 
														List<Long> stoskids=commonDao.findByQuery(stolps);
 | 
				
			||||||
									String stoskid=StringUtils.strip(stoskids.toString(),"[]");
 | 
														String stoskid=StringUtils.strip(stoskids.toString(),"[]");
 | 
				
			||||||
									//按容器查询任务,拣货任务,
 | 
														//按容器查询任务,拣货任务,
 | 
				
			||||||
									String tys="select t.dstLP.LP from Task t where  t.dstLP.id in("+stoskid+") and   t.id not in("+invIds+")"
 | 
														String tys=" select t.dstLP.LP from Task t where  t.dstLP.id in("+stoskid+") and   t.id not in("+invIds+")"
 | 
				
			||||||
											+ " and t.inventoryStatus in('已出库','已合单','合单完成') and t.planQuantity>0 "
 | 
																+ " and t.inventoryStatus in('已出库','已合单','合单完成') and t.planQuantity>0 "
 | 
				
			||||||
											+ " and t.dstLoc.zone.id<>1787 ";
 | 
																+ " and t.dstLoc.zone.id<>1787 ";
 | 
				
			||||||
									List<String> tysids=commonDao.findByQuery(tys);
 | 
														List<String> tysids=commonDao.findByQuery(tys);
 | 
				
			||||||
| 
						 | 
					@ -9787,23 +9785,33 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
											for(Long tashid:tids1) {
 | 
																for(Long tashid:tids1) {
 | 
				
			||||||
												countTasks.remove(tashid);
 | 
																	countTasks.remove(tashid);
 | 
				
			||||||
											}
 | 
																}
 | 
				
			||||||
//											logger.info("1"+countTasks.toString());
 | 
					 | 
				
			||||||
//											logger.info("2"+tids1.toString());
 | 
					 | 
				
			||||||
											if(countTasks.size()==0) {
 | 
																if(countTasks.size()==0) {
 | 
				
			||||||
												jdwz="X";
 | 
																	jdwz="X";//完成标记
 | 
				
			||||||
											}
 | 
																}
 | 
				
			||||||
											
 | 
																
 | 
				
			||||||
										List<String>	tLocds2=commonDao.findByQuery(taskloc2);
 | 
															List<String>	tLocds2=commonDao.findByQuery(taskloc2);
 | 
				
			||||||
										 fromaddress=tLocds2.get(0);
 | 
															 fromaddress=tLocds2.get(0);
 | 
				
			||||||
										 logger.info(jdwz);
 | 
															 //有报错信息,任务不会回传完成标记
 | 
				
			||||||
 | 
															 if(msg!=null&&msg.length()>0) {
 | 
				
			||||||
 | 
																 jdwz="";
 | 
				
			||||||
 | 
															 }
 | 
				
			||||||
										//位置回传 
 | 
															//位置回传 
 | 
				
			||||||
										 JSONObject bh=	wmsSapWeizhihuichuang(tids1,fromaddress,dstLoc.getCode(),jdwz);
 | 
															 JSONObject bh=	wmsSapWeizhihuichuang(tids1,fromaddress,dstLoc.getCode(),jdwz);
 | 
				
			||||||
										//更新task任务的信息
 | 
															//更新task任务的信息
 | 
				
			||||||
										 String mes2= WmsSapposition(bh, tids1, dstLoc, worker);
 | 
															 String mes2="";
 | 
				
			||||||
 | 
															 try {
 | 
				
			||||||
 | 
															 mes2= WmsSapposition(bh, tids1, dstLoc, worker);
 | 
				
			||||||
 | 
															 }catch (Exception e) {
 | 
				
			||||||
 | 
																 try {
 | 
				
			||||||
 | 
																	 mes2= WmsSapposition(bh, tids1, dstLoc, worker);
 | 
				
			||||||
 | 
																 }catch(Exception e1){
 | 
				
			||||||
 | 
																	 
 | 
				
			||||||
 | 
																 }
 | 
				
			||||||
 | 
															}
 | 
				
			||||||
										 if(bh.get("ZCODE").equals("true")) {
 | 
															 if(bh.get("ZCODE").equals("true")) {
 | 
				
			||||||
											 msg1=msg1+mes2;
 | 
																 msg1=msg1+mes2;//成功
 | 
				
			||||||
										 }else {
 | 
															 }else {
 | 
				
			||||||
											 msg=msg+mes2;
 | 
																 msg=msg+mes2;//失败
 | 
				
			||||||
										 }
 | 
															 }
 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
| 
						 | 
					@ -9820,7 +9828,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
 | 
				
			||||||
								 if(bh.get("ZCODE").equals("true")) {
 | 
													 if(bh.get("ZCODE").equals("true")) {
 | 
				
			||||||
									 msg1=msg1+mes2;
 | 
														 msg1=msg1+mes2;
 | 
				
			||||||
								 }else {
 | 
													 }else {
 | 
				
			||||||
									 msg=msg+mes2;
 | 
														 msg=msg+mes2;//失败
 | 
				
			||||||
								 }							
 | 
													 }							
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2422,6 +2422,8 @@ public class DefaultWaveDocManager extends DefaultBaseManager implements
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public  void hotWaveDoc(Date date1,Date date2 ,Integer longtiem,Integer lxqQty,Integer hjqQty,Integer lkqQty,boolean ddq,String pickCode
 | 
						public  void hotWaveDoc(Date date1,Date date2 ,Integer longtiem,Integer lxqQty,Integer hjqQty,Integer lkqQty,boolean ddq,String pickCode
 | 
				
			||||||
			,boolean ddq1,boolean ddq2,boolean ddq3,boolean ddq4,boolean ddq5,boolean ddq6,boolean ddq7,boolean ddq8,boolean ddq9,Integer taskQty,boolean beUrgent) {
 | 
								,boolean ddq1,boolean ddq2,boolean ddq3,boolean ddq4,boolean ddq5,boolean ddq6,boolean ddq7,boolean ddq8,boolean ddq9,Integer taskQty,boolean beUrgent) {
 | 
				
			||||||
 | 
							synchronized (DefaultWaveDocManager.class) {
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
 | 
							SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
 | 
				
			||||||
		Date date=new Date();
 | 
							Date date=new Date();
 | 
				
			||||||
		logger.info(date);
 | 
							logger.info(date);
 | 
				
			||||||
| 
						 | 
					@ -2710,7 +2712,7 @@ public class DefaultWaveDocManager extends DefaultBaseManager implements
 | 
				
			||||||
				
 | 
									
 | 
				
			||||||
//				autoAllocator.initiandcallAGV(waveDoc.getId(), lxq, hjq, lkq);//下发任务
 | 
					//				autoAllocator.initiandcallAGV(waveDoc.getId(), lxq, hjq, lkq);//下发任务
 | 
				
			||||||
//			}
 | 
					//			}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -223,7 +223,7 @@ public class ASNReceiveServlet extends HttpServlet {
 | 
				
			||||||
			String mac =json.has("mac")?json.getString("mac"):"";
 | 
								String mac =json.has("mac")?json.getString("mac"):"";
 | 
				
			||||||
			resultJson=this.receiving(mac,pqty,asnDetailIds,serials,date, locId, z_id,s_id, receivedQuantity, workerId, wId, commonDao,propLC2,propLC3);
 | 
								resultJson=this.receiving(mac,pqty,asnDetailIds,serials,date, locId, z_id,s_id, receivedQuantity, workerId, wId, commonDao,propLC2,propLC3);
 | 
				
			||||||
		}else if("scanPutOrder".equals(methodType)){
 | 
							}else if("scanPutOrder".equals(methodType)){
 | 
				
			||||||
			//查询上架任务
 | 
								//PDA查询上架任务
 | 
				
			||||||
			String itemCode =json.has("itemCode")?json.getString("itemCode"):""; 
 | 
								String itemCode =json.has("itemCode")?json.getString("itemCode"):""; 
 | 
				
			||||||
			String barCode =json.has("barCode")?json.getString("barCode"):""; 
 | 
								String barCode =json.has("barCode")?json.getString("barCode"):""; 
 | 
				
			||||||
			resultJson=app.scanPutOrder(itemCode,barCode, workerId, wId);
 | 
								resultJson=app.scanPutOrder(itemCode,barCode, workerId, wId);
 | 
				
			||||||
| 
						 | 
					@ -1653,6 +1653,9 @@ public class ASNReceiveServlet extends HttpServlet {
 | 
				
			||||||
									flag=0;
 | 
														flag=0;
 | 
				
			||||||
									msg=msg+ncrCode+"库存数"+qys;
 | 
														msg=msg+ncrCode+"库存数"+qys;
 | 
				
			||||||
								}
 | 
													}
 | 
				
			||||||
 | 
												}else {
 | 
				
			||||||
 | 
													flag=0;
 | 
				
			||||||
 | 
													msg=msg+ncrCode+"号输入错误";
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
| 
						 | 
					@ -1940,18 +1943,6 @@ public class ASNReceiveServlet extends HttpServlet {
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
//					if(status.equals("1")) {
 | 
					 | 
				
			||||||
//						if(ncrCode!=null&&ncrCode.length()>0){
 | 
					 | 
				
			||||||
//							List<Inventory> Inventorys1=commonDao.findByQuery(" from Inventory inv where inv.id in ("+invIds.toString()+") ");
 | 
					 | 
				
			||||||
//							ItemKey ik=null;
 | 
					 | 
				
			||||||
//							Location lc=null;
 | 
					 | 
				
			||||||
//							if(Inventorys1.size()>0) {
 | 
					 | 
				
			||||||
//								Inventory iv=Inventorys1.get(0);
 | 
					 | 
				
			||||||
//								lc=commonDao.load(Location.class, iv.getLocation().getId());
 | 
					 | 
				
			||||||
//								ik=commonDao.load(ItemKey.class, iv.getItemKey().getId());
 | 
					 | 
				
			||||||
//							}
 | 
					 | 
				
			||||||
//						}
 | 
					 | 
				
			||||||
//					}
 | 
					 | 
				
			||||||
					
 | 
										
 | 
				
			||||||
				}else {
 | 
									}else {
 | 
				
			||||||
					status = "2";
 | 
										status = "2";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,3 +57,15 @@ ALTER TABLE   LOCATION    add be_Urgent tinyint  NULL;
 | 
				
			||||||
GO
 | 
					GO
 | 
				
			||||||
update LOCATION set be_Urgent=0 where be_Urgent is null;
 | 
					update LOCATION set be_Urgent=0 where be_Urgent is null;
 | 
				
			||||||
GO
 | 
					GO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					------------2025-04-14
 | 
				
			||||||
 | 
					ALTER TABLE   WorkOrderAllocationInfo    add STORAGE_DATE DATE  ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					----创建非聚合索引
 | 
				
			||||||
 | 
					CREATE NONCLUSTERED INDEX [idx_task_item_key_id]
 | 
				
			||||||
 | 
					ON [dbo].[TASK] (
 | 
				
			||||||
 | 
					  [ITEM_KEY_ID] ASC
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CREATE CLUSTERED INDEX idx_clust_EmployeeID ON Employees(EmployeeID);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@
 | 
				
			||||||
                <date id="beginDate" title="日期" row="2" col="1"
 | 
					                <date id="beginDate" title="日期" row="2" col="1"
 | 
				
			||||||
                      readOnly="false" required="false" reserve="false" forceOverride="false"
 | 
					                      readOnly="false" required="false" reserve="false" forceOverride="false"
 | 
				
			||||||
                      inVisible="false" showTime="false" manualEditable="true"
 | 
					                      inVisible="false" showTime="false" manualEditable="true"
 | 
				
			||||||
                      defaultCurrentDate="false" />
 | 
					                      defaultCurrentDate="true" />
 | 
				
			||||||
                <!-- 结束日期查询输入 -->
 | 
					                <!-- 结束日期查询输入 -->
 | 
				
			||||||
                <date id="endDate" title="至" row="2" col="2"
 | 
					                <date id="endDate" title="至" row="2" col="2"
 | 
				
			||||||
                      readOnly="false" required="false" reserve="false" forceOverride="false"
 | 
					                      readOnly="false" required="false" reserve="false" forceOverride="false"
 | 
				
			||||||
| 
						 | 
					@ -29,9 +29,10 @@
 | 
				
			||||||
                workOrder.locationNumber,
 | 
					                workOrder.locationNumber,
 | 
				
			||||||
                workOrder.factory,
 | 
					                workOrder.factory,
 | 
				
			||||||
                workOrder.loc,
 | 
					                workOrder.loc,
 | 
				
			||||||
 | 
					                workOrder.storageDate,
 | 
				
			||||||
                workOrder.allocationDate
 | 
					                workOrder.allocationDate
 | 
				
			||||||
            from WorkOrderAllocationInfo workOrder
 | 
					            from WorkOrderAllocationInfo workOrder
 | 
				
			||||||
            where 1 = 1
 | 
					            where 1 = 1 
 | 
				
			||||||
            /~workOrderNumber: and workOrder.workOrderNumber like {workOrderNumber} ~/
 | 
					            /~workOrderNumber: and workOrder.workOrderNumber like {workOrderNumber} ~/
 | 
				
			||||||
            /~materialNumber: and workOrder.materialNumber like {materialNumber} ~/
 | 
					            /~materialNumber: and workOrder.materialNumber like {materialNumber} ~/
 | 
				
			||||||
            /~beginDate: AND CONVERT(varchar(100), workOrder.allocationDate, 23) = {beginDate} ~/
 | 
					            /~beginDate: AND CONVERT(varchar(100), workOrder.allocationDate, 23) = {beginDate} ~/
 | 
				
			||||||
| 
						 | 
					@ -57,6 +58,7 @@
 | 
				
			||||||
            <!-- LOC 列 -->
 | 
					            <!-- LOC 列 -->
 | 
				
			||||||
            <column id="workOrder.loc" title="LOC" visible="true" horizonAlign="center" verticalAlign="middle" />
 | 
					            <column id="workOrder.loc" title="LOC" visible="true" horizonAlign="center" verticalAlign="middle" />
 | 
				
			||||||
            <!-- 日期列 -->
 | 
					            <!-- 日期列 -->
 | 
				
			||||||
 | 
					            <column id="workOrder.storageDate" title="库存日期" visible="true" horizonAlign="center" verticalAlign="middle" format="dateFormat" />
 | 
				
			||||||
            <column id="workOrder.allocationDate" title="创建日期" visible="true" horizonAlign="center" verticalAlign="middle" format="dateFormat" />
 | 
					            <column id="workOrder.allocationDate" title="创建日期" visible="true" horizonAlign="center" verticalAlign="middle" format="dateFormat" />
 | 
				
			||||||
        </columns>
 | 
					        </columns>
 | 
				
			||||||
    </maintainPage>
 | 
					    </maintainPage>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,8 +42,17 @@
 | 
				
			||||||
					title="工作站效率" visible="true" horizonAlign="left" />
 | 
										title="工作站效率" visible="true" horizonAlign="left" />
 | 
				
			||||||
			</columns>
 | 
								</columns>
 | 
				
			||||||
			<buttons>
 | 
								<buttons>
 | 
				
			||||||
<!-- 				<popup id="AGVList1" title="下发" enableType="none" invisible="false" containId="true" pageId="editAGVWorkTASKPage" /> -->
 | 
								<commit id="3312adjustment22" title="清除领取人" enableType="single" invisible="false" confirmMessage="确认清除领取人?">
 | 
				
			||||||
 | 
										<mappings>
 | 
				
			||||||
 | 
											<mapping id="ids" className="list"/>
 | 
				
			||||||
 | 
										</mappings>
 | 
				
			||||||
 | 
										<actions>
 | 
				
			||||||
 | 
											<action managerName="countPlanManager" methodName="cleanCountRecordVIEW" parameter="ids"/>
 | 
				
			||||||
 | 
										</actions>
 | 
				
			||||||
 | 
										<forwards>
 | 
				
			||||||
 | 
										<forward name="refreshWindow" newEnabled="true" editEnabled="true" />
 | 
				
			||||||
 | 
									</forwards>
 | 
				
			||||||
 | 
								</commit>
 | 
				
			||||||
			</buttons>
 | 
								</buttons>
 | 
				
			||||||
		</detail>
 | 
							</detail>
 | 
				
			||||||
	</modifyDetailPage>
 | 
						</modifyDetailPage>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -128,7 +128,11 @@
 | 
				
			||||||
			<text id="w43" title="7#4楼地堆区" defaultValue="0" row="24"  span="2" col="1"
 | 
								<text id="w43" title="7#4楼地堆区" defaultValue="0" row="24"  span="2" col="1"
 | 
				
			||||||
				width="100" readOnly="false" required="false" reserve="false"
 | 
									width="100" readOnly="false" required="false" reserve="false"
 | 
				
			||||||
				forceOverride="true" inVisible="false"  trimSpace="true"
 | 
									forceOverride="true" inVisible="false"  trimSpace="true"
 | 
				
			||||||
				isPrecision="true" />		
 | 
									isPrecision="true" />
 | 
				
			||||||
 | 
								<text id="w44" title="4#地堆区" defaultValue="0" row="25"  span="2" col="1"
 | 
				
			||||||
 | 
									width="100" readOnly="false" required="false" reserve="false"
 | 
				
			||||||
 | 
									forceOverride="true" inVisible="false"  trimSpace="true"
 | 
				
			||||||
 | 
									isPrecision="true" />			
 | 
				
			||||||
		</inputUIs>
 | 
							</inputUIs>
 | 
				
			||||||
		<buttons>
 | 
							<buttons>
 | 
				
			||||||
			<commit id="save" title="save" enableType="none" invisible="false">
 | 
								<commit id="save" title="save" enableType="none" invisible="false">
 | 
				
			||||||
| 
						 | 
					@ -174,12 +178,13 @@
 | 
				
			||||||
					<mapping id="w41" className="double" />
 | 
										<mapping id="w41" className="double" />
 | 
				
			||||||
					<mapping id="w42" className="double" />
 | 
										<mapping id="w42" className="double" />
 | 
				
			||||||
					<mapping id="w43" className="double" />
 | 
										<mapping id="w43" className="double" />
 | 
				
			||||||
 | 
										<mapping id="w44" className="double" />
 | 
				
			||||||
				</mappings>
 | 
									</mappings>
 | 
				
			||||||
				<actions>
 | 
									<actions>
 | 
				
			||||||
					<action managerName="countPlanManager" methodName="AGVworke"
 | 
										<action managerName="countPlanManager" methodName="AGVworke"
 | 
				
			||||||
						parameter="countPlan.id,wid1,wid2,wid3,wid4,wid5,wid6,wid7,wid8,wid9,
 | 
											parameter="countPlan.id,wid1,wid2,wid3,wid4,wid5,wid6,wid7,wid8,wid9,
 | 
				
			||||||
						wid10,wid11,wid12,wid13,wid14,wid15,wid16,wid17,wid18,wid19,wid20,wid21,wid22,
 | 
											wid10,wid11,wid12,wid13,wid14,wid15,wid16,wid17,wid18,wid19,wid20,wid21,wid22,
 | 
				
			||||||
						w601,w602,w603,w604,w605,w31,w32,w33,w34,w35,w36,w37,w38,w39,w40,w41,w42,w43" />
 | 
											w601,w602,w603,w604,w605,w31,w32,w33,w34,w35,w36,w37,w38,w39,w40,w41,w42,w43,w44" />
 | 
				
			||||||
				</actions>
 | 
									</actions>
 | 
				
			||||||
				<forwards>
 | 
									<forwards>
 | 
				
			||||||
					<forward name="refreshParent" newEnabled="true" editEnabled="true" />
 | 
										<forward name="refreshParent" newEnabled="true" editEnabled="true" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -88,6 +88,7 @@
 | 
				
			||||||
 asnDetail.lotInfo.propC3,
 | 
					 asnDetail.lotInfo.propC3,
 | 
				
			||||||
  asnDetail.lotInfo.propC6,
 | 
					  asnDetail.lotInfo.propC6,
 | 
				
			||||||
  asnDetail.lotInfo.propC7,
 | 
					  asnDetail.lotInfo.propC7,
 | 
				
			||||||
 | 
					  ad.lotInfo.propLC5,
 | 
				
			||||||
 asnDetail.description
 | 
					 asnDetail.description
 | 
				
			||||||
 FROM ASNDetail asnDetail
 | 
					 FROM ASNDetail asnDetail
 | 
				
			||||||
 left join asnDetail.item item 
 | 
					 left join asnDetail.item item 
 | 
				
			||||||
| 
						 | 
					@ -120,6 +121,7 @@
 | 
				
			||||||
				<column id="asnDetail.lotInfo.propC3" width="120" title="特殊标记" visible="true" horizonAlign="center" />
 | 
									<column id="asnDetail.lotInfo.propC3" width="120" title="特殊标记" visible="true" horizonAlign="center" />
 | 
				
			||||||
				<column id="asnDetail.lotInfo.propC6" width="120" title="工号" visible="true" horizonAlign="center" />
 | 
									<column id="asnDetail.lotInfo.propC6" width="120" title="工号" visible="true" horizonAlign="center" />
 | 
				
			||||||
				<column id="asnDetail.lotInfo.propC7" width="120" title="申请人" visible="true" horizonAlign="center" />
 | 
									<column id="asnDetail.lotInfo.propC7" width="120" title="申请人" visible="true" horizonAlign="center" />
 | 
				
			||||||
 | 
									<column id="asnDetail.lotInfo.propLC5" width="120" title="用途" visible="true" horizonAlign="center" />
 | 
				
			||||||
				<column id="asnDetail.description" width="220" title="备注" visible="true" horizonAlign="center" />
 | 
									<column id="asnDetail.description" width="220" title="备注" visible="true" horizonAlign="center" />
 | 
				
			||||||
			</columns>
 | 
								</columns>
 | 
				
			||||||
			<buttons>
 | 
								<buttons>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,7 @@
 | 
				
			||||||
         	<value>jdbc:sqlserver://192.168.2.88:1433;DatabaseName=zwlgtest</value>
 | 
					         	<value>jdbc:sqlserver://192.168.2.88:1433;DatabaseName=zwlgtest</value>
 | 
				
			||||||
<!-- 	正式环境地址 -->
 | 
					<!-- 	正式环境地址 -->
 | 
				
			||||||
<!-- 				<value>jdbc:sqlserver://10.1.96.105:1433;DatabaseName=LD_WMSDB</value> -->
 | 
					<!-- 				<value>jdbc:sqlserver://10.1.96.105:1433;DatabaseName=LD_WMSDB</value> -->
 | 
				
			||||||
        	<!-- <value>jdbc:sqlserver://47.103.100.52:1433;DatabaseName=zwtest</value> -->
 | 
					<!--         	<value>jdbc:sqlserver://47.103.100.52:1433;DatabaseName=zwlgtest</value> -->
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="username">
 | 
					        <property name="username">
 | 
				
			||||||
<!--          <value>WMSDB</value> -->
 | 
					<!--          <value>WMSDB</value> -->
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue