from BaseDataMaintenance.model.ots.designed_project import designed_project, designed_project_id, \
    designed_project_partitionkey, designed_project_project_investment, designed_project_engineer_cost, \
    designed_project_proportion_unit, designed_project_facade_type, designed_project_construct_install_fee, \
    designed_project_project_structure, designed_project_has_steel, designed_project_covered_area, \
    designed_project_floor_space, designed_project_elevator, designed_project_project_nature, \
    designed_project_floors_num
from BaseDataMaintenance.dataSource.source import getConnect_ots


ots_client = getConnect_ots()


def update():
    _dict1 = {
        designed_project_partitionkey: 2,
        designed_project_id: 4624623048274739201,
        designed_project_project_investment: 100000.12354,
        designed_project_engineer_cost: 20000.222,
        designed_project_construct_install_fee: 10000.4,
        designed_project_floor_space: '',
        designed_project_covered_area: 900,
        designed_project_proportion_unit: 'm',
        designed_project_project_structure: '框架结构',
        designed_project_facade_type: '玻璃幕墙',
        designed_project_has_steel: 1,
        designed_project_elevator: 1,
        designed_project_project_nature: '新建',
        designed_project_floors_num: 0,
    }

    _dict2 = {
        designed_project_partitionkey: 2,
        designed_project_id: 4647683317091532801,
        designed_project_project_investment: None,
        designed_project_engineer_cost: 20.222,
        designed_project_construct_install_fee: 100,
        designed_project_floor_space: '',
        designed_project_covered_area: 5465.36,
        # designed_project_proportion_unit: '㎡',
        designed_project_proportion_unit: '',
        designed_project_project_structure: None,
        designed_project_facade_type: '',
        designed_project_has_steel: 0,
        designed_project_elevator: 0,
        designed_project_project_nature: None,
        designed_project_floors_num: 2,
    }
    ots_dp = designed_project(_dict2)
    ots_dp.update_row(ots_client)


if __name__ == '__main__':
    update()