|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"crypto/md5"
|
|
|
"dashoo.cn/genepoint_srv/business/arrangeService"
|
|
|
"fmt"
|
|
|
+ "gitee.com/johng/gf/util/gconv"
|
|
|
"github.com/Unknwon/com"
|
|
|
"github.com/gogf/gf/os/glog"
|
|
|
"log"
|
|
|
@@ -907,9 +908,21 @@ func (this *ConverseService) UpdateDetail(BarCode string, entity ResponseEntity,
|
|
|
*/
|
|
|
func (this *ConverseService) UpdatePosition(rack_id string, tubes []Tube, entity ResponseEntity, parentId int) {
|
|
|
// 根据返回的报文中的盒子标识,获取盒子类型
|
|
|
- sql := "select Id,RowNum,ColumnNum from bank_box where Barcode ='" + rack_id + "'"
|
|
|
+ sql := "select Id,RowNum,ColumnNum,EquipmentId,ShelfId,XStation,YStation from bank_box where Barcode ='" + rack_id + "'"
|
|
|
var box Box
|
|
|
this.DBE.SQL(sql).Get(&box)
|
|
|
+
|
|
|
+ // 根据盒子信息获取容器和冻存架信息, 用于更新样本孔位信息
|
|
|
+ // 获取容器信息
|
|
|
+ equipmentsql := " select Id,Code,Name from bank_equipment where id = '"+ gconv.String( box.EquipmentId)+"' "
|
|
|
+ var equipmentInfo EquipmentInfo
|
|
|
+ this.DBE.SQL(equipmentsql).Get(&equipmentInfo)
|
|
|
+ // 获取架子信息
|
|
|
+ shelfsql := " select Id,XStation,YStation from bank_shelf where id = '"+ gconv.String( box.ShelfId)+"' "
|
|
|
+ var shelf Shelf
|
|
|
+ this.DBE.SQL(shelfsql).Get(&shelf)
|
|
|
+
|
|
|
+
|
|
|
RowNum := box.RowNum
|
|
|
ColumnNum := box.ColumnNum
|
|
|
glog.Info("冻存盒的行数:", RowNum, ";冻存盒的列数:", ColumnNum)
|
|
|
@@ -929,10 +942,16 @@ func (this *ConverseService) UpdatePosition(rack_id string, tubes []Tube, entity
|
|
|
}
|
|
|
|
|
|
glog.Info("管子在盒子中的位置坐标为:", box_y, ";", box_x)
|
|
|
- var position = utils.NumberToLetter(box_x) + utils.ToStr(box_y)
|
|
|
- sql = "update bank_sample set BoxId = '" + utils.ToStr(box.Id) + "',Position = '" + utils.ToStr(box_y) + ";" + utils.ToStr(box_x) + "' ,PositionInfo = concat( REVERSE(SUBSTR(REVERSE(PositionInfo) FROM INSTR(REVERSE(PositionInfo),'-')+1)),'-" + position + "' ) where barcode ='" + id + "' "
|
|
|
+ //var position = utils.NumberToLetter(box_x) + utils.ToStr(box_y)
|
|
|
+
|
|
|
+ position := equipmentInfo.Code + "-" + utils.NumberToLetter(shelf.YStation) + utils.ToStr(shelf.XStation) + "-" +
|
|
|
+ "" + utils.NumberToLetter(box.YStation) + utils.ToStr(box.XStation) + "-" + utils.NumberToLetter(box_x) + utils.ToStr(box_y)
|
|
|
+ sql = "update bank_sample set BoxId = '" + utils.ToStr(box.Id) + "',Position = '" + utils.ToStr(box_y) + ";" +
|
|
|
+ "" + utils.ToStr(box_x) + "',PositionInfo = '"+position+"' where barcode ='" + id + "' "
|
|
|
//执行sql 更新位置和坐标信息
|
|
|
this.DBE.Exec(sql)
|
|
|
+
|
|
|
+
|
|
|
this.UpdateDetail(id, entity, parentId, rack_id)
|
|
|
}
|
|
|
}
|