Commit ce43893c 孙克

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

1 个父辈 0ad6690d
......@@ -35,7 +35,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler(Throwable.class)
public ResponseEntity<ApiError> handleException(Throwable e){
// 打印堆栈信息
log.error(ThrowableUtil.getStackTrace(e));
log.error(e.getMessage());
return buildResponseEntity(ApiError.error(e.getMessage()));
}
......
......@@ -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) {
if (subCodeList == null) {
subCodeList = new ArrayList<>();
......
......@@ -21,7 +21,7 @@ public class BinCacheUtil {
private static DataCache dataCache;
private static long binCodeUpdateTime = 0l;
private static long binCodeUpdateTime = 0L;
@Autowired
private void setDataCache(DataCache cache){
......@@ -30,7 +30,7 @@ public class BinCacheUtil {
public static boolean canPutInBinCode(String binCode, String warehouseCode) {
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));
for (QueryBinResult result : resultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!