Пример #1
0
def vcms_company_product(self, functions, actions, html_template,
                         page_settings, parameter_dict):
    pages = 1
    if parameter_dict.get("pages") is not None:
        pages = int(parameter_dict.get("pages"))
    #if session["user_rank_sn"] == 2 :
    #    return VcmsRootFunction().get_company_product_list(page_settings,int(parameter_dict.get("data_sn")))
    if session["user_rank_sn"] == 3:
        search = {
            "product_sn": parameter_dict.get("product_sn"),
            "product_name": parameter_dict.get("product_name"),
            "abbreviation": parameter_dict.get("abbreviation"),
            "barcode": parameter_dict.get("barcode"),
            "ct_start_date": parameter_dict.get("ct_start_date"),
            "ct_end_date": parameter_dict.get("ct_end_date"),
            "ut_start_date": parameter_dict.get("ut_start_date"),
            "ut_end_date": parameter_dict.get("ut_end_date"),
            "image_cnt": parameter_dict.get("image_cnt"),
            "enabled": parameter_dict.get("enabled")
        }
        return VcmsAdminFunction().get_company_product_list(
            page_settings, int(parameter_dict.get("data_sn")), pages, search)
    if session["user_rank_sn"] == 4:
        return VcmsUserFunction().get_company_product_list(
            page_settings, int(parameter_dict.get("data_sn")), pages)
    return ""
def vcms_upd_company_profile(self,functions,actions,html_template,page_settings,parameter_dict):
    return_data = {}
    if session["user_rank_sn"] == 2 :
        return_data = VcmsRootFunction().set_company_profile(page_settings,parameter_dict)
    if session["user_rank_sn"] == 3 :
        return_data = VcmsAdminFunction().set_company_profile(page_settings,parameter_dict)
    return jsonify(return_data)
Пример #3
0
def vcms_del_company_product_image(self, functions, actions, html_template,
                                   page_settings, parameter_dict):
    return_data = {}
    if session["user_rank_sn"] == 3:
        return_data = VcmsAdminFunction().del_company_product_image(
            page_settings, parameter_dict)
    return jsonify(return_data)
Пример #4
0
def vcms_upd_bind_service_account(self,functions,actions,html_template,page_settings,parameter_dict):
    return_data = {}
    if session["user_rank_sn"] == 2 :
        return_data = VcmsRootFunction().set_bind_service_account(page_settings,parameter_dict)
    if session["user_rank_sn"] == 3 :
        return_data = VcmsAdminFunction().set_bind_service_account(page_settings,parameter_dict)
    return jsonify(return_data)
def vcms_upload_product_image_csv(self, functions, actions, html_template,
                                  page_settings, parameter_dict):
    return_data = {}
    if session["user_rank_sn"] == 3:
        return_data = VcmsAdminFunction().set_company_product_image_csv(
            page_settings, parameter_dict, request.files)
    return jsonify(return_data)
def vcms_add_company_product(self,functions,actions,html_template,page_settings,parameter_dict):
    if session["user_rank_sn"] == 3 :
        pages = 1
        if parameter_dict.get("pages") is not None :
            pages = int(parameter_dict.get("pages"))
        return VcmsAdminFunction().get_edit_company_product(page_settings,int(parameter_dict.get("data_sn")),pages)
    return ""
Пример #7
0
def vcms_upd_pkl_file(self, functions, actions, html_template, page_settings,
                      parameter_dict):
    return_data = {}
    service_sn = int(actions)
    if session["user_rank_sn"] == 3:
        return_data = VcmsAdminFunction().set_pkl_file_to_test_server(
            page_settings, service_sn)
    return jsonify(return_data)
Пример #8
0
def vcms_product_csv_log(self,functions,actions,html_template,page_settings,parameter_dict) :
    #if session["user_rank_sn"] == 2 :
    #    return VcmsRootFunction().get_company_batch_product_list(page_settings,int(parameter_dict.get("data_sn")))
    if session["user_rank_sn"] == 3 :
        return VcmsAdminFunction().get_product_csv_log_list(page_settings,int(parameter_dict.get("data_sn")))
    #if session["user_rank_sn"] == 4 :
    #    return VcmsUserFunction().get_company_batch_product_list(page_settings,int(parameter_dict.get("data_sn")))
    return ""
