|
|
@@ -1,19 +1,22 @@
|
|
|
package lims
|
|
|
|
|
|
import (
|
|
|
- "dashoo.cn/business2/parameter"
|
|
|
- "dashoo.cn/backend/api/business/instrument"
|
|
|
- "dashoo.cn/backend/api/business/limscustomerposition"
|
|
|
- "dashoo.cn/backend/api/business/limsdataentry"
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
- svccustomer "dashoo.cn/backend/api/business/customer"
|
|
|
- "dashoo.cn/business2/userRole"
|
|
|
+
|
|
|
"dashoo.cn/backend/api/business/Limsreportyyaqf"
|
|
|
"dashoo.cn/backend/api/business/baseUser"
|
|
|
+ svccustomer "dashoo.cn/backend/api/business/customer"
|
|
|
+ "dashoo.cn/backend/api/business/instrument"
|
|
|
"dashoo.cn/backend/api/business/items"
|
|
|
+ "dashoo.cn/backend/api/business/limscustomerposition"
|
|
|
+ "dashoo.cn/backend/api/business/limsdataentry"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
+ "dashoo.cn/business2/parameter"
|
|
|
+ "dashoo.cn/business2/userRole"
|
|
|
"dashoo.cn/utils"
|
|
|
)
|
|
|
|
|
|
@@ -93,7 +96,7 @@ func (this *LimsReportYeyaqfController) GetEntityList() {
|
|
|
total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
|
|
|
|
|
|
var list1 []limsreportyyaqf.LimsReportYeyaqf
|
|
|
- svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, 1,total, orderby, asc, &list1, where)
|
|
|
+ svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, 1, total, orderby, asc, &list1, where)
|
|
|
var maxorderno = 0
|
|
|
for i := 0; i < len(list1); i++ {
|
|
|
if maxorderno < list1[i].OrderNo {
|
|
|
@@ -132,11 +135,11 @@ func (this *LimsReportYeyaqfController) GetDictList() {
|
|
|
dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
|
|
|
|
|
|
var dictCustomer []svccustomer.Customer
|
|
|
- customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
|
|
|
+ customerSvc.GetEntitysByWhere(this.User.AccCode+CustomerName, "", &dictCustomer)
|
|
|
dictList["EntrustCorp"] = &dictCustomer
|
|
|
|
|
|
where := "ItemsId=246"
|
|
|
- dictList["StandardItems"] = itemsSvc.GetTreeitemsdetailByWhere(Base_ItemTreeDetailsName,where)
|
|
|
+ dictList["StandardItems"] = itemsSvc.GetTreeitemsdetailByWhere(Base_ItemTreeDetailsName, where)
|
|
|
|
|
|
//常见问题
|
|
|
where = "ParentId=144"
|
|
|
@@ -166,19 +169,19 @@ func (this *LimsReportYeyaqfController) GetDictList() {
|
|
|
// 检测仪器--压力变送器
|
|
|
var list []instrument.Instrument
|
|
|
where = "Classification='压力变送器'"
|
|
|
- instsvc.GetEntitysByWhere(this.User.AccCode+InstrumentName, where,&list)
|
|
|
+ instsvc.GetEntitysByWhere(this.User.AccCode+InstrumentName, where, &list)
|
|
|
dictList["DifPressTran"] = list
|
|
|
|
|
|
// 检测仪器--安全附件检测仪
|
|
|
var list1 []instrument.Instrument
|
|
|
where = "Classification='安全附件检测仪'"
|
|
|
- instsvc.GetEntitysByWhere(this.User.AccCode+InstrumentName, where,&list1)
|
|
|
+ instsvc.GetEntitysByWhere(this.User.AccCode+InstrumentName, where, &list1)
|
|
|
dictList["SafAccDetector"] = list1
|
|
|
|
|
|
// 检测仪器--热式气体质量流量计
|
|
|
var list2 []instrument.Instrument
|
|
|
where = "Classification='热式气体质量流量计'"
|
|
|
- instsvc.GetEntitysByWhere(this.User.AccCode+InstrumentName, where,&list2)
|
|
|
+ instsvc.GetEntitysByWhere(this.User.AccCode+InstrumentName, where, &list2)
|
|
|
dictList["GasFlowMeter"] = list2
|
|
|
|
|
|
dictList["DefaultStandardYyaqf"] = paramSvc.GetBaseparameterMessage("s5OVE", "paramset", "StandardYyaqf")
|
|
|
@@ -186,7 +189,7 @@ func (this *LimsReportYeyaqfController) GetDictList() {
|
|
|
// 相关联的检测仪器
|
|
|
var instrumentgroup []instrument.LimsInstrumentGroup
|
|
|
where = "1 = 1"
|
|
|
- instsvc.GetEntitysByWhere(this.User.AccCode+LimsInstrumentGroup, where,&instrumentgroup)
|
|
|
+ instsvc.GetEntitysByWhere(this.User.AccCode+LimsInstrumentGroup, where, &instrumentgroup)
|
|
|
dictList["instrumentgroup"] = instrumentgroup
|
|
|
|
|
|
var datainfo DataInfo
|
|
|
@@ -346,6 +349,7 @@ func (this *LimsReportYeyaqfController) UpdateEntity() {
|
|
|
"Remark1",
|
|
|
|
|
|
"Remark2",
|
|
|
+ "CheckResult",
|
|
|
|
|
|
"CreateOn",
|
|
|
|
|
|
@@ -418,12 +422,12 @@ func (this *LimsReportYeyaqfController) GetEntrustCorpItems() {
|
|
|
svc := limscustomerposition.GetLimsCustomerpositionService(utils.DBE)
|
|
|
|
|
|
where := "CustomerId=" + cId + " and ParentId = 0"
|
|
|
- svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName, where,&model)
|
|
|
+ svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName, where, &model)
|
|
|
dictList["PositionCheck"] = model
|
|
|
|
|
|
var Positionmodel []limscustomerposition.LimsCustomerPosition
|
|
|
where = "CustomerId=" + cId + " and ParentId <> 0"
|
|
|
- svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName,where, &Positionmodel)
|
|
|
+ svc.GetEntitysByWhere(this.User.AccCode+LimsCustomerpositionName, where, &Positionmodel)
|
|
|
dictList["Position"] = Positionmodel
|
|
|
|
|
|
var datainfo DataInfo
|
|
|
@@ -503,4 +507,64 @@ func (this *LimsReportYeyaqfController) AddRunRecord() {
|
|
|
svc.InsertEntityBytbl(this.User.AccCode+InstrumenRunRecordName, &runrecord)
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 获取列表
|
|
|
+// @Description get user by token
|
|
|
+// @router /getyeyacheckresult [put]
|
|
|
+func (this *LimsReportYeyaqfController) GetYeyaCheckResultList() {
|
|
|
+ var checkresult string
|
|
|
+ var model limsreportyyaqf.LimsReportYeyaqf
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ svc := limsreportyyaqf.GetLimsReportYyaqfService(utils.DBE)
|
|
|
+ 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()
|
|
|
+}
|