diff --git a/main.go b/main.go index c3921bf..29b1100 100644 --- a/main.go +++ b/main.go @@ -3622,7 +3622,7 @@ func GenerateInstrumentPDF(fullData []byte, resp []Tool_warning) (filename strin pdf.SetTextColor(0, 0, 0) pdf.SetX(margin) pdf.SetY(y) - pdf.Cell(nil, fmt.Sprintf("井号:%s\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t报告时间:%s", wellName, reportTime)) + pdf.Cell(nil, fmt.Sprintf("井号:%s\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t报告时间:%s", wellName, reportTime)) y += lineHeight * 1.2 pdf.Line(margin, y, gopdf.PageSizeA4.W-margin, y) y += 10 @@ -3688,7 +3688,7 @@ func GenerateInstrumentPDF(fullData []byte, resp []Tool_warning) (filename strin }{ {"出厂日期:", formattedTime}, {"入库日期:", ""}, - {"当前工作时间:", inst.WorkTime + "小时"}, + {"当次累计工作时间:", inst.WorkTime + "小时"}, {"累计工作时间:", inst.WorkTimes + "小时"}, {"所属部门:", inst.Dept}, {"固件版本号:", inst.Version}, @@ -5361,7 +5361,7 @@ func get_tool_warning_info(user string, wellname string) (resp []Tool_warning) { logs.Info("Connecting Error", err.Error()) } defer conn.Close() - sel_sql := fmt.Sprintf(`select DISTINCT [2327], [2328] from REPAIRANDMENT where [2321] = '%s' AND [2327] IS NOT NULL`, wellname) + sel_sql := fmt.Sprintf(`select DISTINCT [2327], [2328] from REPAIRANDMENT where [2327] IS NOT NULL`) logs.Info("第一个查询:获取仪器组合--------", sel_sql) fmt.Println("第一个查询:获取仪器组合--------", sel_sql) rows, err := conn.Query(sel_sql) @@ -29265,6 +29265,7 @@ func getWellHistory_en(response http.ResponseWriter, request *http.Request) { fmt.Fprintf(response, string(jdata)) return } + fmt.Println() // 这些库被设置为了离线状态,需要先设置为启用状态 if strings.HasPrefix(db, "LH2020-") || strings.HasPrefix(db, "LH2021-") || @@ -29328,7 +29329,7 @@ func getWellHistory_en(response http.ResponseWriter, request *http.Request) { cnt = req.Count } - selSql = fmt.Sprintf("select distinct top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from ( select distinct top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from DECODETABLE ", cnt, req.Index*req.Count) + selSql = fmt.Sprintf("select top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from ( select top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from DECODETABLE ", cnt, req.Index*req.Count) selSql += whereSql ascSql := " order by [4304] asc" @@ -29460,6 +29461,7 @@ func getWellHistory(response http.ResponseWriter, request *http.Request) { fmt.Fprintf(response, string(jdata)) return } + logs.Info("getWellHistory db:", db) // 这些库被设置为了离线状态,需要先设置为启用状态 if strings.HasPrefix(db, "LH2020-") || strings.HasPrefix(db, "LH2021-") || @@ -29530,7 +29532,7 @@ func getWellHistory(response http.ResponseWriter, request *http.Request) { cnt = req.Count } - selSql = fmt.Sprintf("select distinct top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from ( select distinct top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from DECODETABLE ", cnt, req.Index*req.Count) + selSql = fmt.Sprintf("select top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from ( select top %v [4301],[4303],[4304],[4305],[4306],[4307],[4311] from DECODETABLE ", cnt, req.Index*req.Count) selSql += whereSql ascSql := " order by [4304] asc" @@ -29543,6 +29545,7 @@ func getWellHistory(response http.ResponseWriter, request *http.Request) { } fmt.Println("getWellHistory sql:", selSql) + logs.Info("getWellHistory sql:", selSql) row, err := conn.Query(selSql) if err != nil { logs.Info("Query Error", err.Error()) @@ -30163,6 +30166,7 @@ func workMess(wellInfos []get_vibration_resp, flag string, content string) []Wel func getMaintenanceMess(series string, instrument string, opuser string) []GetLcmRespData { logs.Info("维保情况开始------------------------------------") + fmt.Println("维保情况开始------------------------------------") var result []GetLcmRespData ps_info := get_ps_info(opuser) @@ -30210,6 +30214,7 @@ func getMaintenanceMess(series string, instrument string, opuser string) []GetLc var d GetLcmRespData if err = rows.Scan(&d.ID, &d.Series, &d.InstrumentID, &d.Repair_cnt, &d.Repair_level, &d.Note, &d.Time, &d.Applicanter); err != nil { logs.Error("getLcm scan Error", err.Error()) + fmt.Println("getLcm scan Error", err.Error()) continue } @@ -30288,7 +30293,6 @@ func getMaintenanceMess(series string, instrument string, opuser string) []GetLc d.Link = link result = append(result, d) } - logs.Info("维保情况结束------------------------------------") return result } @@ -30558,6 +30562,7 @@ func getQualityData(response http.ResponseWriter, request *http.Request) { WHERE well_name = '%s' AND series = '%s' AND instrument = '%s'`, req.WellName, req.Series, req.Instrument) var resp QualityDataResp + fmt.Println("getQualityData-querySQL----", querySQL) err = sqlConn.QueryRow(querySQL).Scan( &resp.ProcessRecord, &resp.ProcessInspection,