|
|
|
@ -87,13 +87,19 @@ public class StockService {
|
|
|
|
List<Stock>stockList = new ArrayList<>();
|
|
|
|
List<Stock>stockList = new ArrayList<>();
|
|
|
|
//默认全部盘点正确
|
|
|
|
//默认全部盘点正确
|
|
|
|
Map<String,Integer> rowTabStatus = new LinkedHashMap<>();
|
|
|
|
Map<String,Integer> rowTabStatus = new LinkedHashMap<>();
|
|
|
|
|
|
|
|
int columns = 0;
|
|
|
|
|
|
|
|
int rows = 0;
|
|
|
|
for(String rowTab: rowColumnStatus.getRowTabs()){
|
|
|
|
for(String rowTab: rowColumnStatus.getRowTabs()){
|
|
|
|
rowTabStatus.put(rowTab,2);
|
|
|
|
rows = getMax(rowTab,rows);
|
|
|
|
|
|
|
|
rowTabStatus.put(rowTab,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Map<String,Integer> columnTabStatus = new LinkedHashMap<>();
|
|
|
|
Map<String,Integer> columnTabStatus = new LinkedHashMap<>();
|
|
|
|
for(String column:rowColumnStatus.getColumnTabs()){
|
|
|
|
for(String column:rowColumnStatus.getColumnTabs()){
|
|
|
|
columnTabStatus.put(column,2);
|
|
|
|
columns = getMax(column,columns);
|
|
|
|
|
|
|
|
columnTabStatus.put(column,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String,Integer> columnTabCorrectCount = new LinkedHashMap<>();
|
|
|
|
|
|
|
|
Map<String,Integer> rowTabCorrectCount = new LinkedHashMap<>();
|
|
|
|
List<Stock> stocks = stockMapper.selectList(new QueryWrapper<Stock>().select("status","`row`","`column`","`shelve_id`").eq("`shelve_id`",rowColumnStatus.getShelveId()));
|
|
|
|
List<Stock> stocks = stockMapper.selectList(new QueryWrapper<Stock>().select("status","`row`","`column`","`shelve_id`").eq("`shelve_id`",rowColumnStatus.getShelveId()));
|
|
|
|
if(CollectionUtils.isEmpty(stocks)){
|
|
|
|
if(CollectionUtils.isEmpty(stocks)){
|
|
|
|
stockInit(rowColumnStatus.getRowStart(), rowColumnStatus.getRowEnd(), rowColumnStatus.getColumnStart(), rowColumnStatus.getColumnEnd(), rowColumnStatus.getShelveId(),stocks);
|
|
|
|
stockInit(rowColumnStatus.getRowStart(), rowColumnStatus.getRowEnd(), rowColumnStatus.getColumnStart(), rowColumnStatus.getColumnEnd(), rowColumnStatus.getShelveId(),stocks);
|
|
|
|
@ -113,6 +119,16 @@ public class StockService {
|
|
|
|
for(String rowTab: rowColumnStatus.getRowTabs()){
|
|
|
|
for(String rowTab: rowColumnStatus.getRowTabs()){
|
|
|
|
if(isRowColumnInTab(stock,rowTab,true)){
|
|
|
|
if(isRowColumnInTab(stock,rowTab,true)){
|
|
|
|
tabStatus(stock,rowTabStatus,rowTab);
|
|
|
|
tabStatus(stock,rowTabStatus,rowTab);
|
|
|
|
|
|
|
|
//盘点正确
|
|
|
|
|
|
|
|
if(stock.getStatus() != 0 && stock.getStatus() != 1){
|
|
|
|
|
|
|
|
if(rowTabCorrectCount.get(rowTab) == null){
|
|
|
|
|
|
|
|
rowTabCorrectCount.put(rowTab,1);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
int c = rowTabCorrectCount.get(rowTab);
|
|
|
|
|
|
|
|
rowTabCorrectCount.put(rowTab,c+1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -120,10 +136,36 @@ public class StockService {
|
|
|
|
for(String columnTab: rowColumnStatus.getColumnTabs()){
|
|
|
|
for(String columnTab: rowColumnStatus.getColumnTabs()){
|
|
|
|
if(isRowColumnInTab(stock,columnTab,false)){
|
|
|
|
if(isRowColumnInTab(stock,columnTab,false)){
|
|
|
|
tabStatus(stock,columnTabStatus,columnTab);
|
|
|
|
tabStatus(stock,columnTabStatus,columnTab);
|
|
|
|
|
|
|
|
if(columnTabCorrectCount.get(columnTab) == null){
|
|
|
|
|
|
|
|
columnTabCorrectCount.put(columnTab,1);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
int c = columnTabCorrectCount.get(columnTab);
|
|
|
|
|
|
|
|
columnTabCorrectCount.put(columnTab,c+1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(Map.Entry<String,Integer> entry: rowTabCorrectCount.entrySet()){
|
|
|
|
|
|
|
|
String [] strings = entry.getKey().split(" - ");
|
|
|
|
|
|
|
|
Integer tabStart = Integer.valueOf(strings[0]);
|
|
|
|
|
|
|
|
Integer tabEnd = Integer.valueOf(strings[1]);
|
|
|
|
|
|
|
|
int counts = (tabEnd- tabStart) * rows;
|
|
|
|
|
|
|
|
if(counts == entry.getValue()){
|
|
|
|
|
|
|
|
rowTabStatus.put(entry.getKey(),2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for(Map.Entry<String,Integer> entry: columnTabCorrectCount.entrySet()){
|
|
|
|
|
|
|
|
String [] strings = entry.getKey().split(" - ");
|
|
|
|
|
|
|
|
Integer tabStart = Integer.valueOf(strings[0]);
|
|
|
|
|
|
|
|
Integer tabEnd = Integer.valueOf(strings[1]);
|
|
|
|
|
|
|
|
int counts = (tabEnd- tabStart) * rows;
|
|
|
|
|
|
|
|
if(counts == entry.getValue()){
|
|
|
|
|
|
|
|
columnTabStatus.put(entry.getKey(),2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
checkStatus.setColumnTabStatus(columnTabStatus);
|
|
|
|
checkStatus.setColumnTabStatus(columnTabStatus);
|
|
|
|
checkStatus.setRowTabStatus(rowTabStatus);
|
|
|
|
checkStatus.setRowTabStatus(rowTabStatus);
|
|
|
|
checkStatus.setStocks(stockInit(rowColumnStatus.getRowStart(), rowColumnStatus.getRowEnd(), rowColumnStatus.getColumnStart(), rowColumnStatus.getColumnEnd(), rowColumnStatus.getShelveId(),stockList));
|
|
|
|
checkStatus.setStocks(stockInit(rowColumnStatus.getRowStart(), rowColumnStatus.getRowEnd(), rowColumnStatus.getColumnStart(), rowColumnStatus.getColumnEnd(), rowColumnStatus.getShelveId(),stockList));
|
|
|
|
@ -164,6 +206,9 @@ public class StockService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//0 : 未盘点 1:盘点异常 2:盘点正确
|
|
|
|
//0 : 未盘点 1:盘点异常 2:盘点正确
|
|
|
|
|
|
|
|
//1>0>2 替换为
|
|
|
|
|
|
|
|
// 盘点异常 未盘点 盘点正确
|
|
|
|
|
|
|
|
// 1000 100 10
|
|
|
|
|
|
|
|
|
|
|
|
private void tabStatus(Stock stock,Map<String,Integer> tabStatus,String tab){
|
|
|
|
private void tabStatus(Stock stock,Map<String,Integer> tabStatus,String tab){
|
|
|
|
if(tabStatus.get(tab) == null){
|
|
|
|
if(tabStatus.get(tab) == null){
|
|
|
|
@ -192,6 +237,15 @@ public class StockService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Integer getMax(String tab,Integer max){
|
|
|
|
|
|
|
|
String [] strings = tab.split(" - ");
|
|
|
|
|
|
|
|
Integer tabStart = Integer.valueOf(strings[0]);
|
|
|
|
|
|
|
|
Integer tabEnd = Integer.valueOf(strings[1]);
|
|
|
|
|
|
|
|
int a = tabStart > tabEnd ? tabStart : tabEnd;
|
|
|
|
|
|
|
|
a = max > a ? max : a;
|
|
|
|
|
|
|
|
return a;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 导出巷道格子信息
|
|
|
|
* 导出巷道格子信息
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|