package com.bohuikeji.delivery.backstage.service.impl;

import com.bohuikeji.delivery.backstage.entity.TLogistics;
import com.bohuikeji.delivery.backstage.entity.TLogisticsRecord;
import com.bohuikeji.delivery.backstage.mapper.TLogisticsRecordMapper;
import com.bohuikeji.delivery.backstage.service.ITLogisticsRecordService;
import com.bohuikeji.frame.module.admin.base.ServiceImplBase;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 物流跟踪记录表 服务类
 * </p>
 *
 * @author 10552
 * @since 2019-09-10
 */
@Service
public class TLogisticsRecordServicelmpl extends ServiceImplBase<TLogisticsRecordMapper,TLogisticsRecord> implements ITLogisticsRecordService {

    @Override
    public boolean createRecord(TLogistics logistics) {
        TLogisticsRecord record = new TLogisticsRecord();
        record.setCourierId(logistics.getCourierId());
        record.setLogisticsId(logistics.getLogisticsId());
        record.setLogisticsNum(logistics.getLogisticsNum());
        record.setOrderId(logistics.getOrderId());
        record.setOrderNum(logistics.getOrderNum());
        record.setLogisticsStatus(logistics.getLogisticsStatus());
        if(super.save(record)){
            return true;
        }
        return false;
    }
}
