...
|
...
|
@@ -9,9 +9,11 @@ import com.yohoufo.dal.order.model.SellerChangePriceRecord; |
|
|
import com.yohoufo.dal.order.model.SellerOrder;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.order.convert.SellerOrderConvertor;
|
|
|
import com.yohoufo.order.model.NESCPOrderContext;
|
|
|
import com.yohoufo.order.model.dto.ChangePricePrepareDTO;
|
|
|
import com.yohoufo.order.model.response.OrderSubmitResp;
|
|
|
import com.yohoufo.order.service.seller.processor.NESChangePricePrepareProcessor;
|
|
|
import com.yohoufo.order.service.seller.processor.NESChangePricePublishPrepareProcessor;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
...
|
...
|
@@ -49,6 +51,12 @@ public class NotEntrySellerChangePriceService { |
|
|
@Autowired
|
|
|
private NESChangePricePrepareProcessor nesChangePricePrepareProcessor;
|
|
|
|
|
|
@Autowired
|
|
|
NESChangePricePublishPrepareProcessor nesChangePricePublishPrepareProcessor;
|
|
|
|
|
|
@Autowired
|
|
|
NESChangePricePublishExcutor nesChangePricePublishExcutor;
|
|
|
|
|
|
|
|
|
public boolean isChangePriceOrder(int skup){
|
|
|
|
...
|
...
|
@@ -81,7 +89,7 @@ public class NotEntrySellerChangePriceService { |
|
|
*/
|
|
|
public OrderSubmitResp changePrice(NESChangePriceReq req){
|
|
|
logger.info("in NotEntrySellerChangePriceService.changePrice, req {}", req);
|
|
|
ChangePricePrepareDTO cppDto = nesChangePricePrepareProcessor.checkAndAcquire(req);
|
|
|
NESCPOrderContext ctx = nesChangePricePublishPrepareProcessor.buildPublishCtx(req);
|
|
|
//TODO
|
|
|
/*
|
|
|
step 1. 检查变价记录 seller_change_price_record
|
...
|
...
|
@@ -94,9 +102,9 @@ public class NotEntrySellerChangePriceService { |
|
|
|
|
|
step 5. 记录变价记录(新的订单号,新skup)
|
|
|
*/
|
|
|
SellerOrderGoods psog = cppDto.getBaseSellerOrderGoods();
|
|
|
SellerOrderGoods psog = ctx.getSellerOrderGoods();
|
|
|
int skup = psog.getId();
|
|
|
SellerOrder sellerOrder = cppDto.getSkupMap().get(skup).getSellerOrder();
|
|
|
SellerOrder sellerOrder = ctx.getSellerOrder();
|
|
|
Long preOrderCode = sellerOrder.getOrderCode();
|
|
|
List<Short> scprs = Lists.newArrayListWithCapacity(2);
|
|
|
scprs.add(ChangePriceStatus.WAITING_DEAL.getCode());
|
...
|
...
|
@@ -105,7 +113,7 @@ public class NotEntrySellerChangePriceService { |
|
|
List<SellerChangePriceRecord> scprList = sellerChangePriceRecordMapper.selectByPreOrderCodeNStatus(preOrderCode, scprs);
|
|
|
if (CollectionUtils.isEmpty(scprList)){
|
|
|
//首次 或 全部失败
|
|
|
|
|
|
return nesChangePricePublishExcutor.publish(ctx);
|
|
|
}
|
|
|
//存在成功处理,有且只有一条才对(不完全正确,多终端操作同一个待变价商品)
|
|
|
|
...
|
...
|
|