Project

General

Profile

追加功能 #471

Updated by Zhongbao Ye 6 months ago

*Background* 
 # New requirement for v4.0 OTS 
   See: OneDrive\赤蓝商贸(上海)有限公司\Shanghai Group - IT\开发相关\OTS V4\开发需求 

 *Task List* 
 # Upload/Download/Remove/Preview attach files. 
   a) 使用Dropzone 
   b) 逻辑删除 is_delete 
   c) Preview图片/pdf, zip压缩可能不需要(需要到时候商量) 
   d) 保存订单时遇到超大文件上传,如何确保数据的完整性? 
   - 文件上传时,order的save按钮被Disabled,只有上传完成后,才能Enabled 
   e) 显示文件名要不要做转换? 
   - 不转换 文件名要不要做转换? 
   f) 临时文件存储路径:  
   New order: storage/upload/order/{current_year}/temp/customer_{customer_id}/ 文件存储路径: storage/upload/{current_year}/order/order_id/ 
   Edit order: storage/upload/order/{current_year}/temp/order_{order_id}/ 
   g) 最终文件存储路径 
   storage/upload/order/{current_year}/order_{order_id}/ 
 # Upload/Download/Preview product proof images. 
   a) 图片需要压缩(gd),动态匹配如下几种尺寸,且最多3件 
   - '1:1' => [1000, 1000] 
   - '4:3' => [1000, 750] 
   - '3:4' => [750, 1000] 
   - '16:9' => [1280, 720] 
   - '9:16' => [720, 1280] 
   - '20:9' => [2400, 1080] 
   - '9:20' => [1080, 2400] 图片需要压缩(gd)后存储,照片也可以?最多3件 
   b) 物理删除 (感觉不需要恢复机制) 
   c) proof images 和attach files共通处理?只是支持文件Preview种类的不同? 
   e) 显示文件名要不要做转换? 
   - 转换,格式{file_index}-{order_id}-{order_product_id}-{original_name} 文件名直接转换 
   f) 临时文件存储路径: 
   Added order: storage/image/cache/order/{current_year}/temp/customer_{customer_id}/ 
   Edit order: storage/image/cache/order/{current_year}/temp/order_{order_id}/ 
   g) 最终文件存储路径 
   storage/image/cache/order/{current_year}/order_{order_id}/ 文件存储路径: storage/upload/{current_year}/order/order_id/ 

 *Questions:* 

 *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