Project

General

Profile

追加功能 #464

v4.0: Customer

Added by Junyi Zhang 10 months ago. Updated 8 months ago.

Status:
已关闭
Priority:
普通
Assignee:
Target version:
IT: Easytryck (Sweden) - v4.0
Start date:
03/07/2025
Due date:
03/28/2025
% Done:

100%

Estimated time:
100.00 h

Description

Background
  1. New requirement for v4.0 OTS
    See: OneDrive\赤蓝商贸(上海)有限公司\Shanghai Group - IT\开发相关\OTS V4\开发需求
Task Details
  1. Admin/Front: 用户模块.
  2. Front: Login,区分V3/V4的用户登录。
v4 coding standard:
  1. Git提交
    #xxx(redmine number): xxx(redmine title) - xxx(任意:补充内容)
      
  2. 代码规范
    2.1: 结构:Public -> Protected -> Private
    2.2: 其他代码规范同SBX
      
  3. MVCL的v3/v4物理分割
    3.1: v3/v4的代码分为两个文件,比如: order.php, order_v3.php
    3.2: system也分为两个文件,暂时只有一个user_v3
    - Note: front的$this->user在v4中会替换为$this->customer, 即v4中需要清除$this->user
    3.3: 代码中,区分v3/v4的调用,比如:new User_V3
     
  4. 前台代码
    twig, js, css (js, css尽量写在单独的css文件中)
     
  5. 后台代码
    MVCL (L:en,cn)
     
  6. 注释
    1. 类名:
      /**
       * xxx
       *
       * @copyright RedBlue-OTS 2024
       * @version v4
       *
       */
      
    2. 函数名:参数类型 + 返回值类型
          /**
           * xxx
           *
           * @param  xxx $xxx
           * @param  xxx $xxx
           * @return xxx
           */
      
Output
  • Report and Solution

Others

#1

Updated by Junyi Zhang 9 months ago

