Commit 6ee0aba6 sunke

1 流水线有出库任务的,不分配入库任务(出库优先),

2多个有效条码不允许入库
3 发料完成时,清空料串和料架缓存
4 确认过物料尺寸的与测试尺寸进行比对,如果厚度偏差在4mm以内,才允许入库
1 个父辈 00e6858a
正在显示 19 个修改的文件 包含 169 行增加90 行删除
......@@ -517,6 +517,10 @@ public class Barcode extends BaseMongoBean {
}
}
public String getSizeStr(){
return getPlateSize() + " x " + getHeight();
}
public String getLifeCycle() {
return lifeCycle;
}
......
......@@ -123,6 +123,11 @@ public class Component extends BaseMongoBean {
*/
private int validDay = 730;
/**
* 尺寸是否已经确认
*/
private boolean sizeConfirmed = false;
public Component() {
//this.height = StorageConstants.DEFAULT_HEIGHT;
//this.plateSize = StorageConstants.PLATE_SIZE_SMALL;
......@@ -373,4 +378,17 @@ public class Component extends BaseMongoBean {
public void setValidDay(int validDay) {
this.validDay = validDay;
}
public boolean isSizeConfirmed() {
return sizeConfirmed;
}
public void setSizeConfirmed(boolean sizeConfirmed) {
this.sizeConfirmed = sizeConfirmed;
}
public String getSizeStr(){
return getPlateSize() + " x " + getHeight();
}
}
......@@ -234,6 +234,10 @@ public class OutInfo extends BaseMongoBean {
return sendStatus;
}
public boolean isSendEnd(){
return sendStatus == 2;
}
public void setSendStatus(int sendStatus) {
this.sendStatus = sendStatus;
}
......
......@@ -50,6 +50,8 @@ public class AlarmInfoSearchController extends BaseSearchController {
}
}
query.addCriteria(baseCriteria);
PageList pageList = alarmInfoDao.findByQuery(query, searchCriteria.getPageList());
searchCriteria.setPageList(pageList);
......
package com.myproject.webapp.controller.qisda.util;
import com.myproject.bean.qisda.InquiryShelfBean;
import com.myproject.bean.update.qisda.OutInfo;
import com.myproject.bean.update.qisda.OutItem;
import com.myproject.dao.mongo.qisda.IOutInfoDao;
......@@ -75,7 +76,13 @@ public class OutInfoCache {
for (OutItem outItem : outItemList) {
outInfo.updateItem(outItem);;
}
outInfoMap.put(hserial, outInfo);
if(!outInfo.getOutItemMap().isEmpty()){
outInfoMap.put(hserial, outInfo);
}else{
outInfo.setSendStatus(2);
outInfoDao.save(outInfo);
}
}
}
......@@ -103,9 +110,9 @@ public class OutInfoCache {
* 更新需求单的发料状态
*/
private void updateStatus(String hSerial){
log.info("更新需求单["+hSerial+"]的发料状态");
OutInfo outInfo = outInfoMap.get(hSerial);
if(outInfo != null){
log.info("更新需求单["+hSerial+"]的发料状态 [" + outInfo.getSendStatus()+"]");
boolean sendEnd = true;
boolean hasOut = false;
//默认为绑定OK,
......@@ -113,7 +120,7 @@ public class OutInfoCache {
for (OutItem outItem : outInfo.getOutItemMap().values()) {
if(outItem.isUrgentAction()){
//紧急料,设置发料数量与出库数量一致
outItem.setSendQty(outItem.getOutQty());
//outItem.setSendQty(outItem.getOutQty());
}
if(!outItem.isItemEnd()){
sendEnd = false;
......@@ -148,6 +155,11 @@ public class OutInfoCache {
dbOutInfo.setBindStatus(outInfo.getBindStatus());
outInfoDao.save(dbOutInfo);
log.info("需求单["+hSerial+"]状态与数据库不一致,更新到数据库");
if(dbOutInfo.isSendEnd()){
outInfoMap.remove(dbOutInfo.gethSerial());
InquiryShelfBean.clearShelf(dbOutInfo.gethSerial());
log.info("需求单["+hSerial+"]发料已完成,从缓存中清除,同时清理使用过的料串");
}
}
}
}
......
......@@ -316,6 +316,7 @@ public class BoxChartController extends BaseController {
return taskService.cancelTask(taskId);
}
@RequestMapping(value="/service/store/hideTask",method= RequestMethod.POST)
@ResponseBody
public void removeTaskFromQueue(HttpServletRequest request) throws Exception{
......@@ -323,7 +324,6 @@ public class BoxChartController extends BaseController {
taskService.hideTask(taskId);
}
/**
* 正在执行和等待的任务
*/
......
......@@ -246,8 +246,7 @@ public class DataCache{
//如果客户端传入的有尺寸,但尺寸不一致,使用上传上来的尺寸
if(barcode.getHeight() != codeBeanFromRule.getReelHeight() || barcode.getPlateSize() != codeBeanFromRule.getReelWidth()){
try{
log.warn("重新设置尺寸["+barcode.getPlateSize()+"x"+barcode.getHeight()+"]为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]");
log.warn("重新设置尺寸["+barcode.getSizeStr()+"]为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]");
barcode.setPlateSize(codeBeanFromRule.getReelWidth());
barcode.setHeight(codeBeanFromRule.getReelHeight());
barcode = barcodeManager.save(barcode);
......@@ -261,24 +260,23 @@ public class DataCache{
if(component != null){
validDay = component.getValidDay();
codeBeanFromRule.setShowImg(component.getShowImg());
}
Barcode barcodeFromRule = codeBeanFromRule.getBarcode();
if(barcodeFromRule != null){
Date produceDate = barcodeFromRule.getProduceDate();
if(produceDate != null){
//抓取到了生产日期,未抓取到过期日期,重新设置过期日期
if(barcode.getExpireDate() == null){
if(validDay > 0){
if(component.isSizeConfirmed()){
//尺寸已经确认的,判断尺寸,如果大小不符合,直接NG,如果大小符合,尺寸差别在4mm内的修改尺寸
if(barcode.getPlateSize() != component.getPlateSize()){
String msg = barcode.getBarcode() + "测量尺寸["+barcode.getSizeStr()+"]与确认PN尺寸["+component.getSizeStr()+"]不符";
codeBeanFromRule.setError(msg);
}else{
//如果厚度小于4mm,使用确认的尺寸入库
int diffHeight = barcode.getHeight() - component.getHeight();
if(diffHeight !=0 && Math.abs(diffHeight) <= 4){
log.info(barcode.getBarcode() + "测量尺寸["+barcode.getSizeStr()+"]与确认PN尺寸["+component.getSizeStr()+"]厚度误差在4mm以内,使用确认的尺寸进行入库");
try {
log.warn("重新设置"+codeBeanFromRule.getCodeStr()+"生产日期和过期日期");
Date expireDate = DateUtil.addDays(produceDate, validDay);
barcode.setExpireDate(expireDate);
barcode.setProduceDate(produceDate);
barcode.setHeight(component.getHeight());
barcodeManager.save(barcode);
}catch (Exception e){
}
}
}
}
......@@ -293,8 +291,6 @@ public class DataCache{
try{
//如果有料盘尺寸,重新设置料盘尺寸信息,没有档案时自动添加档案
if(codeBeanFromRule.hasReelSizeInfo()){
//log.info("料盘["+barcode.getBarcode()+"]的尺寸信息从["+barcode.getPlateSize()+"x"+barcode.getHeight()+"]设置为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]");
Component component = componentManager.findByPartNumber(barcodeFromRule.getPartNumber());
......@@ -306,14 +302,20 @@ public class DataCache{
component.setPlateSize(barcodeFromRule.getPlateSize());
component.setHeight(barcodeFromRule.getHeight());
component.setName(barcodeFromRule.getPartNumber());
component.setProvider(barcodeFromRule.getProvider());
componentManager.save(component);
}else{
//如果 barcode 里的料盘信息比 Component 中的大,使用比较大的,防止放不进去撞击
if(codeBeanFromRule.getReelHeight() > component.getHeight() || codeBeanFromRule.getReelWidth() > component.getPlateSize()){
log.info("更新物料["+component.getPartNumber()+"]档案尺寸["+component.getPlateSize()+"x"+component.getHeight()+"]为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]");
component.setPlateSize(barcodeFromRule.getPlateSize());
component.setHeight(barcodeFromRule.getHeight());
componentManager.save(component);
//尺寸已经确认的,不再更新尺寸
if(!component.isSizeConfirmed()){
//如果 barcode 里的料盘信息比 Component 中的大,使用比较大的,防止放不进去撞击
if(codeBeanFromRule.getReelHeight() > component.getHeight() || codeBeanFromRule.getReelWidth() > component.getPlateSize()){
log.info("更新物料["+component.getPartNumber()+"]档案尺寸["+component.getPlateSize()+"x"+component.getHeight()+"]为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]");
component.setPlateSize(barcodeFromRule.getPlateSize());
component.setHeight(barcodeFromRule.getHeight());
componentManager.save(component);
}
}else{
}
codeBeanFromRule.setShowImg(component.getShowImg());
}
......
......@@ -1367,7 +1367,7 @@ public class QisdaApiController extends BaseController {
allTasks.addAll(queueTasks);
}
//是有工单料任务
//是有工单料任务
boolean hasOrderTask = false;
for (DataLog dataLog : allTasks) {
if(dataLog.isCheckOutTask()){
......
......@@ -453,6 +453,8 @@ public class QisdaDeviceController extends BaseController {
}
/**
* 更新位置信息
*/
......@@ -481,6 +483,7 @@ public class QisdaDeviceController extends BaseController {
log.error("补发通知出错",e);
}
}
if(task.isFinished()){
log.error("料盘["+barcode+"]的任务已完成");
return ResultBean.newErrorResult(302, "料盘["+barcode+"]的任务已完成");
......@@ -767,12 +770,12 @@ public class QisdaDeviceController extends BaseController {
if(totalOrderTaskCount > 0){
log.info("当前任务数:" + resultMap);
}else{
if(!hSerial.isEmpty()){
if(!usedRfidList.isEmpty()){
log.info("工单总任务数为0,且工单有料架已经绑定,清空当前的工单序号["+hSerial+"]");
outInfoCache.setCurrentOrderHSerial(null);
}
}
// if(!hSerial.isEmpty()){
// if(!usedRfidList.isEmpty()){
// log.info("工单总任务数为0,且工单有料架已经绑定,清空当前的工单序号["+hSerial+"]");
// outInfoCache.setCurrentOrderHSerial(null);
// }
// }
}
return ResultBean.newOkResult(resultMap);
......
......@@ -571,10 +571,16 @@ public class StorageDataController extends BaseController {
}else{
Collection<CodeBean> codeBeans = dataCache.resolveCodeStr(code);
Barcode barcode = null;
String validBarcodeStr = "";
for (CodeBean codeBean: codeBeans) {
if(codeBean.isValid()){
barcode = codeBean.getBarcode();
break;
if(barcode == null){
barcode = codeBean.getBarcode();
validBarcodeStr = barcode.getBarcode();
}else{
//有多个有效的条码
validBarcodeStr = validBarcodeStr + "," + barcode.getBarcode();
}
}
}
if(barcode == null){
......@@ -582,13 +588,12 @@ public class StorageDataController extends BaseController {
errorMsg = "条码["+code+"]无效";
resultMap.put("msg",errorMsg);
}else {
StoragePos pos = null;
try {
// log.info("条码["+barcode.getBarcode()+"]入库,清空Facility入库信息");
// barcode.setAppendInfo(null);
// barcode = barcodeManager.save(barcode);
if(!validBarcodeStr.equals(barcode.getBarcode())){
throw new ValidateException("发现多个有效条码:" + validBarcodeStr);
}
pos = taskService.findEmptyPosForPutIn(storageList,barcode, rfid);
StoragePos pos = taskService.findEmptyPosForPutIn(storageList,barcode, rfid);
if(pos != null){
resultMap.put("result","0");
resultMap.put("msg","");
......
......@@ -553,6 +553,7 @@ public class TaskService implements ITaskService {
countMap.put(storage.getId(), 0);
}
Set<String> hasOutTaskStorageIds = new HashSet<>();
for (DataLog task : allTasks) {
String storageId = task.getStorageId();
if(!Strings.isNullOrEmpty(storageId)){
......@@ -561,6 +562,9 @@ public class TaskService implements ITaskService {
taskCount = taskCount + 1;
countMap.put(storageId, taskCount);
}
if(task.isCheckOutTask()){
hasOutTaskStorageIds.add(storageId);
}
}
}
......@@ -572,6 +576,10 @@ public class TaskService implements ITaskService {
if(status.timeOut()){
continue;
}
if(hasOutTaskStorageIds.contains(storage.getId())){
//流水线有出库任务的,不分配入库任务(出库优先)
continue;
}
if(storage.canPutIn(barcode.getPlateSize(),barcode.getHeight())){
availbleStorageList.add(storage);
}
......@@ -797,24 +805,34 @@ public class TaskService implements ITaskService {
@Override
public boolean cancelTask(String taskId) {
DataLog task = dataLogDao.findOneById(taskId);
if(task.isCheckOutTask()){
log.info(task.getBarcode() + "出库任务取消失败: 不允许取消");
return false;
}
return cancelTask(task);
}
@Override
public void hideTask(String taskId) {
DataLog task = dataLogDao.findOneById(taskId);
//发送取消(发料)指令到佳世达
if(task.isCheckOutTask()){
//发送取消(发料)指令到佳世达
AppendInfo taskAppendInfo = task.getAppendInfo();
if(taskAppendInfo.isFirstReelAction() || taskAppendInfo.isTailAction()){
Barcode barcode = barcodeManager.findByBarcode(task.getBarcode());
log.info("["+task.getBarcode()+"]任务已出库完成,但未放上小车,发送E状态到佳世达,同时解除料架架位");
InquiryShelfBean.cancelReelTask(task);
QisdaApiController.VMIMateriaRecAss(task, barcode, "E");
log.info("["+task.getBarcode()+"]任务已出库完成,但未放上小车,发送E状态到佳世达,同时解除料架架位,发料任务完成数量+1");
OutInfo outInfo = outInfoDao.findByHSerial(taskAppendInfo.gethSerial());
if(outInfo != null) {
outInfo.setTaskFinishNum(outInfo.getTaskFinishNum() + 1);
log.info("需求单[" + outInfo.gethSerial() + "]任务完成数量:" + outInfo.getTaskFinishNum() + "/" + outInfo.getTaskNum() + "已出仓料盘数量:" + outInfo.getOutReelNum());
outInfoDao.save(outInfo);
InquiryShelfBean.cancelReelTask(task);
QisdaApiController.VMIMateriaRecAss(task, barcode, "E");
}
}
finishedTaskMap.remove(task.getBarcode());
}
finishedTaskMap.remove(task.getBarcode());
}
/**
......@@ -843,6 +861,7 @@ public class TaskService implements ITaskService {
public Collection<String> excludePosIds(){
//排除掉正在执行的仓位
Collection<DataLog> allTasks = taskMap.values();
allTasks.addAll(finishedTaskMap.values());
Collection<String> operatingPosIds = new HashSet<>();
for(DataLog task : allTasks){
String posId = task.getPosId();
......@@ -1478,6 +1497,8 @@ public class TaskService implements ITaskService {
}
DataLog task = newTask(pos);
//手动出库的当做是紧急料
task.setUrgentReel(true);
task.setType(StorageConstants.OP.CHECKOUT);
task.setStatus(StorageConstants.OP_STATUS.WAIT.name());
task.setSingleOut(isSingleOut);
......
......@@ -28,26 +28,26 @@
</div>
<div class="portlet-body">
<form id="searchCriteria" class="form-horizontal form-bordered" action="alarmInfoSearch.html" method="post">
<div class="form-group">
<label class="control-label col-md-2"><fmt:message key="inOutList.time"/></label>
<div class="col-md-4" style="padding-left:0px;">
<div class="input-group input-large date-picker input-daterange" data-date="2017-05-10" data-date-format="yyyy-mm-dd">
<input type="text" class="form-control" name="startDay" value="${startDay}">
<div class="col-md-4 col-sm-4">
<div class="form-group form-inline">
<div class="input-group input-large date-picker input-daterange margin-top-10" data-date="2017-05-10" data-date-format="yyyy-mm-dd">
<span class="input-group-addon">
<fmt:message key="inOutList.time"/></span>
<input type="text" class="form-control" name="startDay" value="${startDay}">
<span class="input-group-addon">
to </span>
<input type="text" class="form-control" name="endDay" value="${endDay}">
<input type="text" class="form-control" name="endDay" value="${endDay}">
</div>
</div>
<!-- /input-group -->
<span class="help-block"> </span>
</div>
<div class="col-md-2">
<button class="btn purple" type="submit"><i class="fa fa-search"></i>
<fmt:message key="button.search"/>
<button class="btn purple margin-top-10" type="submit"><i class="fa fa-search"></i>
<fmt:message key="button.search"/>
</button>
</div>
</div>
</form>
<display:table name="searchCriteria.pageList" requestURI=""
......
......@@ -91,11 +91,17 @@
<a href="${ctx}/component/componentUpdate.html?type=${component.type}&id=${component.id}">${component.partNumber}</a>
</display:column>
<display:column titleKey="component.partNumber" media="csv" property="partNumber"/>
<display:column property="providerNumber" titleKey="component.providerNumber"/>
<display:column property="provider" titleKey="component.provider"/>
<display:column titleKey="component.plate.size">
${component.plateSize} x ${component.height}
${component.sizeStr}
</display:column>
<display:column titleKey="尺寸已确认" sortProperty="sizeConfirmed" sortable="true">
<c:if test="${component.sizeConfirmed}">
</c:if>
</display:column>
<display:column property="validDay" titleKey="component.validDay"/>
<%--<display:column property="validDay" titleKey="component.validDay"/>--%>
<%--<display:column property="type" titleKey="类型"/>--%>
<display:column property="amount" titleKey="component.amount"/>
......
......@@ -461,11 +461,11 @@
</div>
</div>
<%--贵重物料--%>
<label class="control-label col-md-2"><fmt:message key="otherComponent.expensive"/> </label>
<label class="control-label col-md-2"><fmt:message key="尺寸确认"/> </label>
<div class="col-md-3">
<div style="text-align:left" class="input-group">
<form:checkbox path="needAuth" class="form-control"/>
<form:checkbox path="sizeConfirmed" class="form-control"/>
</div>
</div>
......
......@@ -113,16 +113,16 @@
</form:form>
<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">
<div class="table-toolbar">
<div class="col-md-4">
<div class="btn-group">
<button class="btn yellow" id="checkoutBtn">
<i class="fa fa-sign-out"></i><fmt:message key="storagePosFind.outSelect"/></button>
</div>
</div>
</div>
</security:authorize>
<%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">--%>
<%--<div class="table-toolbar">--%>
<%--<div class="col-md-4">--%>
<%--<div class="btn-group">--%>
<%--<button class="btn yellow" id="checkoutBtn">--%>
<%--<i class="fa fa-sign-out"></i><fmt:message key="storagePosFind.outSelect"/></button>--%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
<%--</security:authorize>--%>
<div class="table-scrollable">
<c:set var="today" value="<%= new Date()%>"/>
<display:table name="searchCriteria.pageList" requestURI="storagePosFind.html" sort="external"
......@@ -138,13 +138,13 @@
</c:if>
<c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.maxStorageTime != 0 && pos.inStoreHour * 60 + pos.inStoreMiniute <= pos.barcode.warmTime * 60)}"/>
<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">
<display:column title="<input type='checkbox' id='allCheck'/>" media="html">
<c:if test="${!limitCheckOut}">
<input type="checkbox" name="posIds" value="${pos.id}" id="check${pos.id}" class="limit${pos.barcode.inFixture}"/>
</c:if>
</display:column>
</security:authorize>
<%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">--%>
<%--<display:column title="<input type='checkbox' id='allCheck'/>" media="html">--%>
<%--<c:if test="${!limitCheckOut}">--%>
<%--<input type="checkbox" name="posIds" value="${pos.id}" id="check${pos.id}" class="limit${pos.barcode.inFixture}"/>--%>
<%--</c:if>--%>
<%--</display:column>--%>
<%--</security:authorize>--%>
<display:column titleKey="storagePosFind.index">${pos_rowNum}</display:column>
<display:column titleKey="component.partNumber" style="width: 15%;" sortProperty="barcode.partNumber" sortable="true" class="${alarmClass}">
......@@ -184,15 +184,15 @@
<%--<display:column titleKey="barcode.expireDate" sortProperty="barcode.expireDate" sortable="true">--%>
<%--<fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/>--%>
<%--</display:column>--%>
<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">
<display:column titleKey="checkOut.operate" media="html">
<c:if test="${!limitCheckOut}">
<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"
onclick="checkoutStorage('${pos.id}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
</c:if>
</display:column>
</security:authorize>
<%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">--%>
<%--<display:column titleKey="checkOut.operate" media="html">--%>
<%--<c:if test="${!limitCheckOut}">--%>
<%--<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"--%>
<%--onclick="checkoutStorage('${pos.id}')">--%>
<%--<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>--%>
<%--</c:if>--%>
<%--</display:column>--%>
<%--</security:authorize>--%>
<c:if test="${limitCheckOut}">
<c:set var="limitCodes" value="${pos.barcode.inFixture},${limitCodes}"/>
</c:if>
......
......@@ -92,7 +92,8 @@
<fmt:formatDate value="${outInfo.createDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
<display:column titleKey="checkOut.operate" media="html">
<display:column titleKey="checkOut.operate" media="html" sortProperty="sendStatus" sortable="true">
<span class="hide">${outInfo.sendStatus}</span>
<c:if test="${outInfo.sendStatus != 2 && outInfo.taskNum == 0}">
<button class="btn yellow" id="btn${outInfo.hSerial}"
onclick="executeOut('${outInfo.hSerial}')">
......
......@@ -12,6 +12,7 @@
today: "今日",
weekStart: 1
};
$.fn.datepicker.dates['en'] = {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
......
......@@ -51,7 +51,7 @@
</li>
<li class="classic-menu-dropdown">
<a href="${ctx}/qisda/diffInventory.html" name="qisda">
<fmt:message key="库存"/><span class="selected"></span>
<fmt:message key="库存比对"/><span class="selected"></span>
</a>
</li>
</ul>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!