修改提出的问题

This commit is contained in:
lupeng 2025-08-19 16:24:53 +08:00
parent 2a0437402d
commit 0e085f0db6
1 changed files with 11 additions and 6 deletions

17
main.go
View File

@ -3622,7 +3622,7 @@ func GenerateInstrumentPDF(fullData []byte, resp []Tool_warning) (filename strin
pdf.SetTextColor(0, 0, 0) pdf.SetTextColor(0, 0, 0)
pdf.SetX(margin) pdf.SetX(margin)
pdf.SetY(y) 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 y += lineHeight * 1.2
pdf.Line(margin, y, gopdf.PageSizeA4.W-margin, y) pdf.Line(margin, y, gopdf.PageSizeA4.W-margin, y)
y += 10 y += 10
@ -3688,7 +3688,7 @@ func GenerateInstrumentPDF(fullData []byte, resp []Tool_warning) (filename strin
}{ }{
{"出厂日期:", formattedTime}, {"出厂日期:", formattedTime},
{"入库日期:", ""}, {"入库日期:", ""},
{"当工作时间:", inst.WorkTime + "小时"}, {"当次累计工作时间:", inst.WorkTime + "小时"},
{"累计工作时间:", inst.WorkTimes + "小时"}, {"累计工作时间:", inst.WorkTimes + "小时"},
{"所属部门:", inst.Dept}, {"所属部门:", inst.Dept},
{"固件版本号:", inst.Version}, {"固件版本号:", inst.Version},
@ -5361,7 +5361,7 @@ func get_tool_warning_info(user string, wellname string) (resp []Tool_warning) {
logs.Info("Connecting Error", err.Error()) logs.Info("Connecting Error", err.Error())
} }
defer conn.Close() 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) logs.Info("第一个查询:获取仪器组合--------", sel_sql)
fmt.Println("第一个查询:获取仪器组合--------", sel_sql) fmt.Println("第一个查询:获取仪器组合--------", sel_sql)
rows, err := conn.Query(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)) fmt.Fprintf(response, string(jdata))
return return
} }
fmt.Println()
// 这些库被设置为了离线状态,需要先设置为启用状态 // 这些库被设置为了离线状态,需要先设置为启用状态
if strings.HasPrefix(db, "LH2020-") || if strings.HasPrefix(db, "LH2020-") ||
strings.HasPrefix(db, "LH2021-") || strings.HasPrefix(db, "LH2021-") ||
@ -29328,7 +29329,7 @@ func getWellHistory_en(response http.ResponseWriter, request *http.Request) {
cnt = req.Count 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 selSql += whereSql
ascSql := " order by [4304] asc" ascSql := " order by [4304] asc"
@ -29460,6 +29461,7 @@ func getWellHistory(response http.ResponseWriter, request *http.Request) {
fmt.Fprintf(response, string(jdata)) fmt.Fprintf(response, string(jdata))
return return
} }
logs.Info("getWellHistory db:", db)
// 这些库被设置为了离线状态,需要先设置为启用状态 // 这些库被设置为了离线状态,需要先设置为启用状态
if strings.HasPrefix(db, "LH2020-") || if strings.HasPrefix(db, "LH2020-") ||
strings.HasPrefix(db, "LH2021-") || strings.HasPrefix(db, "LH2021-") ||
@ -29530,7 +29532,7 @@ func getWellHistory(response http.ResponseWriter, request *http.Request) {
cnt = req.Count 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 selSql += whereSql
ascSql := " order by [4304] asc" ascSql := " order by [4304] asc"
@ -29543,6 +29545,7 @@ func getWellHistory(response http.ResponseWriter, request *http.Request) {
} }
fmt.Println("getWellHistory sql:", selSql) fmt.Println("getWellHistory sql:", selSql)
logs.Info("getWellHistory sql:", selSql)
row, err := conn.Query(selSql) row, err := conn.Query(selSql)
if err != nil { if err != nil {
logs.Info("Query Error", err.Error()) 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 { func getMaintenanceMess(series string, instrument string, opuser string) []GetLcmRespData {
logs.Info("维保情况开始------------------------------------") logs.Info("维保情况开始------------------------------------")
fmt.Println("维保情况开始------------------------------------")
var result []GetLcmRespData var result []GetLcmRespData
ps_info := get_ps_info(opuser) ps_info := get_ps_info(opuser)
@ -30210,6 +30214,7 @@ func getMaintenanceMess(series string, instrument string, opuser string) []GetLc
var d GetLcmRespData 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 { 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()) logs.Error("getLcm scan Error", err.Error())
fmt.Println("getLcm scan Error", err.Error())
continue continue
} }
@ -30288,7 +30293,6 @@ func getMaintenanceMess(series string, instrument string, opuser string) []GetLc
d.Link = link d.Link = link
result = append(result, d) result = append(result, d)
} }
logs.Info("维保情况结束------------------------------------")
return result return result
} }
@ -30558,6 +30562,7 @@ func getQualityData(response http.ResponseWriter, request *http.Request) {
WHERE well_name = '%s' AND series = '%s' AND instrument = '%s'`, WHERE well_name = '%s' AND series = '%s' AND instrument = '%s'`,
req.WellName, req.Series, req.Instrument) req.WellName, req.Series, req.Instrument)
var resp QualityDataResp var resp QualityDataResp
fmt.Println("getQualityData-querySQL----", querySQL)
err = sqlConn.QueryRow(querySQL).Scan( err = sqlConn.QueryRow(querySQL).Scan(
&resp.ProcessRecord, &resp.ProcessRecord,
&resp.ProcessInspection, &resp.ProcessInspection,