Sanjel-Energy-Services / eService_WorkItems

0 stars 0 forks source link

eService Online - Standardize MTS download name #192

Open JasonSchneider19 opened 2 months ago

JasonSchneider19 commented 2 months ago

The name of the current eService Online MTS when printed is a generic printproducthaulpdf.pdf. We want to have a proper name for it just like the MTS printed in BPAVS today.

Current MTS printed by BPAVS Example: CSH_1113461_Petronas Energy Canada Ltd._b-H78-E_94-A-13_PD 462_ECOprime + Additives_MTS-1113456-56254-C1_2024_04_10_08.38.07.pdf

Proposed new format: [Client Short Name][Well Downhole Location][Rig Name][Base Blend Name][MTS Number]_[TimeStamp of Printing]

Example: Petronas_b-H78-E_94-A-13_PD 462_ECOprime _MTS-56254-L1-1113456_2024_04_10_08.38.07.pdf

There are couple exceptions in MTS numbering and print may need to be fixed.

  1. If the product haul is scheduled from a program without call sheet number. The program number is missing from the MTS file name. e.g. MTS-53567-L1-0000000 We can use program number instead of 0s in the MTS number. E.g. MTS-53567-L1-PRG2400565.00. In this case, all information will be taken from the program for download file naming. Petronas_Surface(b-H78-E)_PD 462_ECOprime _MTS-56254-L1- PRG2400565.00_2024_04_10_08.38.07.pdf

  2. For backhaul and transfer, we may have less information. BackHaul’s MTS name can be PD462 GPBP ECOprime _MTS-56254-L1- 0000000_2024_04_10_08.38.07.pdf Transfer’s MTS name can be PD510 PD462 GPBP ECOprime _MTS-56254-L1- 0000000_2024_04_10_08.38.07.pdf

  3. Backhual and Transfer MTS are not printable currently. We will need to add Print MTS menu on Rig Bin column.

awangatsanjel commented 2 months ago

Architect Notes:

In this requirement, it actually has 4 functions related.

  1. Fix MTS serail number for product haul from program. The exception 1.
  2. Fix the MTS pdf file naming (regular haul and back haul/transfer) and use it as download name in the return. Main requirement and the exception 2.
  3. Add Print MTS menu to Rig Bin column. The exception 3.
wistaria623 commented 2 months ago
  1. MTS serail number for product haul from program the format is: [MTS Number] = MTS-53567-L1-[ProgramNumber.Ver].

  2. MTS Print pdf file name fomat

    • the format is: [Client Short Name][Well Downhole Location][Rig Name][Base Blend Name][MTS Number][TimeStamp of Printing]_ Petronas_Surface(b-H78-E)_PD 462_ECOprime _MTS-56254-L1- 1113456_2024_04_10_08.38.07.pdf Petronas_Surface(b-H78-E)_PD 462_ECOprime _MTS-56254-L1- PRG2400565.00_2024_04_10_08.38.07.pdf

    • Back Haul(from rig bin to bulkplant,from rig bin to rig bin) ,the format is: [From Rig Name][To Rig Name/BulkPlant][Base Blend Name][MTS Number][TimeStamp of Printing]_ PD_510_PD462 ECOprime _MTS-56254-L1- 0000000_2024_04_10_08.38.07.pdf

  1. Add Print MTS menu to Rig Bin column.
    • With a product available, the print MTS menu is enabled
tobeytong commented 2 months ago

@wistaria623 @awangatsanjel

Baytex_104/01-33-031-24W3/00_Savanna 425_PRODUCTIONmix LW + Additives_MTS-48145-L1-1110726_2024_04_26_10_46_16.pdf

在进行数据测试的时候,我发现Well Downhole Location中有部分数据带斜杠,这样会导致无法保存

目前我将file name中进行了替换,斜杠反斜杠都替换为下划线,不知道这样是否可以?

awangatsanjel commented 2 months ago

@tobeytong 可以

tobeytong commented 2 months ago

我重新检查了一遍,为了防止出现非法字符 我把系统不许可使用的字符都全部替换了,替换方法如下,如果替换有不合适的地方,请告知如何替换 fileName = fileName.Replace("\", "").Replace("/", "").Replace("*", "").Replace("?", "").Replace(":", "").Replace("<", "").Replace(">", "").Replace("|", "");

另外,系统之前是先将PDF生成后,然后在页面加载,但是这样另存时,文件名都是一个

Image

所以我进行了修改,点击PrintMTS后,服务器生成文件,然后直接下载到用户电脑里,这样做是否可行?

Image

Image

awangatsanjel commented 2 months ago

@tobeytong return File function has the third parameter "downloadFileName"

wanghuan69 commented 1 month ago

开发分支验证通过