Ver Fonte

250117-1代码。

baoyubo há 5 meses atrás
pai
commit
55ed4fdfda
1 ficheiros alterados com 48 adições e 9 exclusões
  1. 48 9
      routers/api/ThreeProofingResponsible/person.py

+ 48 - 9
routers/api/ThreeProofingResponsible/person.py

@@ -625,8 +625,15 @@ def import_data(db,file_path,user_id,file_info):
                 data += new_type_list
         d2 = sheet.cell(row, 12).value
         if d2!='':
-            pass
-
+            dept_name = d2
+            new_person_other_info = ThreeProofingResponsiblePersonOtherInfo(
+                type_parent_id='4',
+                dept_name=dept_name,
+                person_id=new_person.id,
+                create_by=user_id
+            )
+            db.add(new_person_other_info)
+            data.append(new_person_other_info)
         # 重点部门
         e1 = sheet.cell(row, 13).value
         if e1!='':
@@ -636,6 +643,16 @@ def import_data(db,file_path,user_id,file_info):
                 db.add_all(new_type_list)
                 data += new_type_list
         e2 = sheet.cell(row, 14).value
+        if e2!='':
+            dept_name = e2
+            new_person_other_info = ThreeProofingResponsiblePersonOtherInfo(
+                type_parent_id='5',
+                dept_name=dept_name,
+                person_id=new_person.id,
+                create_by=user_id
+            )
+            db.add(new_person_other_info)
+            data.append(new_person_other_info)
         e3 = sheet.cell(row, 15).value
         if e3!='':
             new_type_list,status = other_type_string_type_parent_id_create_data(db,e3,'5',file_info,new_person,user_id,row)
@@ -662,6 +679,16 @@ def import_data(db,file_path,user_id,file_info):
                 db.add_all(new_type_list)
                 data += new_type_list
         g2 = sheet.cell(row, 11).value
+        if g2!='':
+            dept_name = g2
+            new_person_other_info = ThreeProofingResponsiblePersonOtherInfo(
+                type_parent_id='7',
+                dept_name=dept_name,
+                person_id=new_person.id,
+                create_by=user_id
+            )
+            db.add(new_person_other_info)
+            data.append(new_person_other_info)
         g3 = sheet.cell(row, 12).value
         if g3!='':
             new_type_list, status = other_type_string_type_parent_id_create_data(db, g3, '11', file_info, new_person, user_id,
@@ -705,7 +732,16 @@ def import_data(db,file_path,user_id,file_info):
                 db.add_all(new_type_list)
                 data += new_type_list
         k2 = sheet.cell(row, 17).value
-
+        if k2!='':
+            denger_point_name = k2
+            new_person_other_info = ThreeProofingResponsiblePersonOtherInfo(
+                type_parent_id='10',
+                denger_point_name=denger_point_name,
+                person_id=new_person.id,
+                create_by=user_id
+            )
+            db.add(new_person_other_info)
+            data.append(new_person_other_info)
 
         # 其他
         l1 = sheet.cell(row, 18).value
@@ -717,12 +753,15 @@ def import_data(db,file_path,user_id,file_info):
                 data += new_type_list
         l2 = sheet.cell(row, 19).value
         if l2!='':
-            new_type_list, status = other_type_string_type_parent_id_create_data(db, l2, '11', file_info, new_person, user_id,
-                                                                      row)
-            import_status = status
-            if status:
-                db.add_all(new_type_list)
-                data += new_type_list
+            other_type_2_name = l2
+            new_person_other_info = ThreeProofingResponsiblePersonOtherInfo(
+                type_parent_id='11',
+                other_type_2_name=other_type_2_name,
+                person_id=new_person.id,
+                create_by=user_id
+            )
+            db.add(new_person_other_info)
+            data.append(new_person_other_info)
 
 
     if import_status == False: