Commit da869e65 sunke

尺寸不一致,使用佳世达维护的尺寸

需求单手动操作时,重复执行问题
访问Qisda接口时,返回内部异常,进行重发
1 个父辈 796407e1
...@@ -383,7 +383,7 @@ public class InquiryShelfBean { ...@@ -383,7 +383,7 @@ public class InquiryShelfBean {
if(Strings.isEmpty(rfid)){ if(Strings.isEmpty(rfid)){
return null; return null;
} }
ShelfInfo minIndexShelf = null; //ShelfInfo minIndexShelf = null;
for (Map<String, ShelfInfo> shelfInfoMap : hSerialShelfMap.values()) { for (Map<String, ShelfInfo> shelfInfoMap : hSerialShelfMap.values()) {
for (ShelfInfo shelf : shelfInfoMap.values()) { for (ShelfInfo shelf : shelfInfoMap.values()) {
String shelfRFID = shelf.getRealRfid(); String shelfRFID = shelf.getRealRfid();
......
...@@ -633,7 +633,7 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ { ...@@ -633,7 +633,7 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
long timeoutTime = 20 * 60 * 1000; long timeoutTime = 20 * 60 * 1000;
if(!isWait()){ if(!isWait()){
timeoutTime = 10 * 60 * 1000; timeoutTime = 8 * 60 * 1000;
} }
return now - getUpdateDate().getTime() > timeoutTime; return now - getUpdateDate().getTime() > timeoutTime;
} }
......
...@@ -418,8 +418,13 @@ public class QisdaApi { ...@@ -418,8 +418,13 @@ public class QisdaApi {
try { try {
String result = HttpHelper.postParam(url,paramMap); String result = HttpHelper.postParam(url,paramMap);
log.info(reelID + "纯入库操作完成时通知Qisda接口(VMILocationIn)返回:" + result); log.info(reelID + "纯入库操作完成时通知Qisda接口(VMILocationIn)返回:" + result);
QisdaCache.removeFailedRequest(apiRequest); String resultStr = XmlUtil.getNodeBody("string", result);
return; if(resultStr.startsWith("-1")){
log.info("Qisda接口内部异常,需要进行重发");
}else{
QisdaCache.removeFailedRequest(apiRequest);
return;
}
} catch (Exception e) { } catch (Exception e) {
log.error(reelID + "纯入库操作完成时通知Qisda接口(VMILocationIn)出错",e); log.error(reelID + "纯入库操作完成时通知Qisda接口(VMILocationIn)出错",e);
} }
...@@ -459,8 +464,14 @@ public class QisdaApi { ...@@ -459,8 +464,14 @@ public class QisdaApi {
try { try {
String result = HttpHelper.postParam(url,paramMap); String result = HttpHelper.postParam(url,paramMap);
log.info("DN单收料或Facility收料["+barcode.getBarcode()+"]接口返回:" + result); log.info("DN单收料或Facility收料["+barcode.getBarcode()+"]接口返回:" + result);
QisdaCache.removeFailedRequest(apiRequest); String resultStr = XmlUtil.getNodeBody("string", result);
return; if(resultStr.startsWith("-1")){
log.info("Qisda接口内部异常,需要进行重发");
}else{
QisdaCache.removeFailedRequest(apiRequest);
return;
}
} catch (Exception e) { } catch (Exception e) {
log.error("DN单收料或Facility收料接口出错",e); log.error("DN单收料或Facility收料接口出错",e);
} }
...@@ -485,9 +496,14 @@ public class QisdaApi { ...@@ -485,9 +496,14 @@ public class QisdaApi {
QisdaApiRequest apiRequest = new QisdaApiRequest("出仓",paramMap,reelId,url); QisdaApiRequest apiRequest = new QisdaApiRequest("出仓",paramMap,reelId,url);
try { try {
String result = HttpHelper.postParam(url,paramMap); String result = HttpHelper.postParam(url,paramMap);
log.info("出仓完成时通知Qisda(VMILocationOut)返回:" + result); log.info(reelId + "出仓完成时通知Qisda(VMILocationOut)返回:" + result);
QisdaCache.removeFailedRequest(apiRequest); String resultStr = XmlUtil.getNodeBody("string", result);
return; if(resultStr.startsWith("-1")){
log.info("Qisda接口内部异常,需要进行重发");
}else{
QisdaCache.removeFailedRequest(apiRequest);
return;
}
} catch (Exception e) { } catch (Exception e) {
log.error("出仓完成时通知Qisda(VMILocationOut)接口出错",e); log.error("出仓完成时通知Qisda(VMILocationOut)接口出错",e);
} }
...@@ -552,8 +568,13 @@ public class QisdaApi { ...@@ -552,8 +568,13 @@ public class QisdaApi {
try { try {
String result = HttpHelper.postParam(url,paramMap); String result = HttpHelper.postParam(url,paramMap);
log.info(task.getBarcode() + "物料放上小车时通知Qisda(VMIMateriaRecAss)返回:" + result); log.info(task.getBarcode() + "物料放上小车时通知Qisda(VMIMateriaRecAss)返回:" + result);
QisdaCache.removeFailedRequest(apiRequest); String resultStr = XmlUtil.getNodeBody("string", result);
return; if(resultStr.startsWith("-1")){
log.info("Qisda接口内部异常,需要进行重发");
}else{
QisdaCache.removeFailedRequest(apiRequest);
return;
}
} catch (Exception e) { } catch (Exception e) {
log.error(task.getBarcode() + "物料放上小车时通知Qisda(VMIMateriaRecAss)接口出错",e); log.error(task.getBarcode() + "物料放上小车时通知Qisda(VMIMateriaRecAss)接口出错",e);
} }
......
...@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; ...@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
/** /**
* Created by sunke on 2020/3/5. * Created by sunke on 2020/3/5.
...@@ -631,7 +632,25 @@ public class OutInfoCache { ...@@ -631,7 +632,25 @@ public class OutInfoCache {
return null; return null;
} }
private static AtomicBoolean outProcessing = new AtomicBoolean(false);
public synchronized ResultBean checkOutOutItems(String hSerial){ public synchronized ResultBean checkOutOutItems(String hSerial){
boolean canProcess = outProcessing.compareAndSet(false, true);
try{
if(canProcess){
ResultBean resultBean = executeOutItems(hSerial);
return resultBean;
}else{
return ResultBean.newErrorResult(1007,"有需求单执行任务未完成,请稍后再试");
}
}catch (Exception e){
return ResultBean.newErrorResult(1008,"需求单执行出错:"+e.getMessage());
}finally {
outProcessing.set(false);
}
}
public synchronized ResultBean executeOutItems(String hSerial){
//OutInfo outInfo = outInfoDao.findByHSerial(hSerial); //OutInfo outInfo = outInfoDao.findByHSerial(hSerial);
OutInfo outInfo = getOutInfoFromCache(hSerial); OutInfo outInfo = getOutInfoFromCache(hSerial);
......
...@@ -374,21 +374,25 @@ public class DataCache{ ...@@ -374,21 +374,25 @@ public class DataCache{
Component component = getComponent(barcodeFromRule); Component component = getComponent(barcodeFromRule);
if(component.isSizeConfirmed()){ if(component.isSizeConfirmed()){
//尺寸已经确认的,判断尺寸,如果大小不符合,直接NG,如果大小符合,尺寸差别在4mm内的修改尺寸 //尺寸已经确认的,判断尺寸,如果大小不符合,直接NG,如果大小符合,尺寸差别在4mm内的修改尺寸
if(barcodeFromRule.getPlateSize() != component.getPlateSize()){ // if(barcodeFromRule.getPlateSize() != component.getPlateSize()){
String msg = barcodeFromRule.getBarcode() + "测量尺寸["+barcodeFromRule.getSizeStr()+"]与给定尺寸["+component.getSizeStr()+"]不符"; // String msg = barcodeFromRule.getBarcode() + "测量尺寸["+barcodeFromRule.getSizeStr()+"]与给定尺寸["+component.getSizeStr()+"]不符";
throw new ValidateException(msg); // throw new ValidateException(msg);
}else{ // }else{
//如果厚度小于4mm,使用确认的尺寸入库 // //如果厚度小于4mm,使用确认的尺寸入库
int diffHeight = barcodeFromRule.getHeight() - component.getHeight(); // int diffHeight = barcodeFromRule.getHeight() - component.getHeight();
if(Math.abs(diffHeight) > 4){ // if(Math.abs(diffHeight) > 4){
String msg = barcodeFromRule.getBarcode() + "测量厚度["+barcodeFromRule.getSizeStr()+"]与给定厚度["+component.getSizeStr()+"]误差过大"; // String msg = barcodeFromRule.getBarcode() + "测量厚度["+barcodeFromRule.getSizeStr()+"]与给定厚度["+component.getSizeStr()+"]误差过大";
throw new ValidateException(msg); // throw new ValidateException(msg);
}else if(diffHeight !=0 && Math.abs(diffHeight) <= 4){ // }else if(diffHeight !=0 && Math.abs(diffHeight) <= 4){
log.info(barcodeFromRule.getBarcode() + "测量尺寸["+barcodeFromRule.getSizeStr()+"]与给定寸["+component.getSizeStr()+"]厚度误差在4mm以内,使用给定尺寸进行入库"); // log.info(barcodeFromRule.getBarcode() + "测量尺寸["+barcodeFromRule.getSizeStr()+"]与给定寸["+component.getSizeStr()+"]厚度误差在4mm以内,使用给定尺寸进行入库");
barcodeFromRule.setHeight(component.getHeight()); // barcodeFromRule.setHeight(component.getHeight());
barcodeFromRule = barcodeManager.save(barcodeFromRule); // barcodeFromRule = barcodeManager.save(barcodeFromRule);
} // }
} // }
barcodeFromRule.setPlateSize(component.getPlateSize());
barcodeFromRule.setHeight(component.getHeight());
barcodeFromRule = barcodeManager.save(barcodeFromRule);
} }
if(barcode == null){ if(barcode == null){
......
...@@ -117,6 +117,7 @@ public class QisdaApiController extends BaseController { ...@@ -117,6 +117,7 @@ public class QisdaApiController extends BaseController {
String hSerial = request.getParameter("hSerial"); String hSerial = request.getParameter("hSerial");
//OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial); //OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
//qisdaBindService.realBindOutInfo(outInfo); //qisdaBindService.realBindOutInfo(outInfo);
log.info("手动执行需求单["+hSerial+"]出库");
ResultBean resultBean = outInfoCache.checkOutOutItems(hSerial); ResultBean resultBean = outInfoCache.checkOutOutItems(hSerial);
return resultBean.getMsg(); return resultBean.getMsg();
} }
......
...@@ -11,6 +11,7 @@ import com.myproject.dao.mongo.qisda.ICacheInfoDao; ...@@ -11,6 +11,7 @@ import com.myproject.dao.mongo.qisda.ICacheInfoDao;
import com.myproject.dao.mongo.qisda.IDNItemDao; import com.myproject.dao.mongo.qisda.IDNItemDao;
import com.myproject.exception.ApiException; import com.myproject.exception.ApiException;
import com.myproject.util.HttpHelper; import com.myproject.util.HttpHelper;
import com.myproject.util.XmlUtil;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
...@@ -315,6 +316,15 @@ public class QisdaCache { ...@@ -315,6 +316,15 @@ public class QisdaCache {
} }
public static void updateUsedRfid(List<String> usedRfidList){ public static void updateUsedRfid(List<String> usedRfidList){
String oldUsedRfid = "";
if(lastHSerialUsedRfidList != null){
oldUsedRfid = String.join(",",lastHSerialUsedRfidList);
}
String newUsedRfid = "";
if(usedRfidList != null){
newUsedRfid = String.join(",",usedRfidList);
}
log.info("已使用过的料架信息更新:["+oldUsedRfid+"]=>["+newUsedRfid+"]");
lastHSerialUsedRfidList = usedRfidList; lastHSerialUsedRfidList = usedRfidList;
} }
...@@ -390,7 +400,13 @@ public class QisdaCache { ...@@ -390,7 +400,13 @@ public class QisdaCache {
log.info("重发通知指令[" + apiRequest.getMapKey() + "]到Qisda"); log.info("重发通知指令[" + apiRequest.getMapKey() + "]到Qisda");
String result = HttpHelper.postParam(apiRequest.getUrl(),apiRequest.getParamMap()); String result = HttpHelper.postParam(apiRequest.getUrl(),apiRequest.getParamMap());
log.info("重发通知指令[" + apiRequest.getMapKey() + "]到Qisda返回:" + result); log.info("重发通知指令[" + apiRequest.getMapKey() + "]到Qisda返回:" + result);
QisdaCache.removeFailedRequest(apiRequest); String resultStr = XmlUtil.getNodeBody("string", result);
if(resultStr.startsWith("-1")){
log.info("Qisda接口内部异常,需要进行重发");
return;
}else{
QisdaCache.removeFailedRequest(apiRequest);
}
} }
} }
......
...@@ -996,6 +996,7 @@ public class QisdaDeviceController extends BaseController { ...@@ -996,6 +996,7 @@ public class QisdaDeviceController extends BaseController {
//料架上一个工单使用过,直接放行,其他情况继续使用 //料架上一个工单使用过,直接放行,其他情况继续使用
boolean lastHSerialUsed = QisdaCache.isLastHSerialUsedRfid(rfid); boolean lastHSerialUsed = QisdaCache.isLastHSerialUsedRfid(rfid);
if(!lastHSerialUsed){ if(!lastHSerialUsed){
//没有使用过
smallEmpty = 100; smallEmpty = 100;
bigEmpty = 100; bigEmpty = 100;
packageEmpty = 100; packageEmpty = 100;
...@@ -1004,8 +1005,10 @@ public class QisdaDeviceController extends BaseController { ...@@ -1004,8 +1005,10 @@ public class QisdaDeviceController extends BaseController {
if(!usedRfidList.isEmpty()){ if(!usedRfidList.isEmpty()){
log.info("料架["+rfid+"]上一个需求单已使用,当前需求单["+hSerial+"]物料已放上料架,清理上一个需求单使用过的料架"); log.info("料架["+rfid+"]上一个需求单已使用,当前需求单["+hSerial+"]物料已放上料架,清理上一个需求单使用过的料架");
QisdaCache.updateUsedRfid(null); QisdaCache.updateUsedRfid(null);
smallEmpty = 100;
bigEmpty = 100;
packageEmpty = 100;
} }
} }
} }
...@@ -1111,6 +1114,7 @@ public class QisdaDeviceController extends BaseController { ...@@ -1111,6 +1114,7 @@ public class QisdaDeviceController extends BaseController {
String rfid = request.getParameter("rfid"); String rfid = request.getParameter("rfid");
ShelfInfo shelfInfo = InquiryShelfBean.findShelf(rfid); ShelfInfo shelfInfo = InquiryShelfBean.findShelf(rfid);
int taskCount = 0; int taskCount = 0;
String msg = "ok";
if(shelfInfo != null){ if(shelfInfo != null){
Map<Integer, ShelfLoc> locMap = shelfInfo.getLocMap(); Map<Integer, ShelfLoc> locMap = shelfInfo.getLocMap();
for (ShelfLoc shelfLoc : locMap.values()) { for (ShelfLoc shelfLoc : locMap.values()) {
...@@ -1118,11 +1122,13 @@ public class QisdaDeviceController extends BaseController { ...@@ -1118,11 +1122,13 @@ public class QisdaDeviceController extends BaseController {
taskCount = taskCount + 1; taskCount = taskCount + 1;
} }
} }
}else{
msg = "未找到包装料架"+rfid;
} }
Map<String,Object> resultMap = new HashMap<>(); Map<String,Object> resultMap = new HashMap<>();
resultMap.put("taskCount",taskCount); resultMap.put("taskCount",taskCount);
resultMap.put("rfid",rfid); resultMap.put("rfid",rfid);
return ResultBean.newOkResult(resultMap); return ResultBean.newOkResult(msg, resultMap);
} }
/** /**
......
...@@ -1097,7 +1097,7 @@ public class TaskService implements ITaskService { ...@@ -1097,7 +1097,7 @@ public class TaskService implements ITaskService {
} }
for (DataLog dataLog : finishedTaskMap.values()) { for (DataLog dataLog : finishedTaskMap.values()) {
if(!dataLog.isPackageReel()){ if(!dataLog.isPackageReel()){
if(!dataLog.isSmallReel() && !dataLog.isFinished()){ if(!dataLog.isSmallReel() && !dataLog.isFinished() && !dataLog.isLessSendReel()){
//非包装料大料任务还未完成(未放入料架),暂时不出大料 //非包装料大料任务还未完成(未放入料架),暂时不出大料
unFinishedBigTaskCount = unFinishedBigTaskCount + 1; unFinishedBigTaskCount = unFinishedBigTaskCount + 1;
} }
......
...@@ -12,7 +12,42 @@ ...@@ -12,7 +12,42 @@
<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-yellow">
<div class="timeline-time">
<span class="date">2020 </span>
<span class="time">07-15 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2020071511</h2>
<div class="timeline-content">
<ul>
<li>调用Qisda接口返回内部异常时进行重发</li>
</ul>
</div>
</div>
</li>
<li class="timeline-grey">
<div class="timeline-time">
<span class="date">2020 </span>
<span class="time">07-08 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2020070811</h2>
<div class="timeline-content">
<ul>
<li>上一个需求单使用过的料架重用</li>
<li>解决缺料重发影响大料出库的问题</li>
<li>手动点击出库导致同一盘料两个任务的问题</li>
</ul>
</div>
</div>
</li>
<li class="timeline-purple"> <li class="timeline-purple">
<div class="timeline-time"> <div class="timeline-time">
<span class="date">2020 </span> <span class="date">2020 </span>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!