def test_app_submitOrder(self): submiturl = self.ip+"/dcms/pwasCase/pwasCase-pdasave.action" shangbao_data = { "eorc.id":self.orderData['eorcid'],#事部件类型 "fieldintro":self.orderData['fieldintro'], "deptId":"", "mposl":self.orderData['mposl'], "description":self.orderData['description'], "objcode":"", "eventtypeone.id":self.orderData['eventtypeone'], #大类 市容环境 "gridid":self.orderData['gridid'], "bgadminid.id":self.orderData['id'], #上报人id "eventtypetwo.id":self.orderData['eventtypetwo'], #小类 道路不洁 "mposb":self.orderData['mposb'] } #提交app案卷上报 sb_res = requests.post(submiturl,shangbao_data,headers = self.app_header,timeout = 20) sb_respon = sb_res.text result_data= re.compile('<caseInputInfo><issuc>(.*?)</issuc><caseprochisid>(.*?)</caseprochisid><idcase>(.*?)</idcase></caseInputInfo>').search(sb_respon) issuc = result_data.group(1) caseprochisid = result_data.group(2) idcase = result_data.group(3) if issuc: if 'imgPath' in self.orderData: # 上传图片地址 imgUrl = self.ip+"/dcms/PwasAdmin/PwasAdmin-imageup.action?imagetype=image&idcase="+idcase+"&prochisid="+caseprochisid picpath = self.orderData['imgPath'] test_app_ReportPicture(imgUrl,picpath) sb_res.connection.close() else: print("复核案卷未上传图片") return True else: print("XXXXXXXXXX上报失败XXXXXXXXXX") return False
def test_app_daiHeShiDetail(self): dhsResult = self.test_app_heShiList() if dhsResult: hs_url = self.ip + "/dcms/pwasCase/Case-pdaconfirmCase.action" hs_data = { "eorc.id": dhsResult.find('eorc').get_text(), "fieldintro": dhsResult.find('fieldintro').get_text(), "confirmid.id": self.loginUser['id'], #核实人id "mposl": dhsResult.find('mposl').get_text(), "description": dhsResult.find('description').get_text(), "id": dhsResult.find('id').get_text(), "eventtypeone.id": dhsResult.find('eventtypeone').get_text(), "casestateid.id": self.loginUser['casestateid'], #核实有效/核实无效 "gridid": dhsResult.find('gridid').get_text(), "eventtypetwo.id": dhsResult.find('eventtypetwo').get_text(), "mposb": dhsResult.find('mposb').get_text() } hs_result = requests.post(hs_url, hs_data, headers=self.app_header, timeout=20) hs_result.connection.close() if '<caseprochisid>' in hs_result.text: print("案卷核实成功") result_data = re.compile( '<caseInputInfo><issuc>(.*?)</issuc><caseprochisid>(.*?)</caseprochisid><idcase>(.*?)</idcase></caseInputInfo>' ).search(hs_result.text) caseprochisid = result_data.group(2) idcase = result_data.group(3) if 'imgPath' in self.loginUser: # 上传图片地址 imgUrl = self.ip + "/dcms/PwasAdmin/PwasAdmin-imageup.action?imagetype=image&idcase=" + idcase + "&prochisid=" + caseprochisid picpath = self.loginUser['imgPath'] test_app_ReportPicture(imgUrl, picpath) return True else: print("核实案卷未上传图片") else: print( "XXXXXXXXXXXXXXXXXXXXXXXXXXXX核实失败XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) else: print("待核实列表中没有该工单号:{}".format(self.loginUser['oderNumber'])) return dhsResult # if __name__=="__main__": # #test_app_wggly_daiHeShiDetail() # test_app_zfj_daiHeShiDetail()
def test_fastProcessing(self): dcl_list = self.test_quickProcessingList() if dcl_list != False: dclList = json.loads(dcl_list) if dclList['count'] > 0: caseid = dclList['data'][0]['id'] bgadminid = dclList['data'][0]['adminname'] description = dclList['data'][0]['describe'] ksclurl = self.ip + "/dcms/pwasCase/pwasCase-dealCase.action" kscldata = { "eorc.id": loginUser['eorc'], "fieldintro": loginUser['fieldintro'], "deptId": "", "mposl": loginUser['mposl'], "description": description, "objcode": "", "eventtypeone.id": loginUser['eventtypeone'], "gridid": loginUser['gridid'], "bgadminid.id": bgadminid, "eventtypetwo.id": loginUser['eventtypetwo'], "caseid": caseid, "mposb": loginUser['mposb'], } ksclRespons = requests.post(ksclurl, kscldata, headers=self.app_header, timeout=20) ksclres = ksclRespons.text if 'true' in ksclres: if 'imgPath' in self.loginUser: print("正在上传处理图片...") # 上传图片地址 ksclRes = json.loads(ksclres) print(ksclRes) imgUrl = self.ip + "/dcms/PwasAdmin/PwasAdmin-imageup.action?imagetype=image&idcase=" + ksclRes[ 'data']['caseid'] + "&prochisid=" + ksclRes[ 'data']['taskId'] picpath = self.loginUser['imgPath'] test_app_ReportPicture(imgUrl, picpath) else: print("快速案卷处理时未上传图片") return True else: print("XXXXXXXXXXXXXXXXXXX快速处理案卷失败XXXXXXXXXXXXXXXXXXX") return False else: print("00000000000000待处理快速案卷列表暂时为空0000000000000") return False
def test_app_returnDetailsAndVisit(self): # 获取列表 dfhDetalOBJ = self.test_app_returnVisitList() if dfhDetalOBJ: cl_url = self.ip + "/dcms/pwasCase/Case-pdacheckCase.action" cl_data = { "id": dfhDetalOBJ.id.get_text(), "checkdesc": self.hfItem['checkdesc'], "casestateid.id": self. hfItem['casestateid'], #状态402880822f3eca29012f3ed146b30006 "checkid.id": self.hfItem['id'], "taskprocess": "" } clres = requests.post(cl_url, cl_data, headers=self.app_header, timeout=20) cl_res = clres.text result_data = re.compile( '<caseInputInfo><issuc>(.*?)</issuc><caseprochisid>(.*?)</caseprochisid><idcase>(.*?)</idcase></caseInputInfo>' ).search(cl_res) issuc = result_data.group(1) caseprochisid = result_data.group(2) idcase = result_data.group(3) if issuc: print("案卷复核完成") if 'imgPath' in self.hfItem: # 上传图片地址 print("正在上传复核图片......") imgUrl = self.ip + "/dcms/PwasAdmin/PwasAdmin-imageup.action?imagetype=image&idcase=" + idcase + "&prochisid=" + caseprochisid picpath = self.hfItem['imgPath'] test_app_ReportPicture(imgUrl, picpath) else: print("复核案卷未上传图片") return True else: print("XXXXXXXXXX上报失败XXXXXXXXXX") clres.connection.close() else: print("待复核列表中没有该工单号{}".format(self.hfItem['oderNumber'])) return dfhDetalOBJ # if __name__=="__main__": # test_reviewAndReturnVisit().test_returnDetailsAndVisit()
def test_app_handlingDetailsAndHandling(self): # 获取待处理列表 dclResult = self.test_app_PendingList() if dclResult: cl_url = self.ip + "/dcms/PwasAdmin/MobileCase-deal.action" cl_data = { "operatingComments": self.loginUser['operatingComments'], "username": self.loginUser['name'], "stateId": dclResult['stateId'], "isFh": dclResult['isFh'], "deptid": self.loginUser['deptid'], "deptname": dclResult['dealDeptName'], "caseid": dclResult['id'], "resultprocess": "案件回访", "userid": self.loginUser['id'], "taskprocess": dclResult['taskID'] } cl_res = requests.post(cl_url, cl_data, headers=self.app_header, timeout=20) clres = json.loads(cl_res.text) if 'message' in clres and clres['message'] == 'success': print("案卷处理成功") if 'imgPath' in self.loginUser: print("正在上传处理图片......") # 上传图片地址 imgUrl = self.ip + "/dcms/PwasAdmin/PwasAdmin-imageup.action?imagetype=image&idcase=" + clres[ 'id'] + "&prochisid=" + clres['taskid'] picpath = self.loginUser['imgPath'] test_app_ReportPicture(imgUrl, picpath) else: print("处理案卷未上传图片") return True else: print("XXXXXXXXXX处理案卷时出现错误XXXXXXXXXX") cl_res.connection.close() else: print("待处理列表中没有该工单号:{}".format(self.loginUser['oderNumber'])) return dclResult