Merge pull request #145 from LQYBill/hotfix/importSkuWeightDate

hotfix : import sku weight date
pull/8040/head
Qiuyi LI 2025-02-28 16:06:53 +01:00 committed by GitHub
commit 4713d6b82a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 2 deletions

View File

@ -243,8 +243,17 @@ public class SkuWeightController extends JeecgController<SkuWeight, ISkuWeightSe
skuWeight.setWeight(weight);
break;
case 2:
String cellValue = cell.getStringCellValue();
Date effectiveDate = formatter.parse(cellValue);
String date;
if(cell.getCellType().equals(CellType.STRING))
date = cell.getStringCellValue();
else if(cell.getCellType().equals(CellType.NUMERIC))
date = formatter.format(cell.getDateCellValue());
else {
responses.addFailure("Row " + rowIndex + " Date is not a date - Sku : " + erpCode);
hasError = true;
continue;
}
Date effectiveDate = formatter.parse(date);
skuWeight.setEffectiveDate(effectiveDate);
break;
}