Authored by LUOXC

fixbug

package com.yohoufo.order.service.proxy;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.BuyerOrderStatusFlowMapper;
import com.yohoufo.dal.order.model.BuyerOrderStatusFlow;
import com.yohoufo.order.service.IInviteSettlementService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.utils.NamedThreadFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -31,9 +34,14 @@ public class OrderStatusFlowService {
@Autowired
private IInviteSettlementService inviterService;
@Autowired
private OrderCodeGenerator orderCodeGenerator;
public void addAsy(Long orderCode, Integer status) {
try {
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
boolean isBuyerOrderCode = OrderCodeType.BUYER_TYPE.getType() == codeMeta.getType();
logger.info("OrderStatusFlowService add enter , status {}, orderCode {} ", status, orderCode);
executorService.execute(() -> {
BuyerOrderStatusFlow buyerOrderStatusFlow = new BuyerOrderStatusFlow();
... ... @@ -43,7 +51,9 @@ public class OrderStatusFlowService {
logger.info("OrderStatusFlowService add execute , buyerOrderStatusFlow {} ", buyerOrderStatusFlow);
buyerOrderStatusFlowMapper.insert(buyerOrderStatusFlow);
});
inviteExecutorService.execute(() -> inviterService.createInviteSettlementItem(orderCode, status));
if (isBuyerOrderCode) {
inviteExecutorService.execute(() -> inviterService.createInviteSettlementItem(orderCode, status));
}
} catch (Exception e) {
logger.warn("OrderStatusFlowService add error , status {}, orderCode {} ", status, orderCode, e);
}
... ...