Prechádzať zdrojové kódy

表格预算提取修复

znj 11 mesiacov pred
rodič
commit
51811efaa9
1 zmenil súbory, kde vykonal 9 pridanie a 3 odobranie
  1. 9 3
      BiddingKG/dl/interface/predictor.py

+ 9 - 3
BiddingKG/dl/interface/predictor.py

@@ -3159,7 +3159,9 @@ class ProductAttributesPredictor():
                                 _budget = re_price[0]
                                 if '万元' in col0_l[i] and '万' not in _budget:
                                     _budget += '万元'
-                                budget = str(getUnifyMoney(_budget)).rstrip('0').rstrip('.')
+                                budget = str(getUnifyMoney(_budget))
+                                if '.' in budget:
+                                    budget = budget.rstrip('0').rstrip('.')
                                 if float(budget)>= 500*100000000:
                                     budget = ""
                         elif re.search('预算单位|(采购|招标|购买)(单位|人|方|主体)|项目业主|采购商|申购单位|需求单位|业主单位', col0_l[i]):
@@ -3706,7 +3708,9 @@ class ProductAttributesPredictor():
                                             unitPrice = getUnifyMoney(_unitPrice)
                                             if unitPrice>=10000*10000:
                                                 unitPrice = ""
-                                            unitPrice = str(unitPrice).rstrip('0').rstrip('.')
+                                            unitPrice = str(unitPrice)
+                                            if '.' in unitPrice:
+                                                unitPrice = unitPrice.rstrip('0').rstrip('.')
                                 if id4 != "":
                                     if re.search('\w', deal_list[id4]):
                                         brand = deal_list[id4]
@@ -3734,7 +3738,9 @@ class ProductAttributesPredictor():
                                             _budget = re_price[0]
                                             if '万元' in header_list2[2] and '万' not in _budget:
                                                 _budget += '万元'
-                                            budget = str(getUnifyMoney(_budget)).rstrip('0').rstrip('.')
+                                            budget = str(getUnifyMoney(_budget))
+                                            if '.' in budget:
+                                                budget = budget.rstrip('0').rstrip('.')
                                             if float(budget)>= 100000*10000:
                                                 budget = ""
                                 if id8 != "":