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