|
@@ -23,14 +23,28 @@ class batch_path(Load):
|
|
|
)
|
|
|
self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
|
|
|
self.data['common']['search_land_id-select-'] = self.service('common').list('farm_work_land')
|
|
|
+
|
|
|
+ farm_list = {}
|
|
|
+ for value in self.data['common']['search_farm_id-select--gateway_id']:
|
|
|
+ farm_list[value['id']] = value
|
|
|
+
|
|
|
+ farm_work_land = {}
|
|
|
+ for value in self.data['common']['search_land_id-select-']:
|
|
|
+ farm_work_land[value['id']] = value
|
|
|
+
|
|
|
+ gateway = {}
|
|
|
+ gateway_list = self.service('common').list('device_gateway')
|
|
|
+ for value in gateway_list:
|
|
|
+ gateway[value['id']] = value
|
|
|
+
|
|
|
self.commonList('origin_batch')
|
|
|
if self.data['list']:
|
|
|
for key, value in enumerate(self.data['list']):
|
|
|
- farm = self.service('common').one('farm', id=value['farm_id'])
|
|
|
+ farm = farm_list[value['farm_id']]
|
|
|
self.data['list'][key]['farm'] = farm['name']
|
|
|
- device = self.service('common').one('device_gateway', id=value['gateway_id'])
|
|
|
+ device = gateway[value['gateway_id']]
|
|
|
self.data['list'][key]['device'] = device['name']
|
|
|
- land = self.service('common').one('farm_work_land', id=value['land_id'])
|
|
|
+ land = farm_work_land[value['land_id']]
|
|
|
if land:
|
|
|
self.data['list'][key]['land'] = land['name']
|
|
|
self.commonView('list')
|