def test_maintainplan_senddown_more(self):
     u'''批量发布保养计划'''
     mgids = []
     # 创建多条保养计划
     for c in range(3):
         mgid = maintainplan_public.maintainplan_create()
         mgids.append(mgid)
     # 逐个关联设备
     for mid in mgids:
         equipmentmanage_public.associationequipment(mid)
     # 批量发布
     maintainplan_public.maintainplan_senddown(mgids)
     # 验证发布
     check = 0
     for mid in mgids:
         sreq = maintainplan_public.maintainplan_select(mid)
         # print(sreq)
         if '"status":"20"' in sreq:
             check = check + 0
         else:
             check = check + 1
     if check == 0:
         assert 1 == 1
     else:
         assert 1 == 2
 def test_overhaulplan_delete_more(self):
     u'''发布非已创建状态的大修计划'''
     opgids = []
     opgid = overhaulplan_public.overhaulplan_create()
     opgids.append(opgid)
     equipmentmanage_public.associationequipment(opgid)
     overhaulplan_public.overhaulplan_senddown(opgids)
     opsdreq = overhaulplan_public.overhaulplan_senddown(opgids)
     if 'message":"已经发布的大修计划不能发布' in opsdreq:
         assert 1 == 1
     else:
         assert 1 == 2
 def test_overhaulplan_senddown_simple(self):
     u'''发布单条大修计划'''
     opgids = []
     opgid = overhaulplan_public.overhaulplan_create()
     opgids.append(opgid)
     equipmentmanage_public.associationequipment(opgid)
     overhaulplan_public.overhaulplan_senddown(opgids)
     opsreq = overhaulplan_public.overhaulplan_select(opgid)
     if 'status":"20' in opsreq:
         assert 1 == 1
     else:
         assert 1 == 2
Exemple #4
0
def overhaulbill_create():
    u'''生成大修单'''
    opgids = []
    opgid = overhaulplan_public.overhaulplan_create()
    opgids.append(opgid)
    opsreq = overhaulplan_public.overhaulplan_select(opgid)
    opcode = json.loads(opsreq)['data']['code']
    equipmentmanage_public.associationequipment(opgid)
    overhaulplan_public.overhaulplan_senddown(opgids)
    obfreq = overhaulbill_findbycode(opcode)
    obgid = json.loads(obfreq)['data'][0]['gid']
    return obgid
 def test_maintainplan_senddown_again(self):
     u'''已发布的保养计划再次发布'''
     mgids = []
     mgid = maintainplan_public.maintainplan_create()
     mgids.append(mgid)
     equipmentmanage_public.associationequipment(mgid)
     maintainplan_public.maintainplan_senddown(mgids)
     dreq = maintainplan_public.maintainplan_senddown(mgids)
     # print(dreq)
     if 'message":"已经发布的保养单不能发布' in dreq:
         assert 1 == 1
     else:
         assert 1 == 2
 def test_maintainplan_senddown_simple(self):
     u'''单条发布保养计划'''
     mgids = []
     mgid = maintainplan_public.maintainplan_create()
     mgids.append(mgid)
     equipmentmanage_public.associationequipment(mgid)
     maintainplan_public.maintainplan_senddown(mgids)
     sreq = maintainplan_public.maintainplan_select(mgid)
     # print(sreq)
     if '"status":"20"' in sreq:
         assert 1 == 1
     else:
         assert 1 == 2
Exemple #7
0
def maintainbill_create():
    u'''生成保养单'''
    # 创建保养计划
    mpgids = []
    mpgid = maintainplan_public.maintainplan_create()
    # print(mgid)
    mpgids.append(mpgid)
    # 获取保养计划编号
    sreq = maintainplan_public.maintainplan_select(mpgid)
    code = json.loads(sreq)['data']['code']
    # print('======', code)
    # 关联设备
    equipmentmanage_public.associationequipment(mpgid)
    # 发布保养单
    maintainplan_public.maintainplan_senddown(mpgids)
    # 按保养计划编号查询保养单
    searchurl = 'http://' + domain + ':' + port + '/ime-container/imeMaintainBill/query.action?usedPost=true'
    data = {
        "query": {
            "query": [{
                "left": "(",
                "field": "mdEquipmentName",
                "type": "like",
                "value": code,
                "operator": "or"
            }, {
                "field": "imeMaintainPlanCode",
                "type": "like",
                "value": code,
                "operator": "or"
            }, {
                "right": ")",
                "field": "code",
                "type": "like",
                "value": code,
                "operator": "and"
            }]
        },
        "pager": {
            "page": 1,
            "pageSize": 10
        }
    }
    sreq = requests.post(searchurl, headers=headers,
                         data=json.dumps(data)).content.decode()
    # 获取第一个保养单gid
    mbgid = json.loads(sreq)['data'][0]['gid']
    return mbgid
 def test_overhaulplan_senddown_more(self):
     u'''批量发布大修计划'''
     opgids = []
     for c in range(3):
         opgid = overhaulplan_public.overhaulplan_create()
         opgids.append(opgid)
     for opgid in opgids:
         equipmentmanage_public.associationequipment(opgid)
     overhaulplan_public.overhaulplan_senddown(opgids)
     check = 0
     for opgid in opgids:
         opsreq = overhaulplan_public.overhaulplan_select(opgid)
         if 'status":"20' in opsreq:
             check = check + 0
         else:
             check = check + 1
     if check == 0:
         assert 1 == 1
     else:
         assert 1 == 2
Exemple #9
0
    def test_inspectplan_senddown_simple(self):
        u'''单个点检计划下发'''
        # 创建点检计划
        ipgids = []
        ipgid = inspectplan_public.inspectplan_create()
        ipgids.append(ipgid)

        # 关联设备
        equipmentmanage_public.associationequipment(ipgid)

        # 下发点检计划
        inspectplan_public.inspectplan_senddown(ipgids)

        # 验证下发
        sreq = inspectplan_public.inspectplan_select(ipgid)
        # print(sreq)
        if 'status":"20' in sreq:
            assert 1 == 1
        else:
            assert 1 == 2
def inspectbill_create():
    u'''创建点检单'''
    # 创建点检计划
    ipgids = []
    ipgid = inspectplan_public.inspectplan_create()
    ipgids.append(ipgid)

    # 查询点检计划编号
    sreq = inspectplan_public.inspectplan_select(ipgid)
    ipcode = json.loads(sreq)['data']['code']

    # 关联设备
    equipmentmanage_public.associationequipment(ipgid)

    # 发布
    inspectplan_public.inspectplan_senddown(ipgids)

    # 按保养计划编号查询保养单gid
    sreq = inspectbill_find(ipcode)
    ibgid = json.loads(sreq)['data'][0]['gid']
    return ibgid
Exemple #11
0
    def test_inspectplan_senddown_uncreate(self):
        u'''非已创建状态的点检计划下发'''
        # 创建点检计划
        ipgids = []
        ipgid = inspectplan_public.inspectplan_create()
        ipgids.append(ipgid)

        # 关联设备
        equipmentmanage_public.associationequipment(ipgid)

        # 下发点检计划
        inspectplan_public.inspectplan_senddown(ipgids)

        # 已下发的点检计划再次下发
        sdreq = inspectplan_public.inspectplan_senddown(ipgids)
        # print(sdreq)

        # 验证下发
        if 'message":"已下发过的点检计划不能再次发布' in sdreq:
            assert 1 == 1
        else:
            assert 1 == 2