逻辑修改
This commit is contained in:
@@ -11,6 +11,9 @@ pub(crate) struct ExcelService {
|
||||
}
|
||||
|
||||
impl ExcelService {
|
||||
pub fn get_current_line(&self) -> usize {
|
||||
return self.current_line;
|
||||
}
|
||||
pub fn new(file_path: &str) -> Result<Self, String> {
|
||||
let mut work_book: Xlsx<_> = match open_workbook(file_path) {
|
||||
Ok(work_book) => work_book,
|
||||
@@ -57,10 +60,10 @@ impl ExcelService {
|
||||
}
|
||||
work_model.imei = imei.to_string();
|
||||
}
|
||||
if let Some(sn) = self.sheet.get((self.current_line, 1)){
|
||||
if let Some(sn) = self.sheet.get((self.current_line, 1)) {
|
||||
work_model.sn = sn.to_string();
|
||||
}
|
||||
if let Some(line_number) = self.sheet.get((self.current_line, 2)){
|
||||
if let Some(line_number) = self.sheet.get((self.current_line, 2)) {
|
||||
work_model.line_number = line_number.to_string();
|
||||
}
|
||||
self.current_line += 1;
|
||||
|
||||
Reference in New Issue
Block a user