Commit b4456845 sunke

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

提供修改需求单建议时间和必须时间接口
未解绑料架需求单持续请求, 解决料架已解绑,但还显示红框的问题
1 个父辈 423c514e
......@@ -24,6 +24,8 @@ public interface IOutInfoDao extends IMongoDao {
void updateTaskEndTime(String hSerial, long taskEndTime);
void updateSMDate(OutInfo outInfo);
void updateTaskFinishNum(String hSerail, int taskFinishNum);
void updateOutReelNum(String hSerial, int outReelNum);
......
......@@ -13,6 +13,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
......@@ -95,6 +96,17 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao {
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
public void updateTaskFinishNum(String hSerail, int taskFinishNum){
update(hSerail, "taskFinishNum", taskFinishNum);
......
......@@ -304,7 +304,7 @@ public class QisdaController extends BaseController {
* @param request
* @return
*/
@RequestMapping("/service/store/qisda/moveOutInfoToFirst")
@RequestMapping("/service/store/qisda/moveTheOutInfoToFirst")
@ResponseBody
public String moveOutInfoToFirst(HttpServletRequest request){
String hSerialToMove = request.getParameter("hSerialToMove");
......
......@@ -81,6 +81,7 @@ public class OutInfoCache {
updateMustExeOutInfo();
executeBindTask();
executeOutTask();
checkBindShelf();
}
}catch (Exception e){
log.error("需求单定时器执行出错:",e);
......@@ -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(){
Date now = new Date();
......@@ -369,6 +417,9 @@ public class OutInfoCache {
* 将需求单加入到缓存
*/
public void addOutInfo(OutInfo outInfo){
if(outInfo == null){
return;
}
//先把缓存清理掉,从数据库中查询
String hserial =outInfo.gethSerial();
if(!hserial.isEmpty() && !outInfo.isSendEnd() && !outInfo.isClosed()){
......@@ -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){
......
......@@ -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)
......
......@@ -14,7 +14,7 @@
<!--
<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}"
threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}"
connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}"
......@@ -22,8 +22,8 @@
socket-timeout="${mongo.socketTimeout}" slave-ok="${mongo.slaveOk}"
write-number="1" write-timeout="0" write-fsync="true" />
</mongo:mongo>
<mongo:db-factory dbname="qisda" username="${mongo.username}"
password="${mongo.password}" mongo-ref="mongo" />
<mongo:db-factory dbname="qisda" username="dataUser"
password="123" mongo-ref="mongo" />
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
</bean>
......
......@@ -39,24 +39,24 @@
</div>
<div class="row ">
<!--出入库 -->
<div class="col-md-12">
<!-- BEGIN CHART PORTLET-->
<div class="portlet light bordered">
<div class="portlet-title">
<div class="caption">
<i class="icon-bar-chart font-green-haze"></i>
<span class="caption-subject bold uppercase font-green-haze"><fmt:message key="runStatus.throughput"/></span>
</div>
<div class="tools">
</div>
</div>
<div class="portlet-body">
<div id="inOutChart" class="chart" style="height: 300px; overflow: hidden;">
</div>
</div>
</div>
<!-- END CHART PORTLET-->
</div>
<%--<div class="col-md-12">--%>
<%--<!-- BEGIN CHART PORTLET-->--%>
<%--<div class="portlet light bordered">--%>
<%--<div class="portlet-title">--%>
<%--<div class="caption">--%>
<%--<i class="icon-bar-chart font-green-haze"></i>--%>
<%--<span class="caption-subject bold uppercase font-green-haze"><fmt:message key="runStatus.throughput"/></span>--%>
<%--</div>--%>
<%--<div class="tools">--%>
<%--</div>--%>
<%--</div>--%>
<%--<div class="portlet-body">--%>
<%--<div id="inOutChart" class="chart" style="height: 300px; overflow: hidden;">--%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
<%--<!-- END CHART PORTLET-->--%>
<%--</div>--%>
<!--AGV-->
<div class="col-md-4 col-sm-4">
......@@ -384,10 +384,10 @@
});
}
flushInOutChart();
setInterval(function(){
flushInOutChart();
}, 60 * 60000);
// flushInOutChart();
// setInterval(function(){
// flushInOutChart();
// }, 60 * 60000);
});
</script>
</c:set>
\ No newline at end of file
......@@ -122,7 +122,7 @@
//var outItems = outInfo.outItems;
var moveHandle = '';
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';
......@@ -193,18 +193,19 @@
$(".panel-default").mouseover(function(){
$(this).find(".glyphicon-arrow-up").unbind();
$(this).find(".glyphicon-arrow-up").show();
var hSerial = $(this).parent().attr("href");
$(this).find(".glyphicon-arrow-up").click(function(event){
event.stopPropagation();
var hSerial = $(this).parent().attr("href").replace("#","");
$.post("${ctx}/service/store/qisda/moveOutInfoToFirst", {hSerialToMove: hSerial}, function (data) {
//moving = false;
alert(data);
});
<%--$(this).find(".glyphicon-arrow-up").unbind();--%>
<%--$(this).find(".glyphicon-arrow-up").show();--%>
<%--var hSerial = $(this).parent().attr("href");--%>
<%--$(this).find(".glyphicon-arrow-up").click(function(event){--%>
<%--event.stopPropagation();--%>
<%--var hSerial = $(this).parent().attr("href").replace("#","");--%>
<%--alert('该功能已关闭');--%>
<%--&lt;%&ndash;$.post("${ctx}/service/store/qisda/moveOutInfoToFirst", {hSerialToMove: hSerial}, function (data) {&ndash;%&gt;--%>
<%--&lt;%&ndash;//moving = false;&ndash;%&gt;--%>
<%--&lt;%&ndash;alert(data);&ndash;%&gt;--%>
<%--&lt;%&ndash;});&ndash;%&gt;--%>
});
<%--});--%>
});
$(".panel-default").mouseout(function(){
$(this).find(".glyphicon-arrow-up").hide();
......
......@@ -111,8 +111,12 @@
<display:column titleKey="创建时间" sortable="true" sortProperty="createDate">
<fmt:formatDate value="${outInfo.createDate}" pattern="yyyy-MM-dd HH:mm"/>
</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 titleKey="需求时间" sortable="true" sortProperty="taskNeedOutDate">
......
......@@ -12,6 +12,41 @@
<div class="row">
<div class="col-md-12">
<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">
<div class="timeline-time">
<span class="date">2021 </span>
......
......@@ -239,7 +239,7 @@
<div class="page-footer-inner">
2016&copy; <a href="${ctx}/updateHistory.html">SMD BOX</a>
</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">
<i class="icon-arrow-up"></i>
</div>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!