Commit 23db6d3a sunke

修改线体功能

增加更新建议和必须出仓时间及线别目的地
PN需求单入库料盘绑定
1 个父辈 95065b61
package com.myproject.bean.qisda;
import java.util.ArrayList;
import java.util.List;
/**
* Created by sunke on 2020/6/12.
*/
public class LockInfo {
/**
* 工单序号
*/
private String soseq;
private String so;
/**
* 需求序号
*/
private String hSerial;
/**
* 站位序号
*/
private List<LockItemInfo> lockItems = new ArrayList<>();
public List<LockItemInfo> getLockItems() {
return lockItems;
}
public void setLockItems(List<LockItemInfo> lockItems) {
this.lockItems = lockItems;
}
public String getSo() {
return so;
}
public void setSo(String so) {
this.so = so;
}
public String getSoseq() {
return soseq;
}
public void setSoseq(String soseq) {
this.soseq = soseq;
}
public void addLockItem(LockItemInfo lockItem){
lockItems.add(lockItem);
}
public String gethSerial() {
return hSerial;
}
public void sethSerial(String hSerial) {
this.hSerial = hSerial;
}
}
......@@ -29,4 +29,6 @@ public interface IOutInfoDao extends IMongoDao {
void updateOutReelNum(String hSerial, int outReelNum);
void updateExecuteTime(String hSerial, long firstExecuteTime);
void updateOutInfo(OutInfo outInfo);
}
......@@ -90,6 +90,17 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao {
updateFirst(query,update);
}
/**
* 更新建议和必须出仓时间及线别目的地
*/
@Override
public void updateOutInfo(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()).set("line",outInfo.getLine());
updateFirst(query,update);
}
@Override
public void updateTaskEndTime(String hSerial, long taskEndTime){
update(hSerial, "taskEndTime", taskEndTime);
......
......@@ -155,12 +155,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c = c.and("w").is(barcode.getPlateSize()).and("h").is(barcode.getHeight());
}else if(compatibleType == StorageConstants.COMPATIBLE_TYPE.FULLY_COMPATIBLE){//同厚度兼容
//c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度大于等于料盘宽度,高度大于等于料盘高度
if(barcode.getPlateSize() != 7){
// if(barcode.getPlateSize() != 7){
c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//除7寸外,完全兼容
}else{
//=7寸使用同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());
}
// }else{
// //=7寸使用同尺寸兼容
// c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());
// }
}else if(compatibleType == StorageConstants.COMPATIBLE_TYPE.SIZE_COMPATIBLE){//同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
......
......@@ -531,7 +531,7 @@ public class StorageConstants {
/**
* 完全兼容
*/
FULLY_COMPATIBLE("11,13,15完全兼容"),
FULLY_COMPATIBLE("完全兼容"),
/**
* 同尺寸兼容
*/
......
......@@ -277,7 +277,11 @@ public class OutInfoCache {
continue;
}
//寻找未执行过的到达建议时间和必须出库时间的工单料(首盘或补料)
if(unEndOutInfo.isTailAction() || unEndOutInfo.isFirstReelAction()){
if(unEndOutInfo.isTailAction() || unEndOutInfo.isFirstReelAction() || unEndOutInfo.isPnAction()){
if(Strings.isBlank(unEndOutInfo.getLine())){
//无目的地
continue;
}
long firstExecuteTime = unEndOutInfo.getFirstExecuteTime();
if(firstExecuteTime < 0){
if(mustOutInfo == null || firstExecuteTime > mustOutInfo.getFirstExecuteTime()){
......@@ -811,6 +815,16 @@ public class OutInfoCache {
}
}
/**
* 更新需求单的建议和必须出仓时间及线别
*/
public void updateOutInfo(OutInfo outInfo){
//已经执行过的不能更新
outInfoDao.updateOutInfo(outInfo);
outInfoMap.put(outInfo.gethSerial(),outInfo);
log.info("更新需求单["+outInfo.gethSerial()+"]的建议时间为:"+outInfo.getSdate() + " 必须时间为:" + outInfo.getMdate());
}
private void removeFromCache(String hSerial){
outInfoMap.remove(hSerial);
......
package com.myproject.webapp.controller.webService;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.myproject.bean.json.ChartItem;
import com.myproject.bean.qisda.*;
......@@ -120,7 +119,24 @@ public class QisdaApiController extends BaseController {
}
@RequestMapping("/updateLine")
@ResponseBody
public ResultBean updateLine(HttpServletRequest request){
String hSerial = request.getParameter("hSerial");
String line = request.getParameter("line");
//OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
//qisdaBindService.realBindOutInfo(outInfo);
log.info("手动修改需求单["+hSerial+"]目的地:" + line);
OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
if(!Strings.isNullOrEmpty(line) && outInfo != null){
outInfo.setLine(line);
outInfoCache.updateOutInfo(outInfo);
return ResultBean.newOkResult(outInfo);
}else{
return ResultBean.newErrorResult(2001,"线别为空");
}
}
@RequestMapping("/executeOut")
@ResponseBody
......@@ -161,6 +177,31 @@ public class QisdaApiController extends BaseController {
QisdaApi.VMIMateriaReceive(barcode, task);
}
}
/**
* 获取需求单的绑定信息
*/
@RequestMapping(value = "/hSerialLockInfo")
@ResponseBody
public ResultBean hSerialLockInfo(HttpServletRequest request){
String hSerialListStr = receiveParamInfo(request,"hSerialList");
log.info("收到工单绑定查询请求hSerialListStr="+ hSerialListStr);
Set<String> hSerialSet = Sets.newHashSet();
if(!Strings.isNullOrEmpty(hSerialListStr)){
String[] hSerialArr = hSerialListStr.split(",");
for (String hSerial : hSerialArr) {
hSerialSet.add(hSerial);
}
}
List<LockInfo> lockInfos = new ArrayList<>();
for (String soseq : hSerialSet) {
LockInfo lockInfo = getHSerialLockInfo(soseq);
lockInfos.add(lockInfo);
}
return ResultBean.newOkResult(lockInfos);
}
/**
* 获取工单的绑定信息
*/
......@@ -188,20 +229,43 @@ public class QisdaApiController extends BaseController {
}
}
List<SoseqLockInfo> lockInfos = new ArrayList<>();
List<LockInfo> lockInfos = new ArrayList<>();
for (String soseq : soseqSet) {
SoseqLockInfo lockInfo = getLockInfo(soseq);
LockInfo lockInfo = getSoSeqLockInfo(soseq);
lockInfos.add(lockInfo);
}
return ResultBean.newOkResult(lockInfos);
}
private SoseqLockInfo getLockInfo(String soseq){
SoseqLockInfo soseqLockInfo = new SoseqLockInfo();
soseqLockInfo.setSoseq(soseq);
private LockInfo getHSerialLockInfo(String hSerial){
LockInfo lockInfo = new LockInfo();
lockInfo.sethSerial(hSerial);
OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
if(outInfo != null){
lockInfo.setSo(outInfo.getSo());
lockInfo.setSoseq(outInfo.getSoseq());
for (OutItem outItem : outInfo.getOutItems()) {
LockItemInfo lockItemInfo = new LockItemInfo();
lockItemInfo.setSoseq(outItem.getSoseq());
lockItemInfo.setSlotlocation(outItem.getSlotlocation());
lockItemInfo.setPartNum(outItem.getPn());
lockItemInfo.setQty(outItem.getQty());
lockItemInfo.setPreLockQty(outItem.getLockQty());
lockItemInfo.setRealLockQty(outItem.getRealLockQty());
lockItemInfo.setTotalSendQty(outItem.getSendQty());
lockItemInfo.setFirstSendQty(outItem.getOutQty());
lockInfo.addLockItem(lockItemInfo);
}
}
return lockInfo;
}
private LockInfo getSoSeqLockInfo(String soseq){
LockInfo lockInfo = new LockInfo();
lockInfo.setSoseq(soseq);
OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(soseq);
if(cutOutInfo != null){
soseqLockInfo.setSo(cutOutInfo.getSo());
lockInfo.setSo(cutOutInfo.getSo());
for (OutItem outItem : cutOutInfo.getOutItems()) {
LockItemInfo lockItemInfo = new LockItemInfo();
lockItemInfo.setSoseq(outItem.getSoseq());
......@@ -212,10 +276,10 @@ public class QisdaApiController extends BaseController {
lockItemInfo.setRealLockQty(outItem.getRealLockQty());
lockItemInfo.setTotalSendQty(outItem.getSendQty());
lockItemInfo.setFirstSendQty(outItem.getOutQty());
soseqLockInfo.addLockItem(lockItemInfo);
lockInfo.addLockItem(lockItemInfo);
}
}
return soseqLockInfo;
return lockInfo;
}
/**
......@@ -297,19 +361,28 @@ public class QisdaApiController extends BaseController {
}
/**
* 关闭工单
* 关闭工单或需求单
*/
@RequestMapping(value = "/closeSoSeq",method = RequestMethod.POST)
@RequestMapping(value = "/closeOutInfo",method = RequestMethod.POST)
@ResponseBody
public ResultBean closeSoSeq(HttpServletRequest request) {
public ResultBean closeOutInfo(HttpServletRequest request) {
try {
String soseq = receiveParamInfo(request,"soseq");
log.info("收到关闭工单请求soseq="+soseq);
if(soseq == null){
return ResultBean.newErrorResult(-1,"未找到soseq参数");
String hSerial = receiveParamInfo(request,"hSerial");
log.info("收到关闭工单请求soseq="+soseq+"&hSerial="+hSerial);
if(soseq == null && hSerial == null){
return ResultBean.newErrorResult(-1,"未找到soseq或hSerial参数");
}
String msg = "";
if(soseq != null){
ResultBean resultBean = outInfoCache.closeSoSeq(soseq);
msg = resultBean.getMsg();
}
if(hSerial != null){
ResultBean resultBean = outInfoCache.closeHSerial(hSerial);
msg = msg + resultBean.getMsg();
}
ResultBean resultBean = outInfoCache.closeSoSeq(soseq);
return resultBean;
return ResultBean.newOkResult(msg);
} catch (Exception e) {
log.error("需求单请求处理出错", e);
return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage());
......@@ -627,6 +700,73 @@ 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);
String resultMsg = "";
if(outInfo == null){
resultMsg = "需求单号不存在";
}else{
boolean outInfoExecuted = outInfo.getFirstExecuteTime() > 0;
if(outInfoExecuted){
resultMsg = "需求单已执行过,不允许修改";
}else{
Date now = new Date();
Date oldMustDate = outInfo.getMdate();
Date newSuggestDate = outItem.getSdate();
Date newMustDate = outItem.getMdate();
if(oldMustDate.before(now)){
resultMsg = "需求单已到达必须时间,不允许修改";
}else if(newSuggestDate.before(now)){
resultMsg = "新的建议时间不能早于当前时间";
}else if(newMustDate.before(now)){
resultMsg = "新的必须时间不能早于当前时间";
}else{
if(newMustDate != null){
outInfo.setMdate(newMustDate);
}
if(newSuggestDate != null){
outInfo.setSdate(newSuggestDate);
}
String newLine = outItem.getLine();
if(Strings.isNullOrEmpty(newLine)){
outInfo.setLine(outItem.getLine());
}
outInfoCache.updateOutInfo(outInfo);
resultMsg = "ok";
}
}
}
resultMap.put(hSerial, resultMsg);
log.info("需求单["+hSerial+"]修改时间结果:"+resultMsg);
}
return ResultBean.newOkResult(resultMap);
} catch (Exception e) {
log.error("需求单修改时间请求处理出错", e);
return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage());
}
}
//-------------------------Private Method----------------------------------------
......
......@@ -330,6 +330,7 @@ public class QisdaBindService {
if(Strings.isBlank(bindSoseq)){
//未绑定
bindItem = findNeedBindItem(barcode);
barcode = barcode.removeBindInfo();
}else{
//料盘分盘过后入库(已经预绑定过)
isCutReelIn = true;
......@@ -481,6 +482,7 @@ public class QisdaBindService {
//List<OutItem> cutItemList = outItemDao.findCutItemList(lessSoseqList, pn, facility);
log.info("查找["+String.join(",",lessHSerialList)+"]未完成pn=["+pn+"]facility=["+facility+"]的需求单详情");
List<OutItem> outItemList = outItemDao.findUnFinishedItemList(lessHSerialList,pn, facility);
//优先绑定执行过的工单,如果没有,则绑定优先执行的工单
......@@ -489,16 +491,20 @@ public class QisdaBindService {
for (OutItem outItem : outItemList) {
if(!outItem.isBindOk()){
OutInfo outInfo = soseqCache.getCutActionInfoFromCache(outItem.getSoseq());
OutInfo outInfo = outInfoCache.getOutInfoFromCache(outItem.gethSerial());
if(outInfo != null){
//真实绑定缺料
if(outItem.realBindLessQty() > 0){
int orderIndex = lessHSerialList.indexOf(outItem.gethSerial());
if(needBindItem == null || orderIndex < executeOrderIndex){
needBindItem = outItem;
executeOrderIndex = orderIndex;
if(outInfo.isPnAction() || outInfo.isReelCutAction()){
//真实绑定缺料
if(outItem.realBindLessQty() > 0){
int orderIndex = lessHSerialList.indexOf(outItem.gethSerial());
if(needBindItem == null || orderIndex < executeOrderIndex){
needBindItem = outItem;
executeOrderIndex = orderIndex;
}
}
}
}
}
}
......
......@@ -144,7 +144,7 @@
'<h4 class="panel-title">' +
'<a class="accordion-toggle" data-toggle="collapse" href="#'+outInfo.hSerial+'">' +
moveHandle + //outInfo.firstExecuteTime +
'需求单:'+ outInfo.hSerial+' ['+outInfo.action+'] 工单: ' + outInfo.so +' 备料单: ' + outInfo.refno + '[' + outInfo.sendStatus +'] 工单序号:' + outInfo.soseq +
'需求单:'+ outInfo.hSerial+' ['+outInfo.action+'] 工单: ' + outInfo.so +' 线别: ' + outInfo.line + ' 工单序号:' + outInfo.soseq +
'<span class="right">创建时间: '+createDate+'</span>' +
'<span class="right">建议时间: '+sdate+'</span>' +
'<span class="right">必须时间: '+mdate+'</span>' +
......@@ -154,7 +154,7 @@
'<div class="panel-body bg-grey">' +
'<ul class="list-inline">' +
'<li><i class="fa fa-tasks"></i>工单: '+outInfo.so+'</li>' +
'<li><i class="fa fa-briefcase"></i>备料单: '+outInfo.refno+'</li>' +
// '<li><i class="fa fa-briefcase"></i>备料单: '+outInfo.refno+'</li>' +
'<li><i class="fa fa-calendar"></i>建议时间:'+sdate+'</li>' +
'<li><i class="fa fa-star"></i>必须出仓日期:'+mdate+'</li>' +
'<li><i class="fa fa-star"></i>创建时间:'+createDate+'</li>' +
......
......@@ -91,7 +91,13 @@
<display:column titleKey="工单" sortable="true" sortProperty="so">
${outInfo.so}<c:if test="${outInfo.soseq != null}">(${outInfo.soseq})</c:if>
</display:column>
<display:column titleKey="线别" property="line" sortable="true" sortProperty="line"/>
<display:column titleKey="线别" sortable="true" sortProperty="line" media="html">
<span id="${outInfo.hSerial}Line">${outInfo.line}</span>
<c:if test="${outInfo.firstExecuteTime <=0}">
[<a href="#" onclick="changeLine('${outInfo.hSerial}')">编辑</a>]
</c:if>
</display:column>
<display:column titleKey="备料单号" property="refno" sortable="true" sortProperty="refno"/>
<display:column titleKey="建议出仓时间" sortable="true" sortProperty="sdate">
<fmt:formatDate value="${outInfo.sdate}" pattern="yyyy-MM-dd HH:mm"/>
......@@ -202,6 +208,40 @@
</div>
</div>
<div id="lineModifyWindow" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="margin-top: 10%;width:50%;margin-left:25%;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" style="font-weight: 500;">线别修改</h4>
</div>
<div class="modal-body" style="height:80px;overflow-y:hidden;">
<div class="row">
<label class="control-label col-md-2"><fmt:message key="线别:"/></label>
<div class="input-group">
<input type="hidden" id="hSerialToModify" value=""/>
<input type="text" class="form-control" id="lineToModify" />
</div>
<h4>
<span id="lineErrorMsg" style="font-weight: 500;color:red;"></span>
</h4>
</div>
</div>
<div class="modal-footer">
<div>
<%--<a href="" class="btn yellow left" id="findAndOut"><i class="fa fa-sign-out"></i><fmt:message key="allBoxView.findAndOut"/></a>--%>
<button type="button" class="btn green" onclick="lineModifyOkClick();" >
<fmt:message key="button.save"/></button>
<button type="button" data-dismiss="modal" class="btn default" id="cancelAuthBtn"><fmt:message key="button.cancel"/></button>
</div>
</div>
</div>
</div>
</div>
<c:set var="scripts" scope="request">
<script type="text/javascript">
$(document).ready(function(){
......@@ -265,6 +305,23 @@
});
}
changeLine = function (hSerial){
$("#hSerialToModify").val(hSerial);
var oldLine = $("#lineToModify").text();
$("#lineToModify").val(oldLine);
$("#lineModifyWindow").modal("show");
}
lineModifyOkClick = function(){
var line = $("#lineToModify").val();
var hSerial = $("#hSerialToModify").val();
$.post("${ctx}/rest/api/dcs/updateLine", {hSerial: hSerial, line: line}, function (data) {
$("#"+hSerial+"Line").html(line);
$("#lineModifyWindow").modal("hide");
});
}
$(".filterInput").on('input propertychange',function(){
var searchStr = $(this).val();
$(".theItems").children().each(function(){
......
......@@ -85,11 +85,11 @@
</a>
</li>
<%--<li class="classic-menu-dropdown">--%>
<%--<a href="${ctx}/workOrder/checkOutSettings.html" name="workOrder">--%>
<%--<fmt:message key="menu.outRule"/><span class="selected"></span>--%>
<%--</a>--%>
<%--</li>--%>
<li class="classic-menu-dropdown">
<a href="${ctx}/workOrder/checkOutSettings.html" name="workOrder">
<fmt:message key="menu.outRule"/><span class="selected"></span>
</a>
</li>
</security:authorize>
</ul>
</security:authorize>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!