Commit b4456845 sunke

关闭调整需求单优先级功能

提供修改需求单建议时间和必须时间接口
未解绑料架需求单持续请求, 解决料架已解绑,但还显示红框的问题
1 个父辈 423c514e
...@@ -24,6 +24,8 @@ public interface IOutInfoDao extends IMongoDao { ...@@ -24,6 +24,8 @@ public interface IOutInfoDao extends IMongoDao {
void updateTaskEndTime(String hSerial, long taskEndTime); void updateTaskEndTime(String hSerial, long taskEndTime);
void updateSMDate(OutInfo outInfo);
void updateTaskFinishNum(String hSerail, int taskFinishNum); void updateTaskFinishNum(String hSerail, int taskFinishNum);
void updateOutReelNum(String hSerial, int outReelNum); void updateOutReelNum(String hSerial, int outReelNum);
......
...@@ -13,6 +13,7 @@ import org.springframework.data.mongodb.core.query.Query; ...@@ -13,6 +13,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update; import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List; import java.util.List;
@Repository @Repository
...@@ -95,6 +96,17 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao { ...@@ -95,6 +96,17 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao {
update(hSerial, "taskEndTime", taskEndTime); update(hSerial, "taskEndTime", taskEndTime);
} }
/**
* 更新建议和必须出仓时间
*/
@Override
public void updateSMDate(OutInfo outInfo){
Criteria c = Criteria.where("hSerial").is(outInfo.gethSerial());
Query query = Query.query(c);
Update update = Update.update("sdate",outInfo.getSdate()).set("mdate",outInfo.getMdate());
updateFirst(query,update);
}
@Override @Override
public void updateTaskFinishNum(String hSerail, int taskFinishNum){ public void updateTaskFinishNum(String hSerail, int taskFinishNum){
update(hSerail, "taskFinishNum", taskFinishNum); update(hSerail, "taskFinishNum", taskFinishNum);
......
...@@ -304,7 +304,7 @@ public class QisdaController extends BaseController { ...@@ -304,7 +304,7 @@ public class QisdaController extends BaseController {
* @param request * @param request
* @return * @return
*/ */
@RequestMapping("/service/store/qisda/moveOutInfoToFirst") @RequestMapping("/service/store/qisda/moveTheOutInfoToFirst")
@ResponseBody @ResponseBody
public String moveOutInfoToFirst(HttpServletRequest request){ public String moveOutInfoToFirst(HttpServletRequest request){
String hSerialToMove = request.getParameter("hSerialToMove"); String hSerialToMove = request.getParameter("hSerialToMove");
......
...@@ -81,6 +81,7 @@ public class OutInfoCache { ...@@ -81,6 +81,7 @@ public class OutInfoCache {
updateMustExeOutInfo(); updateMustExeOutInfo();
executeBindTask(); executeBindTask();
executeOutTask(); executeOutTask();
checkBindShelf();
} }
}catch (Exception e){ }catch (Exception e){
log.error("需求单定时器执行出错:",e); log.error("需求单定时器执行出错:",e);
...@@ -90,6 +91,53 @@ public class OutInfoCache { ...@@ -90,6 +91,53 @@ public class OutInfoCache {
} }
} }
/**
* 检查产线绑定料架
*/
private void checkBindShelf(){
try{
List<OutInfo> cachedOutInfos = getCachedOutInfos();
List<String> excludeSerialList = new ArrayList<>();
OutInfo firstToExecuteOutInfo = findExecuteOrderHSerial(cachedOutInfos, excludeSerialList);
for (OutInfo unEndOutInfo : cachedOutInfos) {
//第一个可执行的在正常执行里判断,这里不判断
if(firstToExecuteOutInfo.gethSerial().equals(unEndOutInfo.gethSerial())){
continue;
}
//寻找未执行过的到达建议时间和必须出库时间的工单料(首盘或补料)
if(unEndOutInfo.isNew()){
String oldBindShelfInfo = unEndOutInfo.getLineBindShelfInfo();
//只检查有未解绑料架的补料需求单
if(Strings.isNotBlank(oldBindShelfInfo) && unEndOutInfo.isTailAction()){
long firstExecuteTime = unEndOutInfo.getFirstExecuteTime();
if(firstExecuteTime <= 0){
//未执行出库的
String newBindShelfInfo = QisdaApi.GetSerialData(unEndOutInfo.getLine(),unEndOutInfo.gethSerial());
if(!newBindShelfInfo.toLowerCase().contains("wait")){
//需要进行等待,直接返回
int shelfCountToLine = shelfCountToLine(unEndOutInfo.getSoseq(),newBindShelfInfo);
if(unEndOutInfo.isPreTailAction() || unEndOutInfo.isTailAction()){
//补料,检查是否是同一个工单未解绑的料架
if(shelfCountToLine > 0){
//对应产线可放料架大于0,可以进行出库"
newBindShelfInfo = "";
}
}
}
unEndOutInfo.setLineBindShelfInfo(newBindShelfInfo);
outInfoMap.put(unEndOutInfo.gethSerial(), unEndOutInfo);
if(!newBindShelfInfo.equals(oldBindShelfInfo)){
log.info("需求单["+unEndOutInfo.gethSerial()+"]产线有未解绑料架["+newBindShelfInfo+"]需要进行等待");
}
}
}
}
}
}catch (Exception e){
log.error("检查产线绑定料架出错",e);
}
}
public void executeOutTask(){ public void executeOutTask(){
Date now = new Date(); Date now = new Date();
...@@ -369,6 +417,9 @@ public class OutInfoCache { ...@@ -369,6 +417,9 @@ public class OutInfoCache {
* 将需求单加入到缓存 * 将需求单加入到缓存
*/ */
public void addOutInfo(OutInfo outInfo){ public void addOutInfo(OutInfo outInfo){
if(outInfo == null){
return;
}
//先把缓存清理掉,从数据库中查询 //先把缓存清理掉,从数据库中查询
String hserial =outInfo.gethSerial(); String hserial =outInfo.gethSerial();
if(!hserial.isEmpty() && !outInfo.isSendEnd() && !outInfo.isClosed()){ if(!hserial.isEmpty() && !outInfo.isSendEnd() && !outInfo.isClosed()){
...@@ -706,6 +757,16 @@ public class OutInfoCache { ...@@ -706,6 +757,16 @@ public class OutInfoCache {
} }
/** /**
* 更新需求单的建议和必须出仓时间
*/
public void updateSMDate(OutInfo outInfo){
//已经执行过的不能更新
outInfoDao.updateSMDate(outInfo);
outInfoMap.put(outInfo.gethSerial(),outInfo);
log.info("更新需求单["+outInfo.gethSerial()+"]的建议时间为:"+outInfo.getMdate() + " 必须时间为:" + outInfo.getSdate());
}
/**
* 更新需求单的发料状态 * 更新需求单的发料状态
*/ */
public void updateSendStatus(String hSerial){ public void updateSendStatus(String hSerial){
......
...@@ -425,6 +425,48 @@ public class QisdaApiController extends BaseController { ...@@ -425,6 +425,48 @@ public class QisdaApiController extends BaseController {
} }
/** /**
* 更新需求单时间
*/
@RequestMapping(value = "/updateOutInfo",method = RequestMethod.POST)
@ResponseBody
public Object updateOutInfo(HttpServletRequest request) {
try {
String paramInfo = receiveParamInfo(request,"paramInfo");
log.info("收到需求单修改时间请求:"+paramInfo);
if(paramInfo == null){
return ResultBean.newErrorResult(-1,"参数为空");
}
List<RequestOutItemBean> items = JsonUtil.toList(paramInfo, RequestOutItemBean.class);
Map<String,String> resultMap = new HashMap<>();
log.info("需求单修改时间请求解析成功,开始处理");
for (RequestOutItemBean itemBean : items) {
OutItem outItem = new OutItem(itemBean);
String hSerial = outItem.gethSerial();
OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
if(outInfo == null){
resultMap.put(hSerial,"单号不存在");
log.info("需求单号["+hSerial+"]不存在");
}else{
boolean outInfoExecuted = outInfo.getFirstExecuteTime() > 0;
if(outInfoExecuted){
resultMap.put(hSerial,"已执行过,不允许修改");
}else{
outInfo.setMdate(outItem.getMdate());
outInfo.setSdate(outItem.getSdate());
outInfoCache.updateSMDate(outInfo);
resultMap.put(hSerial,"ok");
}
}
}
return ResultBean.newOkResult(resultMap);
} catch (Exception e) {
log.error("需求单修改时间请求处理出错", e);
return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage());
}
}
/**
* 创建需求单 * 创建需求单
*/ */
@RequestMapping(value = "/out",method = RequestMethod.POST) @RequestMapping(value = "/out",method = RequestMethod.POST)
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<!-- <!--
<mongo:mongo id="mongo" replica-set="${mongo.replica-set}"> <mongo:mongo id="mongo" replica-set="${mongo.replica-set}">
--> -->
<mongo:mongo id="mongo" host="${mongo.host}" port="27017"> <mongo:mongo id="mongo" host="192.168.1.245" port="27017">
<mongo:options connections-per-host="${mongo.connectionsPerHost}" <mongo:options connections-per-host="${mongo.connectionsPerHost}"
threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}" threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}"
connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}" connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}"
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
socket-timeout="${mongo.socketTimeout}" slave-ok="${mongo.slaveOk}" socket-timeout="${mongo.socketTimeout}" slave-ok="${mongo.slaveOk}"
write-number="1" write-timeout="0" write-fsync="true" /> write-number="1" write-timeout="0" write-fsync="true" />
</mongo:mongo> </mongo:mongo>
<mongo:db-factory dbname="qisda" username="${mongo.username}" <mongo:db-factory dbname="qisda" username="dataUser"
password="${mongo.password}" mongo-ref="mongo" /> password="123" mongo-ref="mongo" />
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
</bean> </bean>
......
...@@ -39,24 +39,24 @@ ...@@ -39,24 +39,24 @@
</div> </div>
<div class="row "> <div class="row ">
<!--出入库 --> <!--出入库 -->
<div class="col-md-12"> <%--<div class="col-md-12">--%>
<!-- BEGIN CHART PORTLET--> <%--<!-- BEGIN CHART PORTLET-->--%>
<div class="portlet light bordered"> <%--<div class="portlet light bordered">--%>
<div class="portlet-title"> <%--<div class="portlet-title">--%>
<div class="caption"> <%--<div class="caption">--%>
<i class="icon-bar-chart font-green-haze"></i> <%--<i class="icon-bar-chart font-green-haze"></i>--%>
<span class="caption-subject bold uppercase font-green-haze"><fmt:message key="runStatus.throughput"/></span> <%--<span class="caption-subject bold uppercase font-green-haze"><fmt:message key="runStatus.throughput"/></span>--%>
</div> <%--</div>--%>
<div class="tools"> <%--<div class="tools">--%>
</div> <%--</div>--%>
</div> <%--</div>--%>
<div class="portlet-body"> <%--<div class="portlet-body">--%>
<div id="inOutChart" class="chart" style="height: 300px; overflow: hidden;"> <%--<div id="inOutChart" class="chart" style="height: 300px; overflow: hidden;">--%>
</div> <%--</div>--%>
</div> <%--</div>--%>
</div> <%--</div>--%>
<!-- END CHART PORTLET--> <%--<!-- END CHART PORTLET-->--%>
</div> <%--</div>--%>
<!--AGV--> <!--AGV-->
<div class="col-md-4 col-sm-4"> <div class="col-md-4 col-sm-4">
...@@ -384,10 +384,10 @@ ...@@ -384,10 +384,10 @@
}); });
} }
flushInOutChart(); // flushInOutChart();
setInterval(function(){ // setInterval(function(){
flushInOutChart(); // flushInOutChart();
}, 60 * 60000); // }, 60 * 60000);
}); });
</script> </script>
</c:set> </c:set>
\ No newline at end of file \ No newline at end of file
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
//var outItems = outInfo.outItems; //var outItems = outInfo.outItems;
var moveHandle = ''; var moveHandle = '';
if(outInfo.firstExecuteTime <= 0){ if(outInfo.firstExecuteTime <= 0){
moveHandle = '<span class="glyphicon glyphicon-arrow-up" style="width:30px;display:none;"></span>'; //moveHandle = '<span class="glyphicon glyphicon-arrow-up" style="width:30px;display:none;"></span>';
} }
var pannelColor = 'panel-default'; var pannelColor = 'panel-default';
...@@ -193,18 +193,19 @@ ...@@ -193,18 +193,19 @@
$(".panel-default").mouseover(function(){ $(".panel-default").mouseover(function(){
$(this).find(".glyphicon-arrow-up").unbind(); <%--$(this).find(".glyphicon-arrow-up").unbind();--%>
$(this).find(".glyphicon-arrow-up").show(); <%--$(this).find(".glyphicon-arrow-up").show();--%>
var hSerial = $(this).parent().attr("href"); <%--var hSerial = $(this).parent().attr("href");--%>
$(this).find(".glyphicon-arrow-up").click(function(event){ <%--$(this).find(".glyphicon-arrow-up").click(function(event){--%>
event.stopPropagation(); <%--event.stopPropagation();--%>
var hSerial = $(this).parent().attr("href").replace("#",""); <%--var hSerial = $(this).parent().attr("href").replace("#","");--%>
$.post("${ctx}/service/store/qisda/moveOutInfoToFirst", {hSerialToMove: hSerial}, function (data) { <%--alert('该功能已关闭');--%>
//moving = false; <%--&lt;%&ndash;$.post("${ctx}/service/store/qisda/moveOutInfoToFirst", {hSerialToMove: hSerial}, function (data) {&ndash;%&gt;--%>
alert(data); <%--&lt;%&ndash;//moving = false;&ndash;%&gt;--%>
}); <%--&lt;%&ndash;alert(data);&ndash;%&gt;--%>
<%--&lt;%&ndash;});&ndash;%&gt;--%>
});
<%--});--%>
}); });
$(".panel-default").mouseout(function(){ $(".panel-default").mouseout(function(){
$(this).find(".glyphicon-arrow-up").hide(); $(this).find(".glyphicon-arrow-up").hide();
......
...@@ -111,8 +111,12 @@ ...@@ -111,8 +111,12 @@
<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>
<display:column titleKey="更新时间" sortable="true" sortProperty="updateDate">
<fmt:formatDate value="${outInfo.updateDate}" pattern="yyyy-MM-dd HH:mm"/> <display:column titleKey="开始时间" sortable="true" sortProperty="firstExecuteTime" media="csv">
<fmt:formatDate value="${outInfo.firstExecuteDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
<display:column titleKey="结束时间" sortable="true" sortProperty="taskEndTime">
<fmt:formatDate value="${outInfo.taskEndDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column> </display:column>
<display:column titleKey="需求时间" sortable="true" sortProperty="taskNeedOutDate"> <display:column titleKey="需求时间" sortable="true" sortProperty="taskNeedOutDate">
......
...@@ -12,6 +12,41 @@ ...@@ -12,6 +12,41 @@
<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-green">
<div class="timeline-time">
<span class="date">2021</span>
<span class="time">04-01</span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021040111</h2>
<div class="timeline-content">
<ul>
<li>提供修改需求单建议时间和必须时间接口(必须时间超过12小时,且未执行过的需求单才允许进行修改)</li>
<li>未解绑料架需求单持续请求, 解决料架已解绑,但还显示红框的问题</li>
</ul>
</div>
</div>
</li>
<li class="timeline-blue">
<div class="timeline-time">
<span class="date">2021 </span>
<span class="time">03-30 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021033018</h2>
<div class="timeline-content">
<ul>
<li>关闭调整需求单优先级功能</li>
</ul>
</div>
</div>
</li>
<li class="timeline-yellow"> <li class="timeline-yellow">
<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.03.25</span> <span class="right" style="color: #a3a3a3;">Version: 2021.04.01</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!