from huansuan0103 import callzaihuansuan0103_1
from huansuan0103 import callzaihuansuan0103_3
from huansuan0103 import callzaihuansuan0103_2
from huansuan0105 import callzaihuansuan0105_1
from huansuan0105 import callzaihuansuan0105_2
from huansuan0106 import callzaihuansuan0106_1
from huansuan0106 import callzaihuansuan0106_2
from huansuan0106 import callzaihuansuan0106_3
from huansuan0108 import callzaihuansuan0108_1
from huansuan0110 import callzaihuansuan0110_1
from huansuan0111 import callzaihuansuan0111_1
from huansuan0111 import callzaihuansuan0111_2
from huansuan0111 import callzaihuansuan0111_3
from huansuan0112 import callzaihuansuan0112_1
from huansuan0304 import callzaihuansuan030404017
from huansuan0304 import callzaihuansuan030411001
from huansuan0309 import callzaihuansuan030901013
from huansuan0308 import callzaihuansuan030801
import time
def callzaihuansuan(bianma, label, A,B,C, aiclient, qwclient, sfclient):
    time.sleep(1)
    if bianma.startswith("0103"):
        if '送桩 桩长' in label or '送桩  桩长' in label:
            return callzaihuansuan0103_1(bianma, A, B, C, aiclient, sfclient)
        elif '电焊接桩' in label:
            return callzaihuansuan0103_3(bianma, A, B, C, aiclient, qwclient, sfclient)
        else:
            return callzaihuansuan0103_2(bianma, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("0109"):
        print(label)
        print(A)
        if '带肋钢筋' in label and 'm2' in A:##
            return callzaihuansuan0111_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("0110"):
        print(label)
        print(A)
        if '找坡' in label and 'm2' in A:##混凝土找坡的单位是m3
            return callzaihuansuan0110_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("0111"):
        print(label)
        print(A)
        if '带肋钢筋' in label and 'm2' in A:##
            return callzaihuansuan0111_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
        elif '垫层' in label and 'm2' in A:##垫层的单位是m3
            return callzaihuansuan0111_2(bianma, label, A, B, C, aiclient, qwclient, sfclient)
        elif '踢脚线' in label and 'm2' in A:##踢脚线的单位是10m
            return callzaihuansuan0111_3(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("0112"):
        print(label)
        print(A)
        if '隔断' in label and 'm2' in A:##可能单位是10间
            return callzaihuansuan0112_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("0105"):
        print(label)
        print(A)
        if '现浇水平挑檐' in label and 'm3' in A:
            return """
            {
            "answer": "A=B"
            }    
            """
        elif '垫层' in label and 'm2' in A:##垫层的单位是m3
            return callzaihuansuan0105_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
        elif '成品不锈钢盖板安装' in label and '套' in A:##垫层的单位是m3
            return callzaihuansuan0105_2(bianma, label, A, B, C, aiclient, qwclient, sfclient)
        elif '油膏' in label and 'm2' in A and '散水' in C:##伸缩缝的单位是10m
            return """
                 {
                    "answer": "A=0.18*B"
                 }
            """
    if bianma.startswith("0106"):
        print(A)
        print(B)
        if '油漆' in label:
            if 't' in A and 'm2' in B and '10m2' not in B and '100m2' not in B:
                return callzaihuansuan0106_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
            if 't' in A and '10m2' in B:
                return callzaihuansuan0106_2(bianma, label, A, B, C, aiclient, qwclient, sfclient)
            if 't' in A and '100m2' in B:
                return callzaihuansuan0106_3(bianma, label, A, B, C, aiclient, qwclient, sfclient)
        if bianma.startswith("0108"):
            if '樘' in A and 'm2' in B:
                return callzaihuansuan0108_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("030404017"):##配电箱
        print(A)
        print(B)
        if '基础槽钢' in label:
            return callzaihuansuan030404017(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("030411001"):##配管
        print(A)
        print(B)
        if '刚性防水套管' in label:
            return callzaihuansuan030411001(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("030901013"):##灭火器
        print(A)
        print(B)
        if '灭火器' in label:
            return callzaihuansuan030901013(bianma, label, A, B, C, aiclient, qwclient, sfclient)
    if bianma.startswith("030801"):##工业管道
        print(A)
        print(B)
        if '管道刷油' in label or '手工除锈' in label:
            return callzaihuansuan030801(bianma, label, A, B, C, aiclient, qwclient, sfclient)


    return """
       {"answer": "0"}
    """
