def TheRepairSquare_ExternalRepairListData(self, office_id=None): """ 报修广场--外协--数据查询接口,返回编译过的数据 :return: """ list_workOrder = None JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] startDate = self.FilterParameters["开始日期"] if type(startDate) == type(["1"]): startDate = startDate[0] endingDate = self.FilterParameters["结束日期"] if type(endingDate) == type(["1"]): endingDate = endingDate[0] post_Parameter = { "开始日期": startDate, "结束日期": endingDate, "所在单位": office_id } # 调用小程序--客户端--报修广场--外协接口 list_ListWorkOrder, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).ExternalRepairListData() ############################################################################################################## """编译从接口投诉清单返回的数据""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" list_workOrder = workOrder_compile( list_ListWorkOrder).WorkOrderProcess_ExternalRepairListData( self.FilterParameters) return list_workOrder, post_Parameter, url
def applet_EventModules(self, state_name, userinfo): """ 小程序事件模块实际值 :return: """ url = None post_Parameter = {} finish_date2 = None list_workOrder_strState = [] list_workOrder = None for key, value in self.post_Parameter.items(): post_Parameter[key] = value # 去掉开始日期和结束日期的时间 begin_date = post_Parameter["开始日期"] if begin_date: begin_date = begin_date[:10] finish_date1 = post_Parameter["结束日期"] if finish_date1: finish_date2 = finish_date1[:10] post_Parameter["开始日期"] = begin_date post_Parameter["结束日期"] = finish_date2 list_workOrder_initial = None #获取待响应/预约中/待处理/处理中/已处理/已挂起列表数据接口的数据,小程序事件,返回工单列表 if state_name == "外协_待响应" or state_name == "外协_预约中" or state_name == "外协_待处理" or state_name == "外协_处理中" or state_name == "外协_已处理" or state_name == "外协_已挂起": list_workOrder_initial, req_text, url = TheRepairOrderInterface( self.JSESSIONID, post_Parameter).chooseListData() #获取外协_已关单列表数据接口的数据,小程序事件,返回工单列表 elif state_name == "外协_已关单": list_workOrder_initial, req_text, url = TheRepairOrderInterface( self.JSESSIONID, post_Parameter).closedTicketListData() #获取全部工单、紧急事件、驻场事件(包含已关单数据)列表数据接口的数据,小程序事件,返回工单列表 elif state_name == "全部工单": post_Parameter["是否完成的工单"] = None list_workOrder_initial, url = TheRepairOrderInterface( self.JSESSIONID, post_Parameter).allListData() list_workOrder_intState = workOrder_compile( self.JSESSIONID, list_workOrder_initial).compile_homePage(userinfo) # 把工单整数类型的工单状态编译成状态名称 for workOrder in list_workOrder_intState: int_state = workOrder["工单状态"] state_name = dictionaries( self.JSESSIONID, int_state).ADictionaryTable() # 整数的工单状态转化成str工单名称 workOrder["工单状态"] = state_name list_workOrder_strState.append(workOrder) # 截取工单更新日期和创建日期的日期 list_dataKey = ["工单创建日期", "工单更新日期"] list_workOrder = TimeFormat(list_workOrder_strState, list_dataKey).CaptureTheAate("%Y-%m-%d") return list_workOrder, url
def TheRepairSquare_sjTicketServe_details(self, post_Parameter): """ 工单详情 :return: """ new_workOrder_details = [] JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] # 调用小程序--详情页面 workOrder_details, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).sjTicketServe_details() # 因为只有一条数据,所有加转化成列表 new_workOrder_details.append(workOrder_details) """编译从接口工单清单返回的数据""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" compile_workOrder = workOrder_compile( new_workOrder_details).connector_one( self.FilterParameters) # 编译调用小程序--首页--工单接口 return compile_workOrder, post_Parameter, url
def TheRepairSquare_page(self): """ 报修广场数据查询接口,调用小程序--客户端--报修广场--我的报修接口,返回编译过的数据 :return: """ JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] startDate = self.FilterParameters["开始日期"] endingDate = self.FilterParameters["结束日期"] post_Parameter = {"开始日期": startDate, "结束日期": endingDate} # 调用小程序--客户端--报修广场--我的报修接口 list_ListWorkOrder, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).MyRepairListData() ############################################################################################################## """编译从接口投诉清单返回的数据""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" list_workOrder = workOrder_compile( list_ListWorkOrder).WorkOrderProcess_MyRepairListData( self.FilterParameters) return list_workOrder, post_Parameter, url
def TheRepairSquare_closedTicketListData(self): """ 已关单列表数据 :param effect: :return: """ req_text = None post_Parameter = {} list_workOrder = None list_ListWorkOrder = None list_workOrder_strState = [] JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] startDate = self.FilterParameters["开始日期"] endingDate = self.FilterParameters["结束日期"] selected_module = self.FilterParameters["所属模块"] post_Parameter = { "工单状态": "2", "开始日期": startDate, "结束日期": endingDate, "所在单位": None, "查看范围": None } # 调用小程序--服务端--事件--已关单 list_ListWorkOrder, req_text, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).closedTicketListData() list_workOrder_intState = workOrder_compile( list_ListWorkOrder).WorkOrderProcess_closedTicketListData( self.FilterParameters) # 把工单整数类型的工单状态编译成状态名称 for workOrder in list_workOrder_intState: int_state = workOrder["工单状态"] state_name = dictionaries( JSESSIONID, int_state).ADictionaryTable() # 整数的工单状态转化成str工单名称 workOrder["工单状态"] = state_name list_workOrder_strState.append(workOrder) # 截取工单更新日期和创建日期的日期 list_dataKey = ["工单创建日期", "工单更新日期"] list_workOrder = TimeFormat(list_workOrder_strState, list_dataKey).CaptureTheAate("%Y-%m-%d") return list_workOrder, post_Parameter, url
def TheRepairSquare_noOffTicketListData(self): """ 小程序--首页--工单 :return: """ JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] list_workOrder_port = None list_workOrder = None roleName = self.FilterParameters["用户权限"] if roleName == "普通用户" or roleName == "用户管理员" or roleName == "区域管理员": post_Parameter = {"工单范围": None, "月份": "7"} else: post_Parameter = {"工单范围": "0", "月份": "6"} # 调用小程序--首页--工单接口 list_workOrder_port, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).noOffTicketListData() ############################################################################################################## """编译从接口工单清单返回的数据""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" list_workOrder = workOrder_compile( list_workOrder_port).compile_homePage( self.FilterParameters) # 编译调用小程序--首页--工单接口 return list_workOrder, post_Parameter, url
def TheRepairSquare_InsideRepairListData(self, effect=True, location_office=None): """ 报修广场--内部--数据查询接口,返回编译过的数据 :return: """ list_workOrder = None JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] startDate = self.FilterParameters["开始日期"] if type(startDate) == type(["1"]): startDate = startDate[0] endingDate = self.FilterParameters["结束日期"] if type(endingDate) == type(["1"]): endingDate = endingDate[0] post_Parameter = { "开始日期": startDate, "结束日期": endingDate, "所在单位": location_office } # 调用小程序--客户端--报修广场--内部 list_ListWorkOrder, req_text, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).InsideRepairListData() ############################################################################################################## """编译从接口投诉清单返回的数据""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" # "1":数据对比用户; if effect: list_workOrder = workOrder_compile( list_ListWorkOrder).WorkOrderProcess_InsideRepairListData( self.FilterParameters) # "1":获取部分post请求数据 else: list_workOrder = OtherInterfaces_compile( list_ListWorkOrder).WorkOrderProcess_Post( self.FilterParameters, req_text) return list_workOrder, post_Parameter, url
def TheRepairSquare_chooseListData(self, effect=True): """ 小程序--服务端--事件(待响应;预约中;待处理;处理中;已处理;已关单;已挂起) :return: """ req_text = None list_workOrder_strState = [] post_Parameter = {} list_workOrder = None list_ListWorkOrder = None JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] startDate = self.FilterParameters["开始日期"] endingDate = self.FilterParameters["结束日期"] selected_module = self.FilterParameters["所属模块"] if selected_module == "服务端--事件--待响应": post_Parameter = { "工单状态": "2", "开始日期": startDate, "结束日期": endingDate, "所在单位": None, "查看范围": None } elif selected_module == "服务端--事件--预约中": post_Parameter = { "工单状态": "3", "开始日期": startDate, "结束日期": endingDate, "所在单位": None, "查看范围": None } elif selected_module == "服务端--事件--待处理": post_Parameter = { "工单状态": "4", "开始日期": startDate, "结束日期": endingDate, "所在单位": None, "查看范围": None } elif selected_module == "服务端--事件--处理中": post_Parameter = { "工单状态": "5", "开始日期": startDate, "结束日期": endingDate, "所在单位": None, "查看范围": None } elif selected_module == "服务端--事件--已处理": post_Parameter = { "工单状态": "7", "开始日期": startDate, "结束日期": endingDate, "所在单位": None, "查看范围": None } elif selected_module == "服务端--事件--已挂起": post_Parameter = { "工单状态": "6", "开始日期": startDate, "结束日期": endingDate, "所在单位": None, "查看范围": None } # 调用小程序--服务端--事件--待响应;预约中;待处理;处理中;已处理;已挂起 list_ListWorkOrder, req_text, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).chooseListData() ############################################################################################################## """编译从接口投诉清单返回的数据""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" if effect: list_workOrder_intState = workOrder_compile( list_ListWorkOrder).compile_homePage(self.FilterParameters) # 把工单整数类型的工单状态编译成状态名称 for workOrder in list_workOrder_intState: int_state = workOrder["工单状态"] state_name = dictionaries( JSESSIONID, int_state).ADictionaryTable() # 整数的工单状态转化成str工单名称 workOrder["工单状态"] = state_name list_workOrder_strState.append(workOrder) # 截取工单更新日期和创建日期的日期 list_dataKey = ["工单创建日期", "工单更新日期"] list_workOrder = TimeFormat( list_workOrder_strState, list_dataKey).CaptureTheAate("%Y-%m-%d") else: list_workOrder = OtherInterfaces_compile( list_ListWorkOrder).WorkOrderProcess_Post( self.FilterParameters, req_text) return list_workOrder, post_Parameter, url
def TheRepairSquare_allListData(self, effect=True): """ 小程序--客户端-报修广场-已完成和全部;小程序--服务端-事件-全部工单列表实际值;小程序--服务端--首页--紧急报修和驻场服务实际值 :return: """ post_Parameter = {} list_workOrder = None list_ListWorkOrder = None list_workOrder_intState = None list_workOrder_strState = [] selected_office = None selected_module = None startDate = None endingDate = None print("self.FilterParameters:", self.FilterParameters) startDate = self.FilterParameters["开始日期"] endingDate = self.FilterParameters["结束日期"] JSESSIONID = self.FilterParameters["登录用户JSESSIONID"] selected_module = self.FilterParameters["所属模块"] selected_office = self.FilterParameters["所选单位"] if selected_office == "空": selected_office = None if selected_module == "客户端-报修广场-已完成": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": "true", "工单服务类型": None } elif selected_module == "客户端-报修广场-全部": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": None, "工单服务类型": None } elif selected_module == "首页-紧急报修-未完成": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": "false", "工单服务类型": "1" } elif selected_module == "首页-紧急报修-已完成": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": "true", "工单服务类型": "1" } elif selected_module == "首页-紧急报修-全部": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": None, "工单服务类型": "1" } elif selected_module == "首页-驻场服务-未完成": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": "false", "工单服务类型": "2" } elif selected_module == "首页-驻场服务-已完成": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": "true", "工单服务类型": "2" } elif selected_module == "首页-驻场服务-全部": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": None, "工单服务类型": "2" } elif selected_module == "服务端-事件-全部工单": post_Parameter = { "工单类型": None, "开始日期": startDate, "结束日期": endingDate, "所选单位": selected_office, "工单范围": None, "是否完成的工单": None, "工单服务类型": None } print("post_Parameter:", post_Parameter) # 调用接口 list_ListWorkOrder, req_text, url = TheRepairOrderInterface( JSESSIONID, post_Parameter).allListData() """编译从接口投诉清单返回的数据""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" """""" # "1":数据对比用户; if effect: list_workOrder = workOrder_compile( list_ListWorkOrder).WorkOrderProcess_allListData( self.FilterParameters) # "1":获取部分post请求数据 else: list_workOrder = OtherInterfaces_compile( list_ListWorkOrder).WorkOrderProcess_Post( self.FilterParameters, req_text) return list_workOrder, post_Parameter, url