|
|
@@ -2,7 +2,9 @@ package lims
|
|
|
|
|
|
import (
|
|
|
"dashoo.cn/backend/api/business/devicestatistics"
|
|
|
+ "dashoo.cn/backend/api/business/organize"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
+ "dashoo.cn/business2/permission"
|
|
|
"dashoo.cn/utils"
|
|
|
"fmt"
|
|
|
"strconv"
|
|
|
@@ -20,179 +22,229 @@ type DeviceStatisticsController struct {
|
|
|
// @Success 200 {object}
|
|
|
// @router /list [get]
|
|
|
func (this *DeviceStatisticsController) GetEntityList() {
|
|
|
+
|
|
|
+ svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
+ isauth := svcPerm.IsAuthorized(this.User.Id, "Administrator")
|
|
|
+ organizeSvc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ thrunitId := organizeSvc.GetMyThrUnitDepartmentId(this.User.DepartmentId)
|
|
|
+
|
|
|
var devicelist []devicestatistics.DeviceStatistics
|
|
|
svc := devicestatistics.GetDeviceStatisticsService(utils.DBE)
|
|
|
- fromdate := GetFirstDateOfMonth(time.Now()).Format("2006-01-02 15:04:05")
|
|
|
- todate := GetLastDateOfMonth(time.Now()).Format("2006-01-02") + " 23:59:59"
|
|
|
-
|
|
|
- where := "(CreateOn BETWEEN '" + fromdate + "' AND '" + todate + "') and CheckResult != ''"
|
|
|
- fromdateyear := strconv.Itoa(time.Now().Year()) + "-01-01 00:00:00"
|
|
|
- todateyear := strconv.Itoa(time.Now().Year()) + "-12-31 23:59:59"
|
|
|
- whereYno := "(CreateOn BETWEEN '" + fromdateyear + "' AND '" + todateyear + "') and CheckResult='×'"
|
|
|
- whereY := "(CreateOn BETWEEN '" + fromdateyear + "' AND '" + todateyear + "') and CheckResult='○'"
|
|
|
-
|
|
|
- // 防雷装置(等电位)
|
|
|
- var deviceEQ devicestatistics.DeviceStatistics
|
|
|
- totalYearNo := svc.GetCountsByDate(this.User.AccCode + LimsReportEquipotentName, whereYno)
|
|
|
- totalYear := svc.GetCountsByDate(this.User.AccCode + LimsReportEquipotentName, whereY)
|
|
|
- num := svc.GetCountsByDate(this.User.AccCode + LimsReportEquipotentName, where)
|
|
|
- whereN := "TemplateTypeId=187"
|
|
|
- numEQ := svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceEQ.DeviceName = "防雷装置(等电位)"
|
|
|
- deviceEQ.DeviceQty = int(numEQ)
|
|
|
- deviceEQ.FinishMonth = int(num)
|
|
|
- deviceEQ.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceEQ.FinishYear != 0 {
|
|
|
- deviceEQ.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceEQ)
|
|
|
-
|
|
|
- // 防雷装置
|
|
|
- var deviceLPT devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportLightProtectName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportLightProtectName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportLightProtectName, where)
|
|
|
- whereN ="TemplateTypeId=286"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceLPT.DeviceName = "防雷装置"
|
|
|
- deviceLPT.DeviceQty = numEQ
|
|
|
- deviceLPT.FinishMonth = int(num)
|
|
|
- deviceLPT.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceLPT.FinishYear != 0 {
|
|
|
- deviceLPT.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceLPT)
|
|
|
-
|
|
|
- // 漏电保护器
|
|
|
- var deviceLP devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportLeakProtectName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportLeakProtectName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportLeakProtectName, where)
|
|
|
- whereN ="TemplateTypeId=181"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceLP.DeviceName = "漏电保护器"
|
|
|
- deviceLP.DeviceQty = numEQ
|
|
|
- deviceLP.FinishMonth = int(num)
|
|
|
- deviceLP.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceLP.FinishYear != 0 {
|
|
|
- deviceLP.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceLP)
|
|
|
-
|
|
|
- // 电气接地
|
|
|
- var deviceEG devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportElecGroundName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportElecGroundName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportElecGroundName, where)
|
|
|
- whereN ="TemplateTypeId=179"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceEG.DeviceName = "电气接地"
|
|
|
- deviceEG.DeviceQty = numEQ
|
|
|
- deviceEG.FinishMonth = int(num)
|
|
|
- deviceEG.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceEG.FinishYear != 0 {
|
|
|
- deviceEG.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceEG)
|
|
|
-
|
|
|
- whereYno = "(CreateOn BETWEEN '" + fromdateyear + "' AND '" + todateyear + "') and CheckResult LIKE '%不合格%' "
|
|
|
- whereY = "(CreateOn BETWEEN '" + fromdateyear + "' AND '" + todateyear + "') and CheckResult LIKE '%合格%'"
|
|
|
- //阻火器 LimsReportZuhq
|
|
|
- var deviceZHQ devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportZuhqName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportZuhqName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportZuhqName, where)
|
|
|
- whereN ="TemplateTypeId=156"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceZHQ.DeviceName = "阻火器"
|
|
|
- deviceZHQ.DeviceQty = numEQ
|
|
|
- deviceZHQ.FinishMonth = int(num)
|
|
|
- deviceZHQ.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceZHQ.FinishYear != 0 {
|
|
|
- deviceZHQ.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceZHQ)
|
|
|
-
|
|
|
- // 呼吸阀 LimsReportHuxf
|
|
|
- var deviceHXF devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportHuxfName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportHuxfName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportHuxfName, where)
|
|
|
- whereN ="TemplateTypeId=183"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceHXF.DeviceName = "呼吸阀"
|
|
|
- deviceHXF.DeviceQty = numEQ
|
|
|
- deviceHXF.FinishMonth = int(num)
|
|
|
- deviceHXF.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceHXF.FinishYear != 0 {
|
|
|
- deviceHXF.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceHXF)
|
|
|
-
|
|
|
- // 液压安全阀 LimsReportYeyaqf
|
|
|
- var deviceYYF devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportYeyaqfName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportYeyaqfName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportYeyaqfName, where)
|
|
|
- whereN ="TemplateTypeId=154"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceYYF.DeviceName = "液压安全阀"
|
|
|
- deviceYYF.DeviceQty = numEQ
|
|
|
- deviceYYF.FinishMonth = int(num)
|
|
|
- deviceYYF.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceYYF.FinishYear != 0 {
|
|
|
- deviceYYF.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceYYF)
|
|
|
-
|
|
|
- // 空气泡沫产生器 LimsReportAirFoamGenerator
|
|
|
- var deviceKQPM devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportKqpmName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportKqpmName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportKqpmName, where)
|
|
|
- whereN ="TemplateTypeId=189"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceKQPM.DeviceName = "空气泡沫产生器"
|
|
|
- deviceKQPM.DeviceQty = numEQ
|
|
|
- deviceKQPM.FinishMonth = int(num)
|
|
|
- deviceKQPM.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceKQPM.FinishYear != 0 {
|
|
|
- deviceKQPM.PassRate,_ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo) + float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceKQPM)
|
|
|
-
|
|
|
- // 游梁式抽油机 LimsReportBeamPumpingUnits
|
|
|
- var deviceYL devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportBeamPumpingUnitName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportBeamPumpingUnitName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportBeamPumpingUnitName, where)
|
|
|
- whereN ="TemplateTypeId=141"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceYL.DeviceName = "游梁式抽油机"
|
|
|
- deviceYL.DeviceQty = numEQ
|
|
|
- deviceYL.FinishMonth = int(num)
|
|
|
- deviceYL.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceYL.FinishYear != 0 {
|
|
|
- deviceYL.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
- }
|
|
|
- devicelist = append(devicelist, deviceYL)
|
|
|
-
|
|
|
- // 无游梁式抽油机 LimsReportNoBeamPumpingUnit
|
|
|
- var deviceWYL devicestatistics.DeviceStatistics
|
|
|
- totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportNoBeamPumpingUnitName, whereYno)
|
|
|
- totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportNoBeamPumpingUnitName, whereY)
|
|
|
- num = svc.GetCountsByDate(this.User.AccCode + LimsReportNoBeamPumpingUnitName, where)
|
|
|
- whereN ="TemplateTypeId=173"
|
|
|
- numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
- deviceWYL.DeviceName = "无游梁式抽油机"
|
|
|
- deviceWYL.DeviceQty = numEQ
|
|
|
- deviceWYL.FinishMonth = int(num)
|
|
|
- deviceWYL.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
- if deviceWYL.FinishYear != 0 {
|
|
|
- deviceWYL.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ //fromdate := GetFirstDateOfMonth(time.Now()).Format("2006-01-02 15:04:05")
|
|
|
+ //todate := GetLastDateOfMonth(time.Now()).Format("2006-01-02") + " 23:59:59"
|
|
|
+
|
|
|
+ where := "(CreateOn < DATE_ADD(CURDATE()-DAY(CURDATE())+1,INTERVAL 1 MONTH)) and CheckResult != ''"
|
|
|
+ //fromdateyear := strconv.Itoa(time.Now().Year()) + "-01-01 00:00:00"
|
|
|
+ //todateyear := strconv.Itoa(time.Now().Year()) + "-12-31 23:59:59"
|
|
|
+ whereYno := "(CreateOn < DATE_ADD(DATE_SUB(CURDATE(),INTERVAL DAYOFYEAR(NOW())-1 DAY),INTERVAL 1 YEAR)) and CheckResult='×'"
|
|
|
+ whereY := "(CreateOn < DATE_ADD(DATE_SUB(CURDATE(),INTERVAL DAYOFYEAR(NOW())-1 DAY),INTERVAL 1 YEAR)) and CheckResult='○'"
|
|
|
+
|
|
|
+ if isauth || thrunitId == "100001215" {
|
|
|
+ // 防雷装置(等电位)
|
|
|
+ var deviceEQ devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo := svc.GetCountsByDate(this.User.AccCode + LimsReportEquipotentName, whereYno)
|
|
|
+ totalYear := svc.GetCountsByDate(this.User.AccCode + LimsReportEquipotentName, whereY)
|
|
|
+ num := svc.GetCountsByDate(this.User.AccCode + LimsReportEquipotentName, where)
|
|
|
+ whereN := "TemplateTypeId=187"
|
|
|
+ numEQ := svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM :=svc.GetWaitCountsMonth("187")
|
|
|
+ numWY :=svc.GetWaitCountsYear("187")
|
|
|
+ deviceEQ.DeviceName = "防雷装置(等电位)"
|
|
|
+ deviceEQ.DeviceQty = int(numEQ)
|
|
|
+ deviceEQ.WaitYear = int(numWY)
|
|
|
+ deviceEQ.WaitMonth = int(numWM)
|
|
|
+ deviceEQ.FinishMonth = int(num)
|
|
|
+ deviceEQ.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceEQ.FinishYear != 0 {
|
|
|
+ deviceEQ.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceEQ)
|
|
|
+
|
|
|
+ // 防雷装置
|
|
|
+ var deviceLPT devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportLightProtectName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportLightProtectName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportLightProtectName, where)
|
|
|
+ whereN ="TemplateTypeId=286"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("286")
|
|
|
+ numWY =svc.GetWaitCountsYear("286")
|
|
|
+ deviceLPT.DeviceName = "防雷装置"
|
|
|
+ deviceLPT.DeviceQty = numEQ
|
|
|
+ deviceLPT.WaitYear = int(numWY)
|
|
|
+ deviceLPT.WaitMonth = int(numWM)
|
|
|
+ deviceLPT.FinishMonth = int(num)
|
|
|
+ deviceLPT.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceLPT.FinishYear != 0 {
|
|
|
+ deviceLPT.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceLPT)
|
|
|
+
|
|
|
+ // 漏电保护器
|
|
|
+ var deviceLP devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportLeakProtectName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportLeakProtectName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportLeakProtectName, where)
|
|
|
+ whereN ="TemplateTypeId=181"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("181")
|
|
|
+ numWY =svc.GetWaitCountsYear("181")
|
|
|
+ deviceLP.DeviceName = "漏电保护器"
|
|
|
+ deviceLP.DeviceQty = numEQ
|
|
|
+ deviceLP.WaitYear = int(numWY)
|
|
|
+ deviceLP.WaitMonth = int(numWM)
|
|
|
+ deviceLP.FinishMonth = int(num)
|
|
|
+ deviceLP.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceLP.FinishYear != 0 {
|
|
|
+ deviceLP.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceLP)
|
|
|
+
|
|
|
+ // 电气接地
|
|
|
+ var deviceEG devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportElecGroundName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportElecGroundName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportElecGroundName, where)
|
|
|
+ whereN ="TemplateTypeId=179"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("179")
|
|
|
+ numWY =svc.GetWaitCountsYear("179")
|
|
|
+ deviceEG.DeviceName = "电气接地"
|
|
|
+ deviceEG.DeviceQty = numEQ
|
|
|
+ deviceEG.WaitYear = int(numWY)
|
|
|
+ deviceEG.WaitMonth = int(numWM)
|
|
|
+ deviceEG.FinishMonth = int(num)
|
|
|
+ deviceEG.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceEG.FinishYear != 0 {
|
|
|
+ deviceEG.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceEG)
|
|
|
}
|
|
|
- devicelist = append(devicelist, deviceWYL)
|
|
|
|
|
|
+ if isauth || thrunitId == "100001219" {
|
|
|
+ whereYno = "(CreateOn < DATE_ADD(DATE_SUB(CURDATE(),INTERVAL DAYOFYEAR(NOW())-1 DAY),INTERVAL 1 YEAR)) and CheckResult LIKE '%不合格%' "
|
|
|
+ whereY = "(CreateOn < DATE_ADD(DATE_SUB(CURDATE(),INTERVAL DAYOFYEAR(NOW())-1 DAY),INTERVAL 1 YEAR)) and CheckResult LIKE '%合格%' AND CheckResult NOT LIKE '%不合格%'"
|
|
|
+ //阻火器 LimsReportZuhq
|
|
|
+ var deviceZHQ devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo := svc.GetCountsByDate(this.User.AccCode + LimsReportZuhqName, whereYno)
|
|
|
+ totalYear := svc.GetCountsByDate(this.User.AccCode + LimsReportZuhqName, whereY)
|
|
|
+ num := svc.GetCountsByDate(this.User.AccCode + LimsReportZuhqName, where)
|
|
|
+ whereN :="TemplateTypeId=156"
|
|
|
+ numEQ := svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM :=svc.GetWaitCountsMonth("156")
|
|
|
+ numWY :=svc.GetWaitCountsYear("156")
|
|
|
+ deviceZHQ.DeviceName = "阻火器"
|
|
|
+ deviceZHQ.DeviceQty = numEQ
|
|
|
+ deviceZHQ.WaitYear = int(numWY)
|
|
|
+ deviceZHQ.WaitMonth = int(numWM)
|
|
|
+ deviceZHQ.FinishMonth = int(num)
|
|
|
+ deviceZHQ.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceZHQ.FinishYear != 0 {
|
|
|
+ deviceZHQ.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceZHQ)
|
|
|
+
|
|
|
+ // 呼吸阀 LimsReportHuxf
|
|
|
+ var deviceHXF devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportHuxfName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportHuxfName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportHuxfName, where)
|
|
|
+ whereN ="TemplateTypeId=183"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("183")
|
|
|
+ numWY =svc.GetWaitCountsYear("183")
|
|
|
+ deviceHXF.DeviceName = "呼吸阀"
|
|
|
+ deviceHXF.DeviceQty = numEQ
|
|
|
+ deviceHXF.WaitYear = int(numWY)
|
|
|
+ deviceHXF.WaitMonth = int(numWM)
|
|
|
+ deviceHXF.FinishMonth = int(num)
|
|
|
+ deviceHXF.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceHXF.FinishYear != 0 {
|
|
|
+ deviceHXF.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceHXF)
|
|
|
+
|
|
|
+ // 液压安全阀 LimsReportYeyaqf
|
|
|
+ var deviceYYF devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportYeyaqfName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportYeyaqfName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportYeyaqfName, where)
|
|
|
+ whereN ="TemplateTypeId=154"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("154")
|
|
|
+ numWY =svc.GetWaitCountsYear("154")
|
|
|
+ deviceYYF.DeviceName = "液压安全阀"
|
|
|
+ deviceYYF.DeviceQty = numEQ
|
|
|
+ deviceYYF.WaitYear = int(numWY)
|
|
|
+ deviceYYF.WaitMonth = int(numWM)
|
|
|
+ deviceYYF.FinishMonth = int(num)
|
|
|
+ deviceYYF.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceYYF.FinishYear != 0 {
|
|
|
+ deviceYYF.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceYYF)
|
|
|
+
|
|
|
+ // 空气泡沫产生器 LimsReportAirFoamGenerator
|
|
|
+ var deviceKQPM devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportKqpmName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportKqpmName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportKqpmName, where)
|
|
|
+ whereN ="TemplateTypeId=189"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("189")
|
|
|
+ numWY =svc.GetWaitCountsYear("189")
|
|
|
+ deviceKQPM.DeviceName = "空气泡沫产生器"
|
|
|
+ deviceKQPM.DeviceQty = numEQ
|
|
|
+ deviceKQPM.WaitYear = int(numWY)
|
|
|
+ deviceKQPM.WaitMonth = int(numWM)
|
|
|
+ deviceKQPM.FinishMonth = int(num)
|
|
|
+ deviceKQPM.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceKQPM.FinishYear != 0 {
|
|
|
+ deviceKQPM.PassRate,_ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo) + float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceKQPM)
|
|
|
+
|
|
|
+ // 游梁式抽油机 LimsReportBeamPumpingUnits
|
|
|
+ var deviceYL devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportBeamPumpingUnitName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportBeamPumpingUnitName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportBeamPumpingUnitName, where)
|
|
|
+ whereN ="TemplateTypeId=141"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("141")
|
|
|
+ numWY =svc.GetWaitCountsYear("141")
|
|
|
+ deviceYL.DeviceName = "游梁式抽油机"
|
|
|
+ deviceYL.DeviceQty = numEQ
|
|
|
+ deviceYL.WaitYear = int(numWY)
|
|
|
+ deviceYL.WaitMonth = int(numWM)
|
|
|
+ deviceYL.FinishMonth = int(num)
|
|
|
+ deviceYL.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceYL.FinishYear != 0 {
|
|
|
+ deviceYL.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceYL)
|
|
|
+
|
|
|
+ // 无游梁式抽油机 LimsReportNoBeamPumpingUnit
|
|
|
+ var deviceWYL devicestatistics.DeviceStatistics
|
|
|
+ totalYearNo = svc.GetCountsByDate(this.User.AccCode + LimsReportNoBeamPumpingUnitName, whereYno)
|
|
|
+ totalYear = svc.GetCountsByDate(this.User.AccCode + LimsReportNoBeamPumpingUnitName, whereY)
|
|
|
+ num = svc.GetCountsByDate(this.User.AccCode + LimsReportNoBeamPumpingUnitName, where)
|
|
|
+ whereN ="TemplateTypeId=173"
|
|
|
+ numEQ = svc.GetCountsByDate(this.User.AccCode + LimsCheckEquipmentListName, whereN)
|
|
|
+ numWM =svc.GetWaitCountsMonth("173")
|
|
|
+ numWY =svc.GetWaitCountsYear("173")
|
|
|
+ deviceWYL.DeviceName = "无游梁式抽油机"
|
|
|
+ deviceWYL.DeviceQty = numEQ
|
|
|
+ deviceWYL.WaitYear = int(numWY)
|
|
|
+ deviceWYL.WaitMonth = int(numWM)
|
|
|
+ deviceWYL.FinishMonth = int(num)
|
|
|
+ deviceWYL.FinishYear = int(totalYearNo) + int(totalYear)
|
|
|
+ if deviceWYL.FinishYear != 0 {
|
|
|
+ deviceWYL.PassRate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (float64(totalYear)/(float64(totalYearNo)+float64(totalYear)))*100), 64)
|
|
|
+ }
|
|
|
+ devicelist = append(devicelist, deviceWYL)
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
var datainfo ErrorDataInfo
|