姚提交

main
userName 2024-12-23 14:23:04 +08:00
parent d694e3c161
commit 69cf80ef94
14 changed files with 139 additions and 50 deletions

View File

@ -132,6 +132,21 @@ public class PostTest {
// e.printStackTrace();
// }
}
public synchronized void run() {
{
int count=1;
for (int i = 0; i < 5; i++) {
try {
System.out.println("线程名:"+Thread.currentThread().getName() + ":" + (count++));
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
static void tt(int y1,int c) {
int x=0;

View File

@ -53,6 +53,7 @@
<bean id="autoAutoBigTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="itemJobLauncher"/>
<property name="targetMethod" value="DefaultAutoBigTask"/>
<property name="concurrent" value="false" />
</bean>
<bean id="autoAutoBigTaskTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="autoAutoBigTask"/>
@ -65,6 +66,7 @@
<bean id="resendAgvTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="itemJobLauncher"/>
<property name="targetMethod" value="resendAgvTask"/>
<property name="concurrent" value="false" />
</bean>
<bean id="resendAgvTaskTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="resendAgvTask"/>
@ -180,6 +182,7 @@
<bean id="createSeedWall" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="pickTicketManager"/>
<property name="targetMethod" value="createSeedWallTask"/>
<property name="concurrent" value="false" />
</bean>
<bean id="createSeedWallTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="createSeedWall"/>
@ -218,6 +221,7 @@
<bean id="autoInLibraryTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="itemJobLauncher"/>
<property name="targetMethod" value="autoInLibraryTask"/>
<property name="concurrent" value="false" />
</bean>
<bean id="autoInLibraryTaskTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="autoInLibraryTask"/>

View File

@ -138,18 +138,24 @@ public class ItemJobLauncher implements ApplicationListener {
/**
*
*/
public void autoLibraryTask(){
public void autoLibraryTask(){
synchronized ("ltTaskOut") {
//按工作站循环下发
for(int y1=602;y1<=605;y1++) {
List<Long> ls21 = commonDao.findByQuery("select ltask.id from LibraryTask ltask where "
+ " ltask.status in('ATWORK','ATCALL') "
+ " and ltask.type in ('2','6','3') "
+" and ltask.toCellCode='"+y1+"'"
+ " order by ltask.relatedBill4 desc,ltask.seq asc,ltask.createDate asc");
if (ls21.size()>=3) {
continue;
}
// System.out.println("1------");
for(int y1=602;y1<=605;y1++) {
int gzd=0;
Boolean daup =false;
List<Long> ls21 = commonDao.findByQuery("select ltask.id from LibraryTask ltask where "
+ " ltask.status in('ATWORK','ATCALL') "
+ " and ltask.type in ('2','6','3') "
+" and ltask.toCellCode='"+y1+"'"
+ " order by ltask.relatedBill4 desc,ltask.seq asc,ltask.createDate asc");
// System.out.println("1------"+y1);
// System.out.println(y1+"zgz="+ls21.size());
gzd=ls21.size();
if (ls21.size()>=3) {
continue;
}else {
for(int y=1;y<=4;y++) {
/** 查询Y=巷道)是否有执行中的任务,是否跳出任务*/
List<Long> ls22 = commonDao.findByQuery("select ltask.id from LibraryTask ltask where "
@ -157,16 +163,30 @@ public class ItemJobLauncher implements ApplicationListener {
+ " and ltask.type in ('2','6','3') "
+" and ltask.relatedBill5='"+y+"'"
+ " order by ltask.seq asc");
// System.out.println("1------"+y1+"-----"+y);
// System.out.println(y+"hdtask="+ls22.size());
if (ls22.size()>0) {
continue;
}else {
List<LibraryTask> listTasks=moveDocManager.autoOutLibraryTask3(y,y1);//生成出库的移位任务,
moveDocManager.autoWcsLibraryTask(listTasks);//下发任务
List<LibraryTask> listTasks=moveDocManager.autoOutLibraryTask3(y,y1);//生成出库的移位任务,
moveDocManager.autoWcsLibraryTask(listTasks);//下发任务
// System.out.println("xiafarenw="+listTasks.size());
if(listTasks.size()>0) {
// System.out.println("1------"+y1+"-----"+y+"---2222");
gzd++;
if(gzd>=3) {//判定工作站任务是否大于三个,大于跳出工作站循环
daup=true;
}
break;
}
}
}
}
// if(daup) {
// System.out.println("1------"+y1+"--跳出---"+"---2222");
// break;
// }
}
// moveDocManager.autoLibraryTask();
// moveDocManager.autoInLibraryTask();

View File

@ -117,37 +117,23 @@ public class Item extends Entity {
/** 供应商 */
private Set<Structure> suppliers;
// *********新增属性***********
/** 大类 */
private String largeClass;//g助记号
/** 中类 */
private String centerClass;//g生产厂家
/** 小类 */
private String smallClass;//g物料分组
/** 最后盘点日期 */
private Date cycleDate;
protected String strExtend4;//发红规则-库存单位
protected String strExtend5;//是否条码管理-换算方向
private String storageType;//存储类型 g客户
private String department;//部门 gPLM名称
private Double CAcoefficient;//CA系数--装箱数量
private int bearTime=0;//禁收时限
private Location location;//补货库位--对象
private double HighestStock=0;//最高库存
private String barcode;//
private boolean beExtend1=false;//扩展1
private boolean beExtend2=false;//扩展2

View File

@ -277,7 +277,9 @@ public class ReceivedRecord extends Entity {
.append(receivedQuantity, castOther.getReceivedQuantity())
.append(packageUnit, castOther.getPackageUnit())
.append(occurTime, castOther.getOccurTime())
.append(operator, castOther.getOperator()).isEquals();
.append(operator, castOther.getOperator())
.append(barCode, castOther.getBarCode())
.append(warehouseArea, castOther.getWarehouseArea()).isEquals();
}
public int hashCode() {
return new HashCodeBuilder().append(asn).append("|")
@ -288,6 +290,8 @@ public class ReceivedRecord extends Entity {
.append(packageUnit).append("|")
.append(occurTime).append("|")
.append(operator).append("|")
.append(barCode).append("|")
.append(warehouseArea).append("|")
.toHashCode();
}

View File

@ -1709,7 +1709,7 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
throw new BusinessException("货架区有盘点任务,必须勾选");
}
//7#堆垛库
List<Stock> sts3=commonDao.findByQuery(" from Stock s where s.id in("+"select c.location.stock.id from CountRecord c "
List<Stock> sts3=commonDao.findByQuery(" from Stock s where s.id in(select c.location.stock.id from CountRecord c "
+ "where c.location.zone.id=1766 and c.countPlan.id="+countPlanId+") order by s.LP ");
List<String> zh2=new ArrayList() ;

View File

@ -2065,7 +2065,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
//到站的任务
StringBuffer sql=new StringBuffer();
sql.append("select STUFF((select ','+CONVERT(nvarchar(10),b.id) "
sql.append(" select STUFF((select ','+CONVERT(nvarchar(10),b.id) "
+ " from task b "
+ " left join LOCATION loc2 on loc2.id=b.SRC_LOC_ID "
+ " left join ITEM_KEY ik2 on ik2.id=b.ITEM_KEY_ID "

View File

@ -327,7 +327,7 @@ public interface MoveDocManager extends BaseManager {
void autoLibraryTask();
/** 定时生成下发立库出库任务*/
@Transactional
List<LibraryTask> autoOutLibraryTask3(int y,int y1);
List<LibraryTask> autoOutLibraryTask3(int y,int y1);
/** 定时生成下发立库出库任务*/
@Transactional

View File

@ -1194,7 +1194,7 @@ public void addASNDetail(Long id,ASNDetail asnDetail) {
System.out.println(record.getId());
// 直接收货上架的记录不再加入上架计划明细A
if (!LocationType.RECEIVE.equals(record.getLocation().getType())||
record.getWarehouseArea().getId()==1766L) {
record.getWarehouseArea().getId()==1766) {
continue;
}
double qty = record.getReceivedQuantity() ;

View File

@ -2135,7 +2135,7 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
commonDao.store(l);
// commonDao.store(st1);
interfaceManager.storeInterfaceLog("搬运指令", "http", "wms-立库", "library", st1.getLP(),
interfaceManager.storeInterfaceLog("搬运指令", t1.getId()+st1.getLP(), "wms-立库", "library", st1.getLP(),
interfaceReqManager.jsonLibrayTask(t1));
if (relationCode==null) {
relationCode=t1.getId()+"";
@ -2143,7 +2143,7 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
// 2 入库深位
LibraryTask t2 = interfaceReqManager.storeLibraryTask(LibraryTaskType.byzl, libraryTaskType,
st.getLP(), ssk, lq1.getName(), relationCode, seq++, null,classification,"1");
interfaceManager.storeInterfaceLog("搬运指令", "http", "wms-立库", "library", st.getLP(),
interfaceManager.storeInterfaceLog("搬运指令", t2.getId()+st.getLP(), "wms-立库", "library", st.getLP(),
interfaceReqManager.jsonLibrayTask(t2));
l.setStatus(WarehouseAreaStatus.OCCUPY);
commonDao.store(l);
@ -3822,7 +3822,8 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
/** 查询当前库位组对应的任务*/
private LibraryTask findLibraryTaskFor1(LocationStorage ls) {
LibraryTask lt=null;
List<LocationStorage> lsw = this.commonDao.findByQuery(" from LocationStorage ls where relevanceCode='"+ls.getRelevanceCode()+"'");
List<LocationStorage> lsw = this.commonDao.findByQuery(" from LocationStorage ls where relevanceCode='"+ls.getRelevanceCode()+"'"
+ " ");
//查询此库位组的相关任务
if(lsw.size()>1) {
List<LibraryTask> lts = this.commonDao.findByQuery("from LibraryTask t where t.status in ("+STATUS.lk_yxz+") "
@ -5313,7 +5314,7 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
}
}
public List<LibraryTask> autoOutLibraryTask3(int y,int y1){
public synchronized List<LibraryTask> autoOutLibraryTask3(int y,int y1){
//任务组;
List<LibraryTask> listTasks=new ArrayList<LibraryTask>();
@ -5321,12 +5322,13 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
boolean xh=false;
//出库任务按巷道下发,每个巷道只有一个任务执行
//查询移库和出库的任务
// List<LibraryTaskView1> libraryTaskView1s = commonDao.findByQuery(" from LibraryTaskView1 ltask where ltask.agvZone='"+y+"'"
// + " and ltask.classification not in('入空托','入库') and ltask.toCellCode='"+y1+"'"
// + " order by ltask.relatedBill4 desc,ltask.relationCode asc ");
// for (LibraryTaskView1 libraryTaskView1 : libraryTaskView1s) {
//查询关联任务
//查询移库和出库的任务
List<LibraryTask> libraryTasks = commonDao.findByQuery(" from LibraryTask ltask where "
+ " ltask.status='"+STATUS.UNAUDITED+"' and ltask.relatedBill5='"+y+"' "
// + " and ltask.relationCode='"+libraryTaskView1.getRelationCode()+"'"
@ -5339,16 +5341,24 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
List<Stock> sls= commonDao.findByQuery(" From Stock s where s.LP='"+libraryTask.getBarcode()+"' ");
//查询出库任务起点
List<LocationStorage> locst=commonDao.findByQuery(" from LocationStorage l where l.code='"+libraryTask.getFromCellCode()+"'"
+ " and l.warehouseArea.id=1766 ");
if(locst.size()>0) {
LocationStorage lsa=locst.get(0);
// List<LocationStorage> locst=commonDao.findByQuery(" from LocationStorage l where l.code='"+libraryTask.getFromCellCode()+"'"
// + " and l.warehouseArea.id=1766 ");
// if(locst.size()>0) {
// LocationStorage lsa=locst.get(0);
LocationStorage lssds=null;//出库托盘的浅位单浅位点位
if(sls.size()>0&&sls.get(0).getLocationStorage()!=null) {
Stock st=sls.get(0);
//出库托盘起点
LocationStorage lsa = commonDao.load(LocationStorage.class, st.getLocationStorage().getId());
//起点是深位时,查询浅位是否有任务。有任务调整该出库任务。
if(lsa.getSqType()!=null&&lsa.getSqType().equals("2")) {
List<LocationStorage> locsttwo=commonDao.findByQuery(" from LocationStorage l where l.relevanceCode='"+lsa.getRelevanceCode()+"'"
+ " and l.warehouseArea.id=1766 and l.sqType='1' ");
if(locsttwo.size()>0) {
LocationStorage lsatwo=locsttwo.get(0);
lssds=locsttwo.get(0);
List<Long> listlict=commonDao.findByQuery("select l.id from LibraryTask l where l.toCellCode='"+lsatwo.getCode()+"'"
+ " and l.status in('ATCALL','ATWORK')");
if(listlict.size()>0) {
@ -5411,12 +5421,15 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
// //托盘点位是深位,检查浅位是否有东西。
//获取当前任务组
LibraryTask ltz = findLibraryTaskFor1(ls1);
String relationCode=null;
int seq=1;
if (ltz!=null) {
seq=ltz.getSeq()+1;
relationCode=ltz.getRelationCode();
}
// 判断浅位有没有托盘
List<Stock> sts1 = this.commonDao
.findByQuery("from Stock s where s.locationStorage.sqType=1 and s.locationStorage.relevanceCode='"
@ -5426,9 +5439,19 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
Stock qws = sts1.get(0);
LocationStorage qwl = qws.getLocationStorage();
// 判断浅位托盘有没有任务
List<LibraryTask> lts = this.commonDao.findByQuery("from LibraryTask t where t.status in ("+STATUS.lk_yxz+") "
List<LibraryTask> lts = this.commonDao.findByQuery("from LibraryTask t where t.status in ("+STATUS.lk_yxz2+") "
+ " and t.fromCellCode='" + qwl.getName() + "'");
if (lts.size() > 0) {
LibraryTask tlstwo=lts.get(0);
if(tlstwo.getStatus().equals("NONCHECKED")) {
listTasks.add(tlstwo);
libraryTask.setSeq(tlstwo.getSeq()+1);
libraryTask.setRelationCode(tlstwo.getRelationCode());//
commonDao.store(libraryTask);
listTasks.add(libraryTask);
xh=true;
break;
}else {
//查询浅位任务是否有关联任务
List<LibraryTask> lts1 = this.commonDao.findByQuery("from LibraryTask t where "
+ " and t.relationCode='" + lts.get(0).getRelationCode() + "' order by t.seq desc ");
@ -5439,8 +5462,7 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
listTasks.add(libraryTask);
xh=true;
break;
}
}
} else {
@ -5474,10 +5496,13 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
Stock qws3 = sts3.get(0);
LocationStorage qwl3 = qws3.getLocationStorage();
// 判断浅位托盘有没有任务
List<LibraryTask> lts3 = this.commonDao.findByQuery("from LibraryTask t where t.status in ("+STATUS.lk_yxz+") "
List<LibraryTask> lts3 = this.commonDao.findByQuery("from LibraryTask t where t.status in ("+STATUS.lk_yxz2+") "
+ " and t.fromCellCode='" + qwl3.getName() + "'");
if (lts3.size() > 0) {
LibraryTask ttt1=lts3.get(0);
if(ttt1.getStatus().equals("NONCHECKED")) {
listTasks.add(ttt1);
}
//浅位托盘有任务
LibraryTask t1 = interfaceReqManager.storeLibraryTask(LibraryTaskType.byzl,
LibraryTaskType.yk, qws.getLP(), qwl.getName(), lq2.getName(), libraryTask.getId()+"", seq++,
@ -5577,7 +5602,7 @@ public class DefaultMoveDocManager extends DefaultBaseManager implements MoveDoc
return listTasks;
}
//下发WCS立库任务
public void autoWcsLibraryTask(List<LibraryTask> listTasks) {
public synchronized void autoWcsLibraryTask(List<LibraryTask> listTasks) {
for(LibraryTask slt:listTasks) {
if(slt.getStatus().equals(STATUS.UNAUDITED)) {
boolean flag2 = agvTaskManager.sendLibraryTask(slt);//下发任务

View File

@ -0,0 +1,8 @@
package com.dev.swms.server.service.shipping;
import com.dev.energy.server.service.BaseManager;
public interface NewWellentManager extends BaseManager {
}

View File

@ -0,0 +1,11 @@
package com.dev.swms.server.service.shipping.pojo;
import com.dev.energy.server.service.pojo.DefaultBaseManager;
import com.dev.swms.server.service.shipping.NewWellentManager;
public class DefaultNewWellentManager extends DefaultBaseManager implements NewWellentManager{
}

View File

@ -204,7 +204,7 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
/*
* (non-Javadoc)
*
* DefaultNewWellentManager
* @see
* com.dev.swms.server.service.shipping.PickTicketManager#storePickTicket(com.
* dev.swms.server.model.shipping.PickTicket)
@ -9604,7 +9604,8 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
if(stloc.getStock()!=null) {
String hqlsh=" select t.id from Task t where t.planQuantity>0 and "
+ " t.dateBill3 is not null and t.dstLoc.stock.id= "+stloc.getStock().getId()+""
+ " and t.inventoryStatus in('已出库','已合单','合单完成') ";
+ " and t.inventoryStatus in('已出库','已合单','合单完成') "
+ " and t.dstLoc.zone.id<>1787 ";
countTasks=commonDao.findByQuery(hqlsh);
}else {
jdwz="X";
@ -9637,7 +9638,8 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
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+")"
+ " and t.inventoryStatus in('已出库','已合单','合单完成') and t.planQuantity>0 ";
+ " and t.inventoryStatus in('已出库','已合单','合单完成') and t.planQuantity>0 "
+ " and t.dstLoc.zone.id<>1787 ";
List<String> tysids=commonDao.findByQuery(tys);
if(tysids.size()>0) {
throw new BusinessException(tysids.get(0)+"容器有其它任务");

View File

@ -452,6 +452,20 @@
</commit>
<popup id="pickConfirm212" title="其它出库打印A4" enableType="single" invisible="false" containId="true" pageId="editTaskPrintA4Page">
</popup>
<commit id="addtask" title="获取拣货任务" enableType="multi" invisible="false" confirmMessage="确认生成AGV">
<enableExpression><![CDATA[(${t.movedQuantityMU} ==0 ) ]]></enableExpression>
<mappings>
<mapping id="ids" className="list" />
</mappings>
<actions>
<action managerName="pickTicketManager" methodName="addSeedWallTask"
parameter="ids" />
</actions>
<forwards>
<forward name="refreshWindow" newEnabled="true"
editEnabled="true" />
</forwards>
</commit>
</buttons>
</maintainPage>
</pages>