Пример #9
0
def vcms_bind_service_account(self, functions, actions, html_template,
                              page_settings, parameter_dict):
    if session["user_rank_sn"] == 2:
        return VcmsRootFunction().get_bind_service_account_list(
            page_settings, int(parameter_dict.get("data_sn")))
    if session["user_rank_sn"] == 3:
        return VcmsAdminFunction().get_bind_service_account_list(
            page_settings, int(parameter_dict.get("data_sn")))
    return ""
Пример #10
0
def vcms_deploy_pkl(self, functions, actions, html_template, page_settings,
                    parameter_dict):
    return_data = {}
    service_sn = int(actions)
    if session["user_rank_sn"] == 3:
        return_data = VcmsAdminFunction().deploy_pkl_file_to_server(
            page_settings, service_sn)
        self.logger.info("on demand : " + str(service_sn))
        self.logger.info(return_data)
    return jsonify(return_data)
def vcms_view_system_announcement(self, functions, actions, html_template,
                                  page_settings, parameter_dict):
    if session["user_rank_sn"] == 2:
        return VcmsRootFunction().get_system_announcement_by_board_hash(
            page_settings, parameter_dict)
    if session["user_rank_sn"] == 3:
        return VcmsAdminFunction().get_system_announcement_by_board_hash(
            page_settings, parameter_dict)
    if session["user_rank_sn"] == 4:
        return VcmsUserFunction().get_system_announcement_by_board_hash(
            page_settings, parameter_dict)
    return ""
def vcms_download_product_csv(self, functions, actions, html_template,
                              page_settings, parameter_dict):
    return_data = {}
    if session["user_rank_sn"] == 3:
        return_data = VcmsAdminFunction().download_company_product_csv(
            page_settings, parameter_dict)
        if int(return_data["code"]) == 1:
            filename = str(uuid.uuid4()).replace("-", "")
            response = make_response(return_data["data"])
            response.headers[
                'Content-Disposition'] = 'attachment; filename=' + filename + '.csv'
            response.mimetype = 'text/csv'
            return response
    return jsonify(return_data)
def vcms_system_announcement(self, functions, actions, html_template,
                             page_settings, parameter_dict):
    pages = 1
    if parameter_dict.get("pages") is not None:
        pages = int(parameter_dict.get("pages"))
    if session["user_rank_sn"] == 2:
        return VcmsRootFunction().get_system_announcement_list(
            page_settings, pages)
    if session["user_rank_sn"] == 3:
        return VcmsAdminFunction().get_system_announcement_list(
            page_settings, pages)
    if session["user_rank_sn"] == 4:
        return VcmsUserFunction().get_system_announcement_list(
            page_settings, pages)
    return ""
Пример #14
0
def vcms_main(self, functions, actions, html_template, page_settings,
              parameter_dict):
    html_data = HtmlBuilder().getHeaderFooterHtml(page_settings)
    tab_ui = {}
    if session["user_rank_sn"] == 1:
        tab_ui = VcmsEngineerFunction().get_main_ui(page_settings)
    if session["user_rank_sn"] == 2:
        tab_ui = VcmsRootFunction().get_main_ui(page_settings)
    if session["user_rank_sn"] == 3:
        tab_ui = VcmsAdminFunction().get_main_ui(page_settings)
    if session["user_rank_sn"] == 4:
        tab_ui = VcmsUserFunction().get_main_ui(page_settings)
    page_settings["tab_ui"] = tab_ui
    return render_template(html_template,
                           header_footer_data=html_data,
                           data=page_settings)
Пример #15
0
def vcms_add_company_branch_account(self,functions,actions,html_template,page_settings,parameter_dict):
    if session["user_rank_sn"] == 3 :
        return VcmsAdminFunction().get_edit_company_branch_account(page_settings,int(parameter_dict.get("data_sn")))
    return ""
Пример #16
0
def vcms_upd_account_status(self,functions,actions,html_template,page_settings,parameter_dict) :
    return_data = {}
    if session["user_rank_sn"] == 3 :
        return_data = VcmsAdminFunction().set_company_account_status(page_settings,parameter_dict)
    return jsonify(return_data)
Пример #17
0
def vcms_check_sku(self,functions,actions,html_template,page_settings,parameter_dict) :
    service_sn = parameter_dict.get("service_sn")
    return_data = VcmsAdminFunction().get_product_by_sku(actions,service_sn)
    return jsonify(return_data)