예제 #1
0
    def execute(self, request):
        staff_admin = self.auth_user
        StaffServer.judge_staff_role(staff_admin)

        staff = StaffServer.get(request.user_id)

        staff = StaffPermiseServer.hung_permise_bystaff(staff)
        # staff_list = StaffAccountServer.hung_account_forstaffs(staff_list)

        return staff
예제 #2
0
    def execute(self, request):
        """判断是否为管理员"""
        staff_admin = self.auth_user
        StaffServer.judge_staff_role(staff_admin)
        """身份证号是否存在"""
        StaffServer.check_exist(request.user_info['identity'])
        """创建员工"""
        staff = StaffServer.register(**request.user_info)
        """添加权限关系"""
        if 'role_ids' in request.user_info:
            StaffPermiseServer.generate_staff_access(
                request.user_info['role_ids'], "role", staff)

        if 'department_ids' in request.user_info:
            StaffPermiseServer.generate_staff_access(
                request.user_info['department_ids'], "department", staff)
예제 #3
0
    def execute(self, request):
        '''获得员工信息'''
        staff = StaffServer.get(request.user_id)
        """判断身份证号是否存在"""
        if "identity" in request.user_info:
            StaffServer.check_exist(request.user_info['identity'], staff)

        StaffServer.update(staff, **request.user_info)
        '''更新账号信息
        account = StaffAccountServer.get_account_bystaff(staff)
        StaffAccountServer.update(account, **request.user_info)
        '''
        '''更新权限信息'''
        StaffPermiseServer.update_staff_access(request.user_info['role_ids'],
                                               "role", staff)
        StaffPermiseServer.update_staff_access(
            request.user_info['department_ids'], "department", staff)
예제 #4
0
 def execute(self, request):
     staff = StaffServer.get(request.sale_chance_info["staff_id"])
     goods = GoodsServer.get(request.sale_chance_info["goods_id"])
     customer_list = CustomerServer.search_qs(
         id__in=request.sale_chance_info["customer_ids"])
     for customer in customer_list:
         SaleChanceServer.generate(customer = customer, staff = staff, goods = goods, shop = goods.shop, \
                                   end_time = request.sale_chance_info["end_time"])
예제 #5
0
 def execute(self, request):
     cur_user = self.auth_user
     user_pro = UserRightServer(cur_user)
     request.search_info['cur_user'] = user_pro
     staff_pages = StaffServer.search(request.current_page,
                                      **request.search_info)
     staff_list = StaffPermiseServer.hung_permise_forstaffs(
         staff_pages.data)
     staff_list = StaffAccountServer.hung_account_forstaffs(staff_list)
     staff_pages.data = staff_list
     return staff_pages
예제 #6
0
 def execute(self, request):
     MobilephoneServer.is_phone_exist(
         request.mobile_phone_info["phone_number"])
     if 'staff_id' in request.mobile_phone_info:
         staff = StaffServer.get(request.mobile_phone_info["staff_id"])
         request.mobile_phone_info.update({"staff": staff})
         request.mobile_phone_info.update({"name": staff.name})
         request.mobile_phone_info.update({"identity": staff.identity})
     if 'mobile_devices_id' in request.mobile_phone_info:
         mobile_devices = MobileDevicesServer.get(
             request.mobile_phone_info["mobile_devices_id"])
         request.mobile_phone_info.update({"devices": mobile_devices})
     mobilephone = MobilephoneServer.generate(**request.mobile_phone_info)
예제 #7
0
    def execute(self, request):
        if "staff_name" in request.search_info:
            staff_name = request.search_info.pop("staff_name")
            staff_list = StaffServer.search_all(name = staff_name)
            request.search_info.update({"staff__in":staff_list})
        cur_user = self.auth_user
        user_pro = UserRightServer(cur_user)
        request.search_info['cur_user'] = user_pro
        measure_staff_qs = MeasureStaffServer.search_qs(**request.search_info)
        sum_data = MeasureStaffServer.summing(measure_staff_qs)

        page_list = MeasureStaffServer.search(request.current_page, measure_staff_qs)

        MeasureStaffServer.calculation(page_list.data)

        sum_measure_data = ServiceItemServer.summing(sum_data, **request.search_info)
        ServiceItemServer.huang_serviceitem_rate(page_list.data)

        return sum_data, sum_measure_data, page_list
예제 #8
0
    def execute(self, request):
        mobilephone = MobilephoneServer.get(request.mobile_phone_id)
        MobilephoneServer.is_phone_exist(
            request.mobile_phone_info["phone_number"], mobilephone)
        if "staff_id" in request.mobile_phone_info:
            staff = StaffServer.get(request.mobile_phone_info["staff_id"])
            request.mobile_phone_info.update({"staff": staff})
            request.mobile_phone_info.update({"name": staff.name})
            request.mobile_phone_info.update({"identity": staff.identity})
        else:
            request.mobile_phone_info.update({"staff": None})

        if "mobile_devices_id" in request.mobile_phone_info:
            mobile_devices = MobileDevicesServer.get(
                request.mobile_phone_info["mobile_devices_id"])
            request.mobile_phone_info.update({"devices": mobile_devices})
        else:
            request.mobile_phone_info.update({"devices": None})

        MobilephoneServer.update(mobilephone, **request.mobile_phone_info)
예제 #9
0
 def execute(self, request):
     cur_user = self.auth_user
     user_pro = UserRightServer(cur_user)
     request.search_info.update({"id__in": user_pro._staff_id_list})
     staff_list = StaffServer.search_all(**request.search_info)
     return staff_list
예제 #10
0
    def execute(self, request):
        staff_list = StaffServer.search_all(**request.search_info)

        return staff_list
예제 #11
0
 def execute(self, request):
     staff_list = StaffServer.match(request.keyword, request.size)
     return staff_list
예제 #12
0
    def execute(self, request):
        staff = self.auth_user

        StaffServer.update(staff, **request.user_info)
예제 #13
0
    def execute(self, request):
        staff = StaffServer.get(request.staff_id)

        StaffAccountServer.register_account_bystaff(staff, request._ip, **request.account_info)
예제 #14
0
 def execute(self, request):
     record_staff = self.auth_user
     staff = StaffServer.get(request.measure_staff_info["staff_id"])
     request.measure_staff_info.update({'record': record_staff, 'staff':staff})
     MeasureStaffServer.generate(**request.measure_staff_info)