Merge remote-tracking branch 'origin/main'
						commit
						dfef3aecbc
					
				| 
						 | 
					@ -1,8 +1,16 @@
 | 
				
			||||||
package com.dev.swms.server.service.shipping;
 | 
					package com.dev.swms.server.service.shipping;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.dev.energy.server.service.BaseManager;
 | 
					import com.dev.energy.server.service.BaseManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public interface NewWaveManager extends BaseManager {
 | 
					public interface NewWaveManager extends BaseManager {
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
	
 | 
						 * 分配工作站
 | 
				
			||||||
 | 
						 * @param ids
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						@Transactional
 | 
				
			||||||
 | 
						 void allocateGZZ(List<Long> ids);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,77 @@
 | 
				
			||||||
package com.dev.swms.server.service.shipping.pojo;
 | 
					package com.dev.swms.server.service.shipping.pojo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import net.sf.json.JSONObject;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.hibernate.Query;
 | 
				
			||||||
 | 
					import org.hibernate.Session;
 | 
				
			||||||
 | 
					import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.dev.energy.server.service.pojo.DefaultBaseManager;
 | 
					import com.dev.energy.server.service.pojo.DefaultBaseManager;
 | 
				
			||||||
 | 
					import com.dev.swms.server.model.shipping.WaveDoc;
 | 
				
			||||||
import com.dev.swms.server.service.shipping.NewWaveManager;
 | 
					import com.dev.swms.server.service.shipping.NewWaveManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class DefaultNewWaveManager extends DefaultBaseManager implements NewWaveManager{
 | 
					import org.apache.log4j.Logger;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class DefaultNewWaveManager extends DefaultBaseManager implements NewWaveManager{
 | 
				
			||||||
 | 
						private static Logger logger = Logger.getLogger(DefaultNewWaveManager.class); 
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						public  void allocateGZZ(List<Long> ids){
 | 
				
			||||||
 | 
							for(Long id:ids){
 | 
				
			||||||
 | 
								WaveDoc waveDoc=commonDao.get(WaveDoc.class, id);
 | 
				
			||||||
 | 
								allocateGZZ(waveDoc.getCode(),null,null,null);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						public  void allocateGZZ(String waveDocCode,List<Long> lx_gzz_ids,List<Long> hj_gzz_ids,List<Long> lk_gzz_ids){
 | 
				
			||||||
 | 
							Session session = ((HibernateDaoSupport) this.commonDao).getSessionFactory().openSession();
 | 
				
			||||||
 | 
							try {	
 | 
				
			||||||
 | 
								String sql ="select STUFF((select ','+CONVERT(nvarchar(10),b.id) "
 | 
				
			||||||
 | 
											+"from task b "
 | 
				
			||||||
 | 
											+"left join PICK_TICKET_DETAIL ptd1 on ptd1.id=b.PICK_TICKET_DETAIL_ID   "
 | 
				
			||||||
 | 
											+"left join PICK_TICKET pt1 on pt1.id=ptd1.PICK_TICKET_ID "
 | 
				
			||||||
 | 
											+"left join LOCATION loc2 on loc2.id=b.SRC_LOC_ID "
 | 
				
			||||||
 | 
											+"left join ITEM_KEY ik2 on ik2.id=b.ITEM_KEY_ID "
 | 
				
			||||||
 | 
											+"left join item item2 on item2.id=ik2.ITEM_ID "
 | 
				
			||||||
 | 
											+"where 1=1 and b.BILLCODE=t.BILLCODE and pt1.BILL_TYPE_ID=1094  and loc2.id=loc.id  and item2.id=item.id "
 | 
				
			||||||
 | 
											//" and b.PLAN_QUANTITY_MU-b.MOVED_QUANTITY_MU>0 "+
 | 
				
			||||||
 | 
											+" for xml Path('')),1,1,'') as taskId,"
 | 
				
			||||||
 | 
											+ "item.code as liaohao  ,"
 | 
				
			||||||
 | 
											+ "max(z.NAME) as kuqu,"
 | 
				
			||||||
 | 
											+"sum(t.PLAN_QUANTITY_MU-t.MOVED_QUANTITY_MU) as jhsl,"
 | 
				
			||||||
 | 
											+ "MAX(s2.LP) as rqh ,"
 | 
				
			||||||
 | 
											+ "t.BILLCODE as zrwh,"
 | 
				
			||||||
 | 
											+ "MAX(pt.code) as gdh,"
 | 
				
			||||||
 | 
											+ "max(pt.RELATED_BILL3) as twl,"
 | 
				
			||||||
 | 
											+ "loc.code as kwh,"
 | 
				
			||||||
 | 
											+ "max(t.agv_Status) as rwzt,"
 | 
				
			||||||
 | 
											+"max(item.GOOD_TYPE) as wllx,"
 | 
				
			||||||
 | 
											+ "max(t.strBill8) as twlcfh "
 | 
				
			||||||
 | 
											+"from task t   "
 | 
				
			||||||
 | 
											+"left join PICK_TICKET_DETAIL ptd on ptd.id=t.PICK_TICKET_DETAIL_ID   "
 | 
				
			||||||
 | 
											+"left join PICK_TICKET pt on pt.id=ptd.PICK_TICKET_ID "   
 | 
				
			||||||
 | 
											+"left join LOCATION loc on loc.id=t.SRC_LOC_ID   "
 | 
				
			||||||
 | 
											+"left join ZONE z on z.id=loc.ZONE_ID   "
 | 
				
			||||||
 | 
											+"left join ITEM_KEY ik on ik.id=t.ITEM_KEY_ID  " 
 | 
				
			||||||
 | 
											+"left join ITEM item on item.id=ik.ITEM_ID "
 | 
				
			||||||
 | 
											+"left join STOCK s2 on s2.id=t.SRC_LP   "
 | 
				
			||||||
 | 
											+"left join STOCK s1 on s1.id=loc.stock "
 | 
				
			||||||
 | 
											+"left join WAVE_DOC wd on wd.id=t.WAVE_DOC_ID  "
 | 
				
			||||||
 | 
											+"where 1=1 and pt.BILL_TYPE_ID=1094 and wd.code='"+waveDocCode+"' and t.WAVE_DOC_ID is not null "
 | 
				
			||||||
 | 
											//+ " t.PLAN_QUANTITY_MU-t.MOVED_QUANTITY_MU>0 and t.agv_status=0 "
 | 
				
			||||||
 | 
											+"group by pt.code,t.BILLCODE,item.id,item.code,item.BE_MARK_WEIGHT,loc.id,loc.code,ik.PROP_C1,ik.PROP_C2,ik.PROP_C3,ik.PROP_D1,ik.PROP_D2,item.ISBOM "
 | 
				
			||||||
 | 
											+"order by min(t.skips ),max(loc.code) asc, item.id,pt.code,t.BILLCODE ";
 | 
				
			||||||
 | 
								logger.info(sql);
 | 
				
			||||||
 | 
								Query   query   =   session.createSQLQuery(sql); 
 | 
				
			||||||
 | 
								List<Object[]> list= (List<Object[]>)query.list();
 | 
				
			||||||
 | 
								System.out.println(list.size());
 | 
				
			||||||
 | 
							}catch (Exception e) {
 | 
				
			||||||
 | 
								session.close();
 | 
				
			||||||
 | 
							}finally {
 | 
				
			||||||
 | 
								session.close();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -616,6 +616,15 @@
 | 
				
			||||||
			</bean>
 | 
								</bean>
 | 
				
			||||||
		</property>
 | 
							</property>
 | 
				
			||||||
	</bean>
 | 
						</bean>
 | 
				
			||||||
 | 
							<bean id="newWaveManager" parent="abstractTransactionProxy">
 | 
				
			||||||
 | 
							<property name="target">
 | 
				
			||||||
 | 
								<bean
 | 
				
			||||||
 | 
									class="com.dev.swms.server.service.shipping.pojo.DefaultNewWaveManager"
 | 
				
			||||||
 | 
									parent="baseManager">
 | 
				
			||||||
 | 
									
 | 
				
			||||||
 | 
								</bean>
 | 
				
			||||||
 | 
							</property>
 | 
				
			||||||
 | 
						</bean>
 | 
				
			||||||
	<bean id="waveDocSortManager" parent="abstractTransactionProxy">
 | 
						<bean id="waveDocSortManager" parent="abstractTransactionProxy">
 | 
				
			||||||
		<property name="target">
 | 
							<property name="target">
 | 
				
			||||||
			<bean
 | 
								<bean
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -74,6 +74,19 @@
 | 
				
			||||||
			<column id="waveDoc.updateTime2" title="完成时间" visible="true" horizonAlign="center" verticalAlign="middle" format="dateTiemFormatter"/>
 | 
								<column id="waveDoc.updateTime2" title="完成时间" visible="true" horizonAlign="center" verticalAlign="middle" format="dateTiemFormatter"/>
 | 
				
			||||||
		</columns>
 | 
							</columns>
 | 
				
			||||||
		<buttons>
 | 
							<buttons>
 | 
				
			||||||
 | 
							<commit id="allocateGZZ" title="分配工作站" enableType="multi" invisible="false" >
 | 
				
			||||||
 | 
									<mappings>
 | 
				
			||||||
 | 
										<mapping id="ids" className="list" />
 | 
				
			||||||
 | 
									</mappings>
 | 
				
			||||||
 | 
									<actions>
 | 
				
			||||||
 | 
										<action managerName="newWaveManager" methodName="allocateGZZ"
 | 
				
			||||||
 | 
											parameter="ids" />
 | 
				
			||||||
 | 
									</actions>
 | 
				
			||||||
 | 
									<forwards>
 | 
				
			||||||
 | 
										<forward name="refreshWindow" newEnabled="true"
 | 
				
			||||||
 | 
											editEnabled="true" />
 | 
				
			||||||
 | 
									</forwards>
 | 
				
			||||||
 | 
								</commit>
 | 
				
			||||||
			<popup id="bkcb" title="创建波次" enableType="none" invisible="false" containId="false" pageId="editbkcbPage" />
 | 
								<popup id="bkcb" title="创建波次" enableType="none" invisible="false" containId="false" pageId="editbkcbPage" />
 | 
				
			||||||
			<popup id="issuedAgvTask" title="下发工作站任务" enableType="single" invisible="false"
 | 
								<popup id="issuedAgvTask" title="下发工作站任务" enableType="single" invisible="false"
 | 
				
			||||||
				containId="true" pageId="modifyIssuedAgvTaskPage" />
 | 
									containId="true" pageId="modifyIssuedAgvTaskPage" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue