Commit 9597f9f2 sunke

阳光电源出库扫码时不区分料架BUG

1 个父辈 221a18ec
......@@ -94,7 +94,7 @@ public class AccShelfController extends BaseController {
if(pos != null){
log.info(pos.getBarcode().getBarcode() + " 从["+pos.getPosName()+"]出库,点亮对应库位");
int delayCloseTime = 30000;
String color = "blue";
String color = "green";
openAndCloseLights(storage,pos.getPosName(),delayCloseTime,color);
taskService.addTaskToFinished(pos,null,null);
return "OK" + getText("shelf.msg.outOk",new String[]{pos.getPosName()},request.getLocale(),"操作成功,请从库位["+pos.getPosName()+"]中取出物料");
......@@ -124,6 +124,12 @@ public class AccShelfController extends BaseController {
Thread.sleep(delayCloseTime);
log.info(storage.getName()+"["+cid+"]库位["+posName+"]灭灯");
StorageDataController.appendOp(cid,"close", posName);
StoragePos lastPutinPos= lastPutinPosMap.get(cid);
if(lastPutinPos != null && lastPutinPos.getPosName() != null){
if(lastPutinPos.getPosName().equals(posName)){
lastPutinPosMap.put(cid,new StoragePos());
}
}
}catch (Exception e){
}
......@@ -147,7 +153,7 @@ public class AccShelfController extends BaseController {
}
List<StoragePos> allPos = storagePosManager.findNotEmptyByStorageId(storage.getId());
for (StoragePos pos : allPos) {
opPosLight("open",storage,pos,"Green");
opPosLight("open",storage.getCid(),pos,"Green");
}
return "OK"+getText("shelf.msg.opSucess",request.getLocale(),"操作成功");
}
......@@ -164,15 +170,21 @@ public class AccShelfController extends BaseController {
String code = request.getParameter("code");
StoragePos lastPutinPos= lastPutinPosMap.get(cid);
Storage storage = dataCache.getStorage(cid);
if(lastPutinPos != null){
if(lastPutinPos != null && lastPutinPos.getPosName() != null){
log.info("扫码时关闭上一个库位:"+ lastPutinPos.getPosName());
opPosLight("close", storage, lastPutinPos, "");
opPosLight("close", storage.getCid(), lastPutinPos, "");
lastPutinPosMap.put(cid,new StoragePos());
}
CodeBean codeBean = dataCache.resolveSingleCode(code);
if(codeBean.isValid()){
if(storage.isAccShelf()){
Barcode barcode = codeBean.getBarcode();
try {
if(barcode.getPlateSize() == 1){
//长宽为1的需要弹框设置尺寸
throw new ValidateException("x 料盘未设置尺寸");
}
long now = System.currentTimeMillis();
//5秒内同一个条码忽略
Date usedDate = barcode.getUsedDate();
......@@ -188,35 +200,35 @@ public class AccShelfController extends BaseController {
for (DataLog task : allTasks) {
if(task.getBarcode() != null && task.getBarcode().equals(barcode.getBarcode())){
taskService.addTaskToFinished(inPos,null,null);
opPosLight("close",storage,inPos,null);
return "OK"+getText("shelf.msg.outConfirm",new String[]{inPos.getPosName()},request.getLocale(),"出库完成, 库位["+inPos.getPosName()+"]灭灯");
opPosLight("close",task.getCid(),inPos,null);
return "OK"+ "出库完成, 库位["+inPos.getPosName()+"]灭灯";
}
}
return getText("shelf.msg.noTask",new String[]{inPos.getPosName()},request.getLocale(),"操作失败,已在库位["+inPos.getPosName()+"]中,未找到对应的出库任务");
return "操作失败,已在库位["+inPos.getPosName()+"]中,未找到对应的出库任务";
}
List<Storage> storageList = Lists.newArrayList(storage);
StoragePos pos = taskService.findEmptyPosForPutIn(storageList, barcode);
int delayCloseTime = 30000;
String color = "red";
String color = "green";
if(pos != null){
log.info(barcode.getPartNumber()+" [ "+barcode.getBarcode()+" ] " + "入库到:" + storage.getName()+"["+cid+"] " + pos.getPosName());
taskService.addTaskToFinished(pos,barcode,null);
openAndCloseLights(storage,pos.getPosName(),delayCloseTime,color);
lastPutinPosMap.put(cid,pos);
pos.setCanCheckOutTime(System.currentTimeMillis() + delayCloseTime);
return "OK"+getText("shelf.msg.inOk",new String[]{pos.getPosName()},request.getLocale(),"操作成功,请放入库位["+pos.getPosName()+"]");
return "OK"+"操作成功,请放入库位["+pos.getPosName()+"]";
}else{
//库位没找到
String sizeInfo = barcode.getPlateSize()+" x "+ barcode.getHeight();
String msg = "未找到适合["+sizeInfo +"]的库位";
log.info(msg);
msg = getText("shelf.msg.inError",new String[]{sizeInfo},request.getLocale(),msg);
//msg = getText("shelf.msg.inError",new String[]{sizeInfo},request.getLocale(),msg);
return msg;
}
} catch (ValidateException e) {
log.error("Error:"+e.getMessage());
return e.getMessage();
return getText(e.getMessage(),request.getLocale(),e.getMessage());
}
}
}else{
......@@ -248,16 +260,15 @@ public class AccShelfController extends BaseController {
/**
* 操作库位灯(开灯,或关灯)
* @param opKey
* @param storage
* @param pos
* @param colorStr
*/
private void opPosLight(String opKey, Storage storage, StoragePos pos, String colorStr){
private void opPosLight(String opKey, String cid, StoragePos pos, String colorStr){
String opStr = pos.getPosName();
if(!Strings.isNullOrEmpty(colorStr)){
opStr =opStr+ "=" + colorStr;
}
StorageDataController.appendOp(storage.getCid(), opKey , opStr);
StorageDataController.appendOp(cid, opKey , opStr);
log.info("操作库位["+pos.getPosName()+"]" + opKey + " : " + opStr);
}
......
......@@ -17,8 +17,17 @@
</sourceRoots>
</configuration>
</facet>
<facet type="jpa" name="JPA">
<configuration>
<setting name="validation-enabled" value="true" />
<setting name="provider-name" value="Hibernate" />
<datasource-mapping />
<naming-strategy-map />
<deploymentDescriptor name="persistence.xml" url="file://$MODULE_DIR$/src/main/resources/META-INF/persistence.xml" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!