|
|
@@ -5,19 +5,20 @@ import (
|
|
|
"dashoo.cn/backend/api/business/limscustomerposition"
|
|
|
"dashoo.cn/backend/api/business/limsdataentry"
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
|
- "dashoo.cn/business2/parameter"
|
|
|
"dashoo.cn/backend/api/business/items"
|
|
|
+ "dashoo.cn/business2/parameter"
|
|
|
|
|
|
- baseitems "dashoo.cn/business2/items"
|
|
|
- "dashoo.cn/business2/userRole"
|
|
|
"dashoo.cn/backend/api/business/baseUser"
|
|
|
svccustomer "dashoo.cn/backend/api/business/customer"
|
|
|
"dashoo.cn/backend/api/business/limsreporthuxf"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
+ baseitems "dashoo.cn/business2/items"
|
|
|
+ "dashoo.cn/business2/userRole"
|
|
|
"dashoo.cn/utils"
|
|
|
)
|
|
|
|
|
|
@@ -668,6 +669,7 @@ func (this *LimsReportHuxfController) UpdateEntity() {
|
|
|
"Remark1",
|
|
|
|
|
|
"Remark2",
|
|
|
+ "CheckResult",
|
|
|
|
|
|
"CreateOn",
|
|
|
|
|
|
@@ -879,4 +881,61 @@ func (this *LimsReportHuxfController) AddRunRecord() {
|
|
|
svc.InsertEntityBytbl(this.User.AccCode+InstrumenRunRecordName, &runrecord)
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+// @Title 获取列表
|
|
|
+// @Description get user by token
|
|
|
+// @router /getmoscheckresult [put]
|
|
|
+func (this *LimsReportHuxfController) GetMosCheckResultList() {
|
|
|
+ var model limsreporthuxf.LimsReportHuxf
|
|
|
+ var checkresult string
|
|
|
+ svc := limsreporthuxf.GetLimsReportHuxfService(utils.DBE)
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ json.Unmarshal(jsonBlob, &model)
|
|
|
+ var reportmainlist limsdataentry.LimsDateEntry
|
|
|
+ svc.GetEntityByWhere(this.User.AccCode+LimsDateEntryName, " Id= "+utils.ToStr(model.DataEntryId), &reportmainlist)
|
|
|
+ var DetectBasis string
|
|
|
+ if strings.Contains(reportmainlist.DetectBasis, ",") == true {
|
|
|
+ DetectBasis = strings.Replace(reportmainlist.DetectBasis, ",", " ", -1)
|
|
|
+ } else {
|
|
|
+ DetectBasis = reportmainlist.DetectBasis
|
|
|
+ }
|
|
|
+ //检测结论判断依据
|
|
|
+ PosPressureFloat, PosPressureFloat2, NgPressureFloat, NgPressureFloat2, PospressureStandard, NgpressureStandard, PosThroughPutInt, NgThroughPutInt := svc.ThroughPutAdd(model.Spec)
|
|
|
+ fmt.Println(PospressureStandard,NgpressureStandard)
|
|
|
+ PosThroughPut, _ := strconv.ParseFloat(strconv.Itoa(PosThroughPutInt), 64)
|
|
|
+ NgThroughPut, _ := strconv.ParseFloat(strconv.Itoa(NgThroughPutInt), 64)
|
|
|
+ qulify := 1
|
|
|
+ PosPressAvg, _ := strconv.ParseFloat(model.PosPressAvg, 64)
|
|
|
+ if PosPressAvg >= PosPressureFloat && PosPressAvg <= PosPressureFloat2 {
|
|
|
+ qulify = 1
|
|
|
+ } else {
|
|
|
+ qulify = 0
|
|
|
+ }
|
|
|
+ NgPressAvg, _ := strconv.ParseFloat(model.NgPressAvg, 64)
|
|
|
+ if NgPressAvg >= NgPressureFloat && NgPressAvg <= NgPressureFloat2 {
|
|
|
+ qulify = 1
|
|
|
+ } else {
|
|
|
+ qulify = 0
|
|
|
+ }
|
|
|
+ PosCloudAvg, _ := strconv.ParseFloat(model.PosCloudAvg, 64)
|
|
|
+ if PosCloudAvg >= PosThroughPut {
|
|
|
+ qulify = 1
|
|
|
+ } else {
|
|
|
+ qulify = 0
|
|
|
+ }
|
|
|
+ NgCloudAvg, _ := strconv.ParseFloat(model.NgCloudAvg, 64)
|
|
|
+ if NgCloudAvg >= NgThroughPut {
|
|
|
+ qulify = 1
|
|
|
+ } else {
|
|
|
+ qulify = 0
|
|
|
+ }
|
|
|
+ if qulify == 1 {
|
|
|
+ checkresult = "依据《"+DetectBasis+"》标准,检测数据符合标准要求,检测结论:合格。"
|
|
|
+ } else if qulify == 0 {
|
|
|
+ checkresult = "依据《"+DetectBasis+"》标准,检测数据不符合标准要求,检测结论:不合格。"
|
|
|
+ }
|
|
|
+ var datainfo DataInfo
|
|
|
+ datainfo.Items = checkresult
|
|
|
+ this.Data["json"] = &datainfo
|
|
|
+ this.ServeJSON()
|
|
|
}
|