|
@@ -247,6 +247,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
@Override
|
|
|
public Integer outs(List<CameraInOutParam> params){
|
|
|
setCompanyIdByDb(params);
|
|
|
+ checkOrderSn(params);
|
|
|
HashMap<String, Object> resultMap = getResultMap(params);
|
|
|
HashMap<Long,CameraDetail> detailMap = (HashMap<Long, CameraDetail>) resultMap.get("detailMap");
|
|
|
HashMap<String, Camera> snCodeMap = (HashMap<String, Camera>) resultMap.get("snCodeMap");
|
|
@@ -259,6 +260,28 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void checkOrderSn(List<CameraInOutParam> params) {
|
|
|
+ List<String> orderSnList = params.stream().map(CameraInOutParam::getOrderSn).collect(Collectors.toList());
|
|
|
+ if(orderSnList.size() >0){
|
|
|
+ List<Order> orders = orderService.getByOrderSnList(orderSnList);
|
|
|
+ List<String> dbOrderSn = orders.stream().map(Order::getOrderSn).collect(Collectors.toList());
|
|
|
+ List<Integer> errorList = new ArrayList<>();
|
|
|
+ Integer index = 0;
|
|
|
+ for (String sn : orderSnList) {
|
|
|
+ index ++;
|
|
|
+ if(StringUtils.isBlank(sn)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(!dbOrderSn.contains(sn)){
|
|
|
+ errorList.add(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ excelService.toExcelError(errorList);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private Integer saveBatchDetail(HashMap<Long, CameraDetail> detailMap, List<CameraInOutParam> params){
|
|
|
List<CameraDetail> cameraDetails = new ArrayList<>();
|
|
|
for (CameraInOutParam param : params) {
|