public static int AddAutoMoveTask(TaskInfo task, string code, string name, string unit, float count, string batch = "N") { lock (WMS_TASK) { string sid = Guid.NewGuid().ToString(); DateTime dt = DateTime.Now; task.sid = sid; task.taskno = GetTaskKey(); task.exstatus = 1; string goods = $"'{code}','{name}','{unit}','{batch}',{count},"; string fel = "goods_code,goods_name,goods_unit,goods_batch,goods_count,"; string sql = $" '{sid}','300','{task.taskno}','{task.task_type}','{task.src_station}','{task.dest_station}','{task.warehouse}','{dt}','{dt}',1,0)"; sql = "insert sys_task(" + fel + "sid,cmd,taskno,task_type,src_station,dest_station,warehouse,create_time,update_time,exstatus,restatus) values (" + goods + sql; List<string> list = new List<string>(); list.Add(sql); //sql = $"update sys_container set tid3 ='{task.taskno}',state = 2 where station_code ='{task.srcStation}'"; //list.Add(sql); if (DBHelper.UpdateCommand(list) == 1) { WMS_TASK.Add(task.taskno, task); return 0; }; return 1; } }