|
@@ -2,8 +2,8 @@ package com.fjhx.wms.service.stock.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson2.JSONArray;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.alibaba.fastjson2.JSONWriter;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -154,7 +154,10 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
BigDecimal defectiveQuantity = json.getBigDecimal("defectiveQuantity");
|
|
|
defectiveQuantity = ObjectUtil.isEmpty(defectiveQuantity) ? BigDecimal.ZERO : defectiveQuantity;
|
|
|
json.put("defectiveQuantity", defectiveQuantity);
|
|
|
- item.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+
|
|
|
+ JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString);
|
|
|
+
|
|
|
+ item.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -179,7 +182,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
|
|
|
String warehouseName = warehouseMap.get(json.getLong("warehouseId"));
|
|
|
json.put("warehouseName", warehouseName);
|
|
|
- stockVo.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+ stockVo.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
}
|
|
|
return page;
|
|
|
}
|
|
@@ -211,7 +214,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
BigDecimal defectiveQuantity = stockVo.getDefectiveQuantity();
|
|
|
defectiveQuantity = defectiveQuantity == null ? BigDecimal.ZERO : defectiveQuantity;
|
|
|
json.put("defectiveQuantity", defectiveQuantity);
|
|
|
- stockVo.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+ stockVo.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
}
|
|
|
|
|
|
//赋值产品名称
|
|
@@ -239,7 +242,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
BigDecimal defectiveQuantity = json.getBigDecimal("defectiveQuantity");
|
|
|
defectiveQuantity = ObjectUtil.isEmpty(defectiveQuantity) ? BigDecimal.ZERO : defectiveQuantity;
|
|
|
json.put("defectiveQuantity", defectiveQuantity);
|
|
|
- item.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+ item.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
});
|
|
|
|
|
|
//赋值产品分类
|
|
@@ -426,7 +429,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
frozenQuantity = frozenQuantity == null ? BigDecimal.ZERO : frozenQuantity;
|
|
|
frozenQuantity = frozenQuantity.add(stock.getQuantity());
|
|
|
json.put("frozenQuantity", frozenQuantity);
|
|
|
- oldStocks.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+ oldStocks.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
} else if (type == 4) {
|
|
|
//维多利亚待出库操作次品库存
|
|
|
String victoriatouristJson = oldStocks.getVictoriatouristJson();
|
|
@@ -442,7 +445,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
throw new ServiceException("以下商品次品库存不足,无法出库:" + productInfo.getName());
|
|
|
}
|
|
|
json.put("defectiveQuantity", defectiveQuantity);
|
|
|
- oldStocks.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+ oldStocks.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
} else {
|
|
|
throw new ServiceException("未知库存操作类型");
|
|
|
}
|
|
@@ -482,7 +485,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
}
|
|
|
stock1.setQuantity(quantity.add(stock.getQuantity()));
|
|
|
json.put("defectiveQuantity", defectiveQuantity.subtract(stock.getQuantity()));
|
|
|
- stock1.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+ stock1.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
updateById(stock1);
|
|
|
}
|
|
|
|
|
@@ -521,7 +524,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
|
}
|
|
|
stock1.setQuantity(quantity.subtract(stock.getQuantity()));
|
|
|
json.put("defectiveQuantity", defectiveQuantity.add(stock.getQuantity()));
|
|
|
- stock1.setVictoriatouristJson(json.toJSONString(JSONWriter.Feature.WriteLongAsString));
|
|
|
+ stock1.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
|
|
|
updateById(stock1);
|
|
|
}
|
|
|
|