|
|
@@ -397,6 +397,21 @@ func (this *ConverseService) SampleApplyStatusModify(statusCode int, entryNo str
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+//2020/12/18新增 根据当前任务报文返回状态批量更新当前任务下所有的样本状态
|
|
|
+func (this *ConverseService)SampleApplyDetailStatusModify(statusCode int , entryNo string) error {
|
|
|
+
|
|
|
+ //获取出入库单Id
|
|
|
+ getId := "SELECT id FROM " + TABLE_SAMPLE_APPLY + " WHERE entryno = '" + entryNo + "'"
|
|
|
+ var idList []Id
|
|
|
+ err := this.DBE.SQL(getId).Find(&idList)
|
|
|
+ //批量更新全部成功或失败的任务样本状态
|
|
|
+ sql:= "UPDATE " + TABLE_APPLY_DETAIL + " SET taskstatus = '" + strconv.Itoa(statusCode) + "' WHERE parentid = '" + strconv.Itoa(idList[0].Id) + "'"
|
|
|
+ _,err = this.DBE.Exec(sql)
|
|
|
+
|
|
|
+ return err
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
////批量更新全部成功或失败的任务样本状态
|
|
|
//func (this *ConverseService)SampleApplyDetailStatusBatchModify(statusCode int , entryNo string) error {
|
|
|
//
|
|
|
@@ -576,11 +591,19 @@ func (this *ConverseService) UpdatePosition(rack_id string ,tubes []Tube){
|
|
|
id := tubes[i].Id
|
|
|
glog.Info("样本在盒子中的位置:",no,";样本条码: ",id)
|
|
|
//计算管子在盒子中的坐标
|
|
|
- box_x := (no/RowNum)+1
|
|
|
- box_y := no-(RowNum*box_x)
|
|
|
- glog.Info("管子在盒子中的位置坐标为:",box_y,":",box_x)
|
|
|
+ var box_x,box_y int
|
|
|
+
|
|
|
+ if no%RowNum ==0{// 如果 取余数为0 则 证明该数是能被 10 整除的数 为该行 最后一个孔位
|
|
|
+ box_y =10
|
|
|
+ box_x = no/RowNum
|
|
|
+ }else{
|
|
|
+ box_y =no%RowNum
|
|
|
+ box_x = (no/RowNum)+1
|
|
|
+ }
|
|
|
+
|
|
|
+ glog.Info("管子在盒子中的位置坐标为:",box_y,";",box_x)
|
|
|
var position = utils.NumberToLetter(box_x)+utils.ToStr(box_y)
|
|
|
- sql ="update bank_sample set Position = '"+utils.ToStr(box_y)+":"+utils.ToStr(box_x)+"' ,PositionInfo = concat(PositionInfo,'-"+position+"' ) where barcode ='"+id+"' "
|
|
|
+ sql ="update bank_sample set Position = '"+utils.ToStr(box_y)+";"+utils.ToStr(box_x)+"' ,PositionInfo = concat( REVERSE(SUBSTR(REVERSE(PositionInfo) FROM INSTR(REVERSE(PositionInfo),'-')+1)),'-"+position+"' ) where barcode ='"+id+"' "
|
|
|
//执行sql 更新位置和坐标信息
|
|
|
this.DBE.Exec(sql)
|
|
|
}
|
|
|
@@ -889,3 +912,4 @@ func RecordDeviceData(list []List_Data) {
|
|
|
svc := GetConverseService(utils.DBE)
|
|
|
svc.InsertEntity(data)
|
|
|
}
|
|
|
+
|