Commit 2821bcf3 sunke

执行需求单时记录所有delay需求单

到达必须出库时间时记录所有delay需求单
需求单完成时,记录时间
暂停入库时,对包装仓例外
总库位包含被禁用库位
1 个父辈 5789fbf3
package com.myproject.bean.qisda;
import java.util.Date;
/**
* 事件信息
* Created by sunke on 2021/4/20.
*/
public class EventItem {
public static EventItem newEvent(String msg){
EventItem item = new EventItem();
item.msg = msg;
return item;
}
/**
* 事件时间
*/
private Date date = new Date();
/**
* 事件消息
*/
private String msg;
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
...@@ -268,8 +268,8 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -268,8 +268,8 @@ public class StoragePosManagerImpl implements IStoragePosManager {
@Override @Override
public List<StoragePos> findNotEmptyByStorageId(String storageId){ public List<StoragePos> findNotEmptyByStorageId(String storageId){
Criteria c = Criteria.where("barcode").exists(true) Criteria c = Criteria.where("barcode").exists(true);
.and("enabled").is(true);//可用; //.and("enabled").is(true);//可用;
if(!Strings.isNullOrEmpty(storageId)){ if(!Strings.isNullOrEmpty(storageId)){
c = c.and("storageId").is(storageId); c = c.and("storageId").is(storageId);
} }
......
...@@ -69,6 +69,8 @@ public class PLATE_SIZE { ...@@ -69,6 +69,8 @@ public class PLATE_SIZE {
* 用于统计料仓使用情况 * 用于统计料仓使用情况
*/ */
private boolean used = false; private boolean used = false;
private boolean enabled = false;
/** /**
* 尺寸(几寸盘) * 尺寸(几寸盘)
*/ */
...@@ -102,6 +104,14 @@ public class PLATE_SIZE { ...@@ -102,6 +104,14 @@ public class PLATE_SIZE {
this.used = used; this.used = used;
} }
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getSizeStr(){ public String getSizeStr(){
return w + "x" + h; return w + "x" + h;
} }
......
...@@ -214,7 +214,7 @@ public class OutInfoCache { ...@@ -214,7 +214,7 @@ public class OutInfoCache {
//补料,检查是否是同一个工单未解绑的料架 //补料,检查是否是同一个工单未解绑的料架
//boolean preTailCanOut = isPreTailCanOut(firstOutInfoToExecute.getSoseq(),lineHasBindShelf); //boolean preTailCanOut = isPreTailCanOut(firstOutInfoToExecute.getSoseq(),lineHasBindShelf);
if(shelfCountToLine > 0){ if(shelfCountToLine > 0){
log.info("补料需求单["+firstOutInfoToExecute.gethSerial()+"]对应产线可放料架["+shelfCountToLine+"],可以进行出库"); log.info("补料需求单["+firstOutInfoToExecute.gethSerial()+"]对应产线可放料架["+shelfCountToLine+"],可以进行出库:"+lineHasBindShelf);
outInfoToExecute = firstOutInfoToExecute; outInfoToExecute = firstOutInfoToExecute;
firstOutInfoToExecute.setLineBindShelfInfo(""); firstOutInfoToExecute.setLineBindShelfInfo("");
outInfoMap.put(firstOutInfoToExecute.gethSerial(), firstOutInfoToExecute); outInfoMap.put(firstOutInfoToExecute.gethSerial(), firstOutInfoToExecute);
...@@ -611,13 +611,34 @@ public class OutInfoCache { ...@@ -611,13 +611,34 @@ public class OutInfoCache {
} }
/**
* 获取超过必须时间未执行的需求单
*/
public String getTimeOutOutInfos(){
List<OutInfo> cachedOutInfos = getCachedOutInfos();
List<String> timeOutHSerialList = new ArrayList<>();
Date now = new Date();
for (OutInfo cachedOutInfo : cachedOutInfos) {
if(cachedOutInfo.isFirstReelAction() || cachedOutInfo.isTailAction()){
if(cachedOutInfo.getMdate().before(now)){
//已经超时未执行过
timeOutHSerialList.add(cachedOutInfo.gethSerial());
}
}
}
if(timeOutHSerialList.isEmpty()){
return "";
}
return String.join(",",timeOutHSerialList);
}
/** /**
* 获取缓存的需求单信息 * 获取缓存的需求单信息
*/ */
public List<OutInfo> getCachedOutInfos(){ public List<OutInfo> getCachedOutInfos(){
List<OutInfo> outInfoList = Lists.newArrayList(); List<OutInfo> outInfoList = Lists.newArrayList();
long now = System.currentTimeMillis();
for (OutInfo outInfo : outInfoMap.values()) { for (OutInfo outInfo : outInfoMap.values()) {
if(outInfo.isClosed() /*|| outInfo.isSendEnd()*/){ if(outInfo.isClosed() /*|| outInfo.isSendEnd()*/){
removeFromCache(outInfo.gethSerial()); removeFromCache(outInfo.gethSerial());
...@@ -867,9 +888,13 @@ public class OutInfoCache { ...@@ -867,9 +888,13 @@ public class OutInfoCache {
List<String> usedRfidList = InquiryShelfBean.getUsedRfidList(outInfo.gethSerial()); List<String> usedRfidList = InquiryShelfBean.getUsedRfidList(outInfo.gethSerial());
QisdaCache.updateUsedRfid(usedRfidList); QisdaCache.updateUsedRfid(usedRfidList);
log.info("更新需求单["+outInfo.gethSerial()+"]使用过的料架:" + String.join("," + usedRfidList)); log.info("更新需求单["+outInfo.gethSerial()+"]使用过的料架:" + String.join("," + usedRfidList));
} }
} }
String eventMsg = "任务结束";
outInfo = addEventItem(outInfo, eventMsg);
InquiryShelfBean.clearShelf(outInfo.gethSerial()); InquiryShelfBean.clearShelf(outInfo.gethSerial());
outInfo.setTaskEndTime(System.currentTimeMillis()); outInfo.setTaskEndTime(System.currentTimeMillis());
...@@ -924,6 +949,12 @@ public class OutInfoCache { ...@@ -924,6 +949,12 @@ public class OutInfoCache {
needToWaitQueue = true; needToWaitQueue = true;
}else if(mustDate.before(now)){ }else if(mustDate.before(now)){
needToWaitQueue = true; needToWaitQueue = true;
String timeOutHSerial = getTimeOutOutInfos();
String eventMsg = "到达必须出仓时间";
if(!timeOutHSerial.isEmpty()){
eventMsg = eventMsg + ",未完成需求单: " + timeOutHSerial;
}
outInfo = addEventItem(outInfo, eventMsg);
} }
if(needToWaitQueue){ if(needToWaitQueue){
log.info("需求单hSerial=["+outInfo.gethSerial()+"]加入到优先执行队列中"); log.info("需求单hSerial=["+outInfo.gethSerial()+"]加入到优先执行队列中");
...@@ -1153,7 +1184,14 @@ public class OutInfoCache { ...@@ -1153,7 +1184,14 @@ public class OutInfoCache {
} }
String eventMsg = "开始执行"; String eventMsg = "开始执行";
if(outInfo.isFirstReelAction() || outInfo.isTailAction()){
String timeOutHSerial = getTimeOutOutInfos();
if(!timeOutHSerial.isEmpty()){
eventMsg = eventMsg + ",未完成需求单: " + timeOutHSerial;
}
}
outInfo = addEventItem(outInfo, eventMsg); outInfo = addEventItem(outInfo, eventMsg);
String msg = ""; String msg = "";
int outReelNum = tasks.size(); int outReelNum = tasks.size();
if(outReelNum > 0){ if(outReelNum > 0){
......
...@@ -319,8 +319,8 @@ public class BoxChartController extends BaseController { ...@@ -319,8 +319,8 @@ public class BoxChartController extends BaseController {
@ResponseBody @ResponseBody
public boolean cancelTask(HttpServletRequest request) throws Exception{ public boolean cancelTask(HttpServletRequest request) throws Exception{
String taskId = request.getParameter("tid"); String taskId = request.getParameter("tid");
boolean prohibitePos = true;
return taskService.cancelTask(taskId); return taskService.cancelTask(taskId,prohibitePos);
} }
@RequestMapping(value="/service/store/hideTask",method= RequestMethod.POST) @RequestMapping(value="/service/store/hideTask",method= RequestMethod.POST)
......
...@@ -27,7 +27,7 @@ public interface ITaskService { ...@@ -27,7 +27,7 @@ public interface ITaskService {
/** /**
* 取消单个任务 * 取消单个任务
*/ */
boolean cancelTask(String taskId); // boolean cancelTask(String taskId);
/** /**
* 工单出库 * 工单出库
...@@ -73,6 +73,11 @@ public interface ITaskService { ...@@ -73,6 +73,11 @@ public interface ITaskService {
//void checkOutInaction(String areaId, int day) throws ValidateException; //void checkOutInaction(String areaId, int day) throws ValidateException;
/**
* 取消单个任务
*/
boolean cancelTask(String taskId, boolean prohibitePos);
boolean hideTask(String taskId, boolean prohibitePos); boolean hideTask(String taskId, boolean prohibitePos);
Collection<String> excludePosIds(); Collection<String> excludePosIds();
......
...@@ -652,12 +652,14 @@ public class QisdaDeviceController extends BaseController { ...@@ -652,12 +652,14 @@ public class QisdaDeviceController extends BaseController {
@ResponseBody @ResponseBody
public ResultBean cancelPutInTask(HttpServletRequest request) { public ResultBean cancelPutInTask(HttpServletRequest request) {
String codeStr = request.getParameter("barcode"); String codeStr = request.getParameter("barcode");
String disablePos = request.getParameter("disablePos");
try{ try{
Collection<DataLog> tasks = taskService.getAllTasks(); Collection<DataLog> tasks = taskService.getAllTasks();
for (DataLog task : tasks) { for (DataLog task : tasks) {
if(codeStr.contains(task.getBarcode())){ if(codeStr.contains(task.getBarcode())){
if(task.isPutInTask()){ if(task.isPutInTask()){
boolean cancelResult = taskService.cancelTask(task.getId()); boolean prohibitePos = Boolean.valueOf(disablePos);
boolean cancelResult = taskService.cancelTask(task.getId(),prohibitePos);
log.info("客户端取消["+codeStr+"]的入库任务结果:" + cancelResult); log.info("客户端取消["+codeStr+"]的入库任务结果:" + cancelResult);
return ResultBean.newOkResult(cancelResult); return ResultBean.newOkResult(cancelResult);
} }
...@@ -688,11 +690,12 @@ public class QisdaDeviceController extends BaseController { ...@@ -688,11 +690,12 @@ public class QisdaDeviceController extends BaseController {
if(task.isCheckOutTask()){ if(task.isCheckOutTask()){
if(task.isWait() || task.isExecuting()){ if(task.isWait() || task.isExecuting()){
//未执行完成的,理论上不会从客户端取消 //未执行完成的,理论上不会从客户端取消
boolean cancelResult = taskService.cancelTask(task.getId()); boolean prohibitePos = true;
boolean cancelResult = taskService.cancelTask(task.getId(),prohibitePos);
log.info("客户端取消["+codeStr+"]的未执行完成的出库任务结果:" + cancelResult); log.info("客户端取消["+codeStr+"]的未执行完成的出库任务结果:" + cancelResult);
return ResultBean.newOkResult(cancelResult); return ResultBean.newOkResult(cancelResult);
}else{ }else{
//禁用库位 //(空出)禁用库位
boolean prohibitePos = true; boolean prohibitePos = true;
boolean hideResult = taskService.hideTask(task.getId(),prohibitePos); boolean hideResult = taskService.hideTask(task.getId(),prohibitePos);
log.info("客户端取消["+codeStr+"]已完成的出库任务结果:" + hideResult); log.info("客户端取消["+codeStr+"]已完成的出库任务结果:" + hideResult);
...@@ -1456,6 +1459,15 @@ public class QisdaDeviceController extends BaseController { ...@@ -1456,6 +1459,15 @@ public class QisdaDeviceController extends BaseController {
} }
/** /**
* 查找VMI包装料架目的地
* @return
*/
// private String findAShelfStorage(){
// List<DataLog> allTasks = taskService.getAllTasks();
//
// }
/**
* 点料机解析条码,用于获取料盘尺寸 * 点料机解析条码,用于获取料盘尺寸
*/ */
@RequestMapping("/resolveCode") @RequestMapping("/resolveCode")
......
...@@ -7,7 +7,9 @@ import com.google.common.collect.Maps; ...@@ -7,7 +7,9 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.myproject.bean.CodeBean; import com.myproject.bean.CodeBean;
import com.myproject.bean.json.*; import com.myproject.bean.json.*;
import com.myproject.bean.qisda.InquiryShelfBean;
import com.myproject.bean.qisda.ReelLockPosInfo; import com.myproject.bean.qisda.ReelLockPosInfo;
import com.myproject.bean.qisda.ShelfInfo;
import com.myproject.bean.search.PageList; import com.myproject.bean.search.PageList;
import com.myproject.bean.update.*; import com.myproject.bean.update.*;
import com.myproject.bean.utils.BoxStatusBean; import com.myproject.bean.utils.BoxStatusBean;
...@@ -561,12 +563,15 @@ public class StorageDataController extends BaseController { ...@@ -561,12 +563,15 @@ public class StorageDataController extends BaseController {
log.info("流水线["+cids+"]获取["+rfid+"]["+code+"]的入库库位"); log.info("流水线["+cids+"]获取["+rfid+"]["+code+"]的入库库位");
Map<String,Object> resultMap = Maps.newHashMap(); Map<String,Object> resultMap = Maps.newHashMap();
//暂停入库时,包装料架例外,包装仓通过AGV不拉VMI线入库料架控制
if(dataCache.getSettings().isStopIn()){ if(dataCache.getSettings().isStopIn()){
if(!StorageConstants.SHEFL_TYPE.isAShelf(rfid)){
lineMsg = "系统已暂停入库"; lineMsg = "系统已暂停入库";
resultMap.put("result","100"); resultMap.put("result","100");
resultMap.put("msg",lineMsg); resultMap.put("msg",lineMsg);
return resultMap; return resultMap;
} }
}
String okMsg = ""; String okMsg = "";
String errorMsg = ""; String errorMsg = "";
......
...@@ -725,7 +725,7 @@ public class TaskService implements ITaskService { ...@@ -725,7 +725,7 @@ public class TaskService implements ITaskService {
} }
private boolean cancelTask(DataLog task){ private boolean cancelTask(DataLog task,boolean prohibitePos){
if(task != null){ if(task != null){
//从正在执行和等待列表中移除 //从正在执行和等待列表中移除
taskMap.remove(task.getId()); taskMap.remove(task.getId());
...@@ -755,6 +755,7 @@ public class TaskService implements ITaskService { ...@@ -755,6 +755,7 @@ public class TaskService implements ITaskService {
} }
}else{ }else{
//入库任务取消时,将库位置为不可用 //入库任务取消时,将库位置为不可用
if(prohibitePos){
log.info("库位["+task.getPosName()+"]料盘["+task.getBarcode()+"]入库任务取消,禁用库位,解除料盘锁定"); log.info("库位["+task.getPosName()+"]料盘["+task.getBarcode()+"]入库任务取消,禁用库位,解除料盘锁定");
try { try {
StoragePos pos = storagePosManager.get(task.getPosId()); StoragePos pos = storagePosManager.get(task.getPosId());
...@@ -762,27 +763,29 @@ public class TaskService implements ITaskService { ...@@ -762,27 +763,29 @@ public class TaskService implements ITaskService {
storagePosManager.save(pos); storagePosManager.save(pos);
Storage storage = dataCache.getStorage(task.getCid()); Storage storage = dataCache.getStorage(task.getCid());
dataCache.reloadStorage(storage); dataCache.reloadStorage(storage);
QisdaCache.removeReelLockPosInfo(task.getBarcode());
} catch (Exception e) { } catch (Exception e) {
log.error("入库任务取消时,禁用库位出错",e); log.error("入库任务取消时,禁用库位出错",e);
} }
} }
QisdaCache.removeReelLockPosInfo(task.getBarcode());
}
return true; return true;
} }
return false; return false;
} }
@Override @Override
public boolean cancelTask(String taskId) { public boolean cancelTask(String taskId, boolean prohibitePos) {
DataLog task = dataLogDao.findOneById(taskId); DataLog task = dataLogDao.findOneById(taskId);
if(task != null){ if(task != null){
String barcode = task.getBarcode(); String barcode = task.getBarcode();
if(Strings.isNullOrEmpty(barcode)){ if(Strings.isNullOrEmpty(barcode)){
cancelTask(task); cancelTask(task,prohibitePos);
}else{ }else{
List<DataLog> tasks = dataLogDao.findUnExecuteTasks(barcode, task.getType()); List<DataLog> tasks = dataLogDao.findUnExecuteTasks(barcode, task.getType());
for (DataLog dataLog : tasks) { for (DataLog dataLog : tasks) {
cancelTask(dataLog); cancelTask(dataLog,prohibitePos);
} }
} }
...@@ -1411,7 +1414,7 @@ public class TaskService implements ITaskService { ...@@ -1411,7 +1414,7 @@ public class TaskService implements ITaskService {
resultStatus = putInLine(storage, statusBean); resultStatus = putInLine(storage, statusBean);
}else { }else {
resultStatus.setMsg("系统已暂停入库"); resultStatus.setMsg("系统已暂停入库");
serverMsgs.put(cid,"系统已暂停入库"); serverMsgs.put(cid,"系统已暂停入库");
} }
}else { }else {
......
...@@ -12,6 +12,45 @@ ...@@ -12,6 +12,45 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<ul class="timeline"> <ul class="timeline">
<li class="timeline-purple">
<div class="timeline-time">
<span class="date">2021</span>
<span class="time">05-11</span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021051110</h2>
<div class="timeline-content">
<ul>
<li>记录dealy需求单时,将正在执行的需求单也记录下来</li>
<li>入库任务取消时,由客户端判断是否禁用库位</li>
</ul>
</div>
</div>
</li>
<li class="timeline-green">
<div class="timeline-time">
<span class="date">2021</span>
<span class="time">05-08</span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021050811</h2>
<div class="timeline-content">
<ul>
<li>执行需求单时记录所有delay需求单</li>
<li>到达必须出库时间时记录所有delay需求单</li>
<li>需求单完成时,记录时间</li>
<li>暂停入库时,对包装仓例外</li>
<li>总库位包含被禁用库位</li>
</ul>
</div>
</div>
</li>
<li class="timeline-blue"> <li class="timeline-blue">
<div class="timeline-time"> <div class="timeline-time">
<span class="date">2021 </span> <span class="date">2021 </span>
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
<div class="page-footer-inner"> <div class="page-footer-inner">
2016&copy; <a href="${ctx}/updateHistory.html">SMD BOX</a> 2016&copy; <a href="${ctx}/updateHistory.html">SMD BOX</a>
</div> </div>
<span class="right" style="color: #a3a3a3;">Version: 2021.05.06</span> <span class="right" style="color: #a3a3a3;">Version: 2021.05.11</span>
<div class="scroll-to-top"> <div class="scroll-to-top">
<i class="icon-arrow-up"></i> <i class="icon-arrow-up"></i>
</div> </div>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!