Commit afe0c59c sunke

优化条码解析失败时的错误消息

最后一个补料需求单任务为0时,对工单进行解绑
清理库位添加清理记录
1 个父辈 8e0bf381
......@@ -368,7 +368,7 @@ public class QisdaApi {
//TODO:需要重新绑定
}catch (Exception e){
log.error("纯入库判定出错",e);
}
}
......@@ -596,7 +596,7 @@ public class QisdaApi {
Map<String, Object> resultMap = JsonUtil.toMap(result);
String msg = resultMap.get("msg").toString();
if(msg.startsWith("0")){
String errorMsg = "从Qisda获取料号["+vdPartNum+"]转换出错:" + msg;
String errorMsg = "从Qisda获取料号["+vdPartNum+"]转换NG:" + msg;
log.info(errorMsg);
throw new ApiException(errorMsg);
}
......
......@@ -521,7 +521,7 @@ public class OutInfoCache {
List<OutInfo> outInfoList = Lists.newArrayList();
long now = System.currentTimeMillis();
for (OutInfo outInfo : outInfoMap.values()) {
if(outInfo.isClosed() || outInfo.isSendEnd()){
if(outInfo.isClosed() /*|| outInfo.isSendEnd()*/){
removeFromCache(outInfo.gethSerial());
}else{
if(outInfo != null){
......@@ -1061,6 +1061,10 @@ public class OutInfoCache {
}else{
msg = "需求单"+outInfo.gethSerial()+"本次出库料盘数量为0";
if(outInfo.isEndOutInfo()){
log.info("需求单["+outInfo.gethSerial()+"]是工单的最后一个需求单,关闭工单"+outInfo.getSo()+"["+outInfo.getSoseq()+"]");
closeSoSeq(outInfo.getSoseq());
}
}
if(outInfo.isReelCutAction() || outInfo.isFirstReelAction()){
......
......@@ -3,6 +3,7 @@ package com.myproject.webapp.controller.storage;
import com.google.common.base.Strings;
import com.myproject.bean.form.Message;
import com.myproject.bean.update.Barcode;
import com.myproject.bean.update.Storage;
import com.myproject.bean.update.StoragePos;
import com.myproject.dao.mongo.IBarcodeDao;
import com.myproject.exception.ValidateException;
......@@ -11,6 +12,8 @@ import com.myproject.manager.IStoragePosManager;
import com.myproject.util.QisdaApi;
import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.webService.DataCache;
import com.myproject.webapp.controller.webService.ITaskService;
import com.myproject.webapp.controller.webService.StorageDataController;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -31,11 +34,10 @@ public class StoragePosUpdateController extends BaseUpdateController {
private IStoragePosManager storagePosManager;
@Autowired
private IBarcodeManager barcodeManager;
@Autowired
private DataCache dataCache;
private final static String UPDATE_VIEW = "storage/storagePosUpdate";
@Autowired
private ITaskService taskService;
@RequestMapping("/storage/getStoragePos")
@ResponseBody
......@@ -70,17 +72,20 @@ public class StoragePosUpdateController extends BaseUpdateController {
if(barcode != null){
log.info("清理库位["+storagePos.getPosName()+"]中的库存"+barcode.getBarcode());
barcode = barcodeManager.findByBarcode(barcode.getBarcode());
barcode.setPosName("");
barcodeManager.save(barcode);
storagePos.setBarcode(null);
storagePos.setUsed(false);
storagePosManager.save(storagePos);
dataCache.updateInventory(storagePos,barcode);
String opUser = StorageDataController.getLoginUsername();
log.info(opUser + "清理库位["+storagePos.getPosName()+"]中的库存"+barcode.getBarcode());
taskService.addTaskToFinished(storagePos,null,opUser+"-clear");
// barcode = barcodeManager.findByBarcode(barcode.getBarcode());
// barcode.setPosName("");
// barcodeManager.save(barcode);
// storagePos.setBarcode(null);
// storagePos.setUsed(false);
// storagePosManager.save(storagePos);
// dataCache.updateInventory(storagePos,barcode);
}
return "";
} catch (ValidateException e) {
} catch (Exception e) {
return e.getMessage();
}
}
......@@ -102,6 +107,8 @@ public class StoragePosUpdateController extends BaseUpdateController {
pos.setEnabled(enabled);
try {
storagePosManager.save(pos);
Storage storage = dataCache.getStorageById(pos.getStorageId());
dataCache.reloadStorage(storage);
return "";
}catch (Exception e){
return e.getMessage();
......
......@@ -380,6 +380,7 @@ public class DataCache{
}
Collection<CodeBean> codeBeans = resolveCodeStr(codeStr);
Barcode barcode = null;
String errorMsg = "";
for (CodeBean codeBean : codeBeans) {
if(codeBean.isValid()){
Barcode barcodeFromRule = codeBean.getBarcode();
......@@ -412,11 +413,13 @@ public class DataCache{
}else{
throw new ValidateException("找到多个有效的条码");
}
}else{
errorMsg = codeBean.getError();
}
}
if(barcode == null){
throw new ValidateException("未找到有效的条码");
throw new ValidateException("未找到有效的条码:"+ errorMsg);
}
return barcode;
}
......@@ -428,11 +431,13 @@ public class DataCache{
String[] barcodeItemStrs = codeStr.split("##");
for (String barcodeItemStr : barcodeItemStrs){
CodeBean codeBean = resolveSingleCode(barcodeItemStr);
if(codeBean == null){
continue;
if(!barcodeItemStr.isEmpty()){
CodeBean codeBean = resolveSingleCode(barcodeItemStr);
if(codeBean == null){
continue;
}
codeBeans.add(codeBean);
}
codeBeans.add(codeBean);
}
}
return codeBeans;
......
......@@ -511,9 +511,9 @@ public class TaskService implements ITaskService {
for(Storage storage : storageList){
StatusBean status = getStatus(storage.getCid());
if(status.timeOut()){
continue;
}
// if(status.timeOut()){
// continue;
// }
// if(!status.isBoxCanPutIn()){
// //料仓不可入库
// continue;
......@@ -568,9 +568,21 @@ public class TaskService implements ITaskService {
return pos;
}
}catch(Exception e){
log.info("尝试从["+storage.getCid()+"]中为["+barcode.getBarcode()+"]查找空位失败:" + e.getMessage());
log.error("尝试从["+storage.getCid()+"]中为["+barcode.getBarcode()+"]查找空位失败:" + e.getMessage());
}
}
try{
String cids = "";
for (Storage storage : availbleStorageList) {
cids =cids + storage.getCid() + ",";
}
log.info(barcode.getBarcode()+ " 未找到可用库位,可用料仓:"+cids);
}catch (Exception e){
log.error("打印可用料仓出错",e);
}
return null;
}
/**
......@@ -743,7 +755,9 @@ public class TaskService implements ITaskService {
StoragePos pos = storagePosManager.get(task.getPosId());
pos.setEnabled(false);
storagePosManager.save(pos);
} catch (ValidateException e) {
Storage storage = dataCache.getStorage(task.getCid());
dataCache.reloadStorage(storage);
} catch (Exception e) {
log.error("入库任务取消时,禁用库位出错",e);
}
}
......@@ -797,8 +811,11 @@ public class TaskService implements ITaskService {
StoragePos pos = storagePosManager.get(task.getPosId());
pos.setEnabled(false);
storagePosManager.save(pos);
} catch (ValidateException e) {
Storage storage = dataCache.getStorage(task.getCid());
dataCache.reloadStorage(storage);
} catch (ValidateException e) {
log.error("禁用库位出错:" , e);
}
}
......
......@@ -12,6 +12,42 @@
<div class="row">
<div class="col-md-12">
<ul class="timeline">
<li class="timeline-blue">
<div class="timeline-time">
<span class="date">2021 </span>
<span class="time">03-09 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021030918</h2>
<div class="timeline-content">
<ul>
<li>库位禁用时同步更新显示数量</li>
<li>清理库位添加清理记录</li>
</ul>
</div>
</div>
</li>
<li class="timeline-yellow">
<div class="timeline-time">
<span class="date">2021 </span>
<span class="time">03-02 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021030211</h2>
<div class="timeline-content">
<ul>
<li>优化条码解析失败时的错误消息</li>
<li>最后一个补料需求单任务为0时,对工单进行解绑</li>
</ul>
</div>
</div>
</li>
<li class="timeline-grey">
<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.02.04</span>
<span class="right" style="color: #a3a3a3;">Version: 2021.03.02</span>
<div class="scroll-to-top">
<i class="icon-arrow-up"></i>
</div>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!