Explorar el Código

mvp: 更新

Signed-off-by: binren <zhangbr@elab-plus.com>
binren hace 5 años
padre
commit
f84e584592
Se han modificado 3 ficheros con 1 adiciones y 35 borrados
  1. 1 1
      flask_app.py
  2. 0 34
      mvp.py
  3. BIN
      resources/mvp.xlsx

+ 1 - 1
flask_app.py

@@ -17,7 +17,7 @@ def score():
     crowd = request.args.get('crowd', default=None, type=str)
     print(city, age, crowd)
     mvp = Mvp()
-    scores = mvp.fz_fm(city, age, crowd)
+    scores = mvp.query_behavioral_info(city, age, crowd)
     mvp.close()
     return json.dumps(scores, ensure_ascii=False)
 

+ 0 - 34
mvp.py

@@ -403,10 +403,6 @@ class Mvp:
         print('update finished!!!')
         return scores_behavioral
 
-    def fz_fm(self, city=None, age=None, crowd=None):
-        scores_behavioral = self.city_age_crowd_1(city, age, crowd)
-        return scores_behavioral
-
     def people_info(self):
         """
             答题人个人信息获取
@@ -749,36 +745,6 @@ class Mvp:
         return {'behavior_score': result, 'module_score': module_scores}
         # return {'score': result, 'data': data_list}
 
-    def city_age_crowd_1(self, city=None, age=None, crowd=None):
-        data_start = []
-        result = []
-        module_scores = []
-        if city is not None and age is not None and crowd is not None:
-            print('获取指定城市,年龄段,人群类型的数据...')
-            # people_uuids = self.get_people_uuid_by_type(crowd)
-            people_uuids = self.people_filter(city, age, crowd)
-            behavior_data = None
-            if len(people_uuids) > 0:
-                print('{}-{}-{}'.format(city, age, crowd))
-                datas = self.behavior_tag_init(city, age, people_uuids)
-                data_start.append(datas)
-                all_data, behavior_data_1 = self.calculation_standard_score(datas, city, age, crowd)
-                result.append(all_data)
-                behavior_data = behavior_data_1
-            if behavior_data:
-                module_scores.extend(self.module_score(crowd, city, age, behavior_data))
-        # data_list = []
-        # for e in data_start:
-        #     for key in e.keys():
-        #         values = e[key]
-        #         for sub_e in values:
-        #             ele = [key]
-        #             ele.extend(sub_e)
-        #             data_list.append(ele)
-        #     pass
-        return datas
-        # return {'score': result, 'data': data_list}
-
     def scores(self):
         behavior_score = []
         module_scores = []

BIN
resources/mvp.xlsx