|
|
@@ -13,7 +13,8 @@ import (
|
|
|
"dashoo.cn/backend/api/business/baseUser"
|
|
|
"dashoo.cn/backend/api/business/donorsinfo"
|
|
|
"dashoo.cn/backend/api/business/sampleimporttemplate"
|
|
|
- "dashoo.cn/backend/api/business/samplenoteitem"
|
|
|
+
|
|
|
+ // "dashoo.cn/backend/api/business/samplenoteitem"
|
|
|
"dashoo.cn/backend/api/business/samplesbusiness"
|
|
|
"dashoo.cn/backend/api/business/sampletype"
|
|
|
"dashoo.cn/backend/api/business/shelfset"
|
|
|
@@ -205,291 +206,19 @@ func (s *SamplesInfoService) DeleteDetail(tbldetail, where string) error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-/*func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createby string, createuserid int) (err error, warn string) {
|
|
|
- //公共扩展list
|
|
|
- svcdnote := samplenoteitem.GetSampleNoteItemService(utils.DBE)
|
|
|
- wherenote := " AccCode='" + acccode + "'"
|
|
|
- notecount := svcdnote.GetNoteCount(acccode) //获取扩展项目count
|
|
|
- notelist := svcdnote.GetDNoteItemList(wherenote)
|
|
|
-
|
|
|
- tblmain := acccode + SamplesMaintbName
|
|
|
- tbldetail := acccode + SamplesDetailtbName
|
|
|
- tblfile := acccode + SamplesDetailFiletbName
|
|
|
- tblbuss := acccode + SamplesBusstbName
|
|
|
- tbldonor := acccode + DonorstbName
|
|
|
-
|
|
|
- var datadetail SamplesDetail
|
|
|
- var databuss samplesbusiness.SamplesBusiness //业务记录
|
|
|
-
|
|
|
- dir, _ := os.Getwd()
|
|
|
- flag := 0
|
|
|
- excelpath = dir + excelpath
|
|
|
- println("exsdf=--================", excelpath)
|
|
|
- xlFile, _ := xlsx.OpenFile(excelpath)
|
|
|
- svcdonors := donorsinfo.GetDonorsInfoService(utils.DBE)
|
|
|
- var donors_data donorsinfo.DonorsInfo
|
|
|
- var sampletype_data sampletype.SampleType
|
|
|
- var base_userrole userRole.Base_User
|
|
|
- svc := sampletype.GetSampleTypeService(utils.DBE)
|
|
|
- svc1 := baseUser.GetBaseUserService(utils.DBE)
|
|
|
- var warn1 string
|
|
|
- for sheetindex, sheet := range xlFile.Sheets { //循环页数
|
|
|
- sheetrows := len(xlFile.Sheets[sheetindex].Rows) //每一页的行数
|
|
|
- fmt.Println("sheetindex", sheetindex)
|
|
|
- for rowindex, row := range sheet.Rows { //循环行数
|
|
|
- notefieldstr := ""
|
|
|
- notevaluestr := ""
|
|
|
- if rowindex == 0 { //第一行是表头,跳过
|
|
|
- continue
|
|
|
- }
|
|
|
- if row.Cells == nil || len(row.Cells) < 13 { //小于必填项的19列,不允许导入(改为跳过)
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
- basestation := new(SamplesInfoShow)
|
|
|
- for cellindex, cell := range row.Cells { //循环列数
|
|
|
- if cellindex == 0 && len(cell.String()) == 0 { //冰箱ID不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 2 && len(cell.String()) == 0 { //冻存架不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 4 && len(cell.String()) == 0 { //冻存盒Id不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 6 && len(cell.String()) == 0 { //位置不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 7 && len(cell.String()) == 0 { //样本编码不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 9 && len(cell.String()) == 0 { //样本类型不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 15 { //容量不能为空
|
|
|
- if len(cell.String()) == 0 {
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- fcapacity, _ := utils.StrTo(cell.String()).Float32()
|
|
|
- if fcapacity <= 0 {
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if cellindex == 16 && len(cell.String()) == 0 { //单位不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 17 && len(cell.String()) == 0 { //有效日期不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cellindex == 18 && len(cell.String()) == 0 { //接收日期不能为空
|
|
|
- flag = 1
|
|
|
- break
|
|
|
- }
|
|
|
- if cell.String() != "" && len(cell.String()) != 0 {
|
|
|
- if cellindex == 0 {
|
|
|
- basestation.EquipmentId, _ = utils.StrTo(cell.String()).Int()
|
|
|
- } else if cellindex == 2 {
|
|
|
- basestation.ShelfId, _ = utils.StrTo(cell.String()).Int()
|
|
|
- } else if cellindex == 4 {
|
|
|
- basestation.BoxId, _ = utils.StrTo(cell.String()).Int()
|
|
|
- } else if cellindex == 6 {
|
|
|
- spos := cell.String()
|
|
|
- sposs := StrSplit(spos, ";")
|
|
|
- basestation.Position = sposs[1] + ";" + utils.ToStr(Boxlineumber(sposs[0]))
|
|
|
- whereposition := " DeletionStateCode=0 and IState in (1,5) and BoxId=" + utils.ToStr(basestation.BoxId) + " and Position='" + basestation.Position + "'"
|
|
|
- have := s.QuerySampleInfoHas(tbldetail, whereposition)
|
|
|
- if have {
|
|
|
- flag = 1
|
|
|
- warn1 += cell.String() + ","
|
|
|
- break
|
|
|
- }
|
|
|
- } else if cellindex == 7 { //样本编码
|
|
|
- basestation.SampleCode = cell.String()
|
|
|
- } else if cellindex == 8 && len(cell.String()) > 0 { //样本条码
|
|
|
- whereposition := " DeletionStateCode=0 and BarCode = '" + cell.String() + "' "
|
|
|
- have := s.QuerySampleInfoHas(tbldetail, whereposition)
|
|
|
- where := " DeletionStateCode=0 and BarCode = '" + cell.String() + "'"
|
|
|
- has := s.QuerySampleInfoHas(tblfile, where)
|
|
|
- if have || has {
|
|
|
- flag = 1
|
|
|
- warn1 += cell.String() + ","
|
|
|
- break
|
|
|
- }
|
|
|
- basestation.BarCode = cell.String()
|
|
|
- } else if cellindex == 9 {
|
|
|
- basestation.SampleTypeName = cell.String()
|
|
|
- where2 := " AccCode='" + acccode + "' and Name='" + cell.String() + "'"
|
|
|
- sampletype_data = svc.GetSampleType(where2)
|
|
|
- if sampletype_data.Id == 0 {
|
|
|
- flag = 1
|
|
|
- warn1 = " "
|
|
|
- break
|
|
|
- }
|
|
|
- basestation.SampleType = sampletype_data.Id
|
|
|
- } else if cellindex == 10 {
|
|
|
- basestation.Name = cell.String()
|
|
|
- } else if cellindex == 11 {
|
|
|
- basestation.SamplingOrgan = cell.String()
|
|
|
- } else if cellindex == 12 {
|
|
|
- basestation.SamplingOrganName = cell.String()
|
|
|
- } else if cellindex == 13 {
|
|
|
- basestation.SamplingSite = cell.String()
|
|
|
- } else if cellindex == 14 {
|
|
|
- basestation.SamplingSiteName = cell.String()
|
|
|
- } else if cellindex == 15 {
|
|
|
- basestation.Capacity, _ = utils.StrTo(cell.String()).Float32()
|
|
|
- basestation.InitCapacity = basestation.Capacity
|
|
|
- } else if cellindex == 16 {
|
|
|
- basestation.Unit = cell.String()
|
|
|
- } else if cellindex == 17 {
|
|
|
- stime, err := utils.TimeParse(cell.Value, "2006-1-2 15:4:5")
|
|
|
- if err != nil {
|
|
|
- aa, _ := utils.StrTo(cell.Value).Float64()
|
|
|
- basestation.ValidityDate = xlsx.TimeFromExcelTime(aa, false)
|
|
|
- } else {
|
|
|
- basestation.ValidityDate = stime
|
|
|
- }
|
|
|
- } else if cellindex == 18 {
|
|
|
- stime, err := utils.TimeParse(cell.Value, "2006-1-2 15:4:5")
|
|
|
- if err != nil {
|
|
|
- aa, _ := utils.StrTo(cell.Value).Float64()
|
|
|
- basestation.ReceiveDate = xlsx.TimeFromExcelTime(aa, false)
|
|
|
- } else {
|
|
|
- basestation.ReceiveDate = stime
|
|
|
- }
|
|
|
- } else if cellindex == 19 {
|
|
|
- base_userrole = svc1.GetidByRealname(cell.String())
|
|
|
- basestation.CreateBy = cell.String()
|
|
|
- basestation.CreateUserId = base_userrole.Id
|
|
|
- } else if cellindex == 20 {
|
|
|
- basestation.SourceName = cell.String()
|
|
|
- } else if cellindex == 21 {
|
|
|
- basestation.SourceIdCard = cell.String()
|
|
|
- } else if cellindex == 22 {
|
|
|
- basestation.Remark = cell.String()
|
|
|
- } else if cellindex == 23 {
|
|
|
- basestation.ParentBarCode = cell.String()
|
|
|
- } else if cellindex == 24 {
|
|
|
- basestation.InnerCode = cell.String()
|
|
|
- } else if cellindex > 24 && cellindex < 25+notecount {
|
|
|
- for i := 1; i < notecount+1; i++ {
|
|
|
- if cellindex == 24+i {
|
|
|
- notefieldstr = notefieldstr + "," + notelist[i-1].FieldName //扩展字段 因为cellindex可能小于21
|
|
|
- notevaluestr = notevaluestr + ",'" + cell.String() + "'" //扩展名称
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if flag == 1 {
|
|
|
- flag = 0
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
- if basestation.CreateBy == "" {
|
|
|
- basestation.CreateBy = createby
|
|
|
- basestation.CreateUserId = createuserid
|
|
|
- }
|
|
|
- if basestation.SourceName != "" || basestation.SourceIdCard != "" {
|
|
|
- wheredonors := " IdCard = '" + basestation.SourceIdCard + "' and Name ='" + basestation.SourceName + "' "
|
|
|
- donors_data = svcdonors.QueryDonorEntity(tbldonor, wheredonors)
|
|
|
- basestation.SourceId = donors_data.Id
|
|
|
- }
|
|
|
- basestation.AccCode = acccode
|
|
|
- basestation.CreateOn = time.Now()
|
|
|
- basestation.IState = 3
|
|
|
- basestation.IType = 0
|
|
|
- basestation.FreezingNum = 0
|
|
|
- wheremain := " SampleCode='" + basestation.SampleCode + "' "
|
|
|
- ishasmain := s.QuerySampleInfoHas(tblmain, wheremain)
|
|
|
-
|
|
|
- if !ishasmain { //没有主信息,全部添加
|
|
|
- //添加主表
|
|
|
- sqlfield := " AccCode,SampleCode,Name,SampleType,SampleTypeName,SourceId,"
|
|
|
- sqlfield = sqlfield + "SamplingOrgan,SamplingOrganName,SamplingSite,SamplingSiteName,ReceiveDate,"
|
|
|
- sqlfield = sqlfield + "SourceIdCard,SourceName,MCreateUserId,MCreateBy,MCreateOn,MModifiedOn"
|
|
|
- sqlfield = sqlfield + notefieldstr
|
|
|
-
|
|
|
- sqlvalue := "'" + basestation.AccCode + "','" + basestation.SampleCode + "','" + basestation.Name + "'," + utils.ToStr(basestation.SampleType) + ",'" + basestation.SampleTypeName + "',"
|
|
|
- sqlvalue = sqlvalue + "" + utils.ToStr(basestation.SourceId) + ","
|
|
|
- sqlvalue = sqlvalue + "'" + basestation.SamplingOrgan + "','" + basestation.SamplingOrganName + "','" + basestation.SamplingSite + "',"
|
|
|
- sqlvalue = sqlvalue + "'" + basestation.SamplingSiteName + "','" + basestation.ReceiveDate.Format("2006-1-2 15:4:5") + "','" + basestation.SourceIdCard + "','" + basestation.SourceName + "',"
|
|
|
- sqlvalue = sqlvalue + "" + utils.ToStr(basestation.CreateUserId) + ",'" + basestation.CreateBy + "',now(),now()"
|
|
|
- sqlvalue = sqlvalue + notevaluestr
|
|
|
- fmt.Println(sqlfield)
|
|
|
- fmt.Println(sqlvalue)
|
|
|
- s.AddLine(tblmain, sqlfield, sqlvalue)
|
|
|
- }
|
|
|
- if basestation.BarCode == "" {
|
|
|
- basestation.BarCode = s.AutoGetBarCode(acccode, basestation.SampleCode)
|
|
|
- }
|
|
|
- datadetail.SampleCode = basestation.SampleCode
|
|
|
- datadetail.BarCode = basestation.BarCode
|
|
|
- datadetail.IState = 1
|
|
|
- datadetail.EquipmentId = basestation.EquipmentId
|
|
|
- datadetail.ShelfId = basestation.ShelfId
|
|
|
- datadetail.BoxId = basestation.BoxId
|
|
|
- datadetail.Position = basestation.Position
|
|
|
- datadetail.ParentBarCode = basestation.ParentBarCode
|
|
|
- datadetail.IType = basestation.IType
|
|
|
- datadetail.Capacity = basestation.Capacity
|
|
|
- datadetail.InitCapacity = basestation.Capacity
|
|
|
- datadetail.Unit = basestation.Unit
|
|
|
- datadetail.FreezingNum = 0
|
|
|
- datadetail.ValidityDate = basestation.ValidityDate
|
|
|
- datadetail.InnerCode = basestation.InnerCode
|
|
|
- datadetail.CreateUserId = basestation.CreateUserId
|
|
|
- datadetail.CreateBy = basestation.CreateBy
|
|
|
- datadetail.Remark = basestation.Remark
|
|
|
- affected, _ := s.InsertEntityBytbl(tbldetail, &datadetail)
|
|
|
- if affected > 0 {
|
|
|
- databuss.OpType = 7
|
|
|
- databuss.AccCode = basestation.AccCode
|
|
|
- databuss.BarCode = datadetail.BarCode
|
|
|
- databuss.CapacityUsed = datadetail.Capacity
|
|
|
- databuss.CapacityRest = datadetail.Capacity
|
|
|
- databuss.SampleCode = datadetail.SampleCode
|
|
|
- databuss.Unit = datadetail.Unit
|
|
|
- databuss.SampleType = basestation.SampleType
|
|
|
- databuss.EquipmentId = datadetail.EquipmentId
|
|
|
- databuss.ShelfId = datadetail.ShelfId
|
|
|
- databuss.BoxId = datadetail.BoxId
|
|
|
- databuss.Position = datadetail.Position
|
|
|
- databuss.PositionDesc = s.GetPostiondescByPosId(datadetail.EquipmentId, datadetail.ShelfId, datadetail.BoxId, datadetail.Position)
|
|
|
- databuss.CreateUserId = datadetail.CreateUserId
|
|
|
- databuss.CreateBy = datadetail.CreateBy
|
|
|
- s.InsertEntityBytbl(tblbuss, &databuss)
|
|
|
- }
|
|
|
- if rowindex == (sheetrows) {
|
|
|
- //s.AddLine(tbldetail, sqlfield, sqlvalue)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return err, warn1
|
|
|
-}*/
|
|
|
-
|
|
|
func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createby string, createuserid int) (err error, warn string) {
|
|
|
//公共扩展list
|
|
|
- svcdnote := samplenoteitem.GetSampleNoteItemService(utils.DBE)
|
|
|
- wherenote := " AccCode='" + acccode + "'"
|
|
|
- notecount := svcdnote.GetNoteCount(acccode) //获取扩展项目count
|
|
|
- notelist := svcdnote.GetDNoteItemList(wherenote)
|
|
|
+ //svcdnote := samplenoteitem.GetSampleNoteItemService(utils.DBE)
|
|
|
+ //wherenote := " AccCode='" + acccode + "'"
|
|
|
+ //notecount := svcdnote.GetNoteCount(acccode) //获取扩展项目count
|
|
|
+ //notelist := svcdnote.GetDNoteItemList(wherenote)
|
|
|
|
|
|
tblmain := acccode + SamplesMaintbName
|
|
|
tbldetail := acccode + SamplesDetailtbName
|
|
|
tblfile := acccode + SamplesDetailFiletbName
|
|
|
tblbuss := acccode + SamplesBusstbName
|
|
|
- tbldonor := acccode + DonorstbName
|
|
|
+ tbldonor := acccode + AnimalInfoName
|
|
|
+ //tbldonor := acccode + DonorstbName
|
|
|
|
|
|
var datadetail SamplesDetail
|
|
|
var databuss samplesbusiness.SamplesBusiness //业务记录
|
|
|
@@ -513,6 +242,7 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
for sheetindex, sheet := range xlFile.Sheets { //循环页数
|
|
|
sheetrows := len(xlFile.Sheets[sheetindex].Rows) //每一页的行数
|
|
|
templateName := sheet.Name
|
|
|
+
|
|
|
if templateName != "默认模板" {
|
|
|
svc2 := sampleimporttemplate.GetSampleImporttemplateService(utils.DBE)
|
|
|
where := " AccCode = '" + acccode + "'"
|
|
|
@@ -525,7 +255,6 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
continue
|
|
|
}
|
|
|
fields := strings.Split(list[0].Content, ",")
|
|
|
-
|
|
|
for rowindex, row := range sheet.Rows { //循环行数
|
|
|
notefieldstr := ""
|
|
|
notevaluestr := ""
|
|
|
@@ -542,15 +271,14 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
break
|
|
|
}
|
|
|
field := fields[cellindex]
|
|
|
- if len(cell.String()) == 0 &&
|
|
|
- (field == "SampleCode" ||
|
|
|
- field == "SampleType") {
|
|
|
+ if len(cell.String()) == 0 && (field == "SampleCode" || field == "SampleType") {
|
|
|
//不能为空
|
|
|
flag = 1
|
|
|
break
|
|
|
}
|
|
|
|
|
|
if cell.String() != "" && len(cell.String()) != 0 {
|
|
|
+ fmt.Println("mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", field)
|
|
|
if field == "EquipmentId" {
|
|
|
basestation.EquipmentId, _ = utils.StrTo(cell.String()).Int()
|
|
|
} else if field == "ShelfId" {
|
|
|
@@ -582,9 +310,11 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
}
|
|
|
basestation.BarCode = cell.String()
|
|
|
} else if field == "SampleType" {
|
|
|
+ fmt.Println("dvvvvvvvbv ddd", field)
|
|
|
basestation.SampleTypeName = cell.String()
|
|
|
where2 := " AccCode='" + acccode + "' and Name='" + cell.String() + "'"
|
|
|
sampletype_data = svc.GetSampleType(where2)
|
|
|
+ fmt.Println("ddddddddddddddddddddddddd", sampletype_data)
|
|
|
if sampletype_data.Id == 0 {
|
|
|
flag = 1
|
|
|
warn1 = " "
|
|
|
@@ -593,17 +323,6 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
basestation.SampleType = sampletype_data.Id
|
|
|
} else if field == "Name" {
|
|
|
basestation.Name = cell.String()
|
|
|
- } else if field == "SamplingOrgan" {
|
|
|
- basestation.SamplingOrgan = cell.String()
|
|
|
- } else if field == "SamplingOrganName" {
|
|
|
- basestation.SamplingOrganName = cell.String()
|
|
|
- } else if field == "SamplingSite" {
|
|
|
- basestation.SamplingSite = cell.String()
|
|
|
- } else if field == "SamplingSiteName" {
|
|
|
- basestation.SamplingSiteName = cell.String()
|
|
|
- } else if field == "Capacity" {
|
|
|
- basestation.Capacity, _ = utils.StrTo(cell.String()).Float32()
|
|
|
- basestation.InitCapacity = basestation.Capacity
|
|
|
} else if field == "Unit" {
|
|
|
basestation.Unit = cell.String()
|
|
|
} else if field == "ValidityDate" {
|
|
|
@@ -642,19 +361,35 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
notevaluestr = notevaluestr + ",'" + cell.String() + "'" //扩展名称
|
|
|
}
|
|
|
}
|
|
|
+ // else if field == "SamplingOrgan" {
|
|
|
+ // basestation.SamplingOrgan = cell.String()
|
|
|
+ // } else if field == "SamplingOrganName" {
|
|
|
+ // basestation.SamplingOrganName = cell.String()
|
|
|
+ // } else if field == "SamplingSite" {
|
|
|
+ // basestation.SamplingSite = cell.String()
|
|
|
+ // } else if field == "SamplingSiteName" {
|
|
|
+ // basestation.SamplingSiteName = cell.String()
|
|
|
+ // } else if field == "Capacity" {
|
|
|
+ // basestation.Capacity, _ = utils.StrTo(cell.String()).Float32()
|
|
|
+ // basestation.InitCapacity = basestation.Capacity
|
|
|
+ // }
|
|
|
}
|
|
|
- }
|
|
|
- if flag == 1 {
|
|
|
- flag = 0
|
|
|
- continue
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ // if flag == 1 {
|
|
|
+ // flag = 0
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
if basestation.CreateBy == "" {
|
|
|
basestation.CreateBy = createby
|
|
|
basestation.CreateUserId = createuserid
|
|
|
}
|
|
|
- if basestation.SourceName != "" || basestation.SourceIdCard != "" {
|
|
|
- wheredonors := " IdCard = '" + basestation.SourceIdCard + "' and Name ='" + basestation.SourceName + "' "
|
|
|
+
|
|
|
+ // if basestation.SourceName != "" || basestation.SourceIdCard != "" {
|
|
|
+ if basestation.SourceName != "" {
|
|
|
+ //wheredonors := " IdCard = '" + basestation.SourceIdCard + "' and Name ='" + basestation.SourceName + "' "
|
|
|
+ wheredonors := " Name ='" + basestation.SourceName + "' "
|
|
|
donors_data = svcdonors.QueryDonorEntity(tbldonor, wheredonors)
|
|
|
basestation.SourceId = donors_data.Id
|
|
|
}
|
|
|
@@ -680,9 +415,9 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
sqlvalue = sqlvalue + notevaluestr
|
|
|
s.AddLine(tblmain, sqlfield, sqlvalue)
|
|
|
}
|
|
|
- if basestation.BarCode == "" {
|
|
|
- basestation.BarCode = s.AutoGetBarCode(acccode, basestation.SampleCode)
|
|
|
- }
|
|
|
+ // if basestation.BarCode == "" {
|
|
|
+ // basestation.BarCode = s.AutoGetBarCode(acccode, basestation.SampleCode)
|
|
|
+ // }
|
|
|
datadetail.SampleCode = basestation.SampleCode
|
|
|
datadetail.BarCode = basestation.BarCode
|
|
|
datadetail.IState = 1
|
|
|
@@ -701,6 +436,7 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
datadetail.CreateUserId = basestation.CreateUserId
|
|
|
datadetail.CreateBy = basestation.CreateBy
|
|
|
datadetail.Remark = basestation.Remark
|
|
|
+ fmt.Println("eeeeeeeeeeeeeeeeeeeeeeeeeeeeee3", tbldetail, &datadetail)
|
|
|
affected, _ := s.InsertEntityBytbl(tbldetail, &datadetail)
|
|
|
if affected > 0 {
|
|
|
databuss.OpType = 7
|
|
|
@@ -855,14 +591,15 @@ func (s *SamplesInfoService) InsertExcelSamplesInput(excelpath, acccode, createb
|
|
|
basestation.ParentBarCode = cell.String()
|
|
|
} else if cellindex == 24 {
|
|
|
basestation.InnerCode = cell.String()
|
|
|
- } else if cellindex > 24 && cellindex < 25+notecount {
|
|
|
- for i := 1; i < notecount+1; i++ {
|
|
|
- if cellindex == 24+i {
|
|
|
- notefieldstr = notefieldstr + "," + notelist[i-1].FieldName //扩展字段 因为cellindex可能小于21
|
|
|
- notevaluestr = notevaluestr + ",'" + cell.String() + "'" //扩展名称
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
+ // else if cellindex > 24 && cellindex < 25+notecount {
|
|
|
+ // for i := 1; i < notecount+1; i++ {
|
|
|
+ // if cellindex == 24+i {
|
|
|
+ // notefieldstr = notefieldstr + "," + notelist[i-1].FieldName //扩展字段 因为cellindex可能小于21
|
|
|
+ // notevaluestr = notevaluestr + ",'" + cell.String() + "'" //扩展名称
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
|