def next_image(self):
        """ 次の画像の取得 """
        ans = None

        if self.main_building_image:
            ans = self.main_building_image
            self.main_building_image = None
        elif self.layout_image:
            ans = self.layout_image
            self.layout_image = None
        elif self.__building_image_is_prioritized and len(
                self.building_images) > 0:
            ans = self.building_images.pop(0)
        elif len(self.room_images) > 0:
            ans = self.room_images.pop(0)
            self.room_image_count += 1

        if ans:
            DataHelper.download_image(
                ans[SystemInfo.get_instance().download_image_url],
                SystemInfo.get_instance().image_dir,
                SystemInfo.get_instance().image_log_dir,
            )

        return ans
예제 #2
0
 def get_image_filename(cls, image):
     """ 画像データからファイル名を取得 """
     ans = ''
     if image:
         ans = DataHelper.get_url_filename(
             image[SystemInfo.get_instance().download_image_url])
     return ans
예제 #3
0
    def next_panorama(self):
        """ 次のパノラマの取得 """
        ans = None

        if len(self.room_panoramas) <= 0 and len(self.building_panoramas) > 0:
            ans = self.building_panoramas.pop(0)
        elif len(self.room_panoramas) > 0:
            ans = self.room_panoramas.pop(0)

        if ans:
            DataHelper.download_image(
                ans['file_url'],
                SystemInfo.get_instance().panorama_image_dir,
                SystemInfo.get_instance().panorama_image_log_dir,
            )

        return ans
    def __building_image_is_prioritized(self):
        """ 建物画像を優先する場合はTrue(内部メソッド) """
        ans = False
        if len(self.room_images) <= 0:
            # 部屋画像が無い場合
            ans = True
        elif 0 < SystemInfo.get_instance(
        ).prioritized_room_image_count <= self.room_image_count:
            # 部屋画像の優先数の設定が0より大きく、取得数が優先数を以上になっている場合
            ans = True

        return ans
예제 #5
0
    def cleaning_cost(self):
        """ 退去時清掃費用 """
        ans = ''

        if self.room['cleaning_type']['is_paid']:
            cost = xint(self.room['cleaning_cost'])
            if cost > 0:
                tax_id = xint(self.room['cleaning_cost_tax_type']['id'])
                if tax_id == 1:
                    cost = int(cost * (1 + SystemInfo.get_instance().tax_rate))
                ans = xstr(cost)

        return ans
예제 #6
0
    def key_change_cost(self):
        """ 鍵交換費用 """
        ans = ''

        if xint(self.room['key_change_cost_existence']['id']) == 1:  # 有り
            cost = xint(self.room['key_change_cost'])
            if cost > 0:
                tax_id = xint(self.room['key_change_cost_tax_type']['id'])
                if tax_id == 1:
                    cost = int(cost * (1 + SystemInfo.get_instance().tax_rate))
                ans = xstr(cost)

        return ans
예제 #7
0
    def trader_company_tel(self):
        """ 他社元付会社電話番号 """
        ans = ''

        if self.is_managed == '0':
            trader = self.trader
            if trader:
                ans = xstr(trader['tel1'])

            if not ans:
                ans = SystemInfo.get_instance().management_company_tel

        return ans
    def get_cost(self, index: int):
        """ 費用 """
        ans = ''

        if index < len(self.other_costs):
            cost = xint(self.other_costs[index]['cost'])
            tax_id = xint(self.other_costs[index]['tax_id'])
            if tax_id == 1:
                # 税別の場合は税込計算
                ans = xstr(int(cost * (1 + SystemInfo.get_instance().tax_rate)))
            else:
                ans = xstr(cost)

        return ans
예제 #9
0
    def garage_fee(self):
        """ 駐車場料金 """
        ans = ''

        id = xint(self.room['building']['garage_type']['id'])
        if id == 1:
            # 駐車場料金が有料の場合
            fee = xint(self.room['building']['garage_fee_lower'])
            upper = xint(self.room['building']['garage_fee_upper'])
            if fee < upper:
                fee = upper

            tax_id = xint(self.room['building']['garage_fee_tax_type']['id'])
            if tax_id == 1:
                fee = int(fee * (1 + SystemInfo.get_instance().tax_rate))

            ans = xstr(fee)

        elif id == 5:
            # 駐車場料金が無料の場合
            ans = '0'

        return ans
예제 #10
0
 def get_panorama_lens_type(cls, panorama):
     """ パノラマデータのレンズ種別コードを取得 """
     ans = ''
     if panorama:
         ans = SystemInfo.get_instance().panorama_lens_type
     return ans