|
@@ -692,6 +692,7 @@ public class ChangeOrderLogic {
|
|
|
.list().stream().collect(Collectors.toMap(AdminWebsit::getWebsitId, Function.identity()));
|
|
|
|
|
|
List<WebsitDispatch> websitDispatches = new ArrayList<>();
|
|
|
+ List<WebsitDispatch> websitDispatcheUps = new ArrayList<>();
|
|
|
for (Object o : rows) {
|
|
|
List<Object> row = (List<Object>) o;
|
|
|
|
|
@@ -749,20 +750,18 @@ public class ChangeOrderLogic {
|
|
|
websitDispatch.setSaleTypeId(saleOne.getDictCode());
|
|
|
|
|
|
|
|
|
- if (websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode, region.getId())
|
|
|
+
|
|
|
+ WebsitDispatch websitDispatch1 = websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode, region.getId())
|
|
|
.eq(WebsitDispatch::getOrderSmallId, websitDispatch.getOrderSmallId())
|
|
|
.eq(WebsitDispatch::getCategoryId, websitDispatch.getCategoryId())
|
|
|
- .eq(WebsitDispatch::getSaleTypeId, websitDispatch.getSaleTypeId())
|
|
|
- .count() > 0) {
|
|
|
- WebsitDispatch websitDispatch1 = websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode, region.getId())
|
|
|
- .eq(WebsitDispatch::getOrderSmallId, websitDispatch.getOrderSmallId())
|
|
|
- .eq(WebsitDispatch::getCategoryId, websitDispatch.getCategoryId())
|
|
|
- .eq(WebsitDispatch::getSaleTypeId, websitDispatch.getSaleTypeId()).last("limit 1").one();
|
|
|
-
|
|
|
+ .eq(WebsitDispatch::getSaleTypeId, websitDispatch.getSaleTypeId()).last("limit 1").one();
|
|
|
+ if (websitDispatch1 != null) {
|
|
|
websitDispatch.setId(websitDispatch1.getId());
|
|
|
- }
|
|
|
+ websitDispatcheUps.add(websitDispatch);
|
|
|
+ }else {
|
|
|
|
|
|
- websitDispatches.add(websitDispatch);
|
|
|
+ websitDispatches.add(websitDispatch);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -770,8 +769,10 @@ public class ChangeOrderLogic {
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- websitDispatchService.saveOrUpdateBatch(websitDispatches);
|
|
|
+ if (CollectionUtils.isNotEmpty(websitDispatches))
|
|
|
+ websitDispatchService.saveBatch(websitDispatches);
|
|
|
+ if (CollectionUtils.isNotEmpty(websitDispatches))
|
|
|
+ websitDispatchService.updateBatchById(websitDispatcheUps);
|
|
|
|
|
|
}
|
|
|
|