from utils.get_future_day import get_future_date
from utils.get_today import get_today_date

# 申购单保存参数
purchase_apply_save_params = {
    "orderDay": get_today_date(),
    "businessType": "ApplyPurchased",
    "businessTypeName": "申请购买",
    "matTypeName": "五金材料",
    "depotCode": "HBWJ",
    "depotName": "湖北新明珠绿色建材五金仓",
    "factoryCode": "21101",
    "factoryName": "湖北新明珠绿色建材科技有限公司",
    "applyUserName": "丁国华",
    "applyUserDept": "试制组",
    "applyUserTel": "13798674137",
    "applyUserJob": "副主任级",
    "arrivalDay": get_future_date(10),
    "purchasingOrganizationName": "集团",
    "urgebtName": "否",
    "testName": "否",
    "urgebt": "N",
    "companyCode": "211",
    "matTypeCode": "W",
    "applyUserCode": "02KNOI",
    "applyUserDeptCode": "2SC140301",
    "applyUserIdcard": "360622198305265819",
    "purchasingOrganization": "Group",
    "status": "Draft",
    "skipWarn": "false",
}

# 申购单物料明细
detailsJson = [
    {
        "selected": "",
        "itemSeq": 1,
        "isNewMat": "N",
        "fujian": "",
        "detailsStatus1": "",
        "matCode": "15200301210022",
        "matName": "路美仕1350扫地车风机电机碳刷10X14mm-佛山-龙犇",
        "matShorthand": "路美仕1350扫地车风机电机碳刷",
        "produceSquare": "",
        "matgroupName": "扫地车",
        "special": "10X14mm",
        "placeOfProd": "佛山",
        "brand": "龙犇",
        "materialQualityName": "",
        "mmsatShow": "",
        "matRemark": "",
        "supCode": "0101353",
        "supName": "广东大华轴承有限公司",
        "purchaseUom": "个",
        "purchaseDigit": "25",
        "useage": "",
        "remark": "",
        "deposit": "N",
        "hrname": "林家健",
        "uomRate": 1,
        "stockDigit": 0,
        "stockUom": "个",
        "poContractNo": "XMZ[2021]GYB-wjf070578",
        "contractNo": "PC210304001",
        "dealerCode": "",
        "packLong1": "",
        "packLong2": "",
        "packHeight1": "",
        "packSpecial": "",
        "packCode": "",
        "oemCode": "",
        "oemName": "",
        "oemAddress": "",
        "oemLinker": "",
        "oemPhone": "",
        "hrrowid": "085I9M",
        "scmOrgId": 7,
        "purchaseOrgCode": "GWJ",
        "purchaseOrgName": "五金采购",
        "purchaseAreaCode": "GWJ6",
        "purchaseAreaName": "湖北工业园",
        "isNewMatName": "绿灯",
        "depositName": "否",
        "docitem": 1,
        "rowClick": "false",
        "parentNames": "W-五金仓库》152-工具类》152003-车辆",
        "materialQualityCode": "",
        "matgroupCode": "1520030121",
        "stockUomId": "unit033",
        "purchaseUomId": "unit033",
        "uomTypeCode": "numberUom",
        "uomTypeName": "数量单位",
        "materialQualityId": "",
        "materialSize": "",
        "subName": "",
        "detailsStatus": "Draft",
    },
    {
        "selected": "",
        "itemSeq": 2,
        "isNewMat": "N",
        "fujian": "",
        "detailsStatus1": "",
        "matCode": "15200301210033",
        "matName": "环保车刹车泵固定位65mm-湖北-航特",
        "matShorthand": "环保车刹车泵",
        "produceSquare": "",
        "matgroupName": "扫地车",
        "special": "固定位65mm",
        "placeOfProd": "湖北",
        "brand": "航特",
        "materialQualityName": "",
        "mmsatShow": "",
        "matRemark": "",
        "supCode": "0101353",
        "supName": "广东大华轴承有限公司",
        "purchaseUom": "个",
        "purchaseDigit": "55",
        "useage": "",
        "remark": "",
        "deposit": "N",
        "hrname": "林家健",
        "uomRate": 1,
        "stockDigit": 0,
        "stockUom": "个",
        "poContractNo": "XMZ[2021]GYB-wjf070578",
        "contractNo": "PC210304001",
        "dealerCode": "",
        "packLong1": "",
        "packLong2": "",
        "packHeight1": "",
        "packSpecial": "",
        "packCode": "",
        "oemCode": "",
        "oemName": "",
        "oemAddress": "",
        "oemLinker": "",
        "oemPhone": "",
        "hrrowid": "085I9M",
        "scmOrgId": 7,
        "purchaseOrgCode": "GWJ",
        "purchaseOrgName": "五金采购",
        "purchaseAreaCode": "GWJ6",
        "purchaseAreaName": "湖北工业园",
        "isNewMatName": "绿灯",
        "depositName": "否",
        "docitem": 2,
        "rowClick": "false",
        "parentNames": "W-五金仓库》152-工具类》152003-车辆",
        "materialQualityCode": "",
        "matgroupCode": "1520030121",
        "stockUomId": "unit033",
        "purchaseUomId": "unit033",
        "uomTypeCode": "numberUom",
        "uomTypeName": "数量单位",
        "materialQualityId": "",
        "materialSize": "",
        "subName": "",
        "detailsStatus": "Draft",
    },
    {
        "selected": "",
        "itemSeq": 3,
        "isNewMat": "N",
        "fujian": "",
        "detailsStatus1": "",
        "matCode": "15200301210041",
        "matName": "星力环保扫地车刹车皮42*77-佛山-龙犇",
        "matShorthand": "星力环保扫地车刹车皮",
        "produceSquare": "",
        "matgroupName": "扫地车",
        "special": "42*77",
        "placeOfProd": "佛山",
        "brand": "龙犇",
        "materialQualityName": "",
        "mmsatShow": "",
        "matRemark": "",
        "supCode": "0101353",
        "supName": "广东大华轴承有限公司",
        "purchaseUom": "付",
        "purchaseDigit": "05",
        "useage": "",
        "remark": "",
        "deposit": "N",
        "hrname": "林家健",
        "uomRate": 1,
        "stockDigit": 0,
        "stockUom": "付",
        "poContractNo": "XMZ[2021]GYB-wjf070578",
        "contractNo": "PC210304001",
        "dealerCode": "",
        "packLong1": "",
        "packLong2": "",
        "packHeight1": "",
        "packSpecial": "",
        "packCode": "",
        "oemCode": "",
        "oemName": "",
        "oemAddress": "",
        "oemLinker": "",
        "oemPhone": "",
        "hrrowid": "085I9M",
        "scmOrgId": 7,
        "purchaseOrgCode": "GWJ",
        "purchaseOrgName": "五金采购",
        "purchaseAreaCode": "GWJ6",
        "purchaseAreaName": "湖北工业园",
        "isNewMatName": "绿灯",
        "depositName": "否",
        "docitem": 3,
        "rowClick": "true",
        "parentNames": "W-五金仓库》152-工具类》152003-车辆",
        "materialQualityCode": "",
        "matgroupCode": "1520030121",
        "stockUomId": "unit031",
        "purchaseUomId": "unit031",
        "uomTypeCode": "numberUom",
        "uomTypeName": "数量单位",
        "materialQualityId": "",
        "materialSize": "",
        "subName": "",
        "detailsStatus": "Draft",
    },
]

