...
|
...
|
@@ -4,7 +4,7 @@ import com.yohobuy.ufo.model.order.common.OperateTypeEnum; |
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.dal.order.OrderOperateRecordMapper;
|
|
|
import com.yohoufo.dal.order.model.OrderOperateRecord;
|
|
|
import com.yohoufo.order.utils.PubThreadFactory;
|
|
|
import com.yohoufo.order.utils.NamedThreadFactory;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
...
|
...
|
@@ -19,15 +19,16 @@ import java.util.concurrent.TimeUnit; |
|
|
public class OrderOperateRecordService {
|
|
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
private ExecutorService executorService = new ThreadPoolExecutor(5, 10, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1000),new PubThreadFactory("order-operate-record"));
|
|
|
private ExecutorService executorService = new ThreadPoolExecutor(5, 10,
|
|
|
60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1000), NamedThreadFactory.newThreadFactory("order-operate-record"));
|
|
|
|
|
|
@Autowired
|
|
|
private OrderOperateRecordMapper orderOperateRecordMapper;
|
|
|
|
|
|
public void addRecord(Long orderCode,String userName, OperateTypeEnum operateType){
|
|
|
public void addRecord(Long orderCode, String userName, OperateTypeEnum operateType) {
|
|
|
try {
|
|
|
logger.info("OrderOperateRecordService add enter , operateType {}, orderCode {} ,userName {}",
|
|
|
operateType, orderCode ,userName);
|
|
|
operateType, orderCode, userName);
|
|
|
executorService.execute(() -> {
|
|
|
OrderOperateRecord optRecord = new OrderOperateRecord();
|
|
|
optRecord.setOrderCode(String.valueOf(orderCode));
|
...
|
...
|
@@ -36,7 +37,7 @@ public class OrderOperateRecordService { |
|
|
optRecord.setUserName(userName);
|
|
|
optRecord.setUpdateTime(DateUtil.getCurrentTimeSecond());
|
|
|
optRecord.setOldInfo("");
|
|
|
logger.info("OrderOperateRecordService add execute , OrderOperateRecord {} ",optRecord );
|
|
|
logger.info("OrderOperateRecordService add execute , OrderOperateRecord {} ", optRecord);
|
|
|
orderOperateRecordMapper.insert(optRecord);
|
|
|
|
|
|
});
|
...
|
...
|
|