给销售出库页面的序列号批量出库增加(未查询到的序列号的展示)
This commit is contained in:
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -99,8 +100,31 @@ public class SerialNumberController {
|
|||||||
serialNumberEx.setCreateTimeStr(Tools.getCenternTime(serialNumberEx.getCreateTime()));
|
serialNumberEx.setCreateTimeStr(Tools.getCenternTime(serialNumberEx.getCreateTime()));
|
||||||
}
|
}
|
||||||
Long total = serialNumberService.getEnableSerialNumberCount(number, name, nameArray, depotId, barCode);
|
Long total = serialNumberService.getEnableSerialNumberCount(number, name, nameArray, depotId, barCode);
|
||||||
|
List<String> missList = new ArrayList<>();
|
||||||
|
if(nameArray!=null && nameArray.length>0) {
|
||||||
|
List<SerialNumberEx> allList = serialNumberService.getEnableSerialNumberList(number, name, nameArray, depotId, barCode, null, null);
|
||||||
|
if(allList.size() < nameArray.length) {
|
||||||
|
//说明查出的比查询条件里面的序列号少,此时需要寻找出缺少的序列号
|
||||||
|
for (String item : nameArray) {
|
||||||
|
boolean isHave = false;
|
||||||
|
for (SerialNumberEx serialNumberEx : allList) {
|
||||||
|
if (item.equals(serialNumberEx.getSerialNumber())) {
|
||||||
|
isHave = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isHave) {
|
||||||
|
missList.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
map.put("rows", list);
|
map.put("rows", list);
|
||||||
map.put("total", total);
|
map.put("total", total);
|
||||||
|
if(!missList.isEmpty()) {
|
||||||
|
//列出未查询到的序列号
|
||||||
|
map.put("missInfo", String.join(",", missList));
|
||||||
|
}
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = map;
|
res.data = map;
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
|
|||||||
@@ -197,6 +197,9 @@
|
|||||||
this.queryParam.name = ''
|
this.queryParam.name = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(res.data.missInfo) {
|
||||||
|
this.$message.warning("未查询到的序列号:" + res.data.missInfo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|||||||
Reference in New Issue
Block a user