internal static bool UpdateStatusByBatchNumber(BatchUpdateParam batchParam) { // 根据action 获取 fromStatus、toStatus string fromStatus; string toStatus; switch (batchParam.Action) { case "airportconfirm": fromStatus = ((int)OrderStatusEnum.HasSend).ToString(); toStatus = ((int)OrderStatusEnum.InFlight).ToString(); break; case "jbbwconfirm": fromStatus = ((int)OrderStatusEnum.InFlight).ToString(); toStatus = ((int)OrderStatusEnum.ToJBBW).ToString(); break; case "qingguanconfirm": fromStatus = ((int)OrderStatusEnum.ToJBBW).ToString(); toStatus = ((int)OrderStatusEnum.QingGuan).ToString(); break; default: throw new MsgException("参数错误!"); } // 根据batchNumber 查询订单信息 DataTable dt = JabMySqlHelper.ExecuteDataTable(Config.DBConnection, @" SELECT ORDER_NUM,ID FROM ex_orderinfo WHERE BATCH_NUMBER=@BatchNumber and `STATUS`=@Status", new MySqlParameter("@BatchNumber", batchParam.BatchNumber), new MySqlParameter("@Status", fromStatus)); if (dt != null && dt.Rows.Count > 0) { OrderStatusParam param = new OrderStatusParam(); param.Status = toStatus; param.UserName = batchParam.UserName; param.dicOrders = new List <OrderStatusParam.OrderInfo_F>(); foreach (DataRow row in dt.Rows) { param.dicOrders.Add(new OrderStatusParam.OrderInfo_F() { Id = Converter.TryToString(row["ID"]), Order_Num = Converter.TryToString(row["ORDER_NUM"]) }); } // 更新订单信息 return(BatchUpdateStatus(param)); } else { return(true); } }
public MyResult UpdateStatusByBatchNumber([FromBody] BatchUpdateParam param) { bool re = OrderBLL.UpdateStatusByBatchNumber(param); return(re ? MyResult.OK() : MyResult.Error()); }