Ubuntu 3 недель назад
Родитель
Сommit
a500a01e92
2 измененных файлов с 25 добавлено и 4 удалено
  1. 22 2
      subdir/db.py
  2. 3 2
      subdir/util.py

+ 22 - 2
subdir/db.py

@@ -2125,7 +2125,7 @@ async def zcfx(client, biao_id, bh):
     collection = db["Dwgc"]
     document = await collection.find_one({'biao_id': biao_id,'Dwgcbh': bh})
     rcjhz = document['rcjhz'][1:]
-    rcjhz = [x for x in rcjhz if x[4]!='工日' and x[4]!= '台班' and not x[1].startswith('D') and not x[1].startswith('J') and not x[1].startswith('C') and not x[1].startswith('S') and not x[1].startswith('00') and not x[1].startswith('90') and not x[1].startswith('99') and not x[1].startswith('31') and not x[1].startswith('N') and not x[1].startswith('41') and not x[1].startswith('1100') and not x[1].startswith('71') and not x[1].startswith('4F') and not x[1].startswith('9F') and not x[1].startswith('1000') and not x[1].startswith('91') and not x[1].startswith('7F') and not x[1].startswith('1F') and not x[1].startswith('6F') and not x[1].startswith('5F') and not x[1].startswith('Q')]
+    rcjhz = [x for x in rcjhz if x[4]!='工日' and x[4]!= '台班' and not x[1].startswith('D') and not x[1].startswith('J') and not x[1].startswith('C') and not x[1].startswith('S') and not x[1].startswith('00') and not x[1].startswith('90') and not x[1].startswith('99') and not x[1].startswith('31') and not x[1].startswith('N') and not x[1].startswith('41') and not x[1].startswith('1100') and not x[1].startswith('71') and not x[1].startswith('4F') and not x[1].startswith('9F') and not x[1].startswith('1000') and not x[1].startswith('91') and not x[1].startswith('7F') and not x[1].startswith('1F') and not x[1].startswith('6F') and not x[1].startswith('5F') and not x[1].startswith('Q') and not x[1].startswith("LJ") and not x[1].startswith("B")]
     mapping={}
     for entry in rcjhz:
         prefix = entry[1][0:2]
@@ -2169,6 +2169,9 @@ async def jxtz(client, biao_id, bh, gong, chaiyou, qiyou, dian, glf, lr, bz):
             dejxf = 0
             for i in range(1, len(dercj)):
                 rcj = dercj[i]
+                if type(rcj[11]) == type('aaa'):
+                    if len(rcj[11])==0:
+                        rcj[11]='0'
                 if rcj[4] == '台班':
                     hit = True
                     hitde = True
@@ -2179,7 +2182,7 @@ async def jxtz(client, biao_id, bh, gong, chaiyou, qiyou, dian, glf, lr, bz):
                     dergf = dergf + float(rcj[11])
                 elif int(rcj[8]) == 2:
                     declf = declf + float(rcj[11])
-                    if rcj[14] == 'true' :
+                    if rcj[14] == 'true':
                         dezcf = dezcf + float(rcj[11])
                 elif int(rcj[8]) == 3:
                     dejxf = dejxf + float(rcj[11])
@@ -2242,6 +2245,21 @@ async def jxtz(client, biao_id, bh, gong, chaiyou, qiyou, dian, glf, lr, bz):
             for i in range(len(post["__children"])):
                 if len(post["__children"][i]['azfytag']) > 0:
                     continue
+                if type(post['__children'][i]['数量']) == type('aaa'):
+                    if len(post['__children'][i]['数量']) ==0 :
+                        post['__children'][i]['数量']='0'
+                if type(post['__children'][i]['综合单价']) == type('aaa'):
+                    if len(post['__children'][i]['综合单价']) ==0 :
+                        post['__children'][i]['综合单价']='0'
+                if type(post['__children'][i]['合价']) == type('aaa'):
+                    if len(post['__children'][i]['合价']) ==0 :
+                        post['__children'][i]['合价']='0'
+                if type(post['__children'][i]['辅材费']) == type('aaa'):
+                    if len(post['__children'][i]['辅材费']) ==0 :
+                        post['__children'][i]['辅材费']='0'
+                if type(post['__children'][i]['材料费']) == type('aaa'):
+                    if len(post['__children'][i]['材料费']) ==0 :
+                        post['__children'][i]['材料费']='0'
                 post['综合单价'] += float(post['__children'][i]['数量']) * float(post['__children'][i]['综合单价'])
                 post['合价'] += float(post['__children'][i]['合价'])
                 post['人工费'] += float(post['__children'][i]['数量']) * float(post['__children'][i]['人工费'])
@@ -2525,6 +2543,8 @@ async def rgtz(client, biao_id, bh, yi, er, san, glf, lr, bz):
             dejxf = 0
             for i in range(1, len(dercj)):
                 rcj = dercj[i]
+                if type(rcj[11]) == type('aaa') and len(rcj[11]) == 0:
+                    rcj[11]='0'
                 if rcj[4] == '工日':
                     if '一类工' in rcj[2] and len(yi) > 0:
                         hit = True

+ 3 - 2
subdir/util.py

@@ -28,7 +28,6 @@ def indexrcj(rcjhz, rcjarray):
     return ""
 
 def huizongrcj_order(data):
-    
     huizong = {}
     result = [
     ["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
@@ -62,6 +61,8 @@ def huizongrcj_order(data):
         result_hl = 0
         for i in range(0, len(value)):
             result_hl = result_hl + float(value[i][10])
+        if type(value[0][5]) == type('aaa') and len(value[0][5]) == 0:
+            value[0][5]='0'
         result_dj = float(value[0][5])
         result_hj = result_hl * result_dj
         result.append([value[0][0], value[0][1], value[0][2], value[0][3], value[0][4], 
@@ -75,7 +76,6 @@ def huizongrcj_order(data):
     return result
 
 def huizongrcj(data):
-    
     huizong = {}
     result = [
     [ "ID", "编码", "名称", "规格型号", "单位", "数量", "单价", "合价", "产地", 
@@ -109,6 +109,7 @@ def huizongrcj(data):
         result_hl = 0
         for i in range(0, len(value)):
             result_hl = result_hl + float(value[i][10])
+
         result_dj = float(value[0][5])
         result_hj = result_hl * result_dj
         result.append([value[0][0], value[0][1], value[0][2], value[0][3], value[0][4], result_hl,