Commit ce43893c 孙克

库存料格中不再保存,直接保存到料箱中

1 个父辈 0ad6690d
...@@ -35,7 +35,7 @@ public class GlobalExceptionHandler { ...@@ -35,7 +35,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler(Throwable.class) @ExceptionHandler(Throwable.class)
public ResponseEntity<ApiError> handleException(Throwable e){ public ResponseEntity<ApiError> handleException(Throwable e){
// 打印堆栈信息 // 打印堆栈信息
log.error(ThrowableUtil.getStackTrace(e)); log.error(e.getMessage());
return buildResponseEntity(ApiError.error(e.getMessage())); return buildResponseEntity(ApiError.error(e.getMessage()));
} }
......
...@@ -593,6 +593,15 @@ public class Barcode extends BasePo implements Serializable { ...@@ -593,6 +593,15 @@ public class Barcode extends BasePo implements Serializable {
} }
} }
public void removeFromSubCodes(Barcode subCode){
if(subCodeList != null && subCodeList.size() > 0){
boolean removeOk = subCodeList.removeIf(t -> t.getBarcode().equals(subCode.getBarcode()));
if(removeOk){
setAmount(getAmount() - subCode.getAmount());
}
}
}
public void updateSubCodes(Barcode subCode) { public void updateSubCodes(Barcode subCode) {
if (subCodeList == null) { if (subCodeList == null) {
subCodeList = new ArrayList<>(); subCodeList = new ArrayList<>();
......
...@@ -21,7 +21,7 @@ public class BinCacheUtil { ...@@ -21,7 +21,7 @@ public class BinCacheUtil {
private static DataCache dataCache; private static DataCache dataCache;
private static long binCodeUpdateTime = 0l; private static long binCodeUpdateTime = 0L;
@Autowired @Autowired
private void setDataCache(DataCache cache){ private void setDataCache(DataCache cache){
...@@ -30,7 +30,7 @@ public class BinCacheUtil { ...@@ -30,7 +30,7 @@ public class BinCacheUtil {
public static boolean canPutInBinCode(String binCode, String warehouseCode) { public static boolean canPutInBinCode(String binCode, String warehouseCode) {
Map<String, String> cacheMap = new HashMap<>(); Map<String, String> cacheMap = new HashMap<>();
if (binCodeUpdateTime == 0l || (System.currentTimeMillis() - binCodeUpdateTime >= 1000 * 60 * 60)) { if (binCodeUpdateTime == 0L || (System.currentTimeMillis() - binCodeUpdateTime >= 1000 * 60 * 60)) {
List<QueryBinResult> resultList = LuxsanApi.queryBin(new QueryBinRequest(CommonUtil.plantCode, BinEnum.STORAGE_TYPE_C, BinEnum.BIN_STATUS_0, warehouseCode)); List<QueryBinResult> resultList = LuxsanApi.queryBin(new QueryBinRequest(CommonUtil.plantCode, BinEnum.STORAGE_TYPE_C, BinEnum.BIN_STATUS_0, warehouseCode));
for (QueryBinResult result : resultList) { for (QueryBinResult result : resultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE()); cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!