Merge branch 'dev_6.8.4_order' into test6.8.4
Showing
3 changed files
with
11 additions
and
5 deletions
@@ -2,6 +2,7 @@ package com.yohoufo.order.service.handler; | @@ -2,6 +2,7 @@ package com.yohoufo.order.service.handler; | ||
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | import com.google.common.collect.Lists; | 4 | import com.google.common.collect.Lists; |
5 | +import com.yoho.core.dal.datasource.annotation.Database; | ||
5 | import com.yohoufo.common.exception.UfoServiceException; | 6 | import com.yohoufo.common.exception.UfoServiceException; |
6 | import com.yohoufo.common.utils.DateUtil; | 7 | import com.yohoufo.common.utils.DateUtil; |
7 | import com.yohoufo.dal.order.SellerOrderGoodsMapper; | 8 | import com.yohoufo.dal.order.SellerOrderGoodsMapper; |
@@ -23,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional; | @@ -23,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional; | ||
23 | import java.math.BigDecimal; | 24 | import java.math.BigDecimal; |
24 | import java.util.List; | 25 | import java.util.List; |
25 | import java.util.Map; | 26 | import java.util.Map; |
26 | -import java.util.Random; | ||
27 | import java.util.concurrent.Callable; | 27 | import java.util.concurrent.Callable; |
28 | import java.util.concurrent.FutureTask; | 28 | import java.util.concurrent.FutureTask; |
29 | 29 | ||
@@ -91,6 +91,7 @@ public abstract class AbstractSellerAdjustPriceTaskHandler extends AbstractSelle | @@ -91,6 +91,7 @@ public abstract class AbstractSellerAdjustPriceTaskHandler extends AbstractSelle | ||
91 | 91 | ||
92 | @Transactional | 92 | @Transactional |
93 | @Component | 93 | @Component |
94 | + @Database(ForceMaster=true, DataSource="ufo_order") | ||
94 | public static class SkupAdjustPriceDBService { | 95 | public static class SkupAdjustPriceDBService { |
95 | 96 | ||
96 | @Autowired | 97 | @Autowired |
1 | package com.yohoufo.order.service.handler; | 1 | package com.yohoufo.order.service.handler; |
2 | 2 | ||
3 | import com.google.common.collect.Lists; | 3 | import com.google.common.collect.Lists; |
4 | +import com.yoho.core.dal.datasource.annotation.Database; | ||
4 | import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo; | 5 | import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo; |
5 | import com.yohobuy.ufo.model.order.bo.OrderInfo; | 6 | import com.yohobuy.ufo.model.order.bo.OrderInfo; |
6 | import com.yohobuy.ufo.model.order.common.SellerOrderStatus; | 7 | import com.yohobuy.ufo.model.order.common.SellerOrderStatus; |
@@ -67,8 +68,11 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<Map<In | @@ -67,8 +68,11 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<Map<In | ||
67 | for (SellerOrder so : soList) { | 68 | for (SellerOrder so : soList) { |
68 | skupDtoMap.get(so.getSkup()).setSellerOrder(so); | 69 | skupDtoMap.get(so.getSkup()).setSellerOrder(so); |
69 | } | 70 | } |
71 | + log.info("[{}-{}] down shelf skups:{}", taskDto.getUid(), taskDto.getTaskId(), skupSets); | ||
70 | //先商品下架 | 72 | //先商品下架 |
71 | - return productProxyService.sellerBatchUpdateStatus(Lists.newArrayList(skupSets), ProductProxyService.PrdShelvelStatus.off); | 73 | + boolean updateStatusFlag = productProxyService.sellerBatchUpdateStatus(Lists.newArrayList(skupSets), ProductProxyService.PrdShelvelStatus.off); |
74 | + log.info("[{}-{}] skups down shelf result is {}", taskDto.getUid(), taskDto.getTaskId(), updateStatusFlag); | ||
75 | + return updateStatusFlag; | ||
72 | } | 76 | } |
73 | 77 | ||
74 | @Override | 78 | @Override |
@@ -198,6 +202,7 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<Map<In | @@ -198,6 +202,7 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<Map<In | ||
198 | 202 | ||
199 | @Transactional | 203 | @Transactional |
200 | @Component | 204 | @Component |
205 | + @Database(ForceMaster=true, DataSource="ufo_order") | ||
201 | public static class SkupDownShelfDBService { | 206 | public static class SkupDownShelfDBService { |
202 | @Autowired | 207 | @Autowired |
203 | private SellerOrderMapper sellerOrderMapper; | 208 | private SellerOrderMapper sellerOrderMapper; |
@@ -23,7 +23,7 @@ public class SellerIncrPriceTaskHandler extends AbstractSellerAdjustPriceTaskHan | @@ -23,7 +23,7 @@ public class SellerIncrPriceTaskHandler extends AbstractSellerAdjustPriceTaskHan | ||
23 | protected boolean preHandle(SellerTaskResult result, SellerTaskDTO<ChangePricePrepareDTO> taskDto) { | 23 | protected boolean preHandle(SellerTaskResult result, SellerTaskDTO<ChangePricePrepareDTO> taskDto) { |
24 | ChangePricePrepareDTO cppDto = taskDto.getProcessData(); | 24 | ChangePricePrepareDTO cppDto = taskDto.getProcessData(); |
25 | int uid = taskDto.getUid(); | 25 | int uid = taskDto.getUid(); |
26 | - long oprId = taskDto.getTaskId(); | 26 | + long taskId = taskDto.getTaskId(); |
27 | BigDecimal preSalePrice = cppDto.getPreSalePrice(), | 27 | BigDecimal preSalePrice = cppDto.getPreSalePrice(), |
28 | salePrice = cppDto.getSalePrice(); | 28 | salePrice = cppDto.getSalePrice(); |
29 | Map<Integer, SkupDto> skupMap = cppDto.getSkupMap(); | 29 | Map<Integer, SkupDto> skupMap = cppDto.getSkupMap(); |
@@ -38,10 +38,10 @@ public class SellerIncrPriceTaskHandler extends AbstractSellerAdjustPriceTaskHan | @@ -38,10 +38,10 @@ public class SellerIncrPriceTaskHandler extends AbstractSellerAdjustPriceTaskHan | ||
38 | .beforeProductPrice(preSalePrice) | 38 | .beforeProductPrice(preSalePrice) |
39 | .afterEarnestMoney(computeResult.getEarnestMoney().getEarnestMoney().toPlainString()) | 39 | .afterEarnestMoney(computeResult.getEarnestMoney().getEarnestMoney().toPlainString()) |
40 | .earnestMoney(totalDiffMoney).productCount(skupMap.size()) | 40 | .earnestMoney(totalDiffMoney).productCount(skupMap.size()) |
41 | - .seriNo(String.valueOf(oprId)) | 41 | + .seriNo(String.valueOf(taskId)) |
42 | .type(swdType.getValue()).build(); | 42 | .type(swdType.getValue()).build(); |
43 | 43 | ||
44 | - log.info("[{}-{}] pre use total earnest:{},diff earnest:{},num:{}", uid, oprId, totalDiffMoney, diffEarnestMoney, skupMap.size()); | 44 | + log.info("[{}-{}] pre use total earnest:{},diff earnest:{},num:{}", uid, taskId, totalDiffMoney, diffEarnestMoney, skupMap.size()); |
45 | SellerWallet sellerWallet = cppDto.isSuper() ? new SellerWallet() : merchantOrderPaymentService.changePriceUseEarnest(uid, totalDiffMoney, moai); | 45 | SellerWallet sellerWallet = cppDto.isSuper() ? new SellerWallet() : merchantOrderPaymentService.changePriceUseEarnest(uid, totalDiffMoney, moai); |
46 | result.sellerWallet = sellerWallet; | 46 | result.sellerWallet = sellerWallet; |
47 | return Objects.nonNull(sellerWallet); | 47 | return Objects.nonNull(sellerWallet); |
-
Please register or login to post a comment