Create function check status for other system
This commit is contained in:
		
							parent
							
								
									06bf78e68a
								
							
						
					
					
						commit
						e7efbdcfdc
					
				| 
						 | 
					@ -1014,26 +1014,30 @@ const checkMultipleRequest = async () => {
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await Promise.all(promises);
 | 
					    await Promise.all(promises);
 | 
				
			||||||
    let listShipping = report.filter((i)=>i.group==="Shipping System").sort((a, b) => a.group.localeCompare(b.group))
 | 
					    let listShipping = report
 | 
				
			||||||
    report = report.filter((i)=>i.group!=="Shipping System").concat(listShipping).sort((a, b) => a.group.localeCompare(b.group))
 | 
					      .filter((i) => i.group === "Shipping System")
 | 
				
			||||||
 | 
					      .sort((a, b) => a.group.localeCompare(b.group));
 | 
				
			||||||
 | 
					    report = report
 | 
				
			||||||
 | 
					      .filter((i) => i.group !== "Shipping System")
 | 
				
			||||||
 | 
					      .concat(listShipping)
 | 
				
			||||||
 | 
					      .sort((a, b) => a.group.localeCompare(b.group));
 | 
				
			||||||
    let groupName = report?.sort((a, b) => a.group.localeCompare(b.group))[0]
 | 
					    let groupName = report?.sort((a, b) => a.group.localeCompare(b.group))[0]
 | 
				
			||||||
      ?.group;
 | 
					      ?.group;
 | 
				
			||||||
    let no = 0;
 | 
					    let no = 0;
 | 
				
			||||||
    content += "||**" + groupName + "**|||\n";
 | 
					    content += "||**" + groupName + "**|||\n";
 | 
				
			||||||
    report
 | 
					    report?.map((u, index) => {
 | 
				
			||||||
      ?.map((u, index) => {
 | 
					      no += 1;
 | 
				
			||||||
        no += 1;
 | 
					      if (u.group === groupName) {
 | 
				
			||||||
        if (u.group === groupName) {
 | 
					        content +=
 | 
				
			||||||
          content +=
 | 
					          "|" + no + "|" + u.name + "|**" + time + "**|" + u.status + "|\n";
 | 
				
			||||||
            "|" + no + "|" + u.name + "|**" + time + "**|" + u.status + "|\n";
 | 
					      } else {
 | 
				
			||||||
        } else {
 | 
					        no = 1;
 | 
				
			||||||
          no = 1;
 | 
					        groupName = u.group;
 | 
				
			||||||
          groupName = u.group;
 | 
					        content += "||**" + groupName + "**|||\n";
 | 
				
			||||||
          content += "||**" + groupName + "**|||\n";
 | 
					        content +=
 | 
				
			||||||
          content +=
 | 
					          "|" + no + "|" + u.name + "|**" + time + "**|" + u.status + "|\n";
 | 
				
			||||||
            "|" + no + "|" + u.name + "|**" + time + "**|" + u.status + "|\n";
 | 
					      }
 | 
				
			||||||
        }
 | 
					    });
 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let params = {
 | 
					    let params = {
 | 
				
			||||||
      type: "stream",
 | 
					      type: "stream",
 | 
				
			||||||
| 
						 | 
					@ -1051,7 +1055,7 @@ const checkMultipleRequest = async () => {
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    client.messages.send(params);
 | 
					    client.messages.send(params);
 | 
				
			||||||
    // client.messages.send(params1);
 | 
					    client.messages.send(params1);
 | 
				
			||||||
    allResponse += report
 | 
					    allResponse += report
 | 
				
			||||||
      .sort((a, b) => a.group.localeCompare(b.group))
 | 
					      .sort((a, b) => a.group.localeCompare(b.group))
 | 
				
			||||||
      .join("\n");
 | 
					      .join("\n");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue