Show last_ack time in report tables
This commit is contained in:
parent
5ab24de4e8
commit
3191c4a95f
19
ews/ews.go
19
ews/ews.go
@ -766,7 +766,7 @@ func (e *EWS) GetIssueReport(cfg cnf.Cfg, logger *log.Logger, host string, addr
|
||||
ri := new(ReportInfo)
|
||||
defect := ""
|
||||
rows, err := dbo.Query(fmt.Sprintf(
|
||||
`SELECT usn,partno,sku,mo,line,location,ipaddr,relay,item,status,message,last_change,diffmins
|
||||
`SELECT usn,partno,sku,mo,line,location,ipaddr,relay,item,status,message,last_change,last_ack,diffmins
|
||||
FROM %s;`, cfg.MySQL.IssuesView))
|
||||
if err != nil {
|
||||
logger.Printf("[ERR] %s; %s; %#v; %s\r\n", addr, uri, params, err.Error())
|
||||
@ -791,13 +791,14 @@ func (e *EWS) GetIssueReport(cfg cnf.Cfg, logger *log.Logger, host string, addr
|
||||
&ri.Status,
|
||||
&ri.Message,
|
||||
&ri.LastChg,
|
||||
&ri.LastAck,
|
||||
&ri.DiffMins,
|
||||
)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
temp := fmt.Sprintf(`<tr><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>%s`,
|
||||
num, ri.USN, ri.PartNO, ri.MfgSKU, ri.MfgMO, ri.Line, ri.Location, ri.IPAddr, ri.Relay, ri.Item, ri.Status, ri.Message, ri.LastChg, ri.DiffMins, "\r\n")
|
||||
temp := fmt.Sprintf(`<tr><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>%s`,
|
||||
num, ri.USN, ri.PartNO, ri.MfgSKU, ri.MfgMO, ri.Line, ri.Location, ri.IPAddr, ri.Relay, ri.Item, ri.Status, ri.Message, ri.LastChg, ri.LastAck, ri.DiffMins, "\r\n")
|
||||
defect = defect + temp
|
||||
num += 1
|
||||
}
|
||||
@ -836,7 +837,7 @@ func (e *EWS) GetOfflineReport(cfg cnf.Cfg, logger *log.Logger, host string, add
|
||||
ri := new(ReportInfo)
|
||||
offline := ""
|
||||
rows, err := dbo.Query(fmt.Sprintf(
|
||||
`SELECT usn,partno,sku,mo,line,location,ipaddr,relay,item,status,message,last_change,diffmins
|
||||
`SELECT usn,partno,sku,mo,line,location,ipaddr,relay,item,status,message,last_change,last_ack,diffmins
|
||||
FROM %s;`, cfg.MySQL.OfflineView))
|
||||
if err != nil {
|
||||
logger.Printf("[ERR] %s; %s; %#v; %s\r\n", addr, uri, params, err.Error())
|
||||
@ -861,13 +862,14 @@ func (e *EWS) GetOfflineReport(cfg cnf.Cfg, logger *log.Logger, host string, add
|
||||
&ri.Status,
|
||||
&ri.Message,
|
||||
&ri.LastChg,
|
||||
&ri.LastAck,
|
||||
&ri.DiffMins,
|
||||
)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
temp := fmt.Sprintf(`<tr><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>%s`,
|
||||
num, ri.USN, ri.PartNO, ri.MfgSKU, ri.MfgMO, ri.Line, ri.Location, ri.IPAddr, ri.Relay, ri.Item, ri.Status, ri.Message, ri.LastChg, ri.DiffMins, "\r\n")
|
||||
temp := fmt.Sprintf(`<tr><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>%s`,
|
||||
num, ri.USN, ri.PartNO, ri.MfgSKU, ri.MfgMO, ri.Line, ri.Location, ri.IPAddr, ri.Relay, ri.Item, ri.Status, ri.Message, ri.LastChg, ri.LastAck, ri.DiffMins, "\r\n")
|
||||
offline = offline + temp
|
||||
num += 1
|
||||
}
|
||||
@ -950,7 +952,7 @@ func (e *EWS) TemplateUutInfo(loc, locTime, misc, last, bkup string) string {
|
||||
<table>
|
||||
<tr>
|
||||
<th>Model</th>
|
||||
<th>Part NO.</th>
|
||||
<th>Project Code</th>
|
||||
<th>SKU</th>
|
||||
<th>MO</th>
|
||||
<th>First Ack</th>
|
||||
@ -1030,7 +1032,7 @@ func (e *EWS) TemplateReportInfo(src string) string {
|
||||
<tr>
|
||||
<th>NO.</th>
|
||||
<th>USN</th>
|
||||
<th>PartNO.</th>
|
||||
<th>Project Code</th>
|
||||
<th>SKU</th>
|
||||
<th>MO</th>
|
||||
<th>Line</th>
|
||||
@ -1041,6 +1043,7 @@ func (e *EWS) TemplateReportInfo(src string) string {
|
||||
<th>Status</th>
|
||||
<th>Message</th>
|
||||
<th>Last Change</th>
|
||||
<th>Last Ack</th>
|
||||
<th>Differ Mins</th>
|
||||
</tr>
|
||||
%s
|
||||
|
Loading…
x
Reference in New Issue
Block a user