Output (2025/04/15 - 2025/04/17), (2025/04/07 - 2025/04/11), (2025/03/24 - 2025/04/03) (2025/03/17 - 2025/03/21),(2025/03/10 - 2025/3/14)

  1. 权限相关参考excel:onedrive 赤蓝商贸(上海)有限公司\Shanghai Group - 文档\IT\开发相关\OTS V4\开发需求\用户管理模块
  2. 数据库参考#440
  3. 创建初始数据的步骤:
    1. sql导入,生成第一个公司和用户
      1. Company: A/R/D = Redblue
      2. User: AA = Admin
        TRUNCATE TABLE `ots_customer`;
        INSERT INTO `ots_customer` (`customer_id`, `customer_company_id`, `firstname`, `lastname`, `abbreviation_name`, `email`, `telephone`, `username`, `password`, `status`, `is_delete`, `date_added`, `date_modified`) VALUES
            (1, 1, 'admin', 'admin', 'admin', 'info@redbluetrading.com', '', 'admin', '$2y$10$zm8clFn3EqbzKUt4lnHbLuWiL48WtBO.Q/SJCRWATiSVr2G39OQn.', 1, 0, '2025-03-19 16:21:02', '2025-03-26 12:24:52');
        
        TRUNCATE TABLE `ots_customer_company`;
        INSERT INTO `ots_customer_company` (`customer_company_id`, `create_customer_id`, `name`, `abbreviation_name`, `manufacturer_origin`, `manufacturer_rank`, `manager_firstname`, `manager_lastname`, `manager_email`, `telephone`, `vat`, `bank_name`, `bank_account`, `se_info`, `moq_check`, `status`, `is_delete`, `date_added`, `date_modified`) VALUES
            (1, 1, 'Redblue', 'RBSH', '', '', 'Daping', 'Huang', 'daping@redbluetrading.com', '', '', '', '', 1, 0, 1, 0, '2025-03-25 14:58:09', '2025-03-26 12:26:45');
        
        TRUNCATE TABLE `ots_customer_company_address`;
        INSERT INTO `ots_customer_company_address` (`customer_company_address_id`, `customer_company_id`, `recipient_name`, `recipient_email`, `recipient_telephone`, `country_id`, `zone_id`, `city`, `postcode`, `address_1`, `address_2`, `default`, `shipping_address`, `invoice_address`) VALUES
            (1, 1, 'Daping', 'daping@redbluetrading.com', 'Huang', 44, 708, '上海', '201615', '4th Floor, Building F', 'No.858 Jiujing Road', 1, 0, 1),
            (2, 1, 'Daping', 'daping@redbluetrading.com', 'Huang', 44, 708, '上海', '201615', '4th Floor, Building F', 'No.858 Jiujing Road', 1, 1, 0);
        
        TRUNCATE TABLE `ots_customer_company_role`;
        INSERT INTO `ots_customer_company_role` (`customer_id`, `customer_company_id`, `customer_role_id`) VALUES
            (1, 1, 1);
        
        TRUNCATE TABLE `ots_customer_company_to_role_group`;
        INSERT INTO `ots_customer_company_to_role_group` (`customer_company_id`, `customer_company_role_group_id`) VALUES
            (1, 1),
             (1, 2),
             (1, 3);
        
        TRUNCATE TABLE `ots_product_to_customer`;
        
    2. 手动添加并测试:(Note: 无需新增其他的测试数据)
      1. Company:
        - R = EasyTryck, Aust_banner D = Redblue 2 (地址:比如北京)
      2. User:
        - AA (Redblue) = hdp, van,bruce,niko
        - RM (Redblue) = LEE,RM (EasyTryck) = Rickard, RM (Aust_banner) = Lake
        - RS (Redblue) = LAKE,RS (EasyTryck) = OskarJ
        - RL (Redblue) = LAKE,RL (EasyTryck) = Jesper
        - RG (Redblue) = MEI
        - DM (Redblue) = Tom
        - DO (Redblue) = Nash
        - DL (Redblue) = Jennify
    3. sql导入:manufacturer(create_customer_id = 1 (step1生成的用户id))
      -- Insert customer company
      INSERT INTO ots_customer_company (
          customer_company_id, 
          create_customer_id,
          `name`,
          abbreviation_name,
          manufacturer_origin,
          manufacturer_rank,
          manager_firstname,
          manager_lastname, 
          manager_email,    
          telephone,        
          vat,              
          bank_name,        
          bank_account,     
          se_info,          
          moq_check,        
          `status`,
          is_delete,   
          date_added,  
          date_modified
      )
      SELECT
          manufacturer_id,
          1,   -- create customer id: admin: 1     
          `name`,
          LPAD(manufacturer_id, 4, '0') AS abbreviation_name,
          origin AS manufacturer_origin,
          '' AS manufacturer_rank,
          '' AS manager_firstname,
          '' AS manager_lastname,
          '' AS manager_email,     
          '' AS telephone,         
          '' AS vat,               
          '' AS bank_name,         
          '' AS bank_account,      
          0 AS se_info,            
          0 AS moq_check,          
          `status`,
          0 AS is_delete,
          NOW() AS date_added,
          NOW() AS date_modified
      FROM ots_manufacturer;
      
      -- Insert shipping/invoice address
      INSERT INTO ots_customer_company_address (
          customer_company_id,
          recipient_name,
          recipient_email,
          recipient_telephone,
          country_id,
          zone_id,
          city,
          postcode,
          address_1,
          address_2,
          `default`,
          shipping_address,
          invoice_address
      )
      SELECT
          manufacturer_id,
          '' AS recipient_name,
          '' AS recipient_email,
          '' AS recipient_telephone,
          country_id,
          zone_id,
          city,
          '' AS postcode,
          address_1,
          address_2,
          1 AS `default`,
          0 AS shipping_address,
          1 AS invoice_address
      FROM ots_manufacturer 
      
      UNION ALL
      
      SELECT
          manufacturer_id,
          '' AS recipient_name,       
          '' AS recipient_email,      
          '' AS recipient_telephone,  
          country_id,
          zone_id,
          city,
          '' AS postcode,             
          address_1,
          address_2,
          1 AS `default`,
          1 AS shipping_address,     
          0 AS invoice_address
      FROM ots_manufacturer;
      
      -- Insert company role group
      INSERT INTO ots_customer_company_to_role_group (
          customer_company_id, 
          customer_company_role_group_id
      )
      SELECT
          manufacturer_id,
          4 AS customer_company_role_group_id  -- Manufacturer
      FROM ots_manufacturer;
      

TODO: 剩余TODO已移到 #453

#2

Updated by Junyi Zhang 9 months ago

  • Description updated (diff)
#3

Updated by Junyi Zhang 9 months ago

  • Description updated (diff)
#4

Updated by Xihua Fan 9 months ago

  • Due date changed from 03/31/2025 to 03/28/2025
#5

Updated by Junyi Zhang 9 months ago

  • % Done changed from 0 to 30
#6

Updated by Junyi Zhang 9 months ago

  • % Done changed from 30 to 50
#7

Updated by Junyi Zhang 8 months ago

  • Status changed from 进行中 to 已关闭
  • % Done changed from 50 to 100

Also available in: Atom PDF