# 申购单接口body
purchase_apply_body = {"detailsJson": "{}".format(detailsJson)}

# 申购单提交接口参数
purchase_apply_submit_params = {
    "orderDay": get_today_date(),
    "businessType": "ApplyPurchased",
    "businessTypeName": "申请购买",
    "matTypeCode": "W",
    "matTypeName": "五金材料",
    "factoryCode": "21101",
    "depotCode": "HBWJ",
    "depotName": "湖北新明珠绿色建材五金仓",
    "factoryName": "湖北新明珠绿色建材科技有限公司",
    "applyUserName": "丁国华",
    "applyUserCode": "02KNOI",
    "applyUserIdcard": "360622198305265819",
    "applyUserDept": "试制组",
    "applyUserDeptCode": "2SC140301",
    "applyUserTel": "13798674137",
    "applyUserJob": "副主任级",
    "arrivalDay": get_future_date(10),
    "purchasingOrganization": "Group",
    "purchasingOrganizationName": "集团",
    "urgebt": "N",
    "urgebtName": "否",
    "test": "N",
    "testName": "否",
    "creator": 1010537,
    "creatorName": "肖建文",
    "status": "WaitPurchase",
    "removed": "false",
    "lastModifierId": 1010537,
    "lastModifierName": "肖建文",
    "status1": "草稿",
    "skipWarn": "false",
}
