Commit 84b80eae sunke

增加totalBindNum(绑定料盘数)和totalTaskNum(累计出库任务),用于统计需求单料盘数量

大料出库顺序Bug修改
1 个父辈 69eb8af4
...@@ -24,6 +24,11 @@ public class OutInfo extends BaseMongoBean { ...@@ -24,6 +24,11 @@ public class OutInfo extends BaseMongoBean {
this.line = outItem.getLine(); this.line = outItem.getLine();
this.refno = outItem.getRefno(); this.refno = outItem.getRefno();
this.sdate = outItem.getSdate(); this.sdate = outItem.getSdate();
Date needOutDate = new Date();
if(this.sdate.after(needOutDate)){
needOutDate = this.sdate;
}
this.taskNeedOutDate = needOutDate;
this.mdate = outItem.getMdate(); this.mdate = outItem.getMdate();
} }
...@@ -67,6 +72,16 @@ public class OutInfo extends BaseMongoBean { ...@@ -67,6 +72,16 @@ public class OutInfo extends BaseMongoBean {
private int taskNum; private int taskNum;
/** /**
* 累计任务数量
*/
private int totalTaskNum;
/**
* 预估出库料盘数量
*/
private int totalBindNum;
/**
* 产线位置 * 产线位置
*/ */
private String line; private String line;
...@@ -101,6 +116,11 @@ public class OutInfo extends BaseMongoBean { ...@@ -101,6 +116,11 @@ public class OutInfo extends BaseMongoBean {
*/ */
private long taskEndTime; private long taskEndTime;
/**
* 需求单应该出库时间,通常为建议时间,当收到时间在建议时间之后,使用收到时间
*/
private Date taskNeedOutDate;
@Transient @Transient
private Map<String, OutItem> outItemMap = new HashMap<>(); private Map<String, OutItem> outItemMap = new HashMap<>();
...@@ -404,6 +424,14 @@ public class OutInfo extends BaseMongoBean { ...@@ -404,6 +424,14 @@ public class OutInfo extends BaseMongoBean {
return null; return null;
} }
public int getTotalTaskNum() {
return totalTaskNum;
}
public void setTotalTaskNum(int totalTaskNum) {
this.totalTaskNum = totalTaskNum;
}
public String getLine() { public String getLine() {
return line; return line;
} }
...@@ -412,6 +440,14 @@ public class OutInfo extends BaseMongoBean { ...@@ -412,6 +440,14 @@ public class OutInfo extends BaseMongoBean {
this.line = line; this.line = line;
} }
public int getTotalBindNum() {
return totalBindNum;
}
public void setTotalBindNum(int totalBindNum) {
this.totalBindNum = totalBindNum;
}
@Override @Override
public String toString() { public String toString() {
return "OutInfo{" + return "OutInfo{" +
......
...@@ -344,14 +344,19 @@ public class OutInfoCache { ...@@ -344,14 +344,19 @@ public class OutInfoCache {
* @param hSerial * @param hSerial
* @param outReelNum * @param outReelNum
* @param lessSend 是否是缺料补发 * @param lessSend 是否是缺料补发
* @param needAdd 是否需要累计
*/ */
public void resetTaskNum(String hSerial, int outReelNum, boolean lessSend){ public void resetTaskNum(String hSerial, int outReelNum, boolean lessSend, boolean needAdd){
OutInfo outInfo = getOutInfoFromCache(hSerial); OutInfo outInfo = getOutInfoFromCache(hSerial);
if(outInfo != null){ if(outInfo != null){
outInfo.setOutReelNum(0); outInfo.setOutReelNum(0);
outInfo.setTaskFinishNum(0); outInfo.setTaskFinishNum(0);
outInfo.setTaskNum(outReelNum); outInfo.setTaskNum(outReelNum);
if(outReelNum != 0){ if(outReelNum != 0){
if(needAdd){
int totalTaskNum = outInfo.getTotalTaskNum() + outReelNum;
outInfo.setTotalTaskNum(totalTaskNum);
}
outInfo.setSendStatus(StorageConstants.SEND_STATUS.EXECUTING); outInfo.setSendStatus(StorageConstants.SEND_STATUS.EXECUTING);
}else{ }else{
outInfo.setSendStatus(StorageConstants.SEND_STATUS.SEND_LESS); outInfo.setSendStatus(StorageConstants.SEND_STATUS.SEND_LESS);
...@@ -731,7 +736,8 @@ public class OutInfoCache { ...@@ -731,7 +736,8 @@ public class OutInfoCache {
for (DataLog itemTask : itemTasks) { for (DataLog itemTask : itemTasks) {
tasks.add(itemTask); tasks.add(itemTask);
} }
resetTaskNum(hSerial, tasks.size(),outInfoExecuted); boolean needAddToTotal = false;
resetTaskNum(hSerial, tasks.size(),outInfoExecuted,needAddToTotal);
updateOutItem(outItem.getId()); updateOutItem(outItem.getId());
} }
} }
...@@ -740,8 +746,8 @@ public class OutInfoCache { ...@@ -740,8 +746,8 @@ public class OutInfoCache {
int outReelNum = tasks.size(); int outReelNum = tasks.size();
if(outReelNum > 0){ if(outReelNum > 0){
log.info("需求单"+outInfo.gethSerial()+"已出("+outInfo.getOutReelNum()+")/已发("+outInfo.getTaskFinishNum()+") 本次出库料盘数量:" + outReelNum); log.info("需求单"+outInfo.gethSerial()+"已出("+outInfo.getOutReelNum()+")/已发("+outInfo.getTaskFinishNum()+") 本次出库料盘数量:" + outReelNum);
boolean needAddToTotal = true;
resetTaskNum(hSerial, outReelNum,outInfoExecuted); resetTaskNum(hSerial, outReelNum,outInfoExecuted,needAddToTotal);
//补料出库,且不是缺料重发,需要重新排序,按站位序号循环出,每次出最大的盘 //补料出库,且不是缺料重发,需要重新排序,按站位序号循环出,每次出最大的盘
if(outInfo.isTailAction() && !outInfoExecuted){ if(outInfo.isTailAction() && !outInfoExecuted){
......
...@@ -43,10 +43,10 @@ public class ChartController extends BaseController{ ...@@ -43,10 +43,10 @@ public class ChartController extends BaseController{
public String showChart(HttpServletRequest request) { public String showChart(HttpServletRequest request) {
//TODO:首页查询订单的时候需要只显示一部分, //TODO:首页查询订单的时候需要只显示一部分,
request.setAttribute("dataLogs",dataLogDao.latestLogs(10)); //request.setAttribute("dataLogs",dataLogDao.latestLogs(10));
request.setAttribute("usedPosData",storageManager.countUsedPos()); //request.setAttribute("usedPosData",storageManager.countUsedPos());
return "storage/chart"; return "homeMenu";
} }
......
...@@ -3,6 +3,7 @@ package com.myproject.webapp.controller.webService; ...@@ -3,6 +3,7 @@ package com.myproject.webapp.controller.webService;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.myproject.bean.json.ChartItem;
import com.myproject.bean.qisda.*; import com.myproject.bean.qisda.*;
import com.myproject.bean.update.*; import com.myproject.bean.update.*;
import com.myproject.bean.update.qisda.DNInfo; import com.myproject.bean.update.qisda.DNInfo;
...@@ -409,7 +410,9 @@ public class QisdaApiController extends BaseController { ...@@ -409,7 +410,9 @@ public class QisdaApiController extends BaseController {
for (OutInfo outInfo : outInfoMap.values()) { for (OutInfo outInfo : outInfoMap.values()) {
log.info("创建出库需求单["+outInfo.gethSerial()+"]" + outInfo.getAction()); int bindReelNum = getBindReelNum(outInfo);
outInfo.setTotalBindNum(bindReelNum);
log.info("创建出库需求单["+outInfo.gethSerial()+"]" + outInfo.getAction() + " 预估需求料盘数量为:" + bindReelNum);
outInfoDao.save(outInfo); outInfoDao.save(outInfo);
//新的需求单,更新缓存 //新的需求单,更新缓存
outInfoCache.addOutInfo(outInfo); outInfoCache.addOutInfo(outInfo);
...@@ -427,9 +430,6 @@ public class QisdaApiController extends BaseController { ...@@ -427,9 +430,6 @@ public class QisdaApiController extends BaseController {
} }
//-------------------------Private Method----------------------------------------
/** /**
* 出库接口 (出仓完成时调用) * 出库接口 (出仓完成时调用)
...@@ -470,6 +470,69 @@ public class QisdaApiController extends BaseController { ...@@ -470,6 +470,69 @@ public class QisdaApiController extends BaseController {
} }
} }
//-------------------------Private Method----------------------------------------
/**
* 更新需求单的绑定数量
*/
private int getBindReelNum(OutInfo outInfo){
List<OutItem> allItems = outInfo.getOutItems();
if(outInfo.isUrgentAction()){
//紧急料,每一条是一盘
return allItems.size();
}else if(outInfo.isReelCutAction()){
//分盘,需求数量与分盘任务数相同
int cutReelCount = 0;
for (OutItem outItem : allItems) {
if(outItem.isCutMaterial()){
List<StoragePos> cutPosList = storagePosDao.findCutList(outItem.getSo(), outItem.getSlotlocation(),outItem.getSoseq());
cutReelCount = cutReelCount + cutPosList.size();
}
}
return cutReelCount;
}else if(outInfo.isFirstReelAction()){
//首盘,每一条是一盘
return allItems.size();
}else if(outInfo.isTailAction()){
//尾料,根据绑定信息进行统计
//绑定信息暂时放到ChartItem中,value1为需求量,value2为累计物料数量,value3为累计料盘数量
Map<String,ChartItem> bindItemMap = new HashMap<>();
for (OutItem outItem : allItems) {
String slotLocationStr = outItem.getSlotlocation() + "";
int needNum = outItem.getQty();
ChartItem bindItem = new ChartItem();
bindItem.setLabel(slotLocationStr);
bindItem.setValue(needNum);
bindItemMap.put(bindItem.getLabel(), bindItem);
}
List<StoragePos> bindList = storagePosDao.listSoSeqBindPos(outInfo.getSoseq());
for (StoragePos storagePos : bindList) {
Barcode barcode = storagePos.getBarcode();
String slotIndex = barcode.getAppendInfo().getPreBindSlot();
ChartItem bindItem = bindItemMap.get(slotIndex);
if(bindItem != null){
if(bindItem.getValue2() < bindItem.getValue()){
//未满足需求
int amount = barcode.getAmount();
int bindAmount = bindItem.getValue2() + amount;
int reelNum = bindItem.getValue3() + 1;
bindItem.setValue2(bindAmount);
bindItem.setValue3(reelNum);
bindItemMap.put(bindItem.getLabel(), bindItem);
}
}
}
int totalBindReelNum = 0;
for (ChartItem chartItem : bindItemMap.values()) {
totalBindReelNum = totalBindReelNum + chartItem.getValue3();
}
return totalBindReelNum;
}
return 0;
}
/** /**
* 出仓完成时的参数 * 出仓完成时的参数
* @param task * @param task
......
...@@ -934,7 +934,7 @@ public class TaskService implements ITaskService { ...@@ -934,7 +934,7 @@ public class TaskService implements ITaskService {
hasFirstReelAction = true; hasFirstReelAction = true;
} }
int rfidIndex = appendInfo.getRfidIndex(); int rfidIndex = appendInfo.getRfidIndex();
boolean isAShelf = StorageConstants.SHEFL_TYPE.isAShelf(appendInfo.getShelfType()); boolean isAShelf = appendInfo.isAShelfTask();
if(isAShelf){ if(isAShelf){
//包装料最小的料架编号 //包装料最小的料架编号
if(minARfidIndex == -1 || rfidIndex < minARfidIndex){ if(minARfidIndex == -1 || rfidIndex < minARfidIndex){
...@@ -942,7 +942,7 @@ public class TaskService implements ITaskService { ...@@ -942,7 +942,7 @@ public class TaskService implements ITaskService {
} }
} }
boolean isDShelf = StorageConstants.SHEFL_TYPE.isDShelf(appendInfo.getShelfType()); boolean isDShelf = appendInfo.isDShelfTask();;
if(isDShelf){ if(isDShelf){
//小料架 //小料架
if(minDRfidIndex == -1 || rfidIndex < minDRfidIndex){ if(minDRfidIndex == -1 || rfidIndex < minDRfidIndex){
...@@ -950,7 +950,7 @@ public class TaskService implements ITaskService { ...@@ -950,7 +950,7 @@ public class TaskService implements ITaskService {
} }
} }
boolean isCShelf = StorageConstants.SHEFL_TYPE.isCShelf(appendInfo.getShelfType()); boolean isCShelf = appendInfo.isCShelfTask();
if(isCShelf){ if(isCShelf){
//大料架 //大料架
if(minCRfidIndex == -1 || rfidIndex < minCRfidIndex){ if(minCRfidIndex == -1 || rfidIndex < minCRfidIndex){
...@@ -1150,12 +1150,12 @@ public class TaskService implements ITaskService { ...@@ -1150,12 +1150,12 @@ public class TaskService implements ITaskService {
return findPackageMinTask(storage, minARfidIndex); return findPackageMinTask(storage, minARfidIndex);
}else{ }else{
//一次性把D料架出完,再出C料架,包装料可以同时出 //一次性把D料架出完,再出C料架,包装料可以同时出
Collection<DataLog> waitTasks = taskMap.values(); List<DataLog> waitTasks = new ArrayList<>(taskMap.values());
List<DataLog> allTaskList = new ArrayList<>(); List<DataLog> allTaskList = new ArrayList<>();
if(!waitTasks.isEmpty()){ if(!waitTasks.isEmpty()){
allTaskList.addAll(waitTasks); allTaskList.addAll(waitTasks);
allTaskList.sort(new Comparator<DataLog>() { waitTasks.sort(new Comparator<DataLog>() {
@Override @Override
public int compare(DataLog o1, DataLog o2) { public int compare(DataLog o1, DataLog o2) {
return o1.getOutOrder() - o2.getOutOrder(); return o1.getOutOrder() - o2.getOutOrder();
...@@ -1163,32 +1163,37 @@ public class TaskService implements ITaskService { ...@@ -1163,32 +1163,37 @@ public class TaskService implements ITaskService {
}); });
} }
for (DataLog task : allTaskList) {
if(storage.getCid().equals(task.getCid()) && task.isCheckOutTask() && task.isWait()){
//还有小料架出库任务,出小料架 //还有小料架出库任务,出小料架
if(minDRfidIndex != -1){ if(minDRfidIndex != -1){
for (DataLog task : waitTasks) {
if(storage.getCid().equals(task.getCid()) && task.isCheckOutTask() && task.isWait()){
if(task.isSmallReel()){ if(task.isSmallReel()){
log.info("出库小料任务"+task.getBarcode()+"["+task.getPosName()+"] outOrder=" + task.getOutOrder()); log.info("出库小料任务"+task.getBarcode()+"["+task.getPosName()+"] outOrder=" + task.getOutOrder());
return task; return task;
} }
}
}
}else{ }else{
//开始出大料架,不需要按顺序 Collection<DataLog> finishedTasks = finishedTaskMap.values();
if(!task.isSmallReel()){ if(!finishedTasks.isEmpty()){
allTaskList.addAll(finishedTasks);
}
//未完成的大料数量(正在执行和未放上料架的) //未完成的大料数量(正在执行和未放上料架的)
int unFinishedBigTaskCount = 0; int unFinishedBigTaskCount = 0;
for (DataLog dataLog : allTaskList) { for (DataLog task : allTaskList) {
if(!dataLog.isPackageReel() && !dataLog.isSmallReel() && dataLog.isExecuting()){ ////非包装料大料任务还未完成(未放入料架),暂时不出大料
unFinishedBigTaskCount = unFinishedBigTaskCount + 1; if(task.isCheckOutTask() && task.getAppendInfo().isCShelfTask()){
} if(!task.isFinished() && !task.isWait() && !task.isCancel()){
}
for (DataLog dataLog : finishedTaskMap.values()) {
if(!dataLog.isPackageReel()){
if(!dataLog.isSmallReel() && !dataLog.isFinished() && !dataLog.isLessSendReel()){
//非包装料大料任务还未完成(未放入料架),暂时不出大料
unFinishedBigTaskCount = unFinishedBigTaskCount + 1; unFinishedBigTaskCount = unFinishedBigTaskCount + 1;
} }
} }
} }
for (DataLog task : waitTasks) {
if(storage.getCid().equals(task.getCid()) && task.isCheckOutTask() && task.isWait()){
//开始出大料架,不需要按顺序
if(!task.isSmallReel()){
if(InquiryShelfBean.canCheckOutTailActionTask(task, unFinishedBigTaskCount)){ if(InquiryShelfBean.canCheckOutTailActionTask(task, unFinishedBigTaskCount)){
log.info("出库大料任务"+task.getBarcode()+"["+task.getPosName()+"]"); log.info("出库大料任务"+task.getBarcode()+"["+task.getPosName()+"]");
return task; return task;
...@@ -1197,6 +1202,7 @@ public class TaskService implements ITaskService { ...@@ -1197,6 +1202,7 @@ public class TaskService implements ITaskService {
} }
} }
} }
} }
return null; return null;
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration status="WARN"> <configuration status="WARN">
<Properties> <Properties>
<Property name="LOG_HOME">logs</Property> <Property name="LOG_HOME">E:/tomcatLog/logs</Property>
<Property name="LOG_NAME">storage.txt</Property> <Property name="LOG_NAME">storage.txt</Property>
</Properties> </Properties>
<appenders> <appenders>
......
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
$.post("${ctx}/service/store/tasks", {}, function (data) { $.post("${ctx}/service/store/tasks", {}, function (data) {
var html = ""; var html = "";
for(var item in data){ for(var item in data){
if(!data[item].timeout || !data[item].executing){ if(!data[item].timeout || data[item].wait){
continue; continue;
} }
var partNumber = data[item].partNumber; var partNumber = data[item].partNumber;
......
...@@ -97,6 +97,11 @@ ...@@ -97,6 +97,11 @@
<display:column titleKey="任务" sortable="true" sortProperty="mdate"> <display:column titleKey="任务" sortable="true" sortProperty="mdate">
${outInfo.taskFinishNum}/${outInfo.taskNum} ${outInfo.taskFinishNum}/${outInfo.taskNum}
</display:column> </display:column>
<display:column titleKey="累计任务" sortable="true" sortProperty="totalTaskNum">
${outInfo.totalTaskNum}/${outInfo.totalBindNum}
</display:column>
<display:column titleKey="创建时间" sortable="true" sortProperty="createDate"> <display:column titleKey="创建时间" sortable="true" sortProperty="createDate">
<fmt:formatDate value="${outInfo.createDate}" pattern="yyyy-MM-dd HH:mm"/> <fmt:formatDate value="${outInfo.createDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column> </display:column>
......
...@@ -12,6 +12,57 @@ ...@@ -12,6 +12,57 @@
<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-yellow">
<div class="timeline-time">
<span class="date">2020 </span>
<span class="time">09-15 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2020091510</h2>
<div class="timeline-content">
<ul>
<li>需求单绑定数量统计,用于统计需求数量分布</li>
</ul>
</div>
</div>
</li>
<li class="timeline-grey">
<div class="timeline-time">
<span class="date">2020 </span>
<span class="time">09-08 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2020090814</h2>
<div class="timeline-content">
<ul>
<li>需求单任务数量累计,用于统计需求数量分布</li>
</ul>
</div>
</div>
</li>
<li class="timeline-purple">
<div class="timeline-time">
<span class="date">2020 </span>
<span class="time">09-07 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2020090715</h2>
<div class="timeline-content">
<ul>
<li>出大料逻辑修改</li>
</ul>
</div>
</div>
</li>
<li class="timeline-green"> <li class="timeline-green">
<div class="timeline-time"> <div class="timeline-time">
<span class="date">2020</span> <span class="date">2020</span>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!