状态过滤
parent
5781732ba8
commit
2d754b1ef8
|
|
@ -93,7 +93,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
// " and b.PLAN_QUANTITY_MU-b.MOVED_QUANTITY_MU>0 "+
|
// " and b.PLAN_QUANTITY_MU-b.MOVED_QUANTITY_MU>0 "+
|
||||||
+ " for xml Path('')),1,1,'') as taskId,"
|
+ " for xml Path('')),1,1,'') as taskId,"
|
||||||
+ "item.code as liaohao ,"
|
+ "item.code as liaohao ,"
|
||||||
+ "max(z.id) as kuqu,"
|
+ "max(z.id) as kuqu,"j
|
||||||
+ "max(t.END_REGION) as gzz,"
|
+ "max(t.END_REGION) as gzz,"
|
||||||
+ "sum(t.PLAN_QUANTITY_MU-t.MOVED_QUANTITY_MU) as jhsl,"
|
+ "sum(t.PLAN_QUANTITY_MU-t.MOVED_QUANTITY_MU) as jhsl,"
|
||||||
+ "MAX(s2.LP) as rqh ,"
|
+ "MAX(s2.LP) as rqh ,"
|
||||||
|
|
@ -115,11 +115,11 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
+ "left join STOCK s1 on s1.id=loc.stock "
|
+ "left join STOCK s1 on s1.id=loc.stock "
|
||||||
+ "left join WAVE_DOC wd on wd.id=t.WAVE_DOC_ID "
|
+ "left join WAVE_DOC wd on wd.id=t.WAVE_DOC_ID "
|
||||||
+ "where 1=1 and pt.BILL_TYPE_ID=1094 and wd.code='"
|
+ "where 1=1 and pt.BILL_TYPE_ID=1094 and wd.code='"
|
||||||
+ waveDocCode + "' and t.WAVE_DOC_ID is not null ";
|
+ waveDocCode + "' and t.WAVE_DOC_ID is not null and t.agv_status=0";
|
||||||
if (zone_id != null) {
|
if (zone_id != null) {
|
||||||
sql += " and z.id=" + zone_id;
|
sql += " and z.id=" + zone_id;
|
||||||
}
|
}
|
||||||
// " t.PLAN_QUANTITY_MU-t.MOVED_QUANTITY_MU>0 and t.agv_status=0 "
|
// sql += " and t.PLAN_QUANTITY_MU-t.MOVED_QUANTITY_MU>0 ";
|
||||||
sql += "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 "
|
sql += "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 ";
|
+ "order by min(t.skips ),max(loc.code) asc, item.id,pt.code,t.BILLCODE ";
|
||||||
logger.info(sql);
|
logger.info(sql);
|
||||||
|
|
@ -414,7 +414,6 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
logger.info("Code:"+gongZuoZhan.code+" notFinished:"+gongZuoZhan.notFinished+" maxRenWu:"+gongZuoZhan.maxRenWu+" isEnble:"+gongZuoZhan.isEnble);
|
logger.info("Code:"+gongZuoZhan.code+" notFinished:"+gongZuoZhan.notFinished+" maxRenWu:"+gongZuoZhan.maxRenWu+" isEnble:"+gongZuoZhan.isEnble);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (TwlFenZu twlFenZu : paixu) {
|
for (TwlFenZu twlFenZu : paixu) {
|
||||||
List<GongDanMingXi> list_show = twlFenZu.gdPaiXus; //当前头物料所有的工单组合,以及每个工单的物料明细
|
List<GongDanMingXi> list_show = twlFenZu.gdPaiXus; //当前头物料所有的工单组合,以及每个工单的物料明细
|
||||||
int this_fenzuCount=twlFenZu.wl_count; //当前分组总物料行数
|
int this_fenzuCount=twlFenZu.wl_count; //当前分组总物料行数
|
||||||
|
|
@ -425,7 +424,10 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
GongDanMingXi gongDanMingXi=list_show.get(index);
|
GongDanMingXi gongDanMingXi=list_show.get(index);
|
||||||
//当前工单的物料
|
//当前工单的物料
|
||||||
List<FenPei> list_wList=gongDanMingXi.list;
|
List<FenPei> list_wList=gongDanMingXi.list;
|
||||||
if(list_wList.size()+curr_gzz.notFinished+curr_gzz.renWuList.size()<=curr_gzz.maxRenWu+cfhs){
|
int chao=(list_wList.size()+curr_gzz.notFinished+curr_gzz.renWuList.size())-curr_gzz.maxRenWu;
|
||||||
|
logger.info(listGzz.size());
|
||||||
|
if(chao<=cfhs||index==list_show.size()-1){
|
||||||
|
logger.info("11=="+listGzz.get(gzz_index));
|
||||||
//如果当前待分配+此工作站未完成+已分配任务数 小于最大任务数 //将当前任务分配到此工作站
|
//如果当前待分配+此工作站未完成+已分配任务数 小于最大任务数 //将当前任务分配到此工作站
|
||||||
for (FenPei fenPei : list_wList) {
|
for (FenPei fenPei : list_wList) {
|
||||||
curr_gzz.renWuList.add(fenPei);
|
curr_gzz.renWuList.add(fenPei);
|
||||||
|
|
@ -435,6 +437,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
gzzMap.put(curr_gzz.code, curr_gzz);
|
gzzMap.put(curr_gzz.code, curr_gzz);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
logger.info("2=="+listGzz.get(gzz_index));
|
||||||
gzzMap.put(curr_gzz.code, curr_gzz);
|
gzzMap.put(curr_gzz.code, curr_gzz);
|
||||||
//如果当前待分配+此工作站未完成+已分配任务数 大于最大任务数 //将当前任务分配到下个工作站
|
//如果当前待分配+此工作站未完成+已分配任务数 大于最大任务数 //将当前任务分配到下个工作站
|
||||||
gzz_index=gzz_index+1;
|
gzz_index=gzz_index+1;
|
||||||
|
|
@ -468,6 +471,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
}
|
}
|
||||||
task.setBillCode(fenPei.gdh+"-"+lx+"-"+fenPei.chf_fz);
|
task.setBillCode(fenPei.gdh+"-"+lx+"-"+fenPei.chf_fz);
|
||||||
task.setEndRegion(gongZuoZhan.code);
|
task.setEndRegion(gongZuoZhan.code);
|
||||||
|
task.setAgvStatus(1);//下发
|
||||||
this.commonDao.store(task);
|
this.commonDao.store(task);
|
||||||
logger.info("one:"+task.getBillCode()+"---"+task.getEndRegion()+"--two:-"+task.getOldGzz()+"---"+task.getOldZrw()+"--three:-"+fenPei.gdh+"-"+fenPei.chf_fz+"-----"+gongZuoZhan.code);
|
logger.info("one:"+task.getBillCode()+"---"+task.getEndRegion()+"--two:-"+task.getOldGzz()+"---"+task.getOldZrw()+"--three:-"+fenPei.gdh+"-"+fenPei.chf_fz+"-----"+gongZuoZhan.code);
|
||||||
}
|
}
|
||||||
|
|
@ -744,24 +748,6 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
return list_new;
|
return list_new;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeToDb(List<FenPei> list_fenpei) {
|
|
||||||
for (FenPei fp : list_fenpei) {
|
|
||||||
String[] ids = fp.tsakId.split(",");
|
|
||||||
for (int i = 0; i <= ids.length; i++) {
|
|
||||||
Task task = this.commonDao.get(Task.class,
|
|
||||||
Long.parseLong(ids[i]));
|
|
||||||
// 保留原有信息字段做对比分析
|
|
||||||
if (task.getOldGzz() == null) {
|
|
||||||
task.setOldGzz(task.getEndRegion());
|
|
||||||
task.setOldZrw(task.getBillCode());
|
|
||||||
}
|
|
||||||
// 对分析后的数据进行赋值
|
|
||||||
task.setEndRegion(null);
|
|
||||||
task.setBillCode(null);
|
|
||||||
this.commonDao.store(task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TwlFenZu implements Comparable<TwlFenZu> {
|
class TwlFenZu implements Comparable<TwlFenZu> {
|
||||||
List<GongDanMingXi> gdPaiXus;
|
List<GongDanMingXi> gdPaiXus;
|
||||||
|
|
@ -943,14 +929,14 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
|
|
||||||
public List<Long> getGzzIds(Long zone_id) {
|
public List<Long> getGzzIds(Long zone_id) {
|
||||||
String hql = "select id from LocationStorage l where l.type='拣货' and l.warehouseArea.id="
|
String hql = "select id from LocationStorage l where l.type='拣货' and l.warehouseArea.id="
|
||||||
+ zone_id;// +" and l.beAuto=1";
|
+ zone_id +" and l.beAuto=1";
|
||||||
List<Long> ids = commonDao.findByQuery(hql);
|
List<Long> ids = commonDao.findByQuery(hql);
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getGzzCodes(Long zone_id) {
|
public List<String> getGzzCodes(Long zone_id) {
|
||||||
String hql = "select code from LocationStorage l where l.type='拣货' and l.warehouseArea.id="
|
String hql = "select code from LocationStorage l where l.type='拣货' and l.warehouseArea.id="
|
||||||
+ zone_id;// +" and l.beAuto=1";
|
+ zone_id+" and l.beAuto=1";
|
||||||
List<String> codes = commonDao.findByQuery(hql);
|
List<String> codes = commonDao.findByQuery(hql);
|
||||||
return codes;
|
return codes;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue