Commit c5b0a79c zshaohui

1.抛异常时,保存到消息列表

2.料盒操作,mes提示禁用,但实际已经入进去了,任务没生成,bug修改
1 个父辈 24c875a9
...@@ -5,6 +5,9 @@ import com.neotel.smfcore.common.exception.EntityNotFoundException; ...@@ -5,6 +5,9 @@ import com.neotel.smfcore.common.exception.EntityNotFoundException;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.ThrowableUtil; import com.neotel.smfcore.common.utils.ThrowableUtil;
import com.neotel.smfcore.core.language.util.MessageUtils; import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.message.enums.MessageType;
import com.neotel.smfcore.core.message.service.manager.IMessageManager;
import com.neotel.smfcore.core.message.service.po.Message;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -28,6 +31,9 @@ import static org.springframework.http.HttpStatus.NOT_FOUND; ...@@ -28,6 +31,9 @@ import static org.springframework.http.HttpStatus.NOT_FOUND;
public class GlobalExceptionHandler { public class GlobalExceptionHandler {
@Autowired @Autowired
private MessageUtils messageUtils; private MessageUtils messageUtils;
@Autowired
IMessageManager messageManager;
/** /**
* 处理所有不可知的异常 * 处理所有不可知的异常
*/ */
...@@ -87,6 +93,14 @@ public class GlobalExceptionHandler { ...@@ -87,6 +93,14 @@ public class GlobalExceptionHandler {
// 打印堆栈信息 // 打印堆栈信息
//log.error(ThrowableUtil.getStackTrace(e)); //log.error(ThrowableUtil.getStackTrace(e));
String targetMsg=messageUtils.getText(e.getMsgKey(),e.getMsgParam(),servlet.getLocale() ,e.getDefaultMsg()); String targetMsg=messageUtils.getText(e.getMsgKey(),e.getMsgParam(),servlet.getLocale() ,e.getDefaultMsg());
e.getMessage();
Message message = new Message();
message.setType(MessageType.ERROR.name());
message.setDeviceName("server");
message.setMsgCode(e.getMsgKey());
message.setMsgParams(e.getMsgParam());
message.setMsg(e.getDefaultMsg());
messageManager.save(message);
return buildResponseEntity(ApiError.error(e.getStatus(),targetMsg)); return buildResponseEntity(ApiError.error(e.getStatus(),targetMsg));
} }
......
...@@ -333,6 +333,7 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -333,6 +333,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds); storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds);
} else { } else {
log.info("料仓" + storageCid + "有出库任务未完成,不允许入库"); log.info("料仓" + storageCid + "有出库任务未完成,不允许入库");
throw new ValidateException("smfcore.error.storage.outNotEnd", "料仓{0}有出库任务未完成,不允许入库", new String[]{storageCid});
} }
} }
if (storagePos == null) { if (storagePos == null) {
......
...@@ -53,6 +53,7 @@ public class MessageController { ...@@ -53,6 +53,7 @@ public class MessageController {
public PageData<MessageDto> query(MessageCriteria criteria, Pageable pageable,HttpServletRequest request){ public PageData<MessageDto> query(MessageCriteria criteria, Pageable pageable,HttpServletRequest request){
Query query = QueryHelp.getQuery(criteria); Query query = QueryHelp.getQuery(criteria);
query.addCriteria(Criteria.where("msg").exists(true).ne(""));
PageData<Message> messagePageData=messageManager.findByPage(query,pageable); PageData<Message> messagePageData=messageManager.findByPage(query,pageable);
List<MessageDto> dtos=messageMapper.toDto(messagePageData.getContent()); List<MessageDto> dtos=messageMapper.toDto(messagePageData.getContent());
for (int i=0;i<dtos.size();i++) { for (int i=0;i<dtos.size();i++) {
......
package com.neotel.smfcore.core.storage.rest; package com.neotel.smfcore.core.storage.rest;
import com.google.common.collect.Maps;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.JsonUtil; import com.neotel.smfcore.common.utils.JsonUtil;
...@@ -77,6 +78,10 @@ public class MaterialBoxController { ...@@ -77,6 +78,10 @@ public class MaterialBoxController {
@Autowired @Autowired
private LiteOrderCache liteOrderCache; private LiteOrderCache liteOrderCache;
private static Map<String,Long> inLastScanMap = Maps.newConcurrentMap();
private static Map<String,Long> outLastScanMap = Maps.newConcurrentMap();
@ApiOperation("查询料盒信息") @ApiOperation("查询料盒信息")
@PostMapping @PostMapping
@PreAuthorize("@el.check('materialBox')") @PreAuthorize("@el.check('materialBox')")
...@@ -103,7 +108,6 @@ public class MaterialBoxController { ...@@ -103,7 +108,6 @@ public class MaterialBoxController {
if(component==null||(component.getType()!=COMPONENT_TYPE.FIXTURE)){ if(component==null||(component.getType()!=COMPONENT_TYPE.FIXTURE)){
throw new ValidateException("smfcore.materialBox.invalid", "未找到料盒信息{0}", new String[]{code}); throw new ValidateException("smfcore.materialBox.invalid", "未找到料盒信息{0}", new String[]{code});
} }
BarcodeDto barcodeDto=barcodeMapper.toDto(barcode); BarcodeDto barcodeDto=barcodeMapper.toDto(barcode);
// if(barcodeDto.getSubCodeMap()==null){ // if(barcodeDto.getSubCodeMap()==null){
// barcodeDto.setSubCodeMap(new HashMap<>()); // barcodeDto.setSubCodeMap(new HashMap<>());
...@@ -113,7 +117,7 @@ public class MaterialBoxController { ...@@ -113,7 +117,7 @@ public class MaterialBoxController {
} else { } else {
//按时间进行排序 //按时间进行排序
List<BarcodeDto> subCodeList = barcodeDto.getSubCodeList(); List<BarcodeDto> subCodeList = barcodeDto.getSubCodeList();
subCodeList = subCodeList.stream().sorted(Comparator.comparing(BarcodeDto :: getCreateDate).reversed()).collect(Collectors.toList()); subCodeList = subCodeList.stream().sorted(Comparator.comparing(BarcodeDto :: getUpdateDate).reversed()).collect(Collectors.toList());
barcodeDto.setSubCodeList(subCodeList); barcodeDto.setSubCodeList(subCodeList);
} }
return barcodeDto; return barcodeDto;
...@@ -206,7 +210,8 @@ public class MaterialBoxController { ...@@ -206,7 +210,8 @@ public class MaterialBoxController {
@ApiOperation("操作料盒内的物料信息") @ApiOperation("操作料盒内的物料信息")
@PostMapping(value = "/operatePos") @PostMapping(value = "/operatePos")
@PreAuthorize("@el.check('materialBox')") @PreAuthorize("@el.check('materialBox')")
public ResultBean operatePos(@RequestBody Map<String, String> paramMap) { public ResultBean operatePos(@RequestBody Map<String, String> paramMap) throws ValidateException{
try { try {
String code = paramMap.get("barcode");//料盒条码 String code = paramMap.get("barcode");//料盒条码
String operageStr = paramMap.get("operatePN");//操作信息 String operageStr = paramMap.get("operatePN");//操作信息
...@@ -233,7 +238,19 @@ public class MaterialBoxController { ...@@ -233,7 +238,19 @@ public class MaterialBoxController {
throw new ValidateException("smfcore.materialBox.inPos", "物料已在库位{0}中", new String[]{pos.getPosName()}); throw new ValidateException("smfcore.materialBox.inPos", "物料已在库位{0}中", new String[]{pos.getPosName()});
} }
long currentTimeMillis = System.currentTimeMillis();
Long outTime = outLastScanMap.get(subBarcode.getBarcode());
if (outTime != null && currentTimeMillis - outTime <= 1000 * 60 * 10) {
throw new ValidateException("smfcore.materialBox.outBox", "物料{0}已经取出", new String[]{subBarcode.getBarcode()});
}
Long inTime = inLastScanMap.get(subBarcode.getBarcode());
if (inTime != null && currentTimeMillis - inTime <= 1000 * 60 * 10) {
throw new ValidateException("smfcore.materialBox.inBox", "物料{0}已在料盒{1}中", new String[]{subBarcode.getBarcode(), barcode.getBarcode()});
}
if (subBarcode.getHostBarcodeId() == null) { if (subBarcode.getHostBarcodeId() == null) {
smfApi.canPutInAfterResolve(subBarcode);
//不存在,入库 //不存在,入库
opQty = OP.PUT_IN; opQty = OP.PUT_IN;
int newCount = subBarcode.getAmount(); int newCount = subBarcode.getAmount();
...@@ -243,18 +260,17 @@ public class MaterialBoxController { ...@@ -243,18 +260,17 @@ public class MaterialBoxController {
subBarcode.setHostBarcodeId(barcode.getId()); subBarcode.setHostBarcodeId(barcode.getId());
subBarcode.setAmount(newCount); subBarcode.setAmount(newCount);
barcodeManager.saveBarcode(subBarcode); barcodeManager.saveBarcode(subBarcode);
smfApi.canPutInAfterResolve(subBarcode);
finishTask(barcode, opQty, currentTask, subBarcode, subBarcode.getAmount()); finishTask(barcode, opQty, currentTask, subBarcode, subBarcode.getAmount());
log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]入库到料盒[" + barcode.getBarcode() + "]数量:" + barcode.getAmount()); log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]入库到料盒[" + barcode.getBarcode() + "]数量:" + barcode.getAmount());
inLastScanMap.put(subBarcode.getBarcode(),System.currentTimeMillis());
} else if (subBarcode.getHostBarcodeId().equals(barcode.getId())) { } else if (subBarcode.getHostBarcodeId().equals(barcode.getId())) {
int qty = subBarcode.getAmount(); int qty = subBarcode.getAmount();
//出库 //出库
subBarcode.setAmount(0); subBarcode.setAmount(0);
opQty = OP.CHECKOUT; opQty = OP.CHECKOUT;
finishTask(barcode, opQty, currentTask, subBarcode, qty); finishTask(barcode, opQty, currentTask, subBarcode, qty);
log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]从料盒[" + barcode.getBarcode() + "]出库,数量:" + qty); log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]从料盒[" + barcode.getBarcode() + "]出库,数量:" + qty);
outLastScanMap.put(subBarcode.getBarcode(),System.currentTimeMillis());
} else { } else {
//在别的料盒中 //在别的料盒中
Barcode hostBarcode = barcodeManager.get(subBarcode.getHostBarcodeId()); Barcode hostBarcode = barcodeManager.get(subBarcode.getHostBarcodeId());
...@@ -267,125 +283,6 @@ public class MaterialBoxController { ...@@ -267,125 +283,6 @@ public class MaterialBoxController {
// return ResultBean.newErrorResult(1, codeBean.getErrorCode(), codeBean.getError(), codeBean.getParams()); // return ResultBean.newErrorResult(1, codeBean.getErrorCode(), codeBean.getError(), codeBean.getParams());
return ResultBean.newOkResult(operageStr); return ResultBean.newOkResult(operageStr);
} }
// //用+或-分割,如果最后几位是数量,按手动输入处理
// String[] codeArray = operageStr.split(" -");
// String pnStr = "";
// int opQty = 0;
// int opType = OP.NON_OP;
// if(codeArray.length == 2){
// try{
// opQty = Integer.valueOf(codeArray[1].trim());
// pnStr = codeArray[0].trim();
// opType = OP .CHECKOUT;
// }catch (Exception e){
//
// }
// }
// if(opType == OP.NON_OP){
// codeArray = operageStr.split(" \\+");
// if(codeArray.length == 2){
// try{
// opQty = Integer.valueOf(codeArray[1].trim());
// pnStr = codeArray[0].trim();
// opType = OP.PUT_IN;
// }catch (Exception e){
//
// }
// }
// }
//
// if(opType != OP.NON_OP){
// //手动输入,按PN来处理
// //先查找是否有相同的PN,没有创建一个
// Component component = autoGetComponent(pnStr,opQty);
// //查看该库位中是否有相同的物料,有的话,数量累加
// Barcode subBarcode=barcode.getSubCode(pnStr);
//
// if(opType == OP.PUT_IN) {
// //入库
// if (subBarcode != null) {
// int oldAmount = subBarcode.getAmount();
//
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(oldAmount + opQty);
// subBarcode = barcodeManager.save(subBarcode);
//
// finishTask(barcode, opType, currentTask, subBarcode, opQty);
// log.info(subBarcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + oldAmount + " + " + opQty + " = " + subBarcode.getAmount());
//
// } else {
// subBarcode=autoGetBarcode(barcode,component,pnStr,opQty);
// finishTask(barcode, opType, currentTask, subBarcode, opQty);
// log.info(barcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + barcode.getAmount());
// }
// }else {
// //出库
// if(subBarcode != null){
//
// int oldAmount = subBarcode.getAmount();
// if(oldAmount < opQty){
// throw new ValidateException("smfcore.materialBox.quantityshort","物料数量不足");
// }
// int newAmount = oldAmount - opQty;
//
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(newAmount);
// subBarcode = barcodeManager.save(subBarcode);
//
// finishTask(barcode, opType, currentTask,subBarcode, opQty);
// log.info(subBarcode.getPartNumber() + "从料盒["+barcode.getPosName()+"]出库,物料数量:" + oldAmount + " - " + opQty + " = " + newAmount);
// }else{
// //无库存
// throw new ValidateException("smfcore.materialBox.noReel","料盒中未找到对应物料");
// }
// }
//
// }else {
//
// String newCodeStr = "=1x1=" + operageStr;
// CodeBean codeBean = codeResolve.resolveSingleCode(newCodeStr );
// if (codeBean.isValid()) {
// Barcode subBarcode = codeBean.getBarcode();
// StoragePos pos = storagePosManager.getByBarcode(subBarcode.getBarcode());
// if (pos != null) {
// throw new ValidateException("smfcore.materialBox.inPos", "物料已在库位{0}中", new String[]{pos.getPosName()});
// }
//
// if (subBarcode.getHostBarcodeId() == null) {
// //不存在,入库
// opQty = OP.PUT_IN;
// int newCount = subBarcode.getAmount() ;
// if(newCount<=0){
// newCount=1;
// }
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(newCount);
// barcodeManager.saveBarcode(subBarcode);
// finishTask(barcode, opQty, currentTask, subBarcode, subBarcode.getAmount());
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]入库到料盒[" + barcode.getBarcode() + "]数量:" + barcode.getAmount());
// }
// else if (subBarcode.getHostBarcodeId().equals(barcode.getId())) {
// int qty = subBarcode.getAmount();
// //出库
// subBarcode.setAmount(0);
// opQty = OP.CHECKOUT;
// finishTask(barcode, opQty, currentTask, subBarcode, qty);
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]从料盒[" + barcode.getBarcode() + "]出库,数量:" + qty);
//
// } else {
// //在别的料盒中
// Barcode hostBarcode = barcodeManager.get(subBarcode.getHostBarcodeId());
// if (hostBarcode != null) {
// throw new ValidateException("smfcore.materialBox.inOtherBox", "物料已在料盒{0}中", new String[]{hostBarcode.getBarcode()});
// }
// }
// } else {
// return ResultBean.newErrorResult(1, codeBean.getErrorCode(), codeBean.getError(), codeBean.getParams());
// }
// }
} catch (Exception e) { } catch (Exception e) {
// return "出入库操作出错:" + e.getMessage(); // return "出入库操作出错:" + e.getMessage();
log.error(e.getMessage()); log.error(e.getMessage());
...@@ -398,7 +295,7 @@ public class MaterialBoxController { ...@@ -398,7 +295,7 @@ public class MaterialBoxController {
@PostMapping(value = "/sureOperate") @PostMapping(value = "/sureOperate")
@PreAuthorize("@el.check('materialBox')") @PreAuthorize("@el.check('materialBox')")
public ResultBean sureOperate(@RequestBody Map<String, String> paramMap) { public ResultBean sureOperate(@RequestBody Map<String, String> paramMap) {
try{ try {
//1.查找元器件pn是否存在,存在时需要弹框输入数量 //1.查找元器件pn是否存在,存在时需要弹框输入数量
//2.pn不存在,解析条码 成功,作为RI处理 //2.pn不存在,解析条码 成功,作为RI处理
...@@ -408,9 +305,9 @@ public class MaterialBoxController { ...@@ -408,9 +305,9 @@ public class MaterialBoxController {
String qtyStr = paramMap.get("qty");//数量 String qtyStr = paramMap.get("qty");//数量
int opQty = Integer.valueOf(qtyStr); int opQty = Integer.valueOf(qtyStr);
DataLog currentTask=null; DataLog currentTask = null;
Barcode barcode=barcodeManager.findByBarcode(code); Barcode barcode = barcodeManager.findByBarcode(code);
if(barcode==null){ if (barcode == null) {
throw new ValidateException("smfcore.materialBox.invalid", "未找到料盒信息{0}", new String[]{code}); throw new ValidateException("smfcore.materialBox.invalid", "未找到料盒信息{0}", new String[]{code});
} }
//用+或-分割,如果最后几位是数量,按手动输入处理 //用+或-分割,如果最后几位是数量,按手动输入处理
...@@ -418,13 +315,13 @@ public class MaterialBoxController { ...@@ -418,13 +315,13 @@ public class MaterialBoxController {
String pnStr = operageStr; String pnStr = operageStr;
int opType = OP.NON_OP; int opType = OP.NON_OP;
if(opQty<0){ if (opQty < 0) {
opType = OP .CHECKOUT; opType = OP.CHECKOUT;
}else if(opQty>0){ } else if (opQty > 0) {
opType = OP .PUT_IN; opType = OP.PUT_IN;
}else{ } else {
//请输入正确的数量 //请输入正确的数量
throw new ValidateException("smfcore.materialBox.qtyError", "请输入正确的数量" ); throw new ValidateException("smfcore.materialBox.qtyError", "请输入正确的数量");
} }
//料盒中放入料盘数量 //料盒中放入料盘数量
...@@ -432,99 +329,54 @@ public class MaterialBoxController { ...@@ -432,99 +329,54 @@ public class MaterialBoxController {
barcode.setAmount(amount + opQty); barcode.setAmount(amount + opQty);
// if(opType != OP.NON_OP){ // if(opType != OP.NON_OP){
//手动输入,按PN来处理 //手动输入,按PN来处理
//先查找是否有相同的PN,没有创建一个 //先查找是否有相同的PN,没有创建一个
Component component = autoGetComponent(pnStr,opQty); Component component = autoGetComponent(pnStr, opQty);
//查看该库位中是否有相同的物料,有的话,数量累加 //查看该库位中是否有相同的物料,有的话,数量累加
Barcode subBarcode=barcode.getSubCode(pnStr); Barcode subBarcode = barcode.getSubCode(pnStr);
if(opType == OP.PUT_IN) { if (opType == OP.PUT_IN) {
//入库 //入库
if (subBarcode != null) { if (subBarcode != null) {
int oldAmount = subBarcode.getAmount(); int oldAmount = subBarcode.getAmount();
subBarcode.setHostBarcodeId(barcode.getId()); subBarcode.setHostBarcodeId(barcode.getId());
subBarcode.setAmount(oldAmount + opQty); subBarcode.setAmount(oldAmount + opQty);
subBarcode = barcodeManager.save(subBarcode); subBarcode = barcodeManager.save(subBarcode);
finishTask(barcode, opType, currentTask, subBarcode, opQty); finishTask(barcode, opType, currentTask, subBarcode, opQty);
log.info(subBarcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + oldAmount + " + " + opQty + " = " + subBarcode.getAmount()); log.info(subBarcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + oldAmount + " + " + opQty + " = " + subBarcode.getAmount());
} else { } else {
subBarcode=autoGetBarcode(barcode,component,pnStr,opQty); subBarcode = autoGetBarcode(barcode, component, pnStr, opQty);
finishTask(barcode, opType, currentTask, subBarcode, opQty); finishTask(barcode, opType, currentTask, subBarcode, opQty);
log.info(barcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + barcode.getAmount()); log.info(barcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + barcode.getAmount());
}
}else {
//出库
if(subBarcode != null){
int oldAmount = subBarcode.getAmount();
if(oldAmount < opQty){
throw new ValidateException("smfcore.materialBox.quantityshort","物料数量不足");
}
int newAmount = oldAmount - opQty;
subBarcode.setHostBarcodeId(barcode.getId());
subBarcode.setAmount(newAmount);
subBarcode = barcodeManager.save(subBarcode);
finishTask(barcode, opType, currentTask,subBarcode, opQty);
log.info(subBarcode.getPartNumber() + "从料盒["+barcode.getPosName()+"]出库,物料数量:" + oldAmount + " - " + opQty + " = " + newAmount);
}else{
//无库存
throw new ValidateException("smfcore.materialBox.noReel","料盒中未找到对应物料");
}
} }
} else {
//出库
if (subBarcode != null) {
// }else { int oldAmount = subBarcode.getAmount();
// if (oldAmount < opQty) {
// String newCodeStr = "=1x1=" + operageStr; throw new ValidateException("smfcore.materialBox.quantityshort", "物料数量不足");
// CodeBean codeBean = codeResolve.resolveSingleCode(newCodeStr ); }
// if (codeBean.isValid()) { int newAmount = oldAmount - opQty;
// Barcode subBarcode = codeBean.getBarcode();
// StoragePos pos = storagePosManager.getByBarcode(subBarcode.getBarcode());
// if (pos != null) {
// throw new ValidateException("smfcore.materialBox.inPos", "物料已在库位{0}中", new String[]{pos.getPosName()});
// }
//
// if (subBarcode.getHostBarcodeId() == null) {
// //不存在,入库
// opQty = OP.PUT_IN;
// int newCount = subBarcode.getAmount() ;
// if(newCount<=0){
// newCount=1;
// }
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(newCount);
// barcodeManager.saveBarcode(subBarcode);
// finishTask(barcode, opQty, currentTask, subBarcode, subBarcode.getAmount());
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]入库到料盒[" + barcode.getBarcode() + "]数量:" + barcode.getAmount());
// }
// else if (subBarcode.getHostBarcodeId().equals(barcode.getId())) {
// int qty = subBarcode.getAmount();
// //出库
// subBarcode.setAmount(0);
// opQty = OP.CHECKOUT;
// finishTask(barcode, opQty, currentTask, subBarcode, qty);
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]从料盒[" + barcode.getBarcode() + "]出库,数量:" + qty);
//
// } else {
// //在别的料盒中
// Barcode hostBarcode = barcodeManager.get(subBarcode.getHostBarcodeId());
// if (hostBarcode != null) {
// throw new ValidateException("smfcore.materialBox.inOtherBox", "物料已在料盒{0}中", new String[]{hostBarcode.getBarcode()});
// }
// }
// } else {
// return ResultBean.newErrorResult(1, codeBean.getErrorCode(), codeBean.getError(), codeBean.getParams());
// }
// }
}catch (Exception e){ subBarcode.setHostBarcodeId(barcode.getId());
subBarcode.setAmount(newAmount);
subBarcode = barcodeManager.save(subBarcode);
finishTask(barcode, opType, currentTask, subBarcode, opQty);
log.info(subBarcode.getPartNumber() + "从料盒[" + barcode.getPosName() + "]出库,物料数量:" + oldAmount + " - " + opQty + " = " + newAmount);
} else {
//无库存
throw new ValidateException("smfcore.materialBox.noReel", "料盒中未找到对应物料");
}
}
} catch (Exception e) {
// return "出入库操作出错:" + e.getMessage(); // return "出入库操作出错:" + e.getMessage();
log.error(e.toString()); log.error(e.toString());
throw new ValidateException("smfcore.error","出错{0}",new String[]{e.toString()}); throw new ValidateException("smfcore.error", "出错{0}", new String[]{e.toString()});
} }
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
......
...@@ -120,7 +120,9 @@ smfcore.materialBox.invalid=\u672A\u627E\u5230\u6599\u76D2\u4FE1\u606F{0} ...@@ -120,7 +120,9 @@ smfcore.materialBox.invalid=\u672A\u627E\u5230\u6599\u76D2\u4FE1\u606F{0}
smfcore.materialBox.noReel=\u6599\u76D2\u4E2D\u672A\u627E\u5230\u5BF9\u5E94\u7269\u6599 smfcore.materialBox.noReel=\u6599\u76D2\u4E2D\u672A\u627E\u5230\u5BF9\u5E94\u7269\u6599
smfcore.materialBox.boxNoReel=\u6599\u76D2\u4E2D\u65E0\u7269\u6599 smfcore.materialBox.boxNoReel=\u6599\u76D2\u4E2D\u65E0\u7269\u6599
smfcore.materialBox.inPos=\u7269\u6599\u5DF2\u5728\u5E93\u4F4D{0}\u4E2D smfcore.materialBox.inPos=\u7269\u6599\u5DF2\u5728\u5E93\u4F4D{0}\u4E2D
smfcore.materialBox.inBox=\u7269\u6599{0}\u5DF2\u5728\u6599\u76D2{1}\u4E2D
smfcore.materialBox.inOtherBox=\u7269\u6599\u5DF2\u5728\u6599\u76D2{0}\u4E2D smfcore.materialBox.inOtherBox=\u7269\u6599\u5DF2\u5728\u6599\u76D2{0}\u4E2D
smfcore.materialBox.outBox=\u7269\u6599{0}\u5DF2\u7ECF\u53D6\u51FA
smfcore.materialBox=\u6599\u76D2\u64CD\u4F5C smfcore.materialBox=\u6599\u76D2\u64CD\u4F5C
smfcore.shelf.nextPos.hasReel=\u5E93\u4F4D[{0}]\u5DF2\u6709\u7269\u6599,\u8BF7\u91CD\u65B0\u626B\u63CF\u5E93\u4F4D\u7801 smfcore.shelf.nextPos.hasReel=\u5E93\u4F4D[{0}]\u5DF2\u6709\u7269\u6599,\u8BF7\u91CD\u65B0\u626B\u63CF\u5E93\u4F4D\u7801
smfcore.shelf.nextPos.hasTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u4EFB\u52A1,\u8BF7\u91CD\u65B0\u626B\u63CF\u5E93\u4F4D\u7801 smfcore.shelf.nextPos.hasTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u4EFB\u52A1,\u8BF7\u91CD\u65B0\u626B\u63CF\u5E93\u4F4D\u7801
...@@ -258,6 +260,7 @@ smfcore.error.virtualOut.noItem=\u5DE5\u5355{0}\u4E2D\u672A\u627E\u5230\u5BF9\u5 ...@@ -258,6 +260,7 @@ smfcore.error.virtualOut.noItem=\u5DE5\u5355{0}\u4E2D\u672A\u627E\u5230\u5BF9\u5
smfcore.error.mimo.outFial=\u672A\u627E\u5230\u53EF\u51FA\u5E93\u7684\u7269\u6599 smfcore.error.mimo.outFial=\u672A\u627E\u5230\u53EF\u51FA\u5E93\u7684\u7269\u6599
smfcore.error.getMaterialLot.in=\u6761\u7801[{0}]\u9A8C\u8BC1\u5931\u8D25\uFF0C\u65E0\u6CD5\u5165\u5E93 smfcore.error.getMaterialLot.in=\u6761\u7801[{0}]\u9A8C\u8BC1\u5931\u8D25\uFF0C\u65E0\u6CD5\u5165\u5E93
smfcore.error.getMaterialLot.out=\u6761\u7801[{0}]\u9A8C\u8BC1\u5931\u8D25\uFF0C\u65E0\u6CD5\u51FA\u5E93 smfcore.error.getMaterialLot.out=\u6761\u7801[{0}]\u9A8C\u8BC1\u5931\u8D25\uFF0C\u65E0\u6CD5\u51FA\u5E93
smfcore.error.storage.outNotEnd=\u6599\u4ED3{0}\u6709\u51FA\u5E93\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u4E0D\u5141\u8BB8\u5165\u5E93
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0} #smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1} #smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!