Project

General

Profile

追加功能 #475

Updated by Zhongbao Ye 2 months ago

*Background* 
 # 上线前的清理工作,有时候一些Dirty Data会影响我们的测试结果。清理他们有时候会变得【很重要】。 

 *Task Details* 
 * 1. *清理数据库(比如: Order相关)* order id起始 = 100001 
 <pre> 
 -- Order 
   TRUNCATE TABLE ots_order; 
   TRUNCATE TABLE ots_order_favorite; 
   TRUNCATE TABLE ots_order_history; 
   TRUNCATE TABLE ots_order_product; 
   TRUNCATE TABLE ots_order_product_option; 
   TRUNCATE TABLE ots_order_product_file; 
   TRUNCATE TABLE ots_order_product_proof_image; 
   TRUNCATE TABLE ots_order_filter; 
   TRUNCATE TABLE ots_order_product_status_history; 

   ALTER TABLE ots_order eazy_9455order AUTO_INCREMENT = 100001; 

 -- Packing 
   TRUNCATE TABLE ots_shipping_packing_carton; 
   TRUNCATE TABLE ots_shipping_packing_carton_number; 
   TRUNCATE TABLE ots_shipping_packing_carton_product; 
   TRUNCATE TABLE ots_shipping_packing_carton_extra_product; ots_shipping_packing_carton_extra_product 
   TRUNCATE TABLE ots_shipping_packing_carton_label; 
   TRUNCATE TABLE ots_shipping_packing_carton_custom_declaration; 

   TRUNCATE TABLE ots_shipping_history; 
 </pre> 

 * 2. *清理文件(比如: Order Design files),    但是Proof images / 报关资料 需要备份* 
 <pre> 
   1. Design files:  
      移除目录:storage/upload/order 
   2. Proof files:  
      移除目录:storage/image/order 
      移除目录:storage/image/cache/order 
   3. Custom declaration files:  
      移除目录:storage/download/custom_declaration/{year} 
 </pre> 
 * 3. *导入v3 历史订单数据* 
 **  
 |_. No. |_. v4 fields                             |_. v3 fields |_. Note | 
 |\3=. *======================== v4.ots_order VS v3.t_order ========================*| | 
 | 1       | order_id                                | ca_index      id            | | 
 | 2       | order_name                              | order_name    | | 
 | 3       | urgency                                 | urgency       | | 
 | 4       | remake                                  | remake        | | 
 | 5       | is_retailer                             | is_retailer | | 
 | 6~8     | retailer_company_id                  
           retailer_abbreviation_name           
           retailer_company_name                   | 1. v3.retailer_id 对应的 company_abbreviation = RBSH 
                                                    v4.retailer_company_id = 1 
                                                    v4.retailer_abbreviation_name = 'RBSH'  
                                                    v4.retailer_company_name = 'Redblue' 
                                                   2. v3.retailer_id 对应的 company_abbreviation = EASY 
                                                    v4.retailer_company_id = 2 
                                                    v4.retailer_abbreviation_name = 'EASY'  
                                                    v4.retailer_company_name = 'EASY Online Stores AB' 
                                                   3. v3.retailer_id 对应的 company_abbreviation = ABLV 
                                                    v4.retailer_company_id = 3 
                                                    v4.retailer_abbreviation_name = 'ABLV'  
                                                    v4.retailer_company_name = 'Aust banners' 
                                                   4. v3.retailer_id 对应的 company_abbreviation = 其他内容,暂无对应关系 | | 
 | 9       | retailer_shipping_time                  | FROM_UNIXTIME(retailer_ship_time) | | 
 | 10~20 | retailer_shipping_address_id                  
           retailer_shipping_country_id                  
           retailer_shipping_zone_id                  
           retailer_shipping_city                  
           retailer_shipping_postcode                  
           retailer_shipping_address_1                  
           retailer_shipping_address_2                  
           retailer_shipping_recipient_name                  
           retailer_shipping_recipient_email                  
           retailer_shipping_recipient_telephone                  
           retailer_shipping_recipient_comment     |1. v3.retailer_ship_to = 1 (STO Office):  
                                                    v4.retailer_shipping_address_id = 151 
                                                    v4.retailer_shipping_country_id = 203 
                                                    v4.retailer_shipping_zone_id = 3088 
                                                    v4.retailer_shipping_city = 'Stockholm' 
                                                    v4.retailer_shipping_postcode = '113 50' 
                                                    v4.retailer_shipping_address_1 = 'Sveavägen 83' 
                                                    v4.retailer_shipping_address_2 = 
                                                    v4.retailer_shipping_recipient_name = 'Ivar Hassler' 
                                                    v4.retailer_shipping_recipient_email = 'logistics@easytryck.se' 
                                                    v4.retailer_shipping_recipient_telephone = '08 - 12 00 11 28' 
                                                    v4.retailer_shipping_recipient_comment = '' 
                                                   2. v3.retailer_ship_to = 2 (Same Retailer): 
                                                     v4.retailer_shipping_address_id = 0 
                                                     v4.retailer_shipping_country_id = 0 
                                                     v4.retailer_shipping_zone_id = 0 
                                                     v4.retailer_shipping_city = '' 
                                                     v4.retailer_shipping_postcode = '' 
                                                     v4.retailer_shipping_address_1 = '' 
                                                     v4.retailer_shipping_address_2 = '' 
                                                     v4.retailer_shipping_recipient_name = '' 
                                                     v4.retailer_shipping_recipient_email = '' 
                                                     v4.retailer_shipping_recipient_telephone = '' 
                                                     v4.retailer_shipping_recipient_comment = v3.retailer_ship_address 
                                                   3. v3.retailer_ship_to = 3 (Customer): 
                                                     同上(Same Retailer) | | 
 | 21       | customer_shipping_time                  | FROM_UNIXTIME(customer_ship_time) |    | 
 | 22       | customer_shipping_service               | CASE v3.customer_ship_to 
                                                    WHEN 10 THEN 1 
                                                    WHEN 11 THEN 10 
                                                    WHEN 12 THEN 11 
                                                    WHEN 13 THEN 12 
                                                    WHEN 14 THEN 13 
                                                    WHEN 15 THEN 14 
                                                    WHEN 60 THEN 15 
                                                    WHEN 70 THEN 16 
                                                    WHEN 99 THEN '' | 99 在v3中表示‘Other’, v4中没有对应的字段,暂时不做映射。| 
 | 23      | customer_shipping_country_id            |0                             |     |        
 | 24      |customer_shipping_zone_id                |0                             |     |   
 | 25      |customer_shipping_city                   |''                            |     | 
 | 26      |customer_shipping_postcode               |''                            |     |    
 | 27      |customer_shipping_address_1              |''                            |     |     
 | 28      |customer_shipping_address_2              |''                            |     |     
 | 29      |customer_shipping_recipient_name         |''                            |     |          
 | 30      |customer_shipping_recipient_email        |''                            |     |           
 | 31      |customer_shipping_recipient_telephone    |''                            |     |            
 | 32      |customer_shipping_recipient_comment      | customer_ship_address        |     | 
 | 33      | is_delete                               | is_delete                    |     | 
 | 34      | create_customer_id                      |                              1                            | 通过v3的o.retailer_id找v4中的用户,找不到设置为其领导 映射到v4的 admin 账户。 是否需要考虑原始作者要看到自己的订单? | 
 | 35      | update_customer_id                      |                              1                            | 通过v3的o.update_user找v4中的用户,找不到设置为其领导 映射到v4的 admin 账户。 是否需要考虑原始作者要看到自己的订单? | 
 | 36      | date_added                              | FROM_UNIXTIME(create_time) |      | 
 | 37      | date_modified                           | FROM_UNIXTIME(update_time) |      | 
 |\3=. *======================== v4.ots_order_product VS v3.t_order_product ========================*| | 
 | 1       | order_product_id                        | id | | 
 | 2       | order_id                                | order_id | | 
 | 3       | product_id                              | 0    | ? 是否可以考虑设置一个特殊的产品,标记v3 转移过来的产品,缺点:历史订单 order list上的产品名称都是一个 | 
 | 4       | model                                   | '' | | 
 | 5       | manufacturer_id                         | 0    | ? 是否考虑挂靠一个v4的 manufacturer_id | 
 | 6       | manufacturer_name                       | '' | | 
 | 7       | manufacturer_origin                     | '' | | 
 | 8       | extra_info                              | extra_info || **重点:**  
                                                  v4.extra_info = product_type + product_name + color + size + material + extra_info| v3产品与v4产品不兼容,将v3产品信息组装好,放到v4的extra info中| 
 | 9       | quantity                                | quantity | | 
 | 10      | unit_price                              | 0          | | 
 | 11      | total                                   | 0          | | 
 | 12      | weight                                  | 0          | | 
 | 13      | weight_class_id                         | 0          | | 
 | 14      | tax_class_id                            | 0          | | 
 | 15      | status                                  | status     | status=60:Ready for Shipment(v4:Packing), 这个状态需要考虑下,可能不能直接导过来,会影响packing列表的逻辑处理 | 
 | 16      | expected_finishing_time                 | FROM_UNIXTIME(expected_finishing_time) | | 
 | 17      | customer_shipper                        | CASE v3.customer_ship_type 
                                                   WHEN 10 THEN 1 
                                                   WHEN 11 THEN 10 
                                                   WHEN 12 THEN 11 
                                                   WHEN 13 THEN 12 
                                                   WHEN 14 THEN 13 
                                                   WHEN 15 THEN 14 
                                                   WHEN 60 THEN 15 
                                                   WHEN 70 THEN 16 
                                                   WHEN 99 THEN ''      | | 
 | 18       | customer_shipper_code                  | customer_ship_code | | 
 | 19       | brand                                  | '' | | 
 | 20       | declaration_required                   | 0    | | 
 | 21       | declaration_unit_price                 | '' | | 
 | 22       | declaration_g_w_g                      | '' | | 
 | 23       | declaration_w_v                        | '' | | 
 | 24       | declaration_product_unit               | '' | | 
 | 25       | declaration_cn_product_name            | '' | | 
 | 26       | declaration_en_product_name            | '' | | 
 | 27       | declaration_cn_hs_code                 | '' | | 
 | 28       | declaration_se_hs_code                 | '' | | 
 | 29       | declaration_base_info                  | 0    | | 
 | 30       | sales_info_incoterm                    | 0    | | 
 | 31       | sales_info_currency                    | 0    | | 
 | 32       | sales_info_real_unit_price             | '' | | 
 | 33       | sales_info_declare_unit_price          | '' | | 
 | 34       | manual_review                          | 0    | | 
 | 35       | manual_reviewed                        | 0    | | 
 | 36       | transferred                            | 0    | | 
 | 37       | key                                    | '' | | 
 | 38       | legacy_info                            |      | v4新增字段:v3产品与v4产品不兼容,使用一个字段:legacy_info,存json储序列化的 product信息,格式如下 
                                                         {"order_product_id":21763,"order_id":10274,"company_abbreviation":"EASY", 
                                                         "retailer_ship_type":"10","retailer_ship_code":"5813050272", 
                                                         "product_type":"Softwall","product_name":"Straight","product_color":"","product_size":"Softwall 600","product_material":""}| 
 | 39       | is_delete                              | is_delete | | 
 | 40 39       | create_customer_id                     |                              1                            | v3找v4中的用户,找不到设置为其领导 映射到v4的 admin 账户。 | 
 | 41 40       | update_customer_id                     |                              1                            | v3找v4中的用户,找不到设置为其领导 映射到v4的 admin 账户。 | 
 | 42 41       | date_added                             | FROM_UNIXTIME(create_time) | | 
 | 43 42       | date_modified                          | FROM_UNIXTIME(update_time) | | 
 |\3=. *======================== v4.ots_order_product_file VS v3.t_order_file ========================*| | 
 | 1        | order_product_file_id                  | id                           | | 
 | 2        | order_id                               | order_id                     | | 
 | 3        | order_product_id                       | order_product_id             | | 
 | 4        | original_name                          | file_original_name           | | 
 | 5        | save_path                              | file_save_path               | | 
 | 6        | is_delete                              | is_delete                    | | 
 | 7        | create_customer_id                     |                              1                            | v3找v4中的用户,找不到设置为其领导 映射到v4的 admin 账户。 | 
 | 8        | update_customer_id                     |                              1                            | v3找v4中的用户,找不到设置为其领导 映射到v4的 admin 账户。 | 
 | 9        | date_added                             | FROM_UNIXTIME(create_time) | | 
 | 10       | date_modified                          | FROM_UNIXTIME(update_time) | | 

 *v4 coding standard:* 
 # Git提交 
   #xxx(redmine number): xxx(redmine title) - xxx(任意:补充内容) 
    
 # 代码规范 
  2.1: 结构:Public -> Protected -> Private 
  2.2: 其他代码规范同SBX 
    
 # 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 
   
 # 前台代码 
   twig, js, css (js, css尽量写在单独的css文件中) 
     
 # 后台代码 
   MVCL    (L:en,cn) 
     
 # 注释 
 ## 类名: 
 <pre> 
 /** 
  * xxx 
  * 
  * @copyright RedBlue-OTS 2024 
  * @version v4 
  * 
  */ 
 </pre> 
 ## 函数名:参数类型 + 返回值类型 
 <pre> 
     /** 
      * xxx 
      * 
      * @param    xxx $xxx 
      * @param    xxx $xxx 
      * @return xxx 
      */ 
 </pre> 

 *Output* 
 * Report and Solution 

 *Others*

Back