wms和EBS库存数量对比,根据物料ID或者物料ID和批次分组统计
This commit is contained in:
parent
347fbaeb6f
commit
9fb55091a8
|
|
@ -93,41 +93,65 @@ public class EbsConfirmController extends BaseController {
|
||||||
@PostMapping("/ebsConfirm/main")
|
@PostMapping("/ebsConfirm/main")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo ebsConfirmMain(EbsStock ebsStock) throws Exception {
|
public TableDataInfo ebsConfirmMain(EbsStock ebsStock) throws Exception {
|
||||||
|
logger.info("查询EBS现有量并对比本地开始===》》》》》》》》");
|
||||||
TMiStock stockForQuery = new TMiStock();
|
TMiStock stockForQuery = new TMiStock();
|
||||||
stockForQuery.setGoodsId(ebsStock.getGoodsId());
|
stockForQuery.setGoodsId(ebsStock.getGoodsId());
|
||||||
stockForQuery.setWhseloc(ebsStock.getSubInventory());
|
stockForQuery.setWhseloc(ebsStock.getSubInventory());
|
||||||
// 库存信息
|
// 库存信息
|
||||||
List<TMiStock> stockList = tMiStockService.selectTMiStockOutList(stockForQuery);
|
List<TMiStock> stockList = tMiStockService.selectTMiStockOutList(stockForQuery);
|
||||||
|
logger.info("根据请求参数查询到的库存条数: {}", stockList.size());
|
||||||
// EBS现有量查询结果
|
// EBS现有量查询结果
|
||||||
List<EbsStock> ebsStockList = new LinkedList<>();
|
List<EbsStock> ebsStockList = new LinkedList<>();
|
||||||
if (stockList.size() < 1) {
|
// if (stockList.size() < 1) {
|
||||||
return getDataTable(ebsStockList);
|
// return getDataTable(ebsStockList);
|
||||||
}
|
// }
|
||||||
// 获取token
|
// 获取token
|
||||||
JSONObject token = JSON.parseObject(HttpUtils.httpPostJson(configService.selectConfigByKey("token_ip"), "", ""));
|
JSONObject token = JSON.parseObject(HttpUtils.httpPostJson(configService.selectConfigByKey("token_ip"), "", ""));
|
||||||
// 一起查询
|
// 一起查询
|
||||||
String params = JSON.toJSONString(createJsonList(stockList, ebsStock.getSubInventory(), EbsUtils.LOCATOR_AREA_MAP.get(ebsStock.getSubInventory())));
|
List<TMiStock> queryList = new ArrayList<>();
|
||||||
|
queryList.add(stockForQuery);
|
||||||
|
String params = JSON.toJSONString(createJsonList(queryList, ebsStock.getSubInventory(), EbsUtils.LOCATOR_AREA_MAP.get(ebsStock.getSubInventory())));
|
||||||
String result = HttpUtils.httpPostJson(configService.selectConfigByKey("ebs_ip"), params, token.get("access_token").toString());
|
String result = HttpUtils.httpPostJson(configService.selectConfigByKey("ebs_ip"), params, token.get("access_token").toString());
|
||||||
logger.info("现有量查询参数:{},结果:{}", params, result);
|
logger.info("现有量查询参数:{},结果:{}", params, result);
|
||||||
JSONObject resultJson = (JSONObject) JSON.parseObject(result).get("obj");
|
JSONObject resultJson = (JSONObject) JSON.parseObject(result).get("obj");
|
||||||
List<ExistingStock> datas = JSON.parseArray(resultJson.getString("rows"), ExistingStock.class);
|
List<ExistingStock> datas = JSON.parseArray(resultJson.getString("rows"), ExistingStock.class);
|
||||||
// 生成现有量数据
|
|
||||||
|
logger.info("返回的条数:{}", datas.size());
|
||||||
|
// 首先,处理EBS响应中的所有商品
|
||||||
|
Map<String, ExistingStock> ebsItemMap = new HashMap<>();
|
||||||
|
for (ExistingStock existingStock : datas) {
|
||||||
|
String itemCode = existingStock.getItemCode();
|
||||||
|
if (ebsItemMap.containsKey(itemCode)) {
|
||||||
|
// 对同一商品的数量进行累加
|
||||||
|
ExistingStock existing = ebsItemMap.get(itemCode);
|
||||||
|
existing.setTransactionQuantity(existing.getTransactionQuantity() + existingStock.getTransactionQuantity());
|
||||||
|
} else {
|
||||||
|
ebsItemMap.put(itemCode, existingStock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理本地库存列表中的商品
|
||||||
|
Set<String> processedItems = new HashSet<>();
|
||||||
for (TMiStock stock : stockList) {
|
for (TMiStock stock : stockList) {
|
||||||
// 插入的EBS现有量数据
|
// 插入的EBS现有量数据
|
||||||
EbsStock temp = new EbsStock();
|
EbsStock temp = new EbsStock();
|
||||||
// 查询结果返回的总量
|
// 查询结果返回的总量
|
||||||
int sum = 0;
|
double sum = 0;
|
||||||
for (ExistingStock existingStock : datas) {
|
|
||||||
if (stock.getGoodsId().equals(existingStock.getItemCode())) {
|
String goodsId = stock.getGoodsId();
|
||||||
sum += existingStock.getTransactionQuantity();
|
processedItems.add(goodsId);
|
||||||
}
|
|
||||||
|
if (ebsItemMap.containsKey(goodsId)) {
|
||||||
|
sum = ebsItemMap.get(goodsId).getTransactionQuantity();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设定EBS现有量的数据
|
// 设定EBS现有量的数据
|
||||||
temp.setGoodsId(stock.getGoodsId());
|
temp.setGoodsId(goodsId);
|
||||||
temp.setGoodsName(stock.getGoodsName());
|
temp.setGoodsName(stock.getGoodsName());
|
||||||
temp.setSubInventory(ebsStock.getSubInventory());
|
temp.setSubInventory(ebsStock.getSubInventory());
|
||||||
temp.setEbsNum(BigDecimal.valueOf(sum));
|
temp.setEbsNum(BigDecimal.valueOf(sum));
|
||||||
temp.setWmsNum(stock.getShelvesNum());
|
temp.setWmsNum(stock.getShelvesNum());
|
||||||
|
|
||||||
if (BigDecimal.valueOf(sum).compareTo(stock.getShelvesNum()) != 0) {
|
if (BigDecimal.valueOf(sum).compareTo(stock.getShelvesNum()) != 0) {
|
||||||
temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
||||||
temp.setSts("0");
|
temp.setSts("0");
|
||||||
|
|
@ -138,6 +162,34 @@ public class EbsConfirmController extends BaseController {
|
||||||
ebsStockList.add(temp);
|
ebsStockList.add(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 生成现有量数据
|
||||||
|
// for (TMiStock stock : stockList) {
|
||||||
|
// // 插入的EBS现有量数据
|
||||||
|
// EbsStock temp = new EbsStock();
|
||||||
|
// // 查询结果返回的总量
|
||||||
|
// int sum = 0;
|
||||||
|
// for (ExistingStock existingStock : datas) {
|
||||||
|
// if (stock.getGoodsId().equals(existingStock.getItemCode())) {
|
||||||
|
// sum += existingStock.getTransactionQuantity();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // 设定EBS现有量的数据
|
||||||
|
// temp.setGoodsId(stock.getGoodsId());
|
||||||
|
// temp.setGoodsName(stock.getGoodsName());
|
||||||
|
// temp.setSubInventory(ebsStock.getSubInventory());
|
||||||
|
// temp.setEbsNum(BigDecimal.valueOf(sum));
|
||||||
|
// temp.setWmsNum(stock.getShelvesNum());
|
||||||
|
// if (BigDecimal.valueOf(sum).compareTo(stock.getShelvesNum()) != 0) {
|
||||||
|
// temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
||||||
|
// temp.setSts("0");
|
||||||
|
// } else {
|
||||||
|
// temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
||||||
|
// temp.setSts("1");
|
||||||
|
// }
|
||||||
|
// ebsStockList.add(temp);
|
||||||
|
// }
|
||||||
|
|
||||||
// 更新逻辑
|
// 更新逻辑
|
||||||
// 1. 传参变化:只传子库
|
// 1. 传参变化:只传子库
|
||||||
// String params = JSON.toJSONString(createJsonGetAll(ebsStock.getSubInventory()));
|
// String params = JSON.toJSONString(createJsonGetAll(ebsStock.getSubInventory()));
|
||||||
|
|
@ -226,57 +278,96 @@ public class EbsConfirmController extends BaseController {
|
||||||
@PostMapping("/ebsConfirmLot/main")
|
@PostMapping("/ebsConfirmLot/main")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo ebsConfirmLotMain(EbsStock ebsStock) throws Exception {
|
public TableDataInfo ebsConfirmLotMain(EbsStock ebsStock) throws Exception {
|
||||||
|
logger.info("查询EBS现有量并对比本地开始===》》》》》》》》");
|
||||||
TMiStock stockForQuery = new TMiStock();
|
TMiStock stockForQuery = new TMiStock();
|
||||||
stockForQuery.setGoodsId(ebsStock.getGoodsId());
|
stockForQuery.setGoodsId(ebsStock.getGoodsId());
|
||||||
stockForQuery.setProduclotid(ebsStock.getLotNumber());
|
stockForQuery.setProduclotid(ebsStock.getLotNumber());
|
||||||
stockForQuery.setWhseloc(ebsStock.getSubInventory());
|
stockForQuery.setWhseloc(ebsStock.getSubInventory());
|
||||||
// 库存信息
|
// 库存信息
|
||||||
List<TMiStock> stockList = tMiStockService.selectTMiStockOutListByLot(stockForQuery);
|
List<TMiStock> stockList = tMiStockService.selectTMiStockOutListByLot(stockForQuery);
|
||||||
// EBS现有量查询结果
|
logger.info("根据请求参数查询到的库存条数: {}", stockList.size());
|
||||||
List<EbsStock> ebsStockList = new LinkedList<>();
|
|
||||||
if (stockList.size() < 1) {
|
// if (stockList.size() < 1) {
|
||||||
return getDataTable(ebsStockList);
|
// return getDataTable(ebsStockList);
|
||||||
}
|
// }
|
||||||
// 获取token
|
// 获取token
|
||||||
JSONObject token = JSON.parseObject(HttpUtils.httpPostJson(configService.selectConfigByKey("token_ip"), "", ""));
|
JSONObject token = JSON.parseObject(HttpUtils.httpPostJson(configService.selectConfigByKey("token_ip"), "", ""));
|
||||||
|
|
||||||
// TODO 分批查询
|
|
||||||
List<ExistingStock> datas = new ArrayList<>();
|
List<ExistingStock> datas = new ArrayList<>();
|
||||||
int batchNum = stockList.size()/200;
|
// int batchNum = stockList.size()/200;
|
||||||
for (int i=0; i<=batchNum; i++) {
|
// for (int i=0; i<=batchNum; i++) {
|
||||||
List<TMiStock> tempStockList;
|
// List<TMiStock> tempStockList;
|
||||||
if (i == batchNum) {
|
// if (i == batchNum) {
|
||||||
tempStockList = stockList.subList(i*200, stockList.size());
|
// tempStockList = stockList.subList(i*200, stockList.size());
|
||||||
} else {
|
// } else {
|
||||||
tempStockList = stockList.subList(i*200, (i+1)*200);
|
// tempStockList = stockList.subList(i*200, (i+1)*200);
|
||||||
}
|
// }
|
||||||
// 一起查询
|
// 一起查询
|
||||||
String params = JSON.toJSONString(createJsonList(tempStockList, ebsStock.getSubInventory(), EbsUtils.LOCATOR_AREA_MAP.get(ebsStock.getSubInventory())));
|
List<TMiStock> queryList = new ArrayList<>();
|
||||||
|
queryList.add(stockForQuery);
|
||||||
|
String params = JSON.toJSONString(createJsonList(queryList, ebsStock.getSubInventory(), EbsUtils.LOCATOR_AREA_MAP.get(ebsStock.getSubInventory())));
|
||||||
String result = HttpUtils.httpPostJson(configService.selectConfigByKey("ebs_ip"), params, token.get("access_token").toString());
|
String result = HttpUtils.httpPostJson(configService.selectConfigByKey("ebs_ip"), params, token.get("access_token").toString());
|
||||||
logger.info("现有量(按批次)查询参数:{},结果:{}", params, result);
|
logger.info("现有量(按批次)查询参数:{},结果:{}", params, result);
|
||||||
JSONObject resultJson = (JSONObject) JSON.parseObject(result).get("obj");
|
JSONObject resultJson = (JSONObject) JSON.parseObject(result).get("obj");
|
||||||
|
|
||||||
// 添加数据
|
// 添加数据
|
||||||
datas.addAll(JSON.parseArray(resultJson.getString("rows"), ExistingStock.class));
|
// datas.addAll(JSON.parseArray(resultJson.getString("rows"), ExistingStock.class));
|
||||||
|
datas = JSON.parseArray(resultJson.getString("rows"), ExistingStock.class);
|
||||||
|
logger.info("返回的条数:{}", datas.size());
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 创建一个Map来存储EBS系统中的商品和批次信息
|
||||||
|
Map<String, Map<String, Double>> ebsItemLotMap = new HashMap<>();
|
||||||
|
for (ExistingStock existingStock : datas) {
|
||||||
|
String itemCode = existingStock.getItemCode();
|
||||||
|
String lotNumber = existingStock.getLotNumber();
|
||||||
|
String key = itemCode + "_" + lotNumber;
|
||||||
|
|
||||||
|
if (ebsItemLotMap.containsKey(itemCode)) {
|
||||||
|
Map<String, Double> lotMap = ebsItemLotMap.get(itemCode);
|
||||||
|
if (lotMap.containsKey(lotNumber)) {
|
||||||
|
// 对同一商品同一批次的数量进行累加
|
||||||
|
lotMap.put(lotNumber, lotMap.get(lotNumber) + existingStock.getTransactionQuantity());
|
||||||
|
} else {
|
||||||
|
lotMap.put(lotNumber, existingStock.getTransactionQuantity());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Map<String, Double> lotMap = new HashMap<>();
|
||||||
|
lotMap.put(lotNumber, existingStock.getTransactionQuantity());
|
||||||
|
ebsItemLotMap.put(itemCode, lotMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成现有量数据
|
// 统计返回结果
|
||||||
|
List<EbsStock> ebsStockList = new LinkedList<>();
|
||||||
|
|
||||||
|
// 用于跟踪已处理的商品和批次组合
|
||||||
|
Set<String> processedItemLots = new HashSet<>();
|
||||||
|
|
||||||
|
// 处理本地库存列表中的商品
|
||||||
for (TMiStock stock : stockList) {
|
for (TMiStock stock : stockList) {
|
||||||
// 插入的EBS现有量数据
|
// 插入的EBS现有量数据
|
||||||
EbsStock temp = new EbsStock();
|
EbsStock temp = new EbsStock();
|
||||||
// 查询结果返回的总量
|
// 查询结果返回的总量
|
||||||
int sum = 0;
|
double sum = 0;
|
||||||
for (ExistingStock existingStock : datas) {
|
|
||||||
if (stock.getGoodsId().equals(existingStock.getItemCode()) && stock.getProduclotid().equals(existingStock.getLotNumber())) {
|
String goodsId = stock.getGoodsId();
|
||||||
sum += existingStock.getTransactionQuantity();
|
String lotNumber = stock.getProduclotid();
|
||||||
}
|
String key = goodsId + "_" + lotNumber;
|
||||||
|
processedItemLots.add(key);
|
||||||
|
|
||||||
|
if (ebsItemLotMap.containsKey(goodsId) && ebsItemLotMap.get(goodsId).containsKey(lotNumber)) {
|
||||||
|
sum = ebsItemLotMap.get(goodsId).get(lotNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设定EBS现有量的数据
|
// 设定EBS现有量的数据
|
||||||
temp.setGoodsId(stock.getGoodsId());
|
temp.setGoodsId(goodsId);
|
||||||
temp.setGoodsName(stock.getGoodsName());
|
temp.setGoodsName(stock.getGoodsName());
|
||||||
temp.setLotNumber(stock.getProduclotid());
|
temp.setLotNumber(lotNumber);
|
||||||
temp.setSubInventory(ebsStock.getSubInventory());
|
temp.setSubInventory(ebsStock.getSubInventory());
|
||||||
temp.setEbsNum(BigDecimal.valueOf(sum));
|
temp.setEbsNum(BigDecimal.valueOf(sum));
|
||||||
temp.setWmsNum(stock.getShelvesNum());
|
temp.setWmsNum(stock.getShelvesNum());
|
||||||
|
|
||||||
if (BigDecimal.valueOf(sum).compareTo(stock.getShelvesNum()) != 0) {
|
if (BigDecimal.valueOf(sum).compareTo(stock.getShelvesNum()) != 0) {
|
||||||
temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
||||||
temp.setSts("0");
|
temp.setSts("0");
|
||||||
|
|
@ -287,6 +378,88 @@ public class EbsConfirmController extends BaseController {
|
||||||
ebsStockList.add(temp);
|
ebsStockList.add(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理仅存在于EBS系统但不在本地系统中的商品和批次
|
||||||
|
for (Map.Entry<String, Map<String, Double>> itemEntry : ebsItemLotMap.entrySet()) {
|
||||||
|
String goodsId = itemEntry.getKey();
|
||||||
|
Map<String, Double> lotMap = itemEntry.getValue();
|
||||||
|
|
||||||
|
for (Map.Entry<String, Double> lotEntry : lotMap.entrySet()) {
|
||||||
|
String lotNumber = lotEntry.getKey();
|
||||||
|
String key = goodsId + "_" + lotNumber;
|
||||||
|
|
||||||
|
if (!processedItemLots.contains(key)) {
|
||||||
|
EbsStock temp = new EbsStock();
|
||||||
|
|
||||||
|
temp.setGoodsId(goodsId);
|
||||||
|
// 需要从某处获取商品名称 - 可能需要查询商品信息
|
||||||
|
temp.setGoodsName(getGoodsNameById(goodsId)); // 您需要实现这个方法
|
||||||
|
temp.setLotNumber(lotNumber);
|
||||||
|
temp.setSubInventory(ebsStock.getSubInventory());
|
||||||
|
temp.setEbsNum(BigDecimal.valueOf(lotEntry.getValue()));
|
||||||
|
temp.setWmsNum(BigDecimal.ZERO); // 本地数量为0
|
||||||
|
temp.setDiffNum(temp.getEbsNum()); // 差异就是EBS数量
|
||||||
|
temp.setSts("0"); // 状态为不同
|
||||||
|
|
||||||
|
ebsStockList.add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO 分批查询
|
||||||
|
// List<ExistingStock> datas = new ArrayList<>();
|
||||||
|
// int batchNum = stockList.size()/200;
|
||||||
|
// for (int i=0; i<=batchNum; i++) {
|
||||||
|
// List<TMiStock> tempStockList;
|
||||||
|
// if (i == batchNum) {
|
||||||
|
// tempStockList = stockList.subList(i*200, stockList.size());
|
||||||
|
// } else {
|
||||||
|
// tempStockList = stockList.subList(i*200, (i+1)*200);
|
||||||
|
// }
|
||||||
|
// // 一起查询
|
||||||
|
// String params = JSON.toJSONString(createJsonList(tempStockList, ebsStock.getSubInventory(), EbsUtils.LOCATOR_AREA_MAP.get(ebsStock.getSubInventory())));
|
||||||
|
// String result = HttpUtils.httpPostJson(configService.selectConfigByKey("ebs_ip"), params, token.get("access_token").toString());
|
||||||
|
// logger.info("现有量(按批次)查询参数:{},结果:{}", params, result);
|
||||||
|
// JSONObject resultJson = (JSONObject) JSON.parseObject(result).get("obj");
|
||||||
|
// // 添加数据
|
||||||
|
// datas.addAll(JSON.parseArray(resultJson.getString("rows"), ExistingStock.class));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 生成现有量数据
|
||||||
|
// for (TMiStock stock : stockList) {
|
||||||
|
// // 插入的EBS现有量数据
|
||||||
|
// EbsStock temp = new EbsStock();
|
||||||
|
// // 查询结果返回的总量
|
||||||
|
// int sum = 0;
|
||||||
|
// for (ExistingStock existingStock : datas) {
|
||||||
|
// if (stock.getGoodsId().equals(existingStock.getItemCode()) && stock.getProduclotid().equals(existingStock.getLotNumber())) {
|
||||||
|
// sum += existingStock.getTransactionQuantity();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // 设定EBS现有量的数据
|
||||||
|
// temp.setGoodsId(stock.getGoodsId());
|
||||||
|
// temp.setGoodsName(stock.getGoodsName());
|
||||||
|
// temp.setLotNumber(stock.getProduclotid());
|
||||||
|
// temp.setSubInventory(ebsStock.getSubInventory());
|
||||||
|
// temp.setEbsNum(BigDecimal.valueOf(sum));
|
||||||
|
// temp.setWmsNum(stock.getShelvesNum());
|
||||||
|
// if (BigDecimal.valueOf(sum).compareTo(stock.getShelvesNum()) != 0) {
|
||||||
|
// temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
||||||
|
// temp.setSts("0");
|
||||||
|
// } else {
|
||||||
|
// temp.setDiffNum(BigDecimal.valueOf(sum).subtract(stock.getShelvesNum()));
|
||||||
|
// temp.setSts("1");
|
||||||
|
// }
|
||||||
|
// ebsStockList.add(temp);
|
||||||
|
// }
|
||||||
|
|
||||||
// 更新逻辑
|
// 更新逻辑
|
||||||
// 1. 传参变化:只传子库
|
// 1. 传参变化:只传子库
|
||||||
// String params = JSON.toJSONString(createJsonGetAll(ebsStock.getSubInventory()));
|
// String params = JSON.toJSONString(createJsonGetAll(ebsStock.getSubInventory()));
|
||||||
|
|
@ -382,6 +555,12 @@ public class EbsConfirmController extends BaseController {
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getGoodsNameById(String goodsId) {
|
||||||
|
TBaseGoods tBaseGoods = goodsService.selectTBaseGoodsByGoodsId(goodsId);
|
||||||
|
if(tBaseGoods == null) return null;
|
||||||
|
return tBaseGoods.getGoodsName();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出EBS现有量记录
|
* 导出EBS现有量记录
|
||||||
*/
|
*/
|
||||||
|
|
@ -480,12 +659,16 @@ public class EbsConfirmController extends BaseController {
|
||||||
String lotNumber = "";
|
String lotNumber = "";
|
||||||
for (int i = 0; i < stocks.size(); i++) {
|
for (int i = 0; i < stocks.size(); i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
itemCode = stocks.get(i).getGoodsId();
|
if(StringUtils.isNotBlank(stocks.get(i).getGoodsId())){
|
||||||
|
itemCode = stocks.get(i).getGoodsId();
|
||||||
|
}
|
||||||
if (StringUtils.isNotEmpty(stocks.get(i).getProduclotid())) {
|
if (StringUtils.isNotEmpty(stocks.get(i).getProduclotid())) {
|
||||||
lotNumber = stocks.get(i).getProduclotid();
|
lotNumber = stocks.get(i).getProduclotid();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
itemCode += "," + stocks.get(i).getGoodsId();
|
if(StringUtils.isNotBlank(stocks.get(i).getGoodsId())){
|
||||||
|
itemCode += "," + stocks.get(i).getGoodsId();
|
||||||
|
}
|
||||||
if (StringUtils.isNotEmpty(stocks.get(i).getProduclotid())) {
|
if (StringUtils.isNotEmpty(stocks.get(i).getProduclotid())) {
|
||||||
lotNumber += "," + stocks.get(i).getProduclotid();
|
lotNumber += "," + stocks.get(i).getProduclotid();
|
||||||
}
|
}
|
||||||
|
|
@ -555,11 +738,11 @@ public class EbsConfirmController extends BaseController {
|
||||||
this.originationDate = originationDate;
|
this.originationDate = originationDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTransactionQuantity() {
|
public Double getTransactionQuantity() {
|
||||||
return transactionQuantity;
|
return transactionQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTransactionQuantity(int transactionQuantity) {
|
public void setTransactionQuantity(Double transactionQuantity) {
|
||||||
this.transactionQuantity = transactionQuantity;
|
this.transactionQuantity = transactionQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -585,7 +768,7 @@ public class EbsConfirmController extends BaseController {
|
||||||
private String subinventoryCode;
|
private String subinventoryCode;
|
||||||
private String expirationDate;
|
private String expirationDate;
|
||||||
private String originationDate;
|
private String originationDate;
|
||||||
private int transactionQuantity;
|
private Double transactionQuantity;
|
||||||
private int pnalQty;
|
private int pnalQty;
|
||||||
private int organizationId;
|
private int organizationId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,11 +129,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectTMiStockOutList" parameterType="TMiStock" resultMap="TMiStockResult">
|
<select id="selectTMiStockOutList" parameterType="TMiStock" resultMap="TMiStockResult">
|
||||||
select GOODS_ID, GOODS_NAME, SUM(SHELVES_NUM) as SHELVES_NUM, WHSELOC from t_mi_stock
|
select GOODS_ID, GOODS_NAME, SUM(SHELVES_NUM) as SHELVES_NUM, WHSELOC from t_mi_stock
|
||||||
<where>
|
<where>
|
||||||
|
GOODS_ID <> "000000000"
|
||||||
<if test="goodsId != null and goodsId != ''"> and GOODS_ID like concat('%', #{goodsId}, '%')</if>
|
<if test="goodsId != null and goodsId != ''"> and GOODS_ID like concat('%', #{goodsId}, '%')</if>
|
||||||
<if test="produclotid != null and produclotid != ''"> and PRODUCLOTID like concat('%', #{produclotid}, '%')</if>
|
<if test="produclotid != null and produclotid != ''"> and PRODUCLOTID like concat('%', #{produclotid}, '%')</if>
|
||||||
<if test="whseloc != null and whseloc != ''"> and WHSELOC = #{whseloc}</if>
|
<if test="whseloc != null and whseloc != ''"> and WHSELOC = #{whseloc}</if>
|
||||||
<if test="sts != null and sts != ''"> and STS = #{sts}</if>
|
<if test="sts != null and sts != ''"> and STS = #{sts}</if>
|
||||||
and GOODS_ID != "000000000"
|
|
||||||
</where>
|
</where>
|
||||||
group by GOODS_ID
|
group by GOODS_ID
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -141,13 +141,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectTMiStockOutListByLot" parameterType="TMiStock" resultMap="TMiStockResult">
|
<select id="selectTMiStockOutListByLot" parameterType="TMiStock" resultMap="TMiStockResult">
|
||||||
select GOODS_ID, PRODUCLOTID, GOODS_NAME, SUM(SHELVES_NUM) as SHELVES_NUM, WHSELOC from t_mi_stock
|
select GOODS_ID, PRODUCLOTID, GOODS_NAME, SUM(SHELVES_NUM) as SHELVES_NUM, WHSELOC from t_mi_stock
|
||||||
<where>
|
<where>
|
||||||
|
GOODS_ID <> "000000000"
|
||||||
<if test="goodsId != null and goodsId != ''"> and GOODS_ID like concat('%', #{goodsId}, '%')</if>
|
<if test="goodsId != null and goodsId != ''"> and GOODS_ID like concat('%', #{goodsId}, '%')</if>
|
||||||
<if test="produclotid != null and produclotid != ''"> and PRODUCLOTID like concat('%', #{produclotid}, '%')</if>
|
<if test="produclotid != null and produclotid != ''"> and PRODUCLOTID like concat('%', #{produclotid}, '%')</if>
|
||||||
<if test="whseloc != null and whseloc != ''"> and WHSELOC = #{whseloc}</if>
|
<if test="whseloc != null and whseloc != ''"> and WHSELOC = #{whseloc}</if>
|
||||||
<if test="sts != null and sts != ''"> and STS = #{sts}</if>
|
<if test="sts != null and sts != ''"> and STS = #{sts}</if>
|
||||||
and GOODS_ID != "000000000"
|
|
||||||
</where>
|
</where>
|
||||||
group by PRODUCLOTID
|
group by GOODS_ID, PRODUCLOTID
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTMiStockByStockId" parameterType="TMiStock" resultMap="TMiStockResult">
|
<select id="selectTMiStockByStockId" parameterType="TMiStock" resultMap="TMiStockResult">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user