| | |
| | | fun loadExpressData() { |
| | | viewModelScope.launch { |
| | | // 1. 获取所有驿站类型的提醒设置 |
| | | val stations = Core.reminder.getByType("驿站") |
| | | val stations = Core.reminder.getByType("快递") |
| | | |
| | | // 2. 按驿站分组获取包裹信息 |
| | | val groups = stations.map { station -> |
| | | val packages = Core.code.getByKeyword(station.nickname).map { code -> |
| | | ExpressPackage( |
| | | id = code.id, //ID |
| | | company = code.name, //快递公司 |
| | | company = code.secondLevel, //快递公司 |
| | | trackingNumber = code.code, // 取件码 |
| | | createTime = code.createtime //快递时间 |
| | | createTime = code.createTime //快递时间 |
| | | ) |
| | | } |
| | | ExpressGroup( |
| | |
| | | fun loadFinanceData() { |
| | | viewModelScope.launch { |
| | | // 1. 获取所有驿站类型的提醒设置 |
| | | val stations = Core.reminder.getByType("财务") |
| | | val stations = Core.reminder.getByType("还款") |
| | | |
| | | // 2. 按驿站分组获取包裹信息 |
| | | val groups = stations.map { station -> |
| | | val packages = Core.code.getByKeyword(station.nickname).map { code -> |
| | | FinancePackage( |
| | | id = code.id, //ID |
| | | company = code.name, //快递公司 |
| | | company = code.secondLevel, //快递公司 |
| | | trackingNumber = code.code, // 取件码 |
| | | createTime = code.createtime //快递时间 |
| | | createTime = code.createTime //快递时间 |
| | | ) |
| | | } |
| | | FinanceGroup( |