Commit 9d6a689a LN

增加过期物料提醒功能

1 个父辈 95065b61
...@@ -347,7 +347,9 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -347,7 +347,9 @@ public class StoragePosManagerImpl implements IStoragePosManager {
@Override @Override
public int expireCount(String storageId, int type){ public int expireCount(String storageId, int type){
Criteria c = Criteria.where("barcode.expireDate").lte(new Date());
//Criteria c = Criteria.where("barcode.expireDate").lte(new Date()).orOperator(Criteria.where("barcode.expTime").lte(new Date()));
Criteria c = Criteria.where("barcode.expTime").lte(new Date());
if(!Strings.isNullOrEmpty(storageId)){ if(!Strings.isNullOrEmpty(storageId)){
c = c.and("storageId").is(storageId); c = c.and("storageId").is(storageId);
} }
......
...@@ -104,11 +104,7 @@ public class StoragePosFindController extends BaseSearchController { ...@@ -104,11 +104,7 @@ public class StoragePosFindController extends BaseSearchController {
String expire = request.getParameter("expire"); String expire = request.getParameter("expire");
if(!Strings.isNullOrEmpty(expire)){ if(!Strings.isNullOrEmpty(expire)){
if("solder".equalsIgnoreCase(expire)){
baseCriteria.and("barcode.expTime").lte(new Date()); baseCriteria.and("barcode.expTime").lte(new Date());
}else if("pcb".equalsIgnoreCase(expire)){
baseCriteria.and("barcode.expireDate").lte(new Date());
}
request.setAttribute("expire",expire); request.setAttribute("expire",expire);
} }
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
<%--<display:column property="validDay" titleKey="component.validDay"/>--%> <%--<display:column property="validDay" titleKey="component.validDay"/>--%>
<%--<display:column property="type" titleKey="类型"/>--%> <%--<display:column property="type" titleKey="类型"/>--%>
<display:column property="amount" titleKey="component.amount"/> <display:column property="amount" titleKey="component.amount"/>
<display:column property="maxStorageTime" titleKey="solder.maxStorageTime" sortable="true"/>
<display:column titleKey="" media="html"> <display:column titleKey="" media="html">
<button class="btn default" type="button" <button class="btn default" type="button"
......
...@@ -471,16 +471,25 @@ ...@@ -471,16 +471,25 @@
</div> </div>
<div class="form-group extraInfo">
<%--单位--%>
<label class="control-label col-md-2"><fmt:message key="component.unit"/></label>
<div class="form-group">
<label class="control-label col-md-2"><fmt:message key="solder.maxStorageTime"/> </label>
<div class="col-md-3"> <div class="col-md-3">
<div style="text-align:left" class="input-group"> <div style="text-align:left" class="input-group">
<form:input type="text" id="unit" path="unit" class="form-control"/> <form:input type="text" id="maxStorageTime" path="maxStorageTime" class="form-control"/>
<span class="input-group-addon"><fmt:message key="solder.hour"/></span>
</div> </div>
</div> </div>
<%-- <div class="form-group extraInfo">
&lt;%&ndash;单位&ndash;%&gt;
<label class="control-label col-md-2"><fmt:message key="component.unit"/></label>
<div class="col-md-3">
<div style="text-align:left" class="input-group">
<form:input type="text" id="unit" path="unit" class="form-control"/>
</div>
</div>--%>
<%--单耗--%> <%--单耗--%>
<label class="control-label col-md-2"><fmt:message key="component.unitCost"/></label> <label class="control-label col-md-2"><fmt:message key="component.unitCost"/></label>
...@@ -492,7 +501,7 @@ ...@@ -492,7 +501,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group extraInfo"> <%-- <div class="form-group extraInfo">
<label class="control-label col-md-2"><fmt:message key="component.producer"/> </label> <label class="control-label col-md-2"><fmt:message key="component.producer"/> </label>
<div class="col-md-3"> <div class="col-md-3">
...@@ -522,7 +531,7 @@ ...@@ -522,7 +531,7 @@
</div> </div>
</div> </div>
<%--SMD 连接时的预警值--%> &lt;%&ndash;SMD 连接时的预警值&ndash;%&gt;
<label class="control-label col-md-2"><fmt:message key="component.smdAlarmValue"/></label> <label class="control-label col-md-2"><fmt:message key="component.smdAlarmValue"/></label>
<div class="col-md-3"> <div class="col-md-3">
...@@ -532,7 +541,7 @@ ...@@ -532,7 +541,7 @@
</div> </div>
</div> </div>
</div> </div>--%>
<div class="form-group extraInfo"> <div class="form-group extraInfo">
......
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-1"><fmt:message key="component.partNumber"/></label> <label class="control-label col-md-1"><fmt:message key="component.partNumber"/></label>
<%--
<input type="hidden" name="expire" value="${expire}"/> <input type="hidden" name="expire" value="${expire}"/>--%>
<div class="col-md-2"> <div class="col-md-2">
<div style="text-align:left"> <div style="text-align:left">
<form:input id="name" path="name" class="form-control"/> <form:input id="name" path="name" class="form-control"/>
...@@ -117,6 +117,15 @@ ...@@ -117,6 +117,15 @@
<input type="text" name="facility" class="form-control" value="${facility}"/> <input type="text" name="facility" class="form-control" value="${facility}"/>
</div> </div>
</div> </div>
<label class="control-label col-md-1 col-xs-2"><fmt:message key="类型"/></label>
<div class="col-md-2">
<select name="expire" class="form-control">
<option value=""><fmt:message key="select.all"/></option>
<option value="1" <c:if test="${expire==1}"> selected </c:if> > <fmt:message key="过期物料"/></option>
</select>
</div>
</div> </div>
</form:form> </form:form>
...@@ -141,7 +150,10 @@ ...@@ -141,7 +150,10 @@
<c:if test="${pos.barcode.type == 1 && pos.barcode.maxStorageTime != 0 && pos.inStoreHour >= pos.barcode.maxStorageTime}"> <c:if test="${pos.barcode.type == 1 && pos.barcode.maxStorageTime != 0 && pos.inStoreHour >= pos.barcode.maxStorageTime}">
<c:set var="alarmClass" value="alarmItem"/> <c:set var="alarmClass" value="alarmItem"/>
</c:if> </c:if>
<c:if test="${today >= pos.barcode.expireDate}"> <%-- <c:if test="${today >= pos.barcode.expireDate}">
<c:set var="alarmClass" value="alarmItem"/>
</c:if>--%>
<c:if test="${today >= pos.barcode.expTime}">
<c:set var="alarmClass" value="alarmItem"/> <c:set var="alarmClass" value="alarmItem"/>
</c:if> </c:if>
<c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.maxStorageTime != 0 && pos.inStoreHour * 60 + pos.inStoreMiniute <= pos.barcode.warmTime * 60)}"/> <c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.maxStorageTime != 0 && pos.inStoreHour * 60 + pos.inStoreMiniute <= pos.barcode.warmTime * 60)}"/>
...@@ -155,7 +167,7 @@ ...@@ -155,7 +167,7 @@
<%--</security:authorize>--%> <%--</security:authorize>--%>
<display:column titleKey="storagePosFind.index">${pos_rowNum}</display:column> <display:column titleKey="storagePosFind.index">${pos_rowNum}</display:column>
<display:column titleKey="component.partNumber" style="width: 15%;" sortProperty="barcode.partNumber" sortable="true" class="${alarmClass}"> <display:column titleKey="component.partNumber" style="width: 15%;" sortProperty="barcode.partNumber" sortable="true" >
${pos.barcode.partNumber} ${pos.barcode.partNumber}
</display:column> </display:column>
...@@ -180,7 +192,9 @@ ...@@ -180,7 +192,9 @@
<display:column titleKey="时间" sortProperty="barcode.putInDate" sortable="true"> <display:column titleKey="时间" sortProperty="barcode.putInDate" sortable="true">
<fmt:formatDate value="${pos.barcode.putInDate}" pattern="yyyy-MM-dd HH:mm"/> <fmt:formatDate value="${pos.barcode.putInDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column> </display:column>
<display:column titleKey="过期时间" sortProperty="barcode.expTime" sortable="true" class="${alarmClass}">
<fmt:formatDate value="${pos.barcode.expTime}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
<display:column titleKey="barcode.amount" sortProperty="barcode.amount" sortable="true"> <display:column titleKey="barcode.amount" sortProperty="barcode.amount" sortable="true">
<c:if test="${pos.barcode.type == 1 || pos.barcode.type == 4}">-</c:if> <c:if test="${pos.barcode.type == 1 || pos.barcode.type == 4}">-</c:if>
<c:if test="${pos.barcode.type != 1 && pos.barcode.type != 4}">${pos.barcode.amount} ${pos.barcode.appendInfo.cutMap}</c:if> <c:if test="${pos.barcode.type != 1 && pos.barcode.type != 4}">${pos.barcode.amount} ${pos.barcode.appendInfo.cutMap}</c:if>
......
...@@ -770,6 +770,49 @@ ...@@ -770,6 +770,49 @@
$("#lineMsg").text(lineMsg); $("#lineMsg").text(lineMsg);
}); });
} }
//过期物料提醒
var expireWindow;
flushExpireAlarm = function(){
$.post("${ctx}/service/store/expireAlarmMsg", {cid: '${show}'}, function (data) {
expireWindow = showAlarmWindow(expireWindow,"${expireAlarmTitle}",data);
});
};
function alarmWindowClick() {
alert("aaa");
}
function showAlarmWindow(alarmWindow, title, msg){
var windowOptions = {
delay: false,
position: 'bottom left',
closeOnClick: false,
sound: false,
title: title,
closable: false,
messageHeight:null,
icon:false,
size: 'normal',
};
if(msg == ''){//无报警,清除报警框
if(alarmWindow){
alarmWindow.remove();
alarmWindow = null;
}
}else{
var titleStr = "<a href=\"${ctx}/component/storagePosFind.html?dir=asc&expire=1&sort=barcode.expTime\" style=\"color: white\">"+msg+"</a>";
msg=titleStr;
if(!alarmWindow){
/* windowOptions.title=titleStr;*/
windowOptions.msg = msg;
alarmWindow =Lobibox.notify('warning', windowOptions);
}else{
alarmWindow.$el.find(".lobibox-notify-msg").html(msg);
}
}
return alarmWindow;
}
setInterval(function(){ setInterval(function(){
flushLineMsg(); flushLineMsg();
...@@ -781,6 +824,7 @@ ...@@ -781,6 +824,7 @@
//flushLineMsg(); //flushLineMsg();
flushUsageItem(); flushUsageItem();
//flushLiteOrders(); //flushLiteOrders();
flushExpireAlarm();
}, 2000); }, 2000);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!