Authored by wujiexiang

批量下架

... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service.handler;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
... ... @@ -23,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
... ... @@ -91,6 +91,7 @@ public abstract class AbstractSellerAdjustPriceTaskHandler extends AbstractSelle
@Transactional
@Component
@Database(ForceMaster=true, DataSource="ufo_order")
public static class SkupAdjustPriceDBService {
@Autowired
... ...
package com.yohoufo.order.service.handler;
import com.google.common.collect.Lists;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
... ... @@ -67,8 +68,11 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<Map<In
for (SellerOrder so : soList) {
skupDtoMap.get(so.getSkup()).setSellerOrder(so);
}
log.info("[{}-{}] down shelf skups:{}", taskDto.getUid(), taskDto.getTaskId(), skupSets);
//先商品下架
return productProxyService.sellerBatchUpdateStatus(Lists.newArrayList(skupSets), ProductProxyService.PrdShelvelStatus.off);
boolean updateStatusFlag = productProxyService.sellerBatchUpdateStatus(Lists.newArrayList(skupSets), ProductProxyService.PrdShelvelStatus.off);
log.info("[{}-{}] skups down shelf result is {}", taskDto.getUid(), taskDto.getTaskId(), updateStatusFlag);
return updateStatusFlag;
}
@Override
... ... @@ -198,6 +202,7 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<Map<In
@Transactional
@Component
@Database(ForceMaster=true, DataSource="ufo_order")
public static class SkupDownShelfDBService {
@Autowired
private SellerOrderMapper sellerOrderMapper;
... ...
... ... @@ -23,7 +23,7 @@ public class SellerIncrPriceTaskHandler extends AbstractSellerAdjustPriceTaskHan
protected boolean preHandle(SellerTaskResult result, SellerTaskDTO<ChangePricePrepareDTO> taskDto) {
ChangePricePrepareDTO cppDto = taskDto.getProcessData();
int uid = taskDto.getUid();
long oprId = taskDto.getTaskId();
long taskId = taskDto.getTaskId();
BigDecimal preSalePrice = cppDto.getPreSalePrice(),
salePrice = cppDto.getSalePrice();
Map<Integer, SkupDto> skupMap = cppDto.getSkupMap();
... ... @@ -38,10 +38,10 @@ public class SellerIncrPriceTaskHandler extends AbstractSellerAdjustPriceTaskHan
.beforeProductPrice(preSalePrice)
.afterEarnestMoney(computeResult.getEarnestMoney().getEarnestMoney().toPlainString())
.earnestMoney(totalDiffMoney).productCount(skupMap.size())
.seriNo(String.valueOf(oprId))
.seriNo(String.valueOf(taskId))
.type(swdType.getValue()).build();
log.info("[{}-{}] pre use total earnest:{},diff earnest:{},num:{}", uid, oprId, totalDiffMoney, diffEarnestMoney, skupMap.size());
log.info("[{}-{}] pre use total earnest:{},diff earnest:{},num:{}", uid, taskId, totalDiffMoney, diffEarnestMoney, skupMap.size());
SellerWallet sellerWallet = cppDto.isSuper() ? new SellerWallet() : merchantOrderPaymentService.changePriceUseEarnest(uid, totalDiffMoney, moai);
result.sellerWallet = sellerWallet;
return Objects.nonNull(sellerWallet);
